From 2b6928941de1bdd32dfd1bf9e8cf412616477543 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Mar 2020 09:31:27 -0400 Subject: [PATCH 01/85] initial --- tfjs-core/src/backends/cpu/backend_cpu.ts | 10 +- tfjs-core/src/backends/cpu/kernels/Div.ts | 23 ++++ .../backends/cpu/kernels/SquaredDifference.ts | 35 ++---- .../src/backends/cpu/register_all_kernels.ts | 5 +- .../src/backends/cpu/utils/kernel_utils.ts | 95 ++++++++++------ .../webgl/kernels/SquaredDifference.ts | 4 +- tfjs-core/src/gradients/Div_grad.ts | 49 ++++++++ tfjs-core/src/kernel_names.ts | 5 +- tfjs-core/src/ops/binary_ops.ts | 68 +----------- tfjs-core/src/ops/div.ts | 105 ++++++++++++++++++ tfjs-core/src/ops/ops.ts | 1 + tfjs-core/src/ops/squared_difference.ts | 5 +- tfjs-core/src/register_all_gradients.ts | 2 + 13 files changed, 263 insertions(+), 144 deletions(-) create mode 100644 tfjs-core/src/backends/cpu/kernels/Div.ts create mode 100644 tfjs-core/src/gradients/Div_grad.ts create mode 100644 tfjs-core/src/ops/div.ts diff --git a/tfjs-core/src/backends/cpu/backend_cpu.ts b/tfjs-core/src/backends/cpu/backend_cpu.ts index f45855309a8..37e9d445806 100644 --- a/tfjs-core/src/backends/cpu/backend_cpu.ts +++ b/tfjs-core/src/backends/cpu/backend_cpu.ts @@ -385,7 +385,7 @@ export class MathBackendCPU extends KernelBackend { const b = this.exp(a); const sumExp = this.sum(b, axes).reshape(expandedShape); - return this.realDivide(b, sumExp) as T; + return b.div(sumExp); } subtract(a: Tensor, b: Tensor): Tensor { @@ -493,14 +493,6 @@ export class MathBackendCPU extends KernelBackend { (aValue, bValue) => aValue * bValue); } - realDivide(a: Tensor, b: Tensor): Tensor { - assertNotComplex([a, b], 'realDivide'); - - const op = (a: number, b: number) => a / b; - const outputDtype = 'float32'; - return this.broadcastedBinaryOp(a, b, outputDtype, op); - } - floorDiv(a: Tensor, b: Tensor): Tensor { assertNotComplex([a, b], 'floorDiv'); diff --git a/tfjs-core/src/backends/cpu/kernels/Div.ts b/tfjs-core/src/backends/cpu/kernels/Div.ts new file mode 100644 index 00000000000..5483f92f857 --- /dev/null +++ b/tfjs-core/src/backends/cpu/kernels/Div.ts @@ -0,0 +1,23 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {Div} from '../../../kernel_names'; +import {createBinaryKernelConfig} from '../utils/kernel_utils'; +import {createBinaryOp} from '../utils/kernel_utils'; + +export const div = createBinaryOp((a: number, b: number) => a / b); +export const divConfig = createBinaryKernelConfig(Div, div); diff --git a/tfjs-core/src/backends/cpu/kernels/SquaredDifference.ts b/tfjs-core/src/backends/cpu/kernels/SquaredDifference.ts index a57bf1a156a..d89a0e71181 100644 --- a/tfjs-core/src/backends/cpu/kernels/SquaredDifference.ts +++ b/tfjs-core/src/backends/cpu/kernels/SquaredDifference.ts @@ -15,31 +15,14 @@ * ============================================================================= */ -import {SquaredDifference, SquaredDifferenceInputs} from '../../../kernel_names'; -import {KernelConfig} from '../../../kernel_registry'; -import {TypedArray} from '../../../types'; -import {MathBackendCPU} from '../backend_cpu'; -import {assertNotComplex} from '../cpu_util'; -import {broadcastedBinaryOp} from '../utils/kernel_utils'; +import {SquaredDifference} from '../../../kernel_names'; +import {createBinaryOp} from '../utils/kernel_utils'; +import {createBinaryKernelConfig} from '../utils/kernel_utils'; -export const squaredDifferenceConfig: KernelConfig = { - kernelName: SquaredDifference, - backendName: 'cpu', - kernelFunc: ({inputs, backend}) => { - const {a, b} = inputs as SquaredDifferenceInputs; - const cpuBackend = backend as MathBackendCPU; - assertNotComplex([a, b], SquaredDifference); +const squaredDifferenceImpl = createBinaryOp((aVal, bVal) => { + const diff = aVal - bVal; + return diff * diff; +}); - const aVals = cpuBackend.data.get(a.dataId).values as TypedArray; - const bVals = cpuBackend.data.get(b.dataId).values as TypedArray; - - const [resultData, resultShape] = broadcastedBinaryOp( - a.shape, b.shape, aVals, bVals, a.dtype, (aVal, bVal) => { - const diff = aVal - bVal; - return diff * diff; - }); - - const dataId = cpuBackend.write(resultData, resultShape, a.dtype); - return {dataId, shape: resultShape, dtype: a.dtype}; - } -}; +export const squaredDifferenceConfig = + createBinaryKernelConfig(SquaredDifference, squaredDifferenceImpl); diff --git a/tfjs-core/src/backends/cpu/register_all_kernels.ts b/tfjs-core/src/backends/cpu/register_all_kernels.ts index 9516f9af311..4d7f2e983cf 100644 --- a/tfjs-core/src/backends/cpu/register_all_kernels.ts +++ b/tfjs-core/src/backends/cpu/register_all_kernels.ts @@ -19,15 +19,14 @@ // the contents of this file and import only the kernels that are needed. import {KernelConfig, registerKernel} from '../../kernel_registry'; +import {divConfig} from './kernels/Div'; import {nonMaxSuppressionV5Config} from './kernels/NonMaxSuppressionV5'; import {squareConfig} from './kernels/Square'; import {squaredDifferenceConfig} from './kernels/SquaredDifference'; // List all kernel configs here const kernelConfigs: KernelConfig[] = [ - nonMaxSuppressionV5Config, - squareConfig, - squaredDifferenceConfig, + nonMaxSuppressionV5Config, squareConfig, squaredDifferenceConfig, divConfig ]; for (const kernelConfig of kernelConfigs) { diff --git a/tfjs-core/src/backends/cpu/utils/kernel_utils.ts b/tfjs-core/src/backends/cpu/utils/kernel_utils.ts index ce21517dba4..f9fa95e9903 100644 --- a/tfjs-core/src/backends/cpu/utils/kernel_utils.ts +++ b/tfjs-core/src/backends/cpu/utils/kernel_utils.ts @@ -16,50 +16,77 @@ */ import * as backend_util from '../../../backends/backend_util'; +import {BinaryInputs} from '../../../kernel_names'; +import {KernelConfig} from '../../../kernel_registry'; import {DataType, NumericDataType, TypedArray} from '../../../types'; import * as util from '../../../util'; +import {MathBackendCPU} from '../backend_cpu'; +import {assertNotComplex} from '../cpu_util'; -export function broadcastedBinaryOp( - aShape: number[], bShape: number[], aVals: TypedArray, bVals: TypedArray, - dtype: DataType, - op: (a: number, b: number) => number): [TypedArray, number[]] { - const newShape = backend_util.assertAndGetBroadcastShape(aShape, bShape); +export const createBinaryKernelConfig = + (name: string, + op: ( + aShape: number[], bShape: number[], aVals: TypedArray, + bVals: TypedArray, dtype: DataType) => [TypedArray, number[]]): + KernelConfig => ({ + kernelName: name, + backendName: 'cpu', + kernelFunc: ({inputs, backend}) => { + const {a, b} = inputs as BinaryInputs; + const cpuBackend = backend as MathBackendCPU; + assertNotComplex([a, b], name); - const resultRank = newShape.length; - const resultStrides = util.computeStrides(newShape); - const resultSize = util.sizeFromShape(newShape); + const aVals = cpuBackend.data.get(a.dataId).values as TypedArray; + const bVals = cpuBackend.data.get(b.dataId).values as TypedArray; - const result = - util.getTypedArrayFromDType(dtype as NumericDataType, resultSize); + const [resultData, resultShape] = + op(a.shape, b.shape, aVals, bVals, a.dtype); - const aRank = aShape.length; - const bRank = bShape.length; + const dataId = cpuBackend.write(resultData, resultShape, a.dtype); + return {dataId, shape: resultShape, dtype: a.dtype}; + } + }); - const aStrides = util.computeStrides(aShape); - const bStrides = util.computeStrides(bShape); +export const createBinaryOp = (op: (a: number, b: number) => number) => + (aShape: number[], bShape: number[], aVals: TypedArray, bVals: TypedArray, + dtype: DataType): [TypedArray, number[]] => { + const newShape = backend_util.assertAndGetBroadcastShape(aShape, bShape); - const aBroadcastDims = backend_util.getBroadcastDims(aShape, newShape); - const bBroadcastDims = backend_util.getBroadcastDims(bShape, newShape); + const resultRank = newShape.length; + const resultStrides = util.computeStrides(newShape); + const resultSize = util.sizeFromShape(newShape); - if (aBroadcastDims.length + bBroadcastDims.length === 0) { - for (let i = 0; i < result.length; ++i) { - result[i] = op(aVals[i % aVals.length], bVals[i % bVals.length]); - } - } else { - for (let i = 0; i < result.length; ++i) { - const loc = util.indexToLoc(i, resultRank, resultStrides); + const result = + util.getTypedArrayFromDType(dtype as NumericDataType, resultSize); - const aLoc = loc.slice(-aRank); - aBroadcastDims.forEach(d => aLoc[d] = 0); - const aIndex = util.locToIndex(aLoc, aRank, aStrides); + const aRank = aShape.length; + const bRank = bShape.length; - const bLoc = loc.slice(-bRank); - bBroadcastDims.forEach(d => bLoc[d] = 0); - const bIndex = util.locToIndex(bLoc, bRank, bStrides); + const aStrides = util.computeStrides(aShape); + const bStrides = util.computeStrides(bShape); - result[i] = op(aVals[aIndex], bVals[bIndex]); - } - } + const aBroadcastDims = backend_util.getBroadcastDims(aShape, newShape); + const bBroadcastDims = backend_util.getBroadcastDims(bShape, newShape); - return [result, newShape]; -} + if (aBroadcastDims.length + bBroadcastDims.length === 0) { + for (let i = 0; i < result.length; ++i) { + result[i] = op(aVals[i % aVals.length], bVals[i % bVals.length]); + } + } else { + for (let i = 0; i < result.length; ++i) { + const loc = util.indexToLoc(i, resultRank, resultStrides); + + const aLoc = loc.slice(-aRank); + aBroadcastDims.forEach(d => aLoc[d] = 0); + const aIndex = util.locToIndex(aLoc, aRank, aStrides); + + const bLoc = loc.slice(-bRank); + bBroadcastDims.forEach(d => bLoc[d] = 0); + const bIndex = util.locToIndex(bLoc, bRank, bStrides); + + result[i] = op(aVals[aIndex], bVals[bIndex]); + } + } + + return [result, newShape]; + }; diff --git a/tfjs-core/src/backends/webgl/kernels/SquaredDifference.ts b/tfjs-core/src/backends/webgl/kernels/SquaredDifference.ts index 41463b2c1cb..9ff08538a74 100644 --- a/tfjs-core/src/backends/webgl/kernels/SquaredDifference.ts +++ b/tfjs-core/src/backends/webgl/kernels/SquaredDifference.ts @@ -16,7 +16,7 @@ */ import {env} from '../../../environment'; -import {SquaredDifference, SquaredDifferenceInputs} from '../../../kernel_names'; +import {BinaryInputs, SquaredDifference} from '../../../kernel_names'; import {KernelConfig} from '../../../kernel_registry'; import {MathBackendWebGL} from '../backend_webgl'; import {BinaryOpProgram} from '../binaryop_gpu'; @@ -26,7 +26,7 @@ export const squaredDifferenceConfig: KernelConfig = { kernelName: SquaredDifference, backendName: 'webgl', kernelFunc: ({inputs, backend}) => { - const {a, b} = inputs as SquaredDifferenceInputs; + const {a, b} = inputs as BinaryInputs; const SQUARED_DIFFERENCE = 'return (a - b) * (a - b);'; const webGLBackend = backend as MathBackendWebGL; diff --git a/tfjs-core/src/gradients/Div_grad.ts b/tfjs-core/src/gradients/Div_grad.ts new file mode 100644 index 00000000000..c2a3b39da7d --- /dev/null +++ b/tfjs-core/src/gradients/Div_grad.ts @@ -0,0 +1,49 @@ +/** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {Div} from '../kernel_names'; +import {GradConfig} from '../kernel_registry'; +import * as broadcast_util from '../ops/broadcast_util'; +import {Tensor} from '../tensor'; + +export const divGradConfig: GradConfig = { + kernelName: Div, + inputsToSave: ['a', 'b'], + gradFunc: (dy: Tensor, saved: Tensor[]) => { + const [$a, $b] = saved; + const outShape = + broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape); + const derA = () => { + const res = dy.div($b.toFloat()); + const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape); + if (reduceAxes.length > 0) { + return res.sum(reduceAxes).reshape($a.shape); + } + return res; + }; + const derB = () => { + let res = dy.mul($a.toFloat()); + const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes).reshape($b.shape); + } + const tmp = $b.square(); + return res.div(tmp.toFloat()).neg(); + }; + return {a: derA, b: derB}; + } +}; diff --git a/tfjs-core/src/kernel_names.ts b/tfjs-core/src/kernel_names.ts index 4b2ce190ef9..2e8ff2e2e8b 100644 --- a/tfjs-core/src/kernel_names.ts +++ b/tfjs-core/src/kernel_names.ts @@ -21,8 +21,11 @@ import {NamedTensorInfoMap} from './kernel_registry'; import {PixelData} from './types'; +export type BinaryInputs = Pick; + +export const Div = 'Div'; + export const SquaredDifference = 'SquaredDifference'; -export type SquaredDifferenceInputs = Pick; export const Square = 'Square'; export type SquareInputs = Pick; diff --git a/tfjs-core/src/ops/binary_ops.ts b/tfjs-core/src/ops/binary_ops.ts index 9aea464bea4..ff04e0dbe40 100644 --- a/tfjs-core/src/ops/binary_ops.ts +++ b/tfjs-core/src/ops/binary_ops.ts @@ -378,71 +378,6 @@ function mulStrict_(a: T|TensorLike, b: T|TensorLike): T { return $a.mul($b); } -/** - * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. - * - * We also expose `tf.divStrict` which has the same signature as this op and - * asserts that `a` and `b` are the same shape (does not broadcast). - * - * ```js - * const a = tf.tensor1d([1, 4, 9, 16]); - * const b = tf.tensor1d([1, 2, 3, 4]); - * - * a.div(b).print(); // or tf.div(a, b) - * ``` - * - * ```js - * // Broadcast div a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(2); - * - * a.div(b).print(); // or tf.div(a, b) - * ``` - * - * @param a The first tensor as the numerator. - * @param b The second tensor as the denominator. Must have the same dtype as - * `a`. - */ -/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */ -function div_(a: Tensor|TensorLike, b: Tensor|TensorLike): T { - let $a = convertToTensor(a, 'a', 'div'); - let $b = convertToTensor(b, 'b', 'div'); - [$a, $b] = makeTypesMatch($a, $b); - - if ($a.dtype === 'int32' && $b.dtype === 'int32') { - return floorDiv($a, $b); - } - - const outShape = - broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape); - const der = (dy: Tensor, saved: Tensor[]) => { - const [$a, $b] = saved; - const derA = () => { - const res = dy.div($b.toFloat()); - const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape); - if (reduceAxes.length > 0) { - return res.sum(reduceAxes).reshape($a.shape); - } - return res; - }; - const derB = () => { - let res = dy.mul($a.toFloat()); - const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape); - if (reduceAxes.length > 0) { - res = res.sum(reduceAxes).reshape($b.shape); - } - const tmp = $b.square(); - return res.div(tmp.toFloat()).neg(); - }; - return {a: derA, b: derB}; - }; - return ENGINE.runKernelFunc((backend, save) => { - const res = backend.realDivide($a, $b); - save([$a, $b]); - return res; - }, {a: $a, b: $b}, der, 'Div') as T; -} - /** * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. Return 0 * if denominator is 0. @@ -480,7 +415,7 @@ function divNoNan_( let $b = convertToTensor(b, 'b', 'div'); [$a, $b] = makeTypesMatch($a, $b); - const divResult = div($a, $b); + const divResult = $a.div($b); const zeros = zerosLike(divResult); const bEqualsZero = $b.equal(zeros); return where(bEqualsZero, zeros, divResult) as T; @@ -841,7 +776,6 @@ export const add = op({add_}); export const addN = op({addN_}); export const addStrict = op({addStrict_}); export const atan2 = op({atan2_}); -export const div = op({div_}); export const divNoNan = op({divNoNan_}); export const divStrict = op({divStrict_}); export const floorDiv = op({floorDiv_}); diff --git a/tfjs-core/src/ops/div.ts b/tfjs-core/src/ops/div.ts new file mode 100644 index 00000000000..05c19b5967a --- /dev/null +++ b/tfjs-core/src/ops/div.ts @@ -0,0 +1,105 @@ +/** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {ENGINE, ForwardFunc} from '../engine'; +import {BinaryInputs, Div} from '../kernel_names'; +import {Tensor} from '../tensor'; +import {NamedTensorMap} from '../tensor_types'; +import {makeTypesMatch} from '../tensor_util'; +import {convertToTensor} from '../tensor_util_env'; +import {TensorLike} from '../types'; + +import {floorDiv} from './binary_ops'; +import * as broadcast_util from './broadcast_util'; +import {op} from './operation'; + +/** + * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. + * + * We also expose `tf.divStrict` which has the same signature as this op and + * asserts that `a` and `b` are the same shape (does not broadcast). + * + * ```js + * const a = tf.tensor1d([1, 4, 9, 16]); + * const b = tf.tensor1d([1, 2, 3, 4]); + * + * a.div(b).print(); // or tf.div(a, b) + * ``` + * + * ```js + * // Broadcast div a with b. + * const a = tf.tensor1d([2, 4, 6, 8]); + * const b = tf.scalar(2); + * + * a.div(b).print(); // or tf.div(a, b) + * ``` + * + * @param a The first tensor as the numerator. + * @param b The second tensor as the denominator. Must have the same dtype as + * `a`. + */ +/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */ +function div_(a: Tensor|TensorLike, b: Tensor|TensorLike): T { + let $a = convertToTensor(a, 'a', 'div'); + let $b = convertToTensor(b, 'b', 'div'); + [$a, $b] = makeTypesMatch($a, $b); + + if ($a.dtype === 'int32' && $b.dtype === 'int32') { + return floorDiv($a, $b); + } + + const outShape = + broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape); + const der = (dy: Tensor, saved: Tensor[]) => { + const [$a, $b] = saved; + const derA = () => { + const res = dy.div($b.toFloat()); + const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape); + if (reduceAxes.length > 0) { + return res.sum(reduceAxes).reshape($a.shape); + } + return res; + }; + const derB = () => { + let res = dy.mul($a.toFloat()); + const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes).reshape($b.shape); + } + const tmp = $b.square(); + return res.div(tmp.toFloat()).neg(); + }; + return {a: derA, b: derB}; + }; + + const forward: ForwardFunc = (backend, save) => { + const res = backend.realDivide($a, $b); + save([$a, $b]); + return res; + }; + + const inputs: BinaryInputs = {a: $a, b: $b}; + const attrs = {}; + const inputsToSave = [$a, $b]; + const outputsToSave: boolean[] = []; + + return ENGINE.runKernelFunc( + forward, inputs as {} as NamedTensorMap, der, Div, attrs, + inputsToSave, outputsToSave) as T; +} + +export const div = op({div_}); diff --git a/tfjs-core/src/ops/ops.ts b/tfjs-core/src/ops/ops.ts index 720d02bc6a0..7355d15ba89 100644 --- a/tfjs-core/src/ops/ops.ts +++ b/tfjs-core/src/ops/ops.ts @@ -17,6 +17,7 @@ // Modularized ops. export {broadcastTo} from './broadcast_to'; +export {div} from './div'; export {square} from './square'; export {squaredDifference} from './squared_difference'; diff --git a/tfjs-core/src/ops/squared_difference.ts b/tfjs-core/src/ops/squared_difference.ts index 0653191326c..264fdb2d9f9 100644 --- a/tfjs-core/src/ops/squared_difference.ts +++ b/tfjs-core/src/ops/squared_difference.ts @@ -16,7 +16,7 @@ */ import {ENGINE, ForwardFunc} from '../engine'; -import {SquaredDifference, SquaredDifferenceInputs} from '../kernel_names'; +import {BinaryInputs, SquaredDifference} from '../kernel_names'; import {Tensor} from '../tensor'; import {NamedTensorMap} from '../tensor_types'; import {makeTypesMatch} from '../tensor_util'; @@ -27,6 +27,7 @@ import {assertAndGetBroadcastShape} from './broadcast_util'; import {op} from './operation'; import {scalar} from './tensor_ops'; + /** * Returns (a - b) * (a - b) element-wise. * Supports broadcasting. @@ -74,7 +75,7 @@ function squaredDifference_( return res; }; - const inputs: SquaredDifferenceInputs = {a: $a, b: $b}; + const inputs: BinaryInputs = {a: $a, b: $b}; const attrs = {}; const inputsToSave = [$a, $b]; diff --git a/tfjs-core/src/register_all_gradients.ts b/tfjs-core/src/register_all_gradients.ts index 5438e897224..8be15b33cbc 100644 --- a/tfjs-core/src/register_all_gradients.ts +++ b/tfjs-core/src/register_all_gradients.ts @@ -15,6 +15,7 @@ * ============================================================================= */ import {broadcastToGradConfig} from './gradients/BroadcastTo_grad'; +import {divGradConfig} from './gradients/Div_grad'; import {squareGradConfig} from './gradients/Square_grad'; import {squaredDifferenceGradConfig} from './gradients/SquaredDifference_grad'; import {GradConfig} from './kernel_registry'; @@ -24,6 +25,7 @@ import {registerGradient} from './kernel_registry'; const gradConfigs: GradConfig[] = [ squareGradConfig, squaredDifferenceGradConfig, + divGradConfig, broadcastToGradConfig, ]; From b159a1fc2ed5353fdda9175888a9a92614dc733f Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Mar 2020 09:59:07 -0400 Subject: [PATCH 02/85] webgl --- tfjs-core/src/backends/webgl/backend_webgl.ts | 35 +++++------- tfjs-core/src/backends/webgl/kernels/Div.ts | 55 +++++++++++++++++++ .../backends/webgl/register_all_kernels.ts | 2 + 3 files changed, 71 insertions(+), 21 deletions(-) create mode 100644 tfjs-core/src/backends/webgl/kernels/Div.ts diff --git a/tfjs-core/src/backends/webgl/backend_webgl.ts b/tfjs-core/src/backends/webgl/backend_webgl.ts index f513265c7aa..831c85bcb2c 100644 --- a/tfjs-core/src/backends/webgl/backend_webgl.ts +++ b/tfjs-core/src/backends/webgl/backend_webgl.ts @@ -1372,18 +1372,6 @@ export class MathBackendWebGL extends KernelBackend { return this.reduce(a2D, 'any', a2D.dtype).reshape(outShape); } - realDivide(a: Tensor, b: Tensor): Tensor { - const op = binaryop_gpu.DIV; - const outputDtype = 'float32'; - if (env().getBool('WEBGL_PACK_BINARY_OPERATIONS')) { - const checkOutOfBounds = true; - return this.packedBinaryOp( - a, b, binaryop_packed_gpu.DIV, outputDtype, checkOutOfBounds); - } - const program = new BinaryOpProgram(op, a.shape, b.shape); - return this.compileAndRun(program, [a, b], outputDtype); - } - floorDiv(a: Tensor, b: Tensor): Tensor { const op = binaryop_gpu.INT_DIV; const outputDtype = 'int32'; @@ -1597,7 +1585,7 @@ export class MathBackendWebGL extends KernelBackend { const b = this.exp(a); const sumExp = this.sum(b, axes).reshape(expandedShape); - return this.realDivide(b, sumExp) as T; + return b.div(sumExp); } log(x: T): T { @@ -2440,8 +2428,8 @@ export class MathBackendWebGL extends KernelBackend { const program = new PackProgram(input.shape); const preventEagerUnpackingOutput = true; return this.runWebGLProgram( - program, [input], input.dtype, null /* customSetup */, - preventEagerUnpackingOutput); + program, [input], input.dtype, null /* out info */, + null /* customSetup */, preventEagerUnpackingOutput); } private packedReshape(input: TensorInfo, afterShape: number[]): TensorInfo { @@ -2461,8 +2449,8 @@ export class MathBackendWebGL extends KernelBackend { const program = new ReshapePackedProgram(afterShapeAs3D, input3DShape); const preventEagerUnpackingOfOutput = true; const output = this.runWebGLProgram( - program, [input3D], input.dtype, null /* customSetup */, - preventEagerUnpackingOfOutput); + program, [input3D], input.dtype, null /* out info */, + null /* customSetup */, preventEagerUnpackingOfOutput); return {dataId: output.dataId, shape: afterShape, dtype: output.dtype}; } @@ -2480,15 +2468,19 @@ export class MathBackendWebGL extends KernelBackend { const preventEagerUnpackingOfOutput = true; const out = this.runWebGLProgram( program, [{shape: shapeAs3D, dtype, dataId}], dtype, - null /* customSetup */, preventEagerUnpackingOfOutput); + null /* out info */, null /* customSetup */, + preventEagerUnpackingOfOutput); return {dtype, shape, dataId: out.dataId}; } runWebGLProgram( program: GPGPUProgram, inputs: TensorInfo[], outputDtype: DataType, + output?: TensorInfo, customSetup?: (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) => void, preventEagerUnpackingOfOutput = false): TensorInfo { - const output = this.makeTensorInfo(program.outputShape, outputDtype); + if (output == null) { + output = this.makeTensorInfo(program.outputShape, outputDtype); + } const outData = this.texData.get(output.dataId); if (program.packedOutput) { outData.isPacked = true; @@ -2615,7 +2607,7 @@ export class MathBackendWebGL extends KernelBackend { preventEagerUnpackingOfOutput = false): K { outputDtype = outputDtype || inputs[0].dtype; const outInfo = this.runWebGLProgram( - program, inputs, outputDtype, customSetup, + program, inputs, outputDtype, null /* out info */, customSetup, preventEagerUnpackingOfOutput); return ENGINE.makeTensorFromDataId( outInfo.dataId, outInfo.shape, outInfo.dtype) as {} as K; @@ -2741,7 +2733,8 @@ export class MathBackendWebGL extends KernelBackend { // WEBGL_PACK. const preventEagerUnpacking = true; const encodedOutputTarget = this.runWebGLProgram( - program, [tempDenseInputHandle], dtype, null, preventEagerUnpacking); + program, [tempDenseInputHandle], dtype, null /* out info */, + null /* custom setup */, preventEagerUnpacking); // Have the original texture assume the identity of the encoded output. const outputTexData = this.texData.get(encodedOutputTarget.dataId); diff --git a/tfjs-core/src/backends/webgl/kernels/Div.ts b/tfjs-core/src/backends/webgl/kernels/Div.ts new file mode 100644 index 00000000000..8da4db85641 --- /dev/null +++ b/tfjs-core/src/backends/webgl/kernels/Div.ts @@ -0,0 +1,55 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {backend_util} from '../../..'; +import {env} from '../../../environment'; +import {BinaryInputs, Div} from '../../../kernel_names'; +import {KernelConfig, TensorInfo} from '../../../kernel_registry'; +import {MathBackendWebGL} from '../backend_webgl'; +import * as binaryop_gpu from '../binaryop_gpu'; +import {BinaryOpProgram} from '../binaryop_gpu'; +import * as binaryop_packed_gpu from '../binaryop_packed_gpu'; +import {BinaryOpPackedProgram} from '../binaryop_packed_gpu'; + +export const divImpl = + (a: TensorInfo, b: TensorInfo, out: TensorInfo, + backend: MathBackendWebGL): TensorInfo => { + let program = new BinaryOpProgram(binaryop_gpu.DIV, a.shape, b.shape); + if (env().getBool('WEBGL_PACK_BINARY_OPERATIONS')) { + program = new BinaryOpPackedProgram( + binaryop_packed_gpu.DIV, a.shape, b.shape, true); + } + const output = backend.runWebGLProgram(program, [a, b], 'float32', out); + return output; + }; + +export const divConfig: KernelConfig = { + kernelName: Div, + backendName: 'webgl', + kernelFunc: ({inputs, backend}) => { + const {a, b} = inputs as BinaryInputs; + + const webglBackend = backend as MathBackendWebGL; + + const outShape = backend_util.assertAndGetBroadcastShape(a.shape, b.shape); + const outTensorInfo = webglBackend.makeTensorInfo(outShape, a.dtype); + + const out = divImpl(a, b, outTensorInfo, webglBackend); + + return {dataId: out.dataId, shape: out.shape, dtype: out.dtype}; + } +}; diff --git a/tfjs-core/src/backends/webgl/register_all_kernels.ts b/tfjs-core/src/backends/webgl/register_all_kernels.ts index f7913ac6b21..fe04734d2cb 100644 --- a/tfjs-core/src/backends/webgl/register_all_kernels.ts +++ b/tfjs-core/src/backends/webgl/register_all_kernels.ts @@ -16,6 +16,7 @@ */ import {KernelConfig, registerKernel} from '../../kernel_registry'; +import {divConfig} from './kernels/Div'; import {fromPixelsConfig} from './kernels/FromPixels'; import {nonMaxSuppressionV5Config} from './kernels/NonMaxSuppressionV5'; import {squareConfig} from './kernels/Square'; @@ -24,6 +25,7 @@ import {squaredDifferenceConfig} from './kernels/SquaredDifference'; // List all kernel configs here const kernelConfigs: KernelConfig[] = [ fromPixelsConfig, + divConfig, nonMaxSuppressionV5Config, squareConfig, squaredDifferenceConfig, From 86c7451ba2f2ce1a0400072576f9e6dc77fef823 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Mar 2020 10:10:49 -0400 Subject: [PATCH 03/85] add divnonan --- tfjs-core/src/backends/webgl/kernels/Div.ts | 4 +- tfjs-core/src/ops/binary_ops.ts | 45 ------------- tfjs-core/src/ops/divNoNan.ts | 71 +++++++++++++++++++++ tfjs-core/src/ops/ops.ts | 1 + tfjs-core/src/ops/squared_difference.ts | 1 - 5 files changed, 74 insertions(+), 48 deletions(-) create mode 100644 tfjs-core/src/ops/divNoNan.ts diff --git a/tfjs-core/src/backends/webgl/kernels/Div.ts b/tfjs-core/src/backends/webgl/kernels/Div.ts index 8da4db85641..d76911d6f78 100644 --- a/tfjs-core/src/backends/webgl/kernels/Div.ts +++ b/tfjs-core/src/backends/webgl/kernels/Div.ts @@ -15,7 +15,7 @@ * ============================================================================= */ -import {backend_util} from '../../..'; +import {assertAndGetBroadcastShape} from '../../../../src/ops/broadcast_util'; import {env} from '../../../environment'; import {BinaryInputs, Div} from '../../../kernel_names'; import {KernelConfig, TensorInfo} from '../../../kernel_registry'; @@ -45,7 +45,7 @@ export const divConfig: KernelConfig = { const webglBackend = backend as MathBackendWebGL; - const outShape = backend_util.assertAndGetBroadcastShape(a.shape, b.shape); + const outShape = assertAndGetBroadcastShape(a.shape, b.shape); const outTensorInfo = webglBackend.makeTensorInfo(outShape, a.dtype); const out = divImpl(a, b, outTensorInfo, webglBackend); diff --git a/tfjs-core/src/ops/binary_ops.ts b/tfjs-core/src/ops/binary_ops.ts index ff04e0dbe40..ac5e0525ce4 100644 --- a/tfjs-core/src/ops/binary_ops.ts +++ b/tfjs-core/src/ops/binary_ops.ts @@ -23,7 +23,6 @@ import {convertToTensor} from '../tensor_util_env'; import {TensorLike} from '../types'; import * as util from '../util'; import * as broadcast_util from './broadcast_util'; -import {where} from './logical_ops'; import {op} from './operation'; import {scalar, zerosLike} from './tensor_ops'; import {neg} from './unary_ops'; @@ -378,49 +377,6 @@ function mulStrict_(a: T|TensorLike, b: T|TensorLike): T { return $a.mul($b); } -/** - * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. Return 0 - * if denominator is 0. - * - * We also expose `tf.divStrict` which has the same signature as this op and - * asserts that `a` and `b` are the same shape (does not broadcast). - * - * ```js - * const a = tf.tensor1d([1, 4, 9, 16]); - * const b = tf.tensor1d([1, 2, 3, 4]); - * const c = tf.tensor1d([0, 0, 0, 0]); - * - * a.divNoNan(b).print(); // or tf.divNoNan(a, b) - * a.divNoNan(c).print(); // or tf.divNoNan(a, c) - * ``` - * - * ```js - * // Broadcast div a with b. - * const a = tf.tensor1d([2, 4, 6, 8]); - * const b = tf.scalar(2); - * const c = tf.scalar(0); - * - * a.divNoNan(b).print(); // or tf.divNoNan(a, b) - * a.divNoNan(c).print(); // or tf.divNoNan(a, c) - * ``` - * - * @param a The first tensor as the numerator. - * @param b The second tensor as the denominator. Must have the same dtype as - * `a`. - */ -/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */ -function divNoNan_( - a: Tensor|TensorLike, b: Tensor|TensorLike): T { - let $a = convertToTensor(a, 'a', 'div'); - let $b = convertToTensor(b, 'b', 'div'); - [$a, $b] = makeTypesMatch($a, $b); - - const divResult = $a.div($b); - const zeros = zerosLike(divResult); - const bEqualsZero = $b.equal(zeros); - return where(bEqualsZero, zeros, divResult) as T; -} - /** * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. * The result is rounded with floor function. @@ -776,7 +732,6 @@ export const add = op({add_}); export const addN = op({addN_}); export const addStrict = op({addStrict_}); export const atan2 = op({atan2_}); -export const divNoNan = op({divNoNan_}); export const divStrict = op({divStrict_}); export const floorDiv = op({floorDiv_}); export const maximum = op({maximum_}); diff --git a/tfjs-core/src/ops/divNoNan.ts b/tfjs-core/src/ops/divNoNan.ts new file mode 100644 index 00000000000..d329c28ec48 --- /dev/null +++ b/tfjs-core/src/ops/divNoNan.ts @@ -0,0 +1,71 @@ +/** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {Tensor} from '../tensor'; +import {makeTypesMatch} from '../tensor_util'; +import {convertToTensor} from '../tensor_util_env'; +import {TensorLike} from '../types'; + +import {div} from './div'; +import {where} from './logical_ops'; +import {op} from './operation'; +import {zerosLike} from './tensor_ops'; + +/** + * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. Return 0 + * if denominator is 0. + * + * We also expose `tf.divStrict` which has the same signature as this op and + * asserts that `a` and `b` are the same shape (does not broadcast). + * + * ```js + * const a = tf.tensor1d([1, 4, 9, 16]); + * const b = tf.tensor1d([1, 2, 3, 4]); + * const c = tf.tensor1d([0, 0, 0, 0]); + * + * a.divNoNan(b).print(); // or tf.divNoNan(a, b) + * a.divNoNan(c).print(); // or tf.divNoNan(a, c) + * ``` + * + * ```js + * // Broadcast div a with b. + * const a = tf.tensor1d([2, 4, 6, 8]); + * const b = tf.scalar(2); + * const c = tf.scalar(0); + * + * a.divNoNan(b).print(); // or tf.divNoNan(a, b) + * a.divNoNan(c).print(); // or tf.divNoNan(a, c) + * ``` + * + * @param a The first tensor as the numerator. + * @param b The second tensor as the denominator. Must have the same dtype as + * `a`. + */ +/** @doc {heading: 'Operations', subheading: 'Arithmetic'} */ +function divNoNan_( + a: Tensor|TensorLike, b: Tensor|TensorLike): T { + let $a = convertToTensor(a, 'a', 'div'); + let $b = convertToTensor(b, 'b', 'div'); + [$a, $b] = makeTypesMatch($a, $b); + + const divResult = div($a, $b); + const zeros = zerosLike(divResult); + const bEqualsZero = $b.equal(zeros); + return where(bEqualsZero, zeros, divResult) as T; +} + +export const divNoNan = op({divNoNan_}); diff --git a/tfjs-core/src/ops/ops.ts b/tfjs-core/src/ops/ops.ts index 7355d15ba89..3e2e08f32bd 100644 --- a/tfjs-core/src/ops/ops.ts +++ b/tfjs-core/src/ops/ops.ts @@ -18,6 +18,7 @@ // Modularized ops. export {broadcastTo} from './broadcast_to'; export {div} from './div'; +export {divNoNan} from './divNoNan'; export {square} from './square'; export {squaredDifference} from './squared_difference'; diff --git a/tfjs-core/src/ops/squared_difference.ts b/tfjs-core/src/ops/squared_difference.ts index 264fdb2d9f9..9a5ecef3641 100644 --- a/tfjs-core/src/ops/squared_difference.ts +++ b/tfjs-core/src/ops/squared_difference.ts @@ -27,7 +27,6 @@ import {assertAndGetBroadcastShape} from './broadcast_util'; import {op} from './operation'; import {scalar} from './tensor_ops'; - /** * Returns (a - b) * (a - b) element-wise. * Supports broadcasting. From 90cb0e647db8539f0b6c2327c294da419788dd60 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Mar 2020 10:18:49 -0400 Subject: [PATCH 04/85] add divnonan --- tfjs-core/src/public/chained_ops/div.ts | 30 ++++++++++++++++++ tfjs-core/src/public/chained_ops/divNoNan.ts | 31 +++++++++++++++++++ .../chained_ops/register_all_chained_ops.ts | 4 ++- 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 tfjs-core/src/public/chained_ops/div.ts create mode 100644 tfjs-core/src/public/chained_ops/divNoNan.ts diff --git a/tfjs-core/src/public/chained_ops/div.ts b/tfjs-core/src/public/chained_ops/div.ts new file mode 100644 index 00000000000..5491e286965 --- /dev/null +++ b/tfjs-core/src/public/chained_ops/div.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {div} from '../../ops/div'; +import {Tensor} from '../../tensor'; +import {Rank, TensorLike} from '../../types'; + +declare module '../../tensor' { + interface Tensor { + div(b: Tensor|TensorLike): T; + } +} + +Tensor.prototype.div = function(b: Tensor|TensorLike): T { + return div(this, b); +}; diff --git a/tfjs-core/src/public/chained_ops/divNoNan.ts b/tfjs-core/src/public/chained_ops/divNoNan.ts new file mode 100644 index 00000000000..b1fce46b8e0 --- /dev/null +++ b/tfjs-core/src/public/chained_ops/divNoNan.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {divNoNan} from '../../ops/divNoNan'; +import {Tensor} from '../../tensor'; +import {Rank, TensorLike} from '../../types'; + +declare module '../../tensor' { + interface Tensor { + divNoNan(b: Tensor|TensorLike): T; + } +} + +Tensor.prototype.divNoNan = function(b: Tensor| + TensorLike): T { + return divNoNan(this, b); +}; diff --git a/tfjs-core/src/public/chained_ops/register_all_chained_ops.ts b/tfjs-core/src/public/chained_ops/register_all_chained_ops.ts index 3a79a8dd6d9..bf68f168aa0 100644 --- a/tfjs-core/src/public/chained_ops/register_all_chained_ops.ts +++ b/tfjs-core/src/public/chained_ops/register_all_chained_ops.ts @@ -15,5 +15,7 @@ * ============================================================================= */ -import './squared_difference'; import './broadcast_to'; +import './div'; +import './divNoNan'; +import './squared_difference'; From 9a985a7b3f05bb4d8d28082cecc6a4ad37d1fa78 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Mar 2020 10:19:14 -0400 Subject: [PATCH 05/85] test --- .../src/public/chained_ops/register_all_chained_ops_test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tfjs-core/src/public/chained_ops/register_all_chained_ops_test.ts b/tfjs-core/src/public/chained_ops/register_all_chained_ops_test.ts index 0ce556c9aa0..e111b20a729 100644 --- a/tfjs-core/src/public/chained_ops/register_all_chained_ops_test.ts +++ b/tfjs-core/src/public/chained_ops/register_all_chained_ops_test.ts @@ -24,8 +24,10 @@ import {ALL_ENVS, describeWithFlags} from '../../jasmine_util'; // flexibility to change in future. const CHAINED_OPS = [ - 'square', 'broadcastTo', + 'div', + 'divNoNan', + 'square', ]; describeWithFlags('chained ops', ALL_ENVS, () => { From ec37e5786f9ab767f21c3c8c7b118b88bcb8dc45 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Mar 2020 11:02:22 -0400 Subject: [PATCH 06/85] chagne import --- tfjs-core/src/backends/webgl/kernels/Div.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tfjs-core/src/backends/webgl/kernels/Div.ts b/tfjs-core/src/backends/webgl/kernels/Div.ts index d76911d6f78..006ab571572 100644 --- a/tfjs-core/src/backends/webgl/kernels/Div.ts +++ b/tfjs-core/src/backends/webgl/kernels/Div.ts @@ -15,10 +15,10 @@ * ============================================================================= */ -import {assertAndGetBroadcastShape} from '../../../../src/ops/broadcast_util'; import {env} from '../../../environment'; import {BinaryInputs, Div} from '../../../kernel_names'; import {KernelConfig, TensorInfo} from '../../../kernel_registry'; +import {assertAndGetBroadcastShape} from '../../backend_util'; import {MathBackendWebGL} from '../backend_webgl'; import * as binaryop_gpu from '../binaryop_gpu'; import {BinaryOpProgram} from '../binaryop_gpu'; From d2b40bbec10e55c3ef81e680f9e7003ca760fe38 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Mar 2020 12:43:22 -0400 Subject: [PATCH 07/85] binary inputs --- tfjs-core/src/backends/webgl/kernels/Div.ts | 4 ++-- tfjs-core/src/backends/webgl/kernels/SquaredDifference.ts | 4 ++-- tfjs-core/src/kernel_names.ts | 2 ++ tfjs-core/src/ops/div.ts | 5 +++-- tfjs-core/src/ops/squared_difference.ts | 5 +++-- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/tfjs-core/src/backends/webgl/kernels/Div.ts b/tfjs-core/src/backends/webgl/kernels/Div.ts index 006ab571572..6aae529eded 100644 --- a/tfjs-core/src/backends/webgl/kernels/Div.ts +++ b/tfjs-core/src/backends/webgl/kernels/Div.ts @@ -16,7 +16,7 @@ */ import {env} from '../../../environment'; -import {BinaryInputs, Div} from '../../../kernel_names'; +import {Div, DivInputs} from '../../../kernel_names'; import {KernelConfig, TensorInfo} from '../../../kernel_registry'; import {assertAndGetBroadcastShape} from '../../backend_util'; import {MathBackendWebGL} from '../backend_webgl'; @@ -41,7 +41,7 @@ export const divConfig: KernelConfig = { kernelName: Div, backendName: 'webgl', kernelFunc: ({inputs, backend}) => { - const {a, b} = inputs as BinaryInputs; + const {a, b} = inputs as DivInputs; const webglBackend = backend as MathBackendWebGL; diff --git a/tfjs-core/src/backends/webgl/kernels/SquaredDifference.ts b/tfjs-core/src/backends/webgl/kernels/SquaredDifference.ts index 9ff08538a74..41463b2c1cb 100644 --- a/tfjs-core/src/backends/webgl/kernels/SquaredDifference.ts +++ b/tfjs-core/src/backends/webgl/kernels/SquaredDifference.ts @@ -16,7 +16,7 @@ */ import {env} from '../../../environment'; -import {BinaryInputs, SquaredDifference} from '../../../kernel_names'; +import {SquaredDifference, SquaredDifferenceInputs} from '../../../kernel_names'; import {KernelConfig} from '../../../kernel_registry'; import {MathBackendWebGL} from '../backend_webgl'; import {BinaryOpProgram} from '../binaryop_gpu'; @@ -26,7 +26,7 @@ export const squaredDifferenceConfig: KernelConfig = { kernelName: SquaredDifference, backendName: 'webgl', kernelFunc: ({inputs, backend}) => { - const {a, b} = inputs as BinaryInputs; + const {a, b} = inputs as SquaredDifferenceInputs; const SQUARED_DIFFERENCE = 'return (a - b) * (a - b);'; const webGLBackend = backend as MathBackendWebGL; diff --git a/tfjs-core/src/kernel_names.ts b/tfjs-core/src/kernel_names.ts index 2e8ff2e2e8b..c25e2e1f624 100644 --- a/tfjs-core/src/kernel_names.ts +++ b/tfjs-core/src/kernel_names.ts @@ -24,8 +24,10 @@ import {PixelData} from './types'; export type BinaryInputs = Pick; export const Div = 'Div'; +export type DivInputs = BinaryInputs; export const SquaredDifference = 'SquaredDifference'; +export type SquaredDifferenceInputs = BinaryInputs; export const Square = 'Square'; export type SquareInputs = Pick; diff --git a/tfjs-core/src/ops/div.ts b/tfjs-core/src/ops/div.ts index 05c19b5967a..cd48cbeaab8 100644 --- a/tfjs-core/src/ops/div.ts +++ b/tfjs-core/src/ops/div.ts @@ -16,7 +16,7 @@ */ import {ENGINE, ForwardFunc} from '../engine'; -import {BinaryInputs, Div} from '../kernel_names'; +import {Div, DivInputs} from '../kernel_names'; import {Tensor} from '../tensor'; import {NamedTensorMap} from '../tensor_types'; import {makeTypesMatch} from '../tensor_util'; @@ -27,6 +27,7 @@ import {floorDiv} from './binary_ops'; import * as broadcast_util from './broadcast_util'; import {op} from './operation'; + /** * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. * @@ -92,7 +93,7 @@ function div_(a: Tensor|TensorLike, b: Tensor|TensorLike): T { return res; }; - const inputs: BinaryInputs = {a: $a, b: $b}; + const inputs: DivInputs = {a: $a, b: $b}; const attrs = {}; const inputsToSave = [$a, $b]; const outputsToSave: boolean[] = []; diff --git a/tfjs-core/src/ops/squared_difference.ts b/tfjs-core/src/ops/squared_difference.ts index 9a5ecef3641..c8fc4ada6e6 100644 --- a/tfjs-core/src/ops/squared_difference.ts +++ b/tfjs-core/src/ops/squared_difference.ts @@ -16,7 +16,7 @@ */ import {ENGINE, ForwardFunc} from '../engine'; -import {BinaryInputs, SquaredDifference} from '../kernel_names'; +import {SquaredDifference, SquaredDifferenceInputs} from '../kernel_names'; import {Tensor} from '../tensor'; import {NamedTensorMap} from '../tensor_types'; import {makeTypesMatch} from '../tensor_util'; @@ -27,6 +27,7 @@ import {assertAndGetBroadcastShape} from './broadcast_util'; import {op} from './operation'; import {scalar} from './tensor_ops'; + /** * Returns (a - b) * (a - b) element-wise. * Supports broadcasting. @@ -74,7 +75,7 @@ function squaredDifference_( return res; }; - const inputs: BinaryInputs = {a: $a, b: $b}; + const inputs: SquaredDifferenceInputs = {a: $a, b: $b}; const attrs = {}; const inputsToSave = [$a, $b]; From d32569f636bd2f9a723dda00996ec78a7324515d Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Mar 2020 12:53:18 -0400 Subject: [PATCH 08/85] avoid public api --- tfjs-core/src/backends/cpu/backend_cpu.ts | 5 +++-- tfjs-core/src/backends/webgl/backend_webgl.ts | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tfjs-core/src/backends/cpu/backend_cpu.ts b/tfjs-core/src/backends/cpu/backend_cpu.ts index 37e9d445806..9d9e9eca22d 100644 --- a/tfjs-core/src/backends/cpu/backend_cpu.ts +++ b/tfjs-core/src/backends/cpu/backend_cpu.ts @@ -19,7 +19,6 @@ import * as seedrandom from 'seedrandom'; import {ENGINE} from '../../engine'; import {env} from '../../environment'; - import {warn} from '../../log'; import * as array_ops_util from '../../ops/array_ops_util'; import * as axis_util from '../../ops/axis_util'; @@ -27,6 +26,7 @@ import * as broadcast_util from '../../ops/broadcast_util'; import {complex, imag, real} from '../../ops/complex_ops'; import * as concat_util from '../../ops/concat_util'; import {Conv2DInfo, Conv3DInfo} from '../../ops/conv_util'; +import {div} from '../../ops/div'; import * as erf_util from '../../ops/erf_util'; import {Activation, FusedBatchMatMulConfig, FusedConv2DConfig} from '../../ops/fused_util'; import * as gather_nd_util from '../../ops/gather_nd_util'; @@ -47,6 +47,7 @@ import {split} from '../split_shared'; import {tile} from '../tile_impl'; import {topkImpl} from '../topk_impl'; import {whereImpl} from '../where_impl'; + import {assertNotComplex} from './cpu_util'; function mapActivation( @@ -385,7 +386,7 @@ export class MathBackendCPU extends KernelBackend { const b = this.exp(a); const sumExp = this.sum(b, axes).reshape(expandedShape); - return b.div(sumExp); + return div(b, sumExp); } subtract(a: Tensor, b: Tensor): Tensor { diff --git a/tfjs-core/src/backends/webgl/backend_webgl.ts b/tfjs-core/src/backends/webgl/backend_webgl.ts index 831c85bcb2c..2dc62e46f58 100644 --- a/tfjs-core/src/backends/webgl/backend_webgl.ts +++ b/tfjs-core/src/backends/webgl/backend_webgl.ts @@ -30,6 +30,7 @@ import * as axis_util from '../../ops/axis_util'; import {complex, imag, real} from '../../ops/complex_ops'; import {computeOutShape} from '../../ops/concat_util'; import {Conv2DInfo, Conv3DInfo} from '../../ops/conv_util'; +import {div} from '../../ops/div'; import {Activation, FusedBatchMatMulConfig, FusedConv2DConfig} from '../../ops/fused_util'; import * as gather_nd_util from '../../ops/gather_nd_util'; import * as reduce_util from '../../ops/reduce_util'; @@ -1585,7 +1586,7 @@ export class MathBackendWebGL extends KernelBackend { const b = this.exp(a); const sumExp = this.sum(b, axes).reshape(expandedShape); - return b.div(sumExp); + return div(b, sumExp); } log(x: T): T { From 5a410dd19ac8d665074cc4c67f01432e3d86e824 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Mar 2020 12:54:48 -0400 Subject: [PATCH 09/85] rename --- tfjs-core/src/backends/cpu/kernels/Div.ts | 4 ++-- tfjs-core/src/backends/cpu/kernels/SquaredDifference.ts | 4 ++-- tfjs-core/src/backends/cpu/utils/kernel_utils.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tfjs-core/src/backends/cpu/kernels/Div.ts b/tfjs-core/src/backends/cpu/kernels/Div.ts index 5483f92f857..76300022d25 100644 --- a/tfjs-core/src/backends/cpu/kernels/Div.ts +++ b/tfjs-core/src/backends/cpu/kernels/Div.ts @@ -17,7 +17,7 @@ import {Div} from '../../../kernel_names'; import {createBinaryKernelConfig} from '../utils/kernel_utils'; -import {createBinaryOp} from '../utils/kernel_utils'; +import {createBinaryKernel} from '../utils/kernel_utils'; -export const div = createBinaryOp((a: number, b: number) => a / b); +export const div = createBinaryKernel((a: number, b: number) => a / b); export const divConfig = createBinaryKernelConfig(Div, div); diff --git a/tfjs-core/src/backends/cpu/kernels/SquaredDifference.ts b/tfjs-core/src/backends/cpu/kernels/SquaredDifference.ts index d89a0e71181..5fdb7346e74 100644 --- a/tfjs-core/src/backends/cpu/kernels/SquaredDifference.ts +++ b/tfjs-core/src/backends/cpu/kernels/SquaredDifference.ts @@ -16,10 +16,10 @@ */ import {SquaredDifference} from '../../../kernel_names'; -import {createBinaryOp} from '../utils/kernel_utils'; +import {createBinaryKernel} from '../utils/kernel_utils'; import {createBinaryKernelConfig} from '../utils/kernel_utils'; -const squaredDifferenceImpl = createBinaryOp((aVal, bVal) => { +const squaredDifferenceImpl = createBinaryKernel((aVal, bVal) => { const diff = aVal - bVal; return diff * diff; }); diff --git a/tfjs-core/src/backends/cpu/utils/kernel_utils.ts b/tfjs-core/src/backends/cpu/utils/kernel_utils.ts index f9fa95e9903..dcaa7e682a3 100644 --- a/tfjs-core/src/backends/cpu/utils/kernel_utils.ts +++ b/tfjs-core/src/backends/cpu/utils/kernel_utils.ts @@ -47,7 +47,7 @@ export const createBinaryKernelConfig = } }); -export const createBinaryOp = (op: (a: number, b: number) => number) => +export const createBinaryKernel = (op: (a: number, b: number) => number) => (aShape: number[], bShape: number[], aVals: TypedArray, bVals: TypedArray, dtype: DataType): [TypedArray, number[]] => { const newShape = backend_util.assertAndGetBroadcastShape(aShape, bShape); From d0f5edd8a375fae909da18b397b5b0b066e36357 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Mar 2020 12:59:22 -0400 Subject: [PATCH 10/85] rename --- .../src/backends/cpu/utils/kernel_utils.ts | 133 +++++++++--------- 1 file changed, 68 insertions(+), 65 deletions(-) diff --git a/tfjs-core/src/backends/cpu/utils/kernel_utils.ts b/tfjs-core/src/backends/cpu/utils/kernel_utils.ts index dcaa7e682a3..93de9353c13 100644 --- a/tfjs-core/src/backends/cpu/utils/kernel_utils.ts +++ b/tfjs-core/src/backends/cpu/utils/kernel_utils.ts @@ -23,70 +23,73 @@ import * as util from '../../../util'; import {MathBackendCPU} from '../backend_cpu'; import {assertNotComplex} from '../cpu_util'; -export const createBinaryKernelConfig = - (name: string, - op: ( - aShape: number[], bShape: number[], aVals: TypedArray, - bVals: TypedArray, dtype: DataType) => [TypedArray, number[]]): - KernelConfig => ({ - kernelName: name, - backendName: 'cpu', - kernelFunc: ({inputs, backend}) => { - const {a, b} = inputs as BinaryInputs; - const cpuBackend = backend as MathBackendCPU; - assertNotComplex([a, b], name); - - const aVals = cpuBackend.data.get(a.dataId).values as TypedArray; - const bVals = cpuBackend.data.get(b.dataId).values as TypedArray; - - const [resultData, resultShape] = - op(a.shape, b.shape, aVals, bVals, a.dtype); - - const dataId = cpuBackend.write(resultData, resultShape, a.dtype); - return {dataId, shape: resultShape, dtype: a.dtype}; - } - }); - -export const createBinaryKernel = (op: (a: number, b: number) => number) => - (aShape: number[], bShape: number[], aVals: TypedArray, bVals: TypedArray, - dtype: DataType): [TypedArray, number[]] => { - const newShape = backend_util.assertAndGetBroadcastShape(aShape, bShape); - - const resultRank = newShape.length; - const resultStrides = util.computeStrides(newShape); - const resultSize = util.sizeFromShape(newShape); - - const result = - util.getTypedArrayFromDType(dtype as NumericDataType, resultSize); - - const aRank = aShape.length; - const bRank = bShape.length; - - const aStrides = util.computeStrides(aShape); - const bStrides = util.computeStrides(bShape); - - const aBroadcastDims = backend_util.getBroadcastDims(aShape, newShape); - const bBroadcastDims = backend_util.getBroadcastDims(bShape, newShape); - - if (aBroadcastDims.length + bBroadcastDims.length === 0) { - for (let i = 0; i < result.length; ++i) { - result[i] = op(aVals[i % aVals.length], bVals[i % bVals.length]); - } - } else { - for (let i = 0; i < result.length; ++i) { - const loc = util.indexToLoc(i, resultRank, resultStrides); - - const aLoc = loc.slice(-aRank); - aBroadcastDims.forEach(d => aLoc[d] = 0); - const aIndex = util.locToIndex(aLoc, aRank, aStrides); - - const bLoc = loc.slice(-bRank); - bBroadcastDims.forEach(d => bLoc[d] = 0); - const bIndex = util.locToIndex(bLoc, bRank, bStrides); - - result[i] = op(aVals[aIndex], bVals[bIndex]); - } +export function createBinaryKernelConfig( + name: string, + op: ( + aShape: number[], bShape: number[], aVals: TypedArray, + bVals: TypedArray, + dtype: DataType) => [TypedArray, number[]]): KernelConfig { + return { + kernelName: name, + backendName: 'cpu', + kernelFunc: ({inputs, backend}) => { + const {a, b} = inputs as BinaryInputs; + const cpuBackend = backend as MathBackendCPU; + assertNotComplex([a, b], name); + + const aVals = cpuBackend.data.get(a.dataId).values as TypedArray; + const bVals = cpuBackend.data.get(b.dataId).values as TypedArray; + + const [resultData, resultShape] = + op(a.shape, b.shape, aVals, bVals, a.dtype); + + const dataId = cpuBackend.write(resultData, resultShape, a.dtype); + return {dataId, shape: resultShape, dtype: a.dtype}; + } + }; +} + +export function createBinaryKernel(op: (a: number, b: number) => number) { + return (aShape: number[], bShape: number[], aVals: TypedArray, + bVals: TypedArray, dtype: DataType): [TypedArray, number[]] => { + const newShape = backend_util.assertAndGetBroadcastShape(aShape, bShape); + + const resultRank = newShape.length; + const resultStrides = util.computeStrides(newShape); + const resultSize = util.sizeFromShape(newShape); + + const result = + util.getTypedArrayFromDType(dtype as NumericDataType, resultSize); + + const aRank = aShape.length; + const bRank = bShape.length; + + const aStrides = util.computeStrides(aShape); + const bStrides = util.computeStrides(bShape); + + const aBroadcastDims = backend_util.getBroadcastDims(aShape, newShape); + const bBroadcastDims = backend_util.getBroadcastDims(bShape, newShape); + + if (aBroadcastDims.length + bBroadcastDims.length === 0) { + for (let i = 0; i < result.length; ++i) { + result[i] = op(aVals[i % aVals.length], bVals[i % bVals.length]); } + } else { + for (let i = 0; i < result.length; ++i) { + const loc = util.indexToLoc(i, resultRank, resultStrides); - return [result, newShape]; - }; + const aLoc = loc.slice(-aRank); + aBroadcastDims.forEach(d => aLoc[d] = 0); + const aIndex = util.locToIndex(aLoc, aRank, aStrides); + + const bLoc = loc.slice(-bRank); + bBroadcastDims.forEach(d => bLoc[d] = 0); + const bIndex = util.locToIndex(bLoc, bRank, bStrides); + + result[i] = op(aVals[aIndex], bVals[bIndex]); + } + } + + return [result, newShape]; + }; +} From 66ac6568a35940bb8984d1d254960598fbafabfd Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Mar 2020 13:15:21 -0400 Subject: [PATCH 11/85] pr comments --- tfjs-core/src/backends/cpu/backend_cpu.ts | 2 ++ tfjs-core/src/backends/cpu/kernels/Div.ts | 4 ++-- tfjs-core/src/backends/cpu/kernels/SquaredDifference.ts | 4 ++-- tfjs-core/src/backends/cpu/utils/kernel_utils.ts | 2 +- tfjs-core/src/backends/webgl/backend_webgl.ts | 2 ++ 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tfjs-core/src/backends/cpu/backend_cpu.ts b/tfjs-core/src/backends/cpu/backend_cpu.ts index 9d9e9eca22d..6880be3269b 100644 --- a/tfjs-core/src/backends/cpu/backend_cpu.ts +++ b/tfjs-core/src/backends/cpu/backend_cpu.ts @@ -386,6 +386,8 @@ export class MathBackendCPU extends KernelBackend { const b = this.exp(a); const sumExp = this.sum(b, axes).reshape(expandedShape); + // TODO(annxingyuan): Call divImpl rather than op as part of softmax kernel + // modularization. return div(b, sumExp); } diff --git a/tfjs-core/src/backends/cpu/kernels/Div.ts b/tfjs-core/src/backends/cpu/kernels/Div.ts index 76300022d25..e5ccc990cee 100644 --- a/tfjs-core/src/backends/cpu/kernels/Div.ts +++ b/tfjs-core/src/backends/cpu/kernels/Div.ts @@ -17,7 +17,7 @@ import {Div} from '../../../kernel_names'; import {createBinaryKernelConfig} from '../utils/kernel_utils'; -import {createBinaryKernel} from '../utils/kernel_utils'; +import {createBinaryKernelImpl} from '../utils/kernel_utils'; -export const div = createBinaryKernel((a: number, b: number) => a / b); +export const div = createBinaryKernelImpl((a: number, b: number) => a / b); export const divConfig = createBinaryKernelConfig(Div, div); diff --git a/tfjs-core/src/backends/cpu/kernels/SquaredDifference.ts b/tfjs-core/src/backends/cpu/kernels/SquaredDifference.ts index 5fdb7346e74..f7ad0205821 100644 --- a/tfjs-core/src/backends/cpu/kernels/SquaredDifference.ts +++ b/tfjs-core/src/backends/cpu/kernels/SquaredDifference.ts @@ -16,10 +16,10 @@ */ import {SquaredDifference} from '../../../kernel_names'; -import {createBinaryKernel} from '../utils/kernel_utils'; +import {createBinaryKernelImpl} from '../utils/kernel_utils'; import {createBinaryKernelConfig} from '../utils/kernel_utils'; -const squaredDifferenceImpl = createBinaryKernel((aVal, bVal) => { +const squaredDifferenceImpl = createBinaryKernelImpl((aVal, bVal) => { const diff = aVal - bVal; return diff * diff; }); diff --git a/tfjs-core/src/backends/cpu/utils/kernel_utils.ts b/tfjs-core/src/backends/cpu/utils/kernel_utils.ts index 93de9353c13..68279392173 100644 --- a/tfjs-core/src/backends/cpu/utils/kernel_utils.ts +++ b/tfjs-core/src/backends/cpu/utils/kernel_utils.ts @@ -49,7 +49,7 @@ export function createBinaryKernelConfig( }; } -export function createBinaryKernel(op: (a: number, b: number) => number) { +export function createBinaryKernelImpl(op: (a: number, b: number) => number) { return (aShape: number[], bShape: number[], aVals: TypedArray, bVals: TypedArray, dtype: DataType): [TypedArray, number[]] => { const newShape = backend_util.assertAndGetBroadcastShape(aShape, bShape); diff --git a/tfjs-core/src/backends/webgl/backend_webgl.ts b/tfjs-core/src/backends/webgl/backend_webgl.ts index 2dc62e46f58..aa86014a98e 100644 --- a/tfjs-core/src/backends/webgl/backend_webgl.ts +++ b/tfjs-core/src/backends/webgl/backend_webgl.ts @@ -1586,6 +1586,8 @@ export class MathBackendWebGL extends KernelBackend { const b = this.exp(a); const sumExp = this.sum(b, axes).reshape(expandedShape); + // TODO(annxingyuan): Call divImpl rather than op as part of softmax kernel + // modularization. return div(b, sumExp); } From 12c457e48df72ebefd1a60ed8922c5fe67a22245 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Mar 2020 17:24:45 -0400 Subject: [PATCH 12/85] remove out tensor --- tfjs-core/src/backends/webgl/kernels/Div.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tfjs-core/src/backends/webgl/kernels/Div.ts b/tfjs-core/src/backends/webgl/kernels/Div.ts index 6aae529eded..373bb083f6d 100644 --- a/tfjs-core/src/backends/webgl/kernels/Div.ts +++ b/tfjs-core/src/backends/webgl/kernels/Div.ts @@ -18,7 +18,6 @@ import {env} from '../../../environment'; import {Div, DivInputs} from '../../../kernel_names'; import {KernelConfig, TensorInfo} from '../../../kernel_registry'; -import {assertAndGetBroadcastShape} from '../../backend_util'; import {MathBackendWebGL} from '../backend_webgl'; import * as binaryop_gpu from '../binaryop_gpu'; import {BinaryOpProgram} from '../binaryop_gpu'; @@ -26,14 +25,13 @@ import * as binaryop_packed_gpu from '../binaryop_packed_gpu'; import {BinaryOpPackedProgram} from '../binaryop_packed_gpu'; export const divImpl = - (a: TensorInfo, b: TensorInfo, out: TensorInfo, - backend: MathBackendWebGL): TensorInfo => { + (a: TensorInfo, b: TensorInfo, backend: MathBackendWebGL): TensorInfo => { let program = new BinaryOpProgram(binaryop_gpu.DIV, a.shape, b.shape); if (env().getBool('WEBGL_PACK_BINARY_OPERATIONS')) { program = new BinaryOpPackedProgram( binaryop_packed_gpu.DIV, a.shape, b.shape, true); } - const output = backend.runWebGLProgram(program, [a, b], 'float32', out); + const output = backend.runWebGLProgram(program, [a, b], 'float32'); return output; }; @@ -45,10 +43,7 @@ export const divConfig: KernelConfig = { const webglBackend = backend as MathBackendWebGL; - const outShape = assertAndGetBroadcastShape(a.shape, b.shape); - const outTensorInfo = webglBackend.makeTensorInfo(outShape, a.dtype); - - const out = divImpl(a, b, outTensorInfo, webglBackend); + const out = divImpl(a, b, webglBackend); return {dataId: out.dataId, shape: out.shape, dtype: out.dtype}; } From 0720c8220e147f0cf306e2f1ef2469756cc0ceed Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Mar 2020 17:26:23 -0400 Subject: [PATCH 13/85] simplify --- tfjs-core/src/backends/webgl/backend_webgl.ts | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/tfjs-core/src/backends/webgl/backend_webgl.ts b/tfjs-core/src/backends/webgl/backend_webgl.ts index aa86014a98e..64d29147b21 100644 --- a/tfjs-core/src/backends/webgl/backend_webgl.ts +++ b/tfjs-core/src/backends/webgl/backend_webgl.ts @@ -2431,8 +2431,8 @@ export class MathBackendWebGL extends KernelBackend { const program = new PackProgram(input.shape); const preventEagerUnpackingOutput = true; return this.runWebGLProgram( - program, [input], input.dtype, null /* out info */, - null /* customSetup */, preventEagerUnpackingOutput); + program, [input], input.dtype, null /* customSetup */, + preventEagerUnpackingOutput); } private packedReshape(input: TensorInfo, afterShape: number[]): TensorInfo { @@ -2452,8 +2452,8 @@ export class MathBackendWebGL extends KernelBackend { const program = new ReshapePackedProgram(afterShapeAs3D, input3DShape); const preventEagerUnpackingOfOutput = true; const output = this.runWebGLProgram( - program, [input3D], input.dtype, null /* out info */, - null /* customSetup */, preventEagerUnpackingOfOutput); + program, [input3D], input.dtype, null /* customSetup */, + preventEagerUnpackingOfOutput); return {dataId: output.dataId, shape: afterShape, dtype: output.dtype}; } @@ -2471,19 +2471,15 @@ export class MathBackendWebGL extends KernelBackend { const preventEagerUnpackingOfOutput = true; const out = this.runWebGLProgram( program, [{shape: shapeAs3D, dtype, dataId}], dtype, - null /* out info */, null /* customSetup */, - preventEagerUnpackingOfOutput); + null /* customSetup */, preventEagerUnpackingOfOutput); return {dtype, shape, dataId: out.dataId}; } runWebGLProgram( program: GPGPUProgram, inputs: TensorInfo[], outputDtype: DataType, - output?: TensorInfo, customSetup?: (gpgpu: GPGPUContext, webGLProgram: WebGLProgram) => void, preventEagerUnpackingOfOutput = false): TensorInfo { - if (output == null) { - output = this.makeTensorInfo(program.outputShape, outputDtype); - } + const output = this.makeTensorInfo(program.outputShape, outputDtype); const outData = this.texData.get(output.dataId); if (program.packedOutput) { outData.isPacked = true; @@ -2610,7 +2606,7 @@ export class MathBackendWebGL extends KernelBackend { preventEagerUnpackingOfOutput = false): K { outputDtype = outputDtype || inputs[0].dtype; const outInfo = this.runWebGLProgram( - program, inputs, outputDtype, null /* out info */, customSetup, + program, inputs, outputDtype, customSetup, preventEagerUnpackingOfOutput); return ENGINE.makeTensorFromDataId( outInfo.dataId, outInfo.shape, outInfo.dtype) as {} as K; @@ -2736,8 +2732,7 @@ export class MathBackendWebGL extends KernelBackend { // WEBGL_PACK. const preventEagerUnpacking = true; const encodedOutputTarget = this.runWebGLProgram( - program, [tempDenseInputHandle], dtype, null /* out info */, - null /* custom setup */, preventEagerUnpacking); + program, [tempDenseInputHandle], dtype, null, preventEagerUnpacking); // Have the original texture assume the identity of the encoded output. const outputTexData = this.texData.get(encodedOutputTarget.dataId); From 32c89e07f8c79bff138cffa9c5a6531bd49c4cf3 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Mar 2020 17:38:34 -0400 Subject: [PATCH 14/85] pr comments --- tfjs-core/src/backends/webgl/kernels/Div.ts | 20 ++++++++++---------- tfjs-core/src/gradients/Div_grad.ts | 21 +++++++++++---------- tfjs-core/src/tensor.ts | 10 ---------- 3 files changed, 21 insertions(+), 30 deletions(-) diff --git a/tfjs-core/src/backends/webgl/kernels/Div.ts b/tfjs-core/src/backends/webgl/kernels/Div.ts index 373bb083f6d..05ce2c2717b 100644 --- a/tfjs-core/src/backends/webgl/kernels/Div.ts +++ b/tfjs-core/src/backends/webgl/kernels/Div.ts @@ -24,16 +24,16 @@ import {BinaryOpProgram} from '../binaryop_gpu'; import * as binaryop_packed_gpu from '../binaryop_packed_gpu'; import {BinaryOpPackedProgram} from '../binaryop_packed_gpu'; -export const divImpl = - (a: TensorInfo, b: TensorInfo, backend: MathBackendWebGL): TensorInfo => { - let program = new BinaryOpProgram(binaryop_gpu.DIV, a.shape, b.shape); - if (env().getBool('WEBGL_PACK_BINARY_OPERATIONS')) { - program = new BinaryOpPackedProgram( - binaryop_packed_gpu.DIV, a.shape, b.shape, true); - } - const output = backend.runWebGLProgram(program, [a, b], 'float32'); - return output; - }; +export function divImpl( + a: TensorInfo, b: TensorInfo, backend: MathBackendWebGL): TensorInfo { + let program = new BinaryOpProgram(binaryop_gpu.DIV, a.shape, b.shape); + if (env().getBool('WEBGL_PACK_BINARY_OPERATIONS')) { + program = new BinaryOpPackedProgram( + binaryop_packed_gpu.DIV, a.shape, b.shape, true); + } + const output = backend.runWebGLProgram(program, [a, b], 'float32'); + return output; +} export const divConfig: KernelConfig = { kernelName: Div, diff --git a/tfjs-core/src/gradients/Div_grad.ts b/tfjs-core/src/gradients/Div_grad.ts index c2a3b39da7d..8b4fc15d985 100644 --- a/tfjs-core/src/gradients/Div_grad.ts +++ b/tfjs-core/src/gradients/Div_grad.ts @@ -18,31 +18,32 @@ import {Div} from '../kernel_names'; import {GradConfig} from '../kernel_registry'; import * as broadcast_util from '../ops/broadcast_util'; +import {div} from '../ops/div'; import {Tensor} from '../tensor'; export const divGradConfig: GradConfig = { kernelName: Div, inputsToSave: ['a', 'b'], gradFunc: (dy: Tensor, saved: Tensor[]) => { - const [$a, $b] = saved; + const [a, b] = saved; const outShape = - broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape); + broadcast_util.assertAndGetBroadcastShape(a.shape, b.shape); const derA = () => { - const res = dy.div($b.toFloat()); - const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape); + const res = div(dy, b.toFloat()); + const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape); if (reduceAxes.length > 0) { - return res.sum(reduceAxes).reshape($a.shape); + return res.sum(reduceAxes).reshape(a.shape); } return res; }; const derB = () => { - let res = dy.mul($a.toFloat()); - const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape); + let res = dy.mul(a.toFloat()); + const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape); if (reduceAxes.length > 0) { - res = res.sum(reduceAxes).reshape($b.shape); + res = res.sum(reduceAxes).reshape(b.shape); } - const tmp = $b.square(); - return res.div(tmp.toFloat()).neg(); + const tmp = b.square(); + return div(res, tmp.toFloat()).neg(); }; return {a: derA, b: derB}; } diff --git a/tfjs-core/src/tensor.ts b/tfjs-core/src/tensor.ts index cee26c4cde3..b4606e44bcc 100644 --- a/tfjs-core/src/tensor.ts +++ b/tfjs-core/src/tensor.ts @@ -229,8 +229,6 @@ export interface OpHandler { powStrict(base: T, exp: Tensor|TensorLike): T; mul(a: Tensor, b: Tensor|TensorLike): T; mulStrict(a: T, b: T|TensorLike): T; - div(a: Tensor, b: Tensor|TensorLike): T; - divNoNan(a: Tensor, b: Tensor|TensorLike): T; floorDiv(a: Tensor, b: Tensor|TensorLike): T; divStrict(a: T, b: T|TensorLike): T; mod(a: Tensor, b: Tensor|TensorLike): T; @@ -955,14 +953,6 @@ export class Tensor { this.throwIfDisposed(); return opHandler.mulStrict(this, x); } - div(x: Tensor|TensorLike): T { - this.throwIfDisposed(); - return opHandler.div(this, x); - } - divNoNan(x: Tensor|TensorLike): T { - this.throwIfDisposed(); - return opHandler.divNoNan(this, x); - } floorDiv(x: Tensor|TensorLike): T { this.throwIfDisposed(); return opHandler.floorDiv(this, x); From 83d9c7f078448cafc4350b75146e994ffc64c48c Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Mar 2020 17:39:48 -0400 Subject: [PATCH 15/85] clean --- tfjs-core/src/ops/div.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tfjs-core/src/ops/div.ts b/tfjs-core/src/ops/div.ts index cd48cbeaab8..e08fb9a587f 100644 --- a/tfjs-core/src/ops/div.ts +++ b/tfjs-core/src/ops/div.ts @@ -95,12 +95,9 @@ function div_(a: Tensor|TensorLike, b: Tensor|TensorLike): T { const inputs: DivInputs = {a: $a, b: $b}; const attrs = {}; - const inputsToSave = [$a, $b]; - const outputsToSave: boolean[] = []; return ENGINE.runKernelFunc( - forward, inputs as {} as NamedTensorMap, der, Div, attrs, - inputsToSave, outputsToSave) as T; + forward, inputs as {} as NamedTensorMap, der, Div, attrs) as T; } export const div = op({div_}); From 15e6c7252a621f5a9744af74ef26de14d43feaec Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Mar 2020 17:55:04 -0400 Subject: [PATCH 16/85] lint --- tfjs-core/src/ops/div.ts | 1 - tfjs-core/src/ops/squared_difference.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/tfjs-core/src/ops/div.ts b/tfjs-core/src/ops/div.ts index e08fb9a587f..194202f343a 100644 --- a/tfjs-core/src/ops/div.ts +++ b/tfjs-core/src/ops/div.ts @@ -27,7 +27,6 @@ import {floorDiv} from './binary_ops'; import * as broadcast_util from './broadcast_util'; import {op} from './operation'; - /** * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. * diff --git a/tfjs-core/src/ops/squared_difference.ts b/tfjs-core/src/ops/squared_difference.ts index c8fc4ada6e6..0653191326c 100644 --- a/tfjs-core/src/ops/squared_difference.ts +++ b/tfjs-core/src/ops/squared_difference.ts @@ -27,7 +27,6 @@ import {assertAndGetBroadcastShape} from './broadcast_util'; import {op} from './operation'; import {scalar} from './tensor_ops'; - /** * Returns (a - b) * (a - b) element-wise. * Supports broadcasting. From 6385e9ec8eaa2fde2f6d5f180fab45ebe9f42018 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Tue, 24 Mar 2020 07:00:44 -0400 Subject: [PATCH 17/85] save From 4af9bbc9bf330278bd8497279a61df733923d96d Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Wed, 25 Mar 2020 10:31:49 -0400 Subject: [PATCH 18/85] separate out --- tfjs-core/src/backends/cpu/kernels/Div.ts | 5 ++- .../src/backends/cpu/kernels/Div_impl.ts | 20 +++++++++++ tfjs-core/src/backends/webgl/kernels/Div.ts | 19 ++-------- .../src/backends/webgl/kernels/Div_impl.ts | 35 +++++++++++++++++++ 4 files changed, 59 insertions(+), 20 deletions(-) create mode 100644 tfjs-core/src/backends/cpu/kernels/Div_impl.ts create mode 100644 tfjs-core/src/backends/webgl/kernels/Div_impl.ts diff --git a/tfjs-core/src/backends/cpu/kernels/Div.ts b/tfjs-core/src/backends/cpu/kernels/Div.ts index e5ccc990cee..d248a487131 100644 --- a/tfjs-core/src/backends/cpu/kernels/Div.ts +++ b/tfjs-core/src/backends/cpu/kernels/Div.ts @@ -17,7 +17,6 @@ import {Div} from '../../../kernel_names'; import {createBinaryKernelConfig} from '../utils/kernel_utils'; -import {createBinaryKernelImpl} from '../utils/kernel_utils'; +import {divImpl} from './Div_impl'; -export const div = createBinaryKernelImpl((a: number, b: number) => a / b); -export const divConfig = createBinaryKernelConfig(Div, div); +export const divConfig = createBinaryKernelConfig(Div, divImpl); diff --git a/tfjs-core/src/backends/cpu/kernels/Div_impl.ts b/tfjs-core/src/backends/cpu/kernels/Div_impl.ts new file mode 100644 index 00000000000..2b4c060d8ff --- /dev/null +++ b/tfjs-core/src/backends/cpu/kernels/Div_impl.ts @@ -0,0 +1,20 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {createBinaryKernelImpl} from '../utils/kernel_utils'; + +export const divImpl = createBinaryKernelImpl((a: number, b: number) => a / b); diff --git a/tfjs-core/src/backends/webgl/kernels/Div.ts b/tfjs-core/src/backends/webgl/kernels/Div.ts index 05ce2c2717b..40f1193bff6 100644 --- a/tfjs-core/src/backends/webgl/kernels/Div.ts +++ b/tfjs-core/src/backends/webgl/kernels/Div.ts @@ -15,25 +15,10 @@ * ============================================================================= */ -import {env} from '../../../environment'; import {Div, DivInputs} from '../../../kernel_names'; -import {KernelConfig, TensorInfo} from '../../../kernel_registry'; +import {KernelConfig} from '../../../kernel_registry'; import {MathBackendWebGL} from '../backend_webgl'; -import * as binaryop_gpu from '../binaryop_gpu'; -import {BinaryOpProgram} from '../binaryop_gpu'; -import * as binaryop_packed_gpu from '../binaryop_packed_gpu'; -import {BinaryOpPackedProgram} from '../binaryop_packed_gpu'; - -export function divImpl( - a: TensorInfo, b: TensorInfo, backend: MathBackendWebGL): TensorInfo { - let program = new BinaryOpProgram(binaryop_gpu.DIV, a.shape, b.shape); - if (env().getBool('WEBGL_PACK_BINARY_OPERATIONS')) { - program = new BinaryOpPackedProgram( - binaryop_packed_gpu.DIV, a.shape, b.shape, true); - } - const output = backend.runWebGLProgram(program, [a, b], 'float32'); - return output; -} +import {divImpl} from './Div_impl'; export const divConfig: KernelConfig = { kernelName: Div, diff --git a/tfjs-core/src/backends/webgl/kernels/Div_impl.ts b/tfjs-core/src/backends/webgl/kernels/Div_impl.ts new file mode 100644 index 00000000000..01a2c145164 --- /dev/null +++ b/tfjs-core/src/backends/webgl/kernels/Div_impl.ts @@ -0,0 +1,35 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {env} from '../../../environment'; +import {TensorInfo} from '../../../kernel_registry'; +import {MathBackendWebGL} from '../backend_webgl'; +import * as binaryop_gpu from '../binaryop_gpu'; +import {BinaryOpProgram} from '../binaryop_gpu'; +import * as binaryop_packed_gpu from '../binaryop_packed_gpu'; +import {BinaryOpPackedProgram} from '../binaryop_packed_gpu'; + +export function divImpl( + a: TensorInfo, b: TensorInfo, backend: MathBackendWebGL): TensorInfo { + let program = new BinaryOpProgram(binaryop_gpu.DIV, a.shape, b.shape); + if (env().getBool('WEBGL_PACK_BINARY_OPERATIONS')) { + program = new BinaryOpPackedProgram( + binaryop_packed_gpu.DIV, a.shape, b.shape, true); + } + const output = backend.runWebGLProgram(program, [a, b], 'float32'); + return output; +} From 3076d8a76d39bb1e83528dcc44c4b1d6a192fdf2 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Wed, 25 Mar 2020 10:32:32 -0400 Subject: [PATCH 19/85] modify --- tfjs-core/src/backends/webgl/kernels/Div.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tfjs-core/src/backends/webgl/kernels/Div.ts b/tfjs-core/src/backends/webgl/kernels/Div.ts index 40f1193bff6..0c88c4b9738 100644 --- a/tfjs-core/src/backends/webgl/kernels/Div.ts +++ b/tfjs-core/src/backends/webgl/kernels/Div.ts @@ -28,8 +28,6 @@ export const divConfig: KernelConfig = { const webglBackend = backend as MathBackendWebGL; - const out = divImpl(a, b, webglBackend); - - return {dataId: out.dataId, shape: out.shape, dtype: out.dtype}; + return divImpl(a, b, webglBackend); } }; From 3cb66118ab435d61e9e376b3c2e84b11db5474de Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Wed, 25 Mar 2020 10:35:02 -0400 Subject: [PATCH 20/85] unchain --- tfjs-core/src/gradients/Div_grad.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tfjs-core/src/gradients/Div_grad.ts b/tfjs-core/src/gradients/Div_grad.ts index 8b4fc15d985..578f48dbdd0 100644 --- a/tfjs-core/src/gradients/Div_grad.ts +++ b/tfjs-core/src/gradients/Div_grad.ts @@ -19,6 +19,9 @@ import {Div} from '../kernel_names'; import {GradConfig} from '../kernel_registry'; import * as broadcast_util from '../ops/broadcast_util'; import {div} from '../ops/div'; +import {sum} from '../ops/reduction_ops'; +import {square} from '../ops/square'; +import {neg} from '../ops/unary_ops'; import {Tensor} from '../tensor'; export const divGradConfig: GradConfig = { @@ -32,7 +35,7 @@ export const divGradConfig: GradConfig = { const res = div(dy, b.toFloat()); const reduceAxes = broadcast_util.getReductionAxes(a.shape, outShape); if (reduceAxes.length > 0) { - return res.sum(reduceAxes).reshape(a.shape); + return sum(res, reduceAxes).reshape(a.shape); } return res; }; @@ -40,10 +43,10 @@ export const divGradConfig: GradConfig = { let res = dy.mul(a.toFloat()); const reduceAxes = broadcast_util.getReductionAxes(b.shape, outShape); if (reduceAxes.length > 0) { - res = res.sum(reduceAxes).reshape(b.shape); + res = sum(res, reduceAxes).reshape(b.shape); } - const tmp = b.square(); - return div(res, tmp.toFloat()).neg(); + const tmp = square(b); + return neg(div(res, tmp.toFloat())); }; return {a: derA, b: derB}; } From 78ed40f22a03d9f3079fc7b5a12c83dbbe669a42 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Wed, 25 Mar 2020 10:36:41 -0400 Subject: [PATCH 21/85] remove der --- tfjs-core/src/ops/div.ts | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/tfjs-core/src/ops/div.ts b/tfjs-core/src/ops/div.ts index 194202f343a..54364f18f05 100644 --- a/tfjs-core/src/ops/div.ts +++ b/tfjs-core/src/ops/div.ts @@ -24,7 +24,6 @@ import {convertToTensor} from '../tensor_util_env'; import {TensorLike} from '../types'; import {floorDiv} from './binary_ops'; -import * as broadcast_util from './broadcast_util'; import {op} from './operation'; /** @@ -62,30 +61,6 @@ function div_(a: Tensor|TensorLike, b: Tensor|TensorLike): T { return floorDiv($a, $b); } - const outShape = - broadcast_util.assertAndGetBroadcastShape($a.shape, $b.shape); - const der = (dy: Tensor, saved: Tensor[]) => { - const [$a, $b] = saved; - const derA = () => { - const res = dy.div($b.toFloat()); - const reduceAxes = broadcast_util.getReductionAxes($a.shape, outShape); - if (reduceAxes.length > 0) { - return res.sum(reduceAxes).reshape($a.shape); - } - return res; - }; - const derB = () => { - let res = dy.mul($a.toFloat()); - const reduceAxes = broadcast_util.getReductionAxes($b.shape, outShape); - if (reduceAxes.length > 0) { - res = res.sum(reduceAxes).reshape($b.shape); - } - const tmp = $b.square(); - return res.div(tmp.toFloat()).neg(); - }; - return {a: derA, b: derB}; - }; - const forward: ForwardFunc = (backend, save) => { const res = backend.realDivide($a, $b); save([$a, $b]); @@ -96,7 +71,8 @@ function div_(a: Tensor|TensorLike, b: Tensor|TensorLike): T { const attrs = {}; return ENGINE.runKernelFunc( - forward, inputs as {} as NamedTensorMap, der, Div, attrs) as T; + forward, inputs as {} as NamedTensorMap, null /* gradient */, Div, + attrs) as T; } export const div = op({div_}); From cd3773243cfefcc2c43d953c357de049832efeba Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Wed, 25 Mar 2020 10:44:02 -0400 Subject: [PATCH 22/85] divnonan --- tfjs-core/src/ops/{divNoNan.ts => div_no_nan.ts} | 1 + tfjs-core/src/ops/ops.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) rename tfjs-core/src/ops/{divNoNan.ts => div_no_nan.ts} (98%) diff --git a/tfjs-core/src/ops/divNoNan.ts b/tfjs-core/src/ops/div_no_nan.ts similarity index 98% rename from tfjs-core/src/ops/divNoNan.ts rename to tfjs-core/src/ops/div_no_nan.ts index d329c28ec48..b9737316cad 100644 --- a/tfjs-core/src/ops/divNoNan.ts +++ b/tfjs-core/src/ops/div_no_nan.ts @@ -58,6 +58,7 @@ import {zerosLike} from './tensor_ops'; /** @doc {heading: 'Operations', subheading: 'Arithmetic'} */ function divNoNan_( a: Tensor|TensorLike, b: Tensor|TensorLike): T { + // TODO: Make this into its own kernel. let $a = convertToTensor(a, 'a', 'div'); let $b = convertToTensor(b, 'b', 'div'); [$a, $b] = makeTypesMatch($a, $b); diff --git a/tfjs-core/src/ops/ops.ts b/tfjs-core/src/ops/ops.ts index 6a99144c066..7f4268fdee2 100644 --- a/tfjs-core/src/ops/ops.ts +++ b/tfjs-core/src/ops/ops.ts @@ -19,7 +19,7 @@ export {broadcastTo} from './broadcast_to'; export {clone} from './clone'; export {div} from './div'; -export {divNoNan} from './divNoNan'; +export {divNoNan} from './div_no_nan'; export {eye} from './eye'; export {multinomial} from './multinomial'; export {oneHot} from './one_hot'; From 24e6ecf0e74cd2bdac0c2eea04831acef43c4cce Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Wed, 25 Mar 2020 10:47:26 -0400 Subject: [PATCH 23/85] save From 6fcecd34415002638729a071de413297df5d50a1 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Wed, 25 Mar 2020 14:29:41 -0400 Subject: [PATCH 24/85] update workspace --- tfjs-backend-wasm/WORKSPACE | 53 ++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/tfjs-backend-wasm/WORKSPACE b/tfjs-backend-wasm/WORKSPACE index 10d6da61368..ff9751b8673 100644 --- a/tfjs-backend-wasm/WORKSPACE +++ b/tfjs-backend-wasm/WORKSPACE @@ -8,7 +8,7 @@ emsdk_configure(name = "emsdk") git_repository( name = "xnnpack", - commit = "15d1f511d37a8dad1ab7a80cfefd7014accf72ac", + commit = "d21fdcb4af35a8764333c3bb24fa54c55bb5db52", remote = "https://github.com/google/XNNPACK.git", shallow_since = "1582560423 -0800", ) @@ -16,71 +16,88 @@ git_repository( # The libraries below are transitive dependencies of XNNPACK that we need to # explicitly enumerate here. See https://docs.bazel.build/versions/master/external.html#transitive-dependencies +# Google Test framework, used by most unit-tests. +http_archive( + name = "com_google_googletest", + urls = ["https://github.com/google/googletest/archive/master.zip"], + strip_prefix = "googletest-master", +) + +# Google Benchmark library, used in micro-benchmarks. +http_archive( + name = "com_google_benchmark", + urls = [ + "https://github.com/google/benchmark/archive/master.zip" + ], + strip_prefix = "benchmark-master", + build_file = "@//third_party:benchmark.BUILD", +) + # FP16 library, used for half-precision conversions http_archive( name = "FP16", - build_file = "@xnnpack//third_party:FP16.BUILD", - sha256 = "9764297a339ad73b0717331a2c3e9c42a52105cd04cab62cb160e2b4598d2ea6", strip_prefix = "FP16-ba1d31f5eed2eb4a69e4dea3870a68c7c95f998f", + sha256 = "9764297a339ad73b0717331a2c3e9c42a52105cd04cab62cb160e2b4598d2ea6", urls = [ "https://github.com/Maratyszcza/FP16/archive/ba1d31f5eed2eb4a69e4dea3870a68c7c95f998f.tar.gz", ], + build_file = "@//third_party:FP16.BUILD", ) # FXdiv library, used for repeated integer division by the same factor http_archive( name = "FXdiv", - build_file = "@xnnpack//third_party:FXdiv.BUILD", - sha256 = "7d3215bea832fe77091ec5666200b91156df6724da1e348205078346325fc45e", strip_prefix = "FXdiv-f8c5354679ec2597792bc70a9e06eff50c508b9a", + sha256 = "7d3215bea832fe77091ec5666200b91156df6724da1e348205078346325fc45e", urls = [ "https://github.com/Maratyszcza/FXdiv/archive/f8c5354679ec2597792bc70a9e06eff50c508b9a.tar.gz", ], + build_file = "@//third_party:FXdiv.BUILD", ) # pthreadpool library, used for parallelization http_archive( name = "pthreadpool", - build_file = "@xnnpack//third_party:pthreadpool.BUILD", - sha256 = "c2328fdf9e48ac9b928953bcbc442eb14402d393e4cfae0541581a3d39efca9d", - strip_prefix = "pthreadpool-0e275fe56094626349c55a524ea8b71a85daa64b", + strip_prefix = "pthreadpool-ebd50d0cfa3664d454ffdf246fcd228c3b370a11", + sha256 = "ca4fc774cf2339cb739bba827de8ed4ccbd450c4608e05329e974153448aaf56", urls = [ - "https://github.com/Maratyszcza/pthreadpool/archive/0e275fe56094626349c55a524ea8b71a85daa64b.tar.gz", + "https://github.com/Maratyszcza/pthreadpool/archive/ebd50d0cfa3664d454ffdf246fcd228c3b370a11.tar.gz", ], + build_file = "@//third_party:pthreadpool.BUILD", ) # clog library, used for logging http_archive( name = "clog", - build_file = "@xnnpack//third_party:clog.BUILD", - sha256 = "3f2dc1970f397a0e59db72f9fca6ff144b216895c1d606f6c94a507c1e53a025", strip_prefix = "cpuinfo-d5e37adf1406cf899d7d9ec1d317c47506ccb970", + sha256 = "3f2dc1970f397a0e59db72f9fca6ff144b216895c1d606f6c94a507c1e53a025", urls = [ "https://github.com/pytorch/cpuinfo/archive/d5e37adf1406cf899d7d9ec1d317c47506ccb970.tar.gz", ], + build_file = "@//third_party:clog.BUILD", ) # cpuinfo library, used for detecting processor characteristics http_archive( name = "cpuinfo", - build_file = "@xnnpack//third_party:cpuinfo.BUILD", - patches = ["@xnnpack//third_party:cpuinfo.patch"], - sha256 = "3f2dc1970f397a0e59db72f9fca6ff144b216895c1d606f6c94a507c1e53a025", - strip_prefix = "cpuinfo-d5e37adf1406cf899d7d9ec1d317c47506ccb970", + strip_prefix = "cpuinfo-d6c0f915ee737f961915c9d17f1679b6777af207", + sha256 = "146fc61c3cf63d7d88db963876929a4d373f621fb65568b895efa0857f467770", urls = [ - "https://github.com/pytorch/cpuinfo/archive/d5e37adf1406cf899d7d9ec1d317c47506ccb970.tar.gz", + "https://github.com/pytorch/cpuinfo/archive/d6c0f915ee737f961915c9d17f1679b6777af207.tar.gz", ], + build_file = "@//third_party:cpuinfo.BUILD", + patches = ["@//third_party:cpuinfo.patch"], ) # psimd library, used for fallback 128-bit SIMD micro-kernels http_archive( name = "psimd", - build_file = "@xnnpack//third_party:psimd.BUILD", - sha256 = "c621f9bb1ff9ab8f0fa4a04f3239d13b345a6e865318d7b464aa80531a1abb2c", strip_prefix = "psimd-88882f601f8179e1987b7e7cf4a8012c9080ad44", + sha256 = "c621f9bb1ff9ab8f0fa4a04f3239d13b345a6e865318d7b464aa80531a1abb2c", urls = [ "https://github.com/Maratyszcza/psimd/archive/88882f601f8179e1987b7e7cf4a8012c9080ad44.tar.gz", ], + build_file = "@//third_party:psimd.BUILD", ) git_repository( From 3cc70fd5b06b66267055cb697f3eee5a982ba4da Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Thu, 26 Mar 2020 07:10:27 -0400 Subject: [PATCH 25/85] update --- tfjs-backend-wasm/WORKSPACE | 16 ++++++++-------- tfjs-core/src/public/chained_ops/divNoNan.ts | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tfjs-backend-wasm/WORKSPACE b/tfjs-backend-wasm/WORKSPACE index ff9751b8673..6f2868c2cac 100644 --- a/tfjs-backend-wasm/WORKSPACE +++ b/tfjs-backend-wasm/WORKSPACE @@ -30,7 +30,7 @@ http_archive( "https://github.com/google/benchmark/archive/master.zip" ], strip_prefix = "benchmark-master", - build_file = "@//third_party:benchmark.BUILD", + build_file = "@xnnpack//third_party:benchmark.BUILD", ) # FP16 library, used for half-precision conversions @@ -41,7 +41,7 @@ http_archive( urls = [ "https://github.com/Maratyszcza/FP16/archive/ba1d31f5eed2eb4a69e4dea3870a68c7c95f998f.tar.gz", ], - build_file = "@//third_party:FP16.BUILD", + build_file = "@xnnpack//third_party:FP16.BUILD", ) # FXdiv library, used for repeated integer division by the same factor @@ -52,7 +52,7 @@ http_archive( urls = [ "https://github.com/Maratyszcza/FXdiv/archive/f8c5354679ec2597792bc70a9e06eff50c508b9a.tar.gz", ], - build_file = "@//third_party:FXdiv.BUILD", + build_file = "@xnnpack//third_party:FXdiv.BUILD", ) # pthreadpool library, used for parallelization @@ -63,7 +63,7 @@ http_archive( urls = [ "https://github.com/Maratyszcza/pthreadpool/archive/ebd50d0cfa3664d454ffdf246fcd228c3b370a11.tar.gz", ], - build_file = "@//third_party:pthreadpool.BUILD", + build_file = "@xnnpack//third_party:pthreadpool.BUILD", ) # clog library, used for logging @@ -74,7 +74,7 @@ http_archive( urls = [ "https://github.com/pytorch/cpuinfo/archive/d5e37adf1406cf899d7d9ec1d317c47506ccb970.tar.gz", ], - build_file = "@//third_party:clog.BUILD", + build_file = "@xnnpack//third_party:clog.BUILD", ) # cpuinfo library, used for detecting processor characteristics @@ -85,8 +85,8 @@ http_archive( urls = [ "https://github.com/pytorch/cpuinfo/archive/d6c0f915ee737f961915c9d17f1679b6777af207.tar.gz", ], - build_file = "@//third_party:cpuinfo.BUILD", - patches = ["@//third_party:cpuinfo.patch"], + build_file = "@xnnpack//third_party:cpuinfo.BUILD", + patches = ["@xnnpack//third_party:cpuinfo.patch"], ) # psimd library, used for fallback 128-bit SIMD micro-kernels @@ -97,7 +97,7 @@ http_archive( urls = [ "https://github.com/Maratyszcza/psimd/archive/88882f601f8179e1987b7e7cf4a8012c9080ad44.tar.gz", ], - build_file = "@//third_party:psimd.BUILD", + build_file = "@xnnpack//third_party:psimd.BUILD", ) git_repository( diff --git a/tfjs-core/src/public/chained_ops/divNoNan.ts b/tfjs-core/src/public/chained_ops/divNoNan.ts index b1fce46b8e0..ad09451be0f 100644 --- a/tfjs-core/src/public/chained_ops/divNoNan.ts +++ b/tfjs-core/src/public/chained_ops/divNoNan.ts @@ -15,7 +15,7 @@ * ============================================================================= */ -import {divNoNan} from '../../ops/divNoNan'; +import {divNoNan} from '../../ops/div_no_nan'; import {Tensor} from '../../tensor'; import {Rank, TensorLike} from '../../types'; From fb76ed3f40966fd623e7c07b0554b8b6c3799e31 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Wed, 1 Apr 2020 11:49:03 -0400 Subject: [PATCH 26/85] add build --- tfjs-backend-wasm/BUILD | 201 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 tfjs-backend-wasm/BUILD diff --git a/tfjs-backend-wasm/BUILD b/tfjs-backend-wasm/BUILD new file mode 100644 index 00000000000..c151000e049 --- /dev/null +++ b/tfjs-backend-wasm/BUILD @@ -0,0 +1,201 @@ +# Description: +# Portable pthread-based thread pool for C and C++ + +package(default_visibility = ["//visibility:public"]) + +licenses(["notice"]) + +exports_files(["LICENSE"]) + +cc_library( + name = "pthreadpool_impl", + srcs = select({ + "//third_party/emscripten:pthreads_off": ["src/threadpool-shim.c"], + "//conditions:default": ["src/threadpool-pthreads.c"], + }) + [ + "src/threadpool-legacy.c", + ], + copts = [ + "-std=gnu11", + "-Wno-deprecated-declarations", + "-Ithird_party/cpuinfo/include", + "-Ithird_party/cpuinfo/src", + ] + select({ + ":optimized_build": ["-O2"], + "//conditions:default": [], + }) + select({ + ":linux_aarch64": ["-DPTHREADPOOL_USE_CPUINFO=1"], + ":chromiumos_arm64": ["-DPTHREADPOOL_USE_CPUINFO=1"], + ":chromiumos_armv7": ["-DPTHREADPOOL_USE_CPUINFO=1"], + ":android_arm64": ["-DPTHREADPOOL_USE_CPUINFO=1"], + ":android_armv7": ["-DPTHREADPOOL_USE_CPUINFO=1"], + "//conditions:default": ["-DPTHREADPOOL_USE_CPUINFO=0"], + }) + select({ + ":pthreadpool_sync_primitive_explicit_condvar": [ + "-DPTHREADPOOL_USE_FUTEX=0", + ], + ":pthreadpool_sync_primitive_explicit_futex": [ + "-DPTHREADPOOL_USE_FUTEX=1", + ], + "//conditions:default": [], + }), + includes = [ + "include", + ], + linkopts = select({ + "//third_party/emscripten:pthreads_on": [ + "-s ALLOW_BLOCKING_ON_MAIN_THREAD=1", + "-s PTHREAD_POOL_SIZE=8", + ], + "//conditions:default": [], + }), + strip_include_prefix = "include", + textual_hdrs = [ + "include/pthreadpool.h", + "src/threadpool-atomics.h", + "src/threadpool-utils.h", + ], + deps = [ + "//third_party/FXdiv", + ] + select({ + ":linux_aarch64": ["//third_party/cpuinfo"], + ":chromiumos_arm64": ["//third_party/cpuinfo"], + ":chromiumos_armv7": ["//third_party/cpuinfo"], + ":android_arm64": ["//third_party/cpuinfo"], + ":android_armv7": ["//third_party/cpuinfo"], + "//conditions:default": [], + }), +) + +cc_library( + name = "pthreadpool", + hdrs = [ + "include/pthreadpool.h", + ], + strip_include_prefix = "include", + deps = [ + ":pthreadpool_impl", + ], +) + +################################## Unit tests ################################## + +EMSCRIPTEN_TEST_LINKOPTS = [ + "-s ASSERTIONS=2", + "-s ERROR_ON_UNDEFINED_SYMBOLS=1", + "-s DEMANGLE_SUPPORT=1", + "-s EXIT_RUNTIME=1", + "-s ALLOW_MEMORY_GROWTH=0", + "-s TOTAL_MEMORY=67108864", # 64M +] + +cc_test( + name = "pthreadpool_test", + srcs = ["test/pthreadpool.cc"], + linkopts = select({ + ":emscripten": EMSCRIPTEN_TEST_LINKOPTS, + "//conditions:default": [], + }), + deps = [ + ":pthreadpool", + "//testing/base/public:gunit", + "//testing/base/public:gunit_main", + ], +) + +################################## Benchmarks ################################## + +EMSCRIPTEN_BENCHMARK_LINKOPTS = [ + "-s ASSERTIONS=1", + "-s ERROR_ON_UNDEFINED_SYMBOLS=1", + "-s EXIT_RUNTIME=1", + "-s ALLOW_MEMORY_GROWTH=0", +] + +cc_binary( + name = "latency_bench", + srcs = ["bench/latency.cc"], + linkopts = select({ + ":emscripten": EMSCRIPTEN_BENCHMARK_LINKOPTS, + "//conditions:default": [], + }), + tags = ["benchmark"], + deps = [ + ":pthreadpool", + # note: internal version is incompatible + "//third_party/benchmark", + ], +) + +cc_binary( + name = "throughput_bench", + srcs = ["bench/throughput.cc"], + linkopts = select({ + ":emscripten": EMSCRIPTEN_BENCHMARK_LINKOPTS, + "//conditions:default": [], + }), + tags = ["benchmark"], + deps = [ + ":pthreadpool", + # note: internal version is incompatible + "//third_party/benchmark", + ], +) + +############################# Build configurations ############################# + +# Synchronize workers using pthreads condition variable. +config_setting( + name = "pthreadpool_sync_primitive_explicit_condvar", + define_values = {"pthreadpool_sync_primitive": "condvar"}, +) + +# Synchronize workers using futex. +config_setting( + name = "pthreadpool_sync_primitive_explicit_futex", + define_values = {"pthreadpool_sync_primitive": "futex"}, +) + +config_setting( + name = "optimized_build", + values = { + "compilation_mode": "opt", + }, +) + +config_setting( + name = "emscripten", + flag_values = { + "//tools/cpp:cc_target_os": "emscripten", + }, +) + +config_setting( + name = "linux_aarch64", + flag_values = {"//tools/cpp:cc_target_os": "linux-google"}, + values = {"cpu": "aarch64"}, +) + +config_setting( + name = "chromiumos_arm64", + flag_values = {"//tools/cpp:cc_target_os": "chromiumos"}, + values = {"cpu": "arm"}, +) + +config_setting( + name = "chromiumos_armv7", + flag_values = {"//tools/cpp:cc_target_os": "chromiumos"}, + values = {"cpu": "armeabi-v7a"}, +) + +config_setting( + name = "android_armv7", + flag_values = {"//tools/cpp:cc_target_os": "android"}, + values = {"android_cpu": "armeabi-v7a"}, +) + +config_setting( + name = "android_arm64", + flag_values = {"//tools/cpp:cc_target_os": "android"}, + values = {"android_cpu": "arm64-v8a"}, +) From 1ee6e91a022333ace7830a64bcb3d75a05fe01b1 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Thu, 2 Apr 2020 10:20:35 -0400 Subject: [PATCH 27/85] update --- tfjs-backend-wasm/WORKSPACE | 17 ----------------- tfjs-core/yarn.lock | 27 ++++----------------------- 2 files changed, 4 insertions(+), 40 deletions(-) diff --git a/tfjs-backend-wasm/WORKSPACE b/tfjs-backend-wasm/WORKSPACE index 6f2868c2cac..b696a55b957 100644 --- a/tfjs-backend-wasm/WORKSPACE +++ b/tfjs-backend-wasm/WORKSPACE @@ -16,23 +16,6 @@ git_repository( # The libraries below are transitive dependencies of XNNPACK that we need to # explicitly enumerate here. See https://docs.bazel.build/versions/master/external.html#transitive-dependencies -# Google Test framework, used by most unit-tests. -http_archive( - name = "com_google_googletest", - urls = ["https://github.com/google/googletest/archive/master.zip"], - strip_prefix = "googletest-master", -) - -# Google Benchmark library, used in micro-benchmarks. -http_archive( - name = "com_google_benchmark", - urls = [ - "https://github.com/google/benchmark/archive/master.zip" - ], - strip_prefix = "benchmark-master", - build_file = "@xnnpack//third_party:benchmark.BUILD", -) - # FP16 library, used for half-precision conversions http_archive( name = "FP16", diff --git a/tfjs-core/yarn.lock b/tfjs-core/yarn.lock index e708e93c2b3..78de9633ccd 100644 --- a/tfjs-core/yarn.lock +++ b/tfjs-core/yarn.lock @@ -18,29 +18,10 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@bazel/bazel-darwin_x64@0.24.0": - version "0.24.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-0.24.0.tgz#828ef298d8d542961df388f17b0244f4f4302a74" - integrity sha512-xly44vkcD/fauUb7Lm5Lme4qhEZdkuuyBKSVQUHPbYAGDdbj/W8dupI3bZREkJAgG/WrRU+WXUemMj4U8ZcLcw== - -"@bazel/bazel-linux_x64@0.24.0": - version "0.24.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-0.24.0.tgz#9ef2e7266833ad2221fe4af4ceb6763d2897e3ff" - integrity sha512-p5ylPLWnJZDGbaIFBrtD/tp3Su5rMdzeeNJKU24XyiWQTHVZ3OD3I2Fb0ILCgfBjY8AlA7EtCtOI4hYnAuIOtg== - -"@bazel/bazel-win32_x64@0.24.0": - version "0.24.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-0.24.0.tgz#02d83113a6c6ed99795a3e41bff5631aa141638d" - integrity sha512-/bcSEx+GoV/q7H4WM0jazfxTcurSiIIePhRv+d05mxRDcaWwhCO8KzmmZRWH1abW6npvq5tLkbSQi7G7nUBhgg== - -"@bazel/bazel@^0.24.0": - version "0.24.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel/-/bazel-0.24.0.tgz#f4e68e3680ac299858c24c26be3d08d1151e78fc" - integrity sha512-/5E55tqH9ogAGF9Dd7RSCJmk7/xdlsPTAhsX3yEsEMs7GLdHlgD3jbeePsKUiHKKr8LXAufjTs2pXQfjrkZRMg== - optionalDependencies: - "@bazel/bazel-darwin_x64" "0.24.0" - "@bazel/bazel-linux_x64" "0.24.0" - "@bazel/bazel-win32_x64" "0.24.0" +"@bazel/bazelisk@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@bazel/bazelisk/-/bazelisk-1.3.0.tgz#dc312dd30ad01e9af86e53b40795ab6e545fa55b" + integrity sha512-73H1nq3572tTf+dhDT86aWQN+LCyfxrh05jabqPXp6cpR8soxte3gS5oUqkN36fUe+J2HzNiV4CXZTz4Xytd3Q== "@bazel/typescript@^0.27.8": version "0.27.10" From 59a1041f48680ad3629d084ad957f26875064d06 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Thu, 2 Apr 2020 10:21:45 -0400 Subject: [PATCH 28/85] del --- tfjs-backend-wasm/BUILD | 201 ---------------------------------------- 1 file changed, 201 deletions(-) delete mode 100644 tfjs-backend-wasm/BUILD diff --git a/tfjs-backend-wasm/BUILD b/tfjs-backend-wasm/BUILD deleted file mode 100644 index c151000e049..00000000000 --- a/tfjs-backend-wasm/BUILD +++ /dev/null @@ -1,201 +0,0 @@ -# Description: -# Portable pthread-based thread pool for C and C++ - -package(default_visibility = ["//visibility:public"]) - -licenses(["notice"]) - -exports_files(["LICENSE"]) - -cc_library( - name = "pthreadpool_impl", - srcs = select({ - "//third_party/emscripten:pthreads_off": ["src/threadpool-shim.c"], - "//conditions:default": ["src/threadpool-pthreads.c"], - }) + [ - "src/threadpool-legacy.c", - ], - copts = [ - "-std=gnu11", - "-Wno-deprecated-declarations", - "-Ithird_party/cpuinfo/include", - "-Ithird_party/cpuinfo/src", - ] + select({ - ":optimized_build": ["-O2"], - "//conditions:default": [], - }) + select({ - ":linux_aarch64": ["-DPTHREADPOOL_USE_CPUINFO=1"], - ":chromiumos_arm64": ["-DPTHREADPOOL_USE_CPUINFO=1"], - ":chromiumos_armv7": ["-DPTHREADPOOL_USE_CPUINFO=1"], - ":android_arm64": ["-DPTHREADPOOL_USE_CPUINFO=1"], - ":android_armv7": ["-DPTHREADPOOL_USE_CPUINFO=1"], - "//conditions:default": ["-DPTHREADPOOL_USE_CPUINFO=0"], - }) + select({ - ":pthreadpool_sync_primitive_explicit_condvar": [ - "-DPTHREADPOOL_USE_FUTEX=0", - ], - ":pthreadpool_sync_primitive_explicit_futex": [ - "-DPTHREADPOOL_USE_FUTEX=1", - ], - "//conditions:default": [], - }), - includes = [ - "include", - ], - linkopts = select({ - "//third_party/emscripten:pthreads_on": [ - "-s ALLOW_BLOCKING_ON_MAIN_THREAD=1", - "-s PTHREAD_POOL_SIZE=8", - ], - "//conditions:default": [], - }), - strip_include_prefix = "include", - textual_hdrs = [ - "include/pthreadpool.h", - "src/threadpool-atomics.h", - "src/threadpool-utils.h", - ], - deps = [ - "//third_party/FXdiv", - ] + select({ - ":linux_aarch64": ["//third_party/cpuinfo"], - ":chromiumos_arm64": ["//third_party/cpuinfo"], - ":chromiumos_armv7": ["//third_party/cpuinfo"], - ":android_arm64": ["//third_party/cpuinfo"], - ":android_armv7": ["//third_party/cpuinfo"], - "//conditions:default": [], - }), -) - -cc_library( - name = "pthreadpool", - hdrs = [ - "include/pthreadpool.h", - ], - strip_include_prefix = "include", - deps = [ - ":pthreadpool_impl", - ], -) - -################################## Unit tests ################################## - -EMSCRIPTEN_TEST_LINKOPTS = [ - "-s ASSERTIONS=2", - "-s ERROR_ON_UNDEFINED_SYMBOLS=1", - "-s DEMANGLE_SUPPORT=1", - "-s EXIT_RUNTIME=1", - "-s ALLOW_MEMORY_GROWTH=0", - "-s TOTAL_MEMORY=67108864", # 64M -] - -cc_test( - name = "pthreadpool_test", - srcs = ["test/pthreadpool.cc"], - linkopts = select({ - ":emscripten": EMSCRIPTEN_TEST_LINKOPTS, - "//conditions:default": [], - }), - deps = [ - ":pthreadpool", - "//testing/base/public:gunit", - "//testing/base/public:gunit_main", - ], -) - -################################## Benchmarks ################################## - -EMSCRIPTEN_BENCHMARK_LINKOPTS = [ - "-s ASSERTIONS=1", - "-s ERROR_ON_UNDEFINED_SYMBOLS=1", - "-s EXIT_RUNTIME=1", - "-s ALLOW_MEMORY_GROWTH=0", -] - -cc_binary( - name = "latency_bench", - srcs = ["bench/latency.cc"], - linkopts = select({ - ":emscripten": EMSCRIPTEN_BENCHMARK_LINKOPTS, - "//conditions:default": [], - }), - tags = ["benchmark"], - deps = [ - ":pthreadpool", - # note: internal version is incompatible - "//third_party/benchmark", - ], -) - -cc_binary( - name = "throughput_bench", - srcs = ["bench/throughput.cc"], - linkopts = select({ - ":emscripten": EMSCRIPTEN_BENCHMARK_LINKOPTS, - "//conditions:default": [], - }), - tags = ["benchmark"], - deps = [ - ":pthreadpool", - # note: internal version is incompatible - "//third_party/benchmark", - ], -) - -############################# Build configurations ############################# - -# Synchronize workers using pthreads condition variable. -config_setting( - name = "pthreadpool_sync_primitive_explicit_condvar", - define_values = {"pthreadpool_sync_primitive": "condvar"}, -) - -# Synchronize workers using futex. -config_setting( - name = "pthreadpool_sync_primitive_explicit_futex", - define_values = {"pthreadpool_sync_primitive": "futex"}, -) - -config_setting( - name = "optimized_build", - values = { - "compilation_mode": "opt", - }, -) - -config_setting( - name = "emscripten", - flag_values = { - "//tools/cpp:cc_target_os": "emscripten", - }, -) - -config_setting( - name = "linux_aarch64", - flag_values = {"//tools/cpp:cc_target_os": "linux-google"}, - values = {"cpu": "aarch64"}, -) - -config_setting( - name = "chromiumos_arm64", - flag_values = {"//tools/cpp:cc_target_os": "chromiumos"}, - values = {"cpu": "arm"}, -) - -config_setting( - name = "chromiumos_armv7", - flag_values = {"//tools/cpp:cc_target_os": "chromiumos"}, - values = {"cpu": "armeabi-v7a"}, -) - -config_setting( - name = "android_armv7", - flag_values = {"//tools/cpp:cc_target_os": "android"}, - values = {"android_cpu": "armeabi-v7a"}, -) - -config_setting( - name = "android_arm64", - flag_values = {"//tools/cpp:cc_target_os": "android"}, - values = {"android_cpu": "arm64-v8a"}, -) From fb4f6cb4e4af0bcc558550607d5264917752f398 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Thu, 2 Apr 2020 10:24:49 -0400 Subject: [PATCH 29/85] del --- tfjs-core/src/public/chained_ops/divNoNan.ts | 31 -------------------- 1 file changed, 31 deletions(-) delete mode 100644 tfjs-core/src/public/chained_ops/divNoNan.ts diff --git a/tfjs-core/src/public/chained_ops/divNoNan.ts b/tfjs-core/src/public/chained_ops/divNoNan.ts deleted file mode 100644 index ad09451be0f..00000000000 --- a/tfjs-core/src/public/chained_ops/divNoNan.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {divNoNan} from '../../ops/div_no_nan'; -import {Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - divNoNan(b: Tensor|TensorLike): T; - } -} - -Tensor.prototype.divNoNan = function(b: Tensor| - TensorLike): T { - return divNoNan(this, b); -}; From b5d9d966140d3b5dae3c04e15466705bd35384d8 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Thu, 2 Apr 2020 10:57:47 -0400 Subject: [PATCH 30/85] update --- tfjs-backend-wasm/WORKSPACE | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tfjs-backend-wasm/WORKSPACE b/tfjs-backend-wasm/WORKSPACE index b696a55b957..26d981cf4b2 100644 --- a/tfjs-backend-wasm/WORKSPACE +++ b/tfjs-backend-wasm/WORKSPACE @@ -9,8 +9,8 @@ emsdk_configure(name = "emsdk") git_repository( name = "xnnpack", commit = "d21fdcb4af35a8764333c3bb24fa54c55bb5db52", - remote = "https://github.com/google/XNNPACK.git", - shallow_since = "1582560423 -0800", + remote = "https://github.com/annxingyuan/XNNPACK.git", + shallow_since = "1585100697 -0700", ) # The libraries below are transitive dependencies of XNNPACK that we need to @@ -19,68 +19,68 @@ git_repository( # FP16 library, used for half-precision conversions http_archive( name = "FP16", - strip_prefix = "FP16-ba1d31f5eed2eb4a69e4dea3870a68c7c95f998f", + build_file = "@xnnpack//third_party:FP16.BUILD", sha256 = "9764297a339ad73b0717331a2c3e9c42a52105cd04cab62cb160e2b4598d2ea6", + strip_prefix = "FP16-ba1d31f5eed2eb4a69e4dea3870a68c7c95f998f", urls = [ "https://github.com/Maratyszcza/FP16/archive/ba1d31f5eed2eb4a69e4dea3870a68c7c95f998f.tar.gz", ], - build_file = "@xnnpack//third_party:FP16.BUILD", ) # FXdiv library, used for repeated integer division by the same factor http_archive( name = "FXdiv", - strip_prefix = "FXdiv-f8c5354679ec2597792bc70a9e06eff50c508b9a", + build_file = "@xnnpack//third_party:FXdiv.BUILD", sha256 = "7d3215bea832fe77091ec5666200b91156df6724da1e348205078346325fc45e", + strip_prefix = "FXdiv-f8c5354679ec2597792bc70a9e06eff50c508b9a", urls = [ "https://github.com/Maratyszcza/FXdiv/archive/f8c5354679ec2597792bc70a9e06eff50c508b9a.tar.gz", ], - build_file = "@xnnpack//third_party:FXdiv.BUILD", ) # pthreadpool library, used for parallelization http_archive( name = "pthreadpool", - strip_prefix = "pthreadpool-ebd50d0cfa3664d454ffdf246fcd228c3b370a11", + build_file = "@xnnpack//third_party:pthreadpool.BUILD", sha256 = "ca4fc774cf2339cb739bba827de8ed4ccbd450c4608e05329e974153448aaf56", + strip_prefix = "pthreadpool-ebd50d0cfa3664d454ffdf246fcd228c3b370a11", urls = [ "https://github.com/Maratyszcza/pthreadpool/archive/ebd50d0cfa3664d454ffdf246fcd228c3b370a11.tar.gz", ], - build_file = "@xnnpack//third_party:pthreadpool.BUILD", ) # clog library, used for logging http_archive( name = "clog", - strip_prefix = "cpuinfo-d5e37adf1406cf899d7d9ec1d317c47506ccb970", + build_file = "@xnnpack//third_party:clog.BUILD", sha256 = "3f2dc1970f397a0e59db72f9fca6ff144b216895c1d606f6c94a507c1e53a025", + strip_prefix = "cpuinfo-d5e37adf1406cf899d7d9ec1d317c47506ccb970", urls = [ "https://github.com/pytorch/cpuinfo/archive/d5e37adf1406cf899d7d9ec1d317c47506ccb970.tar.gz", ], - build_file = "@xnnpack//third_party:clog.BUILD", ) # cpuinfo library, used for detecting processor characteristics http_archive( name = "cpuinfo", - strip_prefix = "cpuinfo-d6c0f915ee737f961915c9d17f1679b6777af207", - sha256 = "146fc61c3cf63d7d88db963876929a4d373f621fb65568b895efa0857f467770", - urls = [ - "https://github.com/pytorch/cpuinfo/archive/d6c0f915ee737f961915c9d17f1679b6777af207.tar.gz", - ], build_file = "@xnnpack//third_party:cpuinfo.BUILD", patches = ["@xnnpack//third_party:cpuinfo.patch"], + sha256 = "80625d0b69a3d69b70c2236f30db2c542d0922ccf9bb51a61bc39c49fac91a35", + strip_prefix = "cpuinfo-0cc563acb9baac39f2c1349bc42098c4a1da59e3", + urls = [ + "https://github.com/pytorch/cpuinfo/archive/0cc563acb9baac39f2c1349bc42098c4a1da59e3.tar.gz", + ], ) # psimd library, used for fallback 128-bit SIMD micro-kernels http_archive( name = "psimd", - strip_prefix = "psimd-88882f601f8179e1987b7e7cf4a8012c9080ad44", + build_file = "@xnnpack//third_party:psimd.BUILD", sha256 = "c621f9bb1ff9ab8f0fa4a04f3239d13b345a6e865318d7b464aa80531a1abb2c", + strip_prefix = "psimd-88882f601f8179e1987b7e7cf4a8012c9080ad44", urls = [ "https://github.com/Maratyszcza/psimd/archive/88882f601f8179e1987b7e7cf4a8012c9080ad44.tar.gz", ], - build_file = "@xnnpack//third_party:psimd.BUILD", ) git_repository( From f4f9a768d10a069d195d1a4c2c0ad6861c0a9763 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Fri, 3 Apr 2020 10:56:51 -0400 Subject: [PATCH 31/85] use latest --- tfjs-backend-wasm/WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tfjs-backend-wasm/WORKSPACE b/tfjs-backend-wasm/WORKSPACE index 26d981cf4b2..fdfe4499f07 100644 --- a/tfjs-backend-wasm/WORKSPACE +++ b/tfjs-backend-wasm/WORKSPACE @@ -42,10 +42,10 @@ http_archive( http_archive( name = "pthreadpool", build_file = "@xnnpack//third_party:pthreadpool.BUILD", - sha256 = "ca4fc774cf2339cb739bba827de8ed4ccbd450c4608e05329e974153448aaf56", - strip_prefix = "pthreadpool-ebd50d0cfa3664d454ffdf246fcd228c3b370a11", + sha256 = "91c7b00c16c60c96f23d1966d524879c0f6044caf4bc5e9fc06518dda643e07e", + strip_prefix = "pthreadpool-76042155a8b1e189c8f141429fd72219472c32e1", urls = [ - "https://github.com/Maratyszcza/pthreadpool/archive/ebd50d0cfa3664d454ffdf246fcd228c3b370a11.tar.gz", + "https://github.com/Maratyszcza/pthreadpool/archive/76042155a8b1e189c8f141429fd72219472c32e1.tar.gz", ], ) From c64fb3588f20b2024cbe534ed6703f7572192801 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 6 Apr 2020 09:57:14 -0400 Subject: [PATCH 32/85] add build options --- tfjs-backend-wasm/src/cc/BUILD | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tfjs-backend-wasm/src/cc/BUILD b/tfjs-backend-wasm/src/cc/BUILD index e3951df8944..30d7e01978d 100644 --- a/tfjs-backend-wasm/src/cc/BUILD +++ b/tfjs-backend-wasm/src/cc/BUILD @@ -10,6 +10,9 @@ KERNELS_WITH_KEEPALIVE = glob( cc_binary( name = "tfjs-backend-wasm.js", srcs = ["backend.cc"] + KERNELS_WITH_KEEPALIVE, + copts = [ + "-pthread" + ], linkopts = [ "-s ALLOW_MEMORY_GROWTH=1", "-s DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=[]", @@ -21,6 +24,7 @@ cc_binary( "-s MODULARIZE=1", "-s EXPORT_NAME=WasmBackendModule", "-s MALLOC=emmalloc", + "-s USE_PTHREADS=1" ], deps = [ ":all_kernels", From d4d35c943a4c1d814c3b9281121c2617ba3e11f4 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 6 Apr 2020 16:29:08 -0400 Subject: [PATCH 33/85] update --- tfjs-backend-wasm/WORKSPACE | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tfjs-backend-wasm/WORKSPACE b/tfjs-backend-wasm/WORKSPACE index fdfe4499f07..7728eca68ae 100644 --- a/tfjs-backend-wasm/WORKSPACE +++ b/tfjs-backend-wasm/WORKSPACE @@ -8,7 +8,7 @@ emsdk_configure(name = "emsdk") git_repository( name = "xnnpack", - commit = "d21fdcb4af35a8764333c3bb24fa54c55bb5db52", + commit = "6213201b4f1f8996dc7353c1a5e901939b880e3c", remote = "https://github.com/annxingyuan/XNNPACK.git", shallow_since = "1585100697 -0700", ) @@ -64,7 +64,6 @@ http_archive( http_archive( name = "cpuinfo", build_file = "@xnnpack//third_party:cpuinfo.BUILD", - patches = ["@xnnpack//third_party:cpuinfo.patch"], sha256 = "80625d0b69a3d69b70c2236f30db2c542d0922ccf9bb51a61bc39c49fac91a35", strip_prefix = "cpuinfo-0cc563acb9baac39f2c1349bc42098c4a1da59e3", urls = [ From 00e1079b3c07d56fbf8742a5abcf7e4f79624c5d Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 6 Apr 2020 16:49:46 -0400 Subject: [PATCH 34/85] add opts --- tfjs-backend-wasm/scripts/build-wasm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tfjs-backend-wasm/scripts/build-wasm.sh b/tfjs-backend-wasm/scripts/build-wasm.sh index 0f360134cc5..a1168048599 100755 --- a/tfjs-backend-wasm/scripts/build-wasm.sh +++ b/tfjs-backend-wasm/scripts/build-wasm.sh @@ -16,7 +16,7 @@ set -e -yarn bazel build -c opt //src/cc:tfjs-backend-wasm.js --config=wasm +yarn bazel build -c opt //src/cc:tfjs-backend-wasm.js --config=wasm --copt="-pthread" --linkopt="-s USE_PTHREADS=1" # The typescript code and karma config expect the output of emscripten to be in # wasm-out/ so we copy the bazel output there. cp -f bazel-bin/src/cc/tfjs-backend-wasm.js \ From 35025abf6fa040b1376b747f445247015434f3fe Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 6 Apr 2020 20:30:32 -0400 Subject: [PATCH 35/85] update --- tfjs-backend-wasm/WORKSPACE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tfjs-backend-wasm/WORKSPACE b/tfjs-backend-wasm/WORKSPACE index 7728eca68ae..7f81987decb 100644 --- a/tfjs-backend-wasm/WORKSPACE +++ b/tfjs-backend-wasm/WORKSPACE @@ -8,7 +8,7 @@ emsdk_configure(name = "emsdk") git_repository( name = "xnnpack", - commit = "6213201b4f1f8996dc7353c1a5e901939b880e3c", + commit = "1e772354757d8bae9a412dc9ee422d120895ecfb", remote = "https://github.com/annxingyuan/XNNPACK.git", shallow_since = "1585100697 -0700", ) From d7bcefb8d68ce22c81040918d9fae9bfe2d10f6c Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Tue, 7 Apr 2020 09:50:21 -0400 Subject: [PATCH 36/85] inc max mem --- tfjs-backend-wasm/src/cc/BUILD | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tfjs-backend-wasm/src/cc/BUILD b/tfjs-backend-wasm/src/cc/BUILD index 30d7e01978d..f19d5541261 100644 --- a/tfjs-backend-wasm/src/cc/BUILD +++ b/tfjs-backend-wasm/src/cc/BUILD @@ -24,7 +24,8 @@ cc_binary( "-s MODULARIZE=1", "-s EXPORT_NAME=WasmBackendModule", "-s MALLOC=emmalloc", - "-s USE_PTHREADS=1" + "-s USE_PTHREADS=1", + "-s MAXIMUM_MEMORY=100Mb", ], deps = [ ":all_kernels", From 6b6c385662d36f13b01ba8edcda82e67a3f9e190 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Wed, 8 Apr 2020 08:34:54 -0400 Subject: [PATCH 37/85] update --- tfjs-backend-wasm/WORKSPACE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tfjs-backend-wasm/WORKSPACE b/tfjs-backend-wasm/WORKSPACE index 7f81987decb..8e28ecac28d 100644 --- a/tfjs-backend-wasm/WORKSPACE +++ b/tfjs-backend-wasm/WORKSPACE @@ -8,8 +8,8 @@ emsdk_configure(name = "emsdk") git_repository( name = "xnnpack", - commit = "1e772354757d8bae9a412dc9ee422d120895ecfb", - remote = "https://github.com/annxingyuan/XNNPACK.git", + commit = "1841b1a240544214c279b9d3b8f91bacc69a206c", + remote = "https://github.com/google/XNNPACK.git", shallow_since = "1585100697 -0700", ) From f3d1bb5cf03a24a08bb469bf6bc34b9c35fda69f Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Wed, 8 Apr 2020 08:38:35 -0400 Subject: [PATCH 38/85] config --- tfjs-backend-wasm/WORKSPACE | 2 +- tfjs-backend-wasm/src/cc/BUILD | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tfjs-backend-wasm/WORKSPACE b/tfjs-backend-wasm/WORKSPACE index 8e28ecac28d..389f7412b0a 100644 --- a/tfjs-backend-wasm/WORKSPACE +++ b/tfjs-backend-wasm/WORKSPACE @@ -10,7 +10,7 @@ git_repository( name = "xnnpack", commit = "1841b1a240544214c279b9d3b8f91bacc69a206c", remote = "https://github.com/google/XNNPACK.git", - shallow_since = "1585100697 -0700", + shallow_since = "1586291019 -0700", ) # The libraries below are transitive dependencies of XNNPACK that we need to diff --git a/tfjs-backend-wasm/src/cc/BUILD b/tfjs-backend-wasm/src/cc/BUILD index f19d5541261..73d8f44e849 100644 --- a/tfjs-backend-wasm/src/cc/BUILD +++ b/tfjs-backend-wasm/src/cc/BUILD @@ -25,7 +25,7 @@ cc_binary( "-s EXPORT_NAME=WasmBackendModule", "-s MALLOC=emmalloc", "-s USE_PTHREADS=1", - "-s MAXIMUM_MEMORY=100Mb", + "-s MAXIMUM_MEMORY=1Gb", ], deps = [ ":all_kernels", From 38de3859fdc0a8d37c83e5f05d4d98d970cc6a8a Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Tue, 14 Apr 2020 13:59:50 -0400 Subject: [PATCH 39/85] it compiles --- tfjs-backend-wasm/karma.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tfjs-backend-wasm/karma.conf.js b/tfjs-backend-wasm/karma.conf.js index ab78cf58cc7..44ed09a3a12 100644 --- a/tfjs-backend-wasm/karma.conf.js +++ b/tfjs-backend-wasm/karma.conf.js @@ -22,7 +22,7 @@ const karmaTypescriptConfig = { sourceMap: true, // Ignore the import of the `worker_threads` package used in a core test // meant to run in node. - exclude: ['worker_threads'], + exclude: ['worker_threads', 'perf_hooks'], // worker_node_test in tfjs-core contains a conditional require statement // that confuses the bundler of karma-typescript. ignore: ['./worker_node_test'] From 296930a6a5c85ed661a897385319b62a58eb7132 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 20 Apr 2020 10:09:29 -0400 Subject: [PATCH 40/85] clean --- tfjs-backend-wasm/scripts/build-wasm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tfjs-backend-wasm/scripts/build-wasm.sh b/tfjs-backend-wasm/scripts/build-wasm.sh index a1168048599..1376f16dac3 100755 --- a/tfjs-backend-wasm/scripts/build-wasm.sh +++ b/tfjs-backend-wasm/scripts/build-wasm.sh @@ -16,7 +16,7 @@ set -e -yarn bazel build -c opt //src/cc:tfjs-backend-wasm.js --config=wasm --copt="-pthread" --linkopt="-s USE_PTHREADS=1" +yarn bazel build -c opt //src/cc:tfjs-backend-wasm.js --config=wasm --copt="-pthread" # The typescript code and karma config expect the output of emscripten to be in # wasm-out/ so we copy the bazel output there. cp -f bazel-bin/src/cc/tfjs-backend-wasm.js \ From 0c5b182dde03080f355338e841cddf6f004a85af Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 20 Apr 2020 10:20:07 -0400 Subject: [PATCH 41/85] add --- tfjs-backend-wasm/src/cc/BUILD | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tfjs-backend-wasm/src/cc/BUILD b/tfjs-backend-wasm/src/cc/BUILD index 73d8f44e849..286fd5f247d 100644 --- a/tfjs-backend-wasm/src/cc/BUILD +++ b/tfjs-backend-wasm/src/cc/BUILD @@ -10,9 +10,6 @@ KERNELS_WITH_KEEPALIVE = glob( cc_binary( name = "tfjs-backend-wasm.js", srcs = ["backend.cc"] + KERNELS_WITH_KEEPALIVE, - copts = [ - "-pthread" - ], linkopts = [ "-s ALLOW_MEMORY_GROWTH=1", "-s DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=[]", @@ -26,6 +23,7 @@ cc_binary( "-s MALLOC=emmalloc", "-s USE_PTHREADS=1", "-s MAXIMUM_MEMORY=1Gb", + "-s ASSERTIONS=1", ], deps = [ ":all_kernels", From 211d3334739d0cb892eec036d49587a5bdde0742 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 20 Apr 2020 10:54:49 -0400 Subject: [PATCH 42/85] fix --- tfjs-backend-wasm/src/cc/batch_mat_mul_impl.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tfjs-backend-wasm/src/cc/batch_mat_mul_impl.cc b/tfjs-backend-wasm/src/cc/batch_mat_mul_impl.cc index 3cf5b15e979..3c793fe14da 100644 --- a/tfjs-backend-wasm/src/cc/batch_mat_mul_impl.cc +++ b/tfjs-backend-wasm/src/cc/batch_mat_mul_impl.cc @@ -206,9 +206,11 @@ void slow_batch_matmul(const size_t a_id, const size_t* a_shape_ptr, float* out_buf = out_info.f32_write(); const float* bias_buf = nullptr; - auto& bias_info = tfjs::backend::get_tensor_info_out(bias_id); + size_t bias_buf_size = 0; if (bias_id != 0) { + auto& bias_info = tfjs::backend::get_tensor_info_out(bias_id); bias_buf = bias_info.f32(); + bias_buf_size = bias_info.size; } const size_t size = left_dim * right_dim; @@ -239,7 +241,7 @@ void slow_batch_matmul(const size_t a_id, const size_t* a_shape_ptr, float current = out_buf[out_buf_index]; // Handles 1D broadcasting. - size_t bias_index = std::min(innermost_dim, bias_info.size - 1); + size_t bias_index = std::min(innermost_dim, bias_buf_size - 1); out_buf[out_buf_index] = std::max( std::min(current + sum + bias_buf[bias_index], output_max), From 8d5b167af8991800b52fbda374b720e2d1d33309 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 20 Apr 2020 11:06:49 -0400 Subject: [PATCH 43/85] bugfix --- tfjs-backend-wasm/src/cc/batch_mat_mul_impl.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tfjs-backend-wasm/src/cc/batch_mat_mul_impl.cc b/tfjs-backend-wasm/src/cc/batch_mat_mul_impl.cc index 3c793fe14da..3faa4b0f59c 100644 --- a/tfjs-backend-wasm/src/cc/batch_mat_mul_impl.cc +++ b/tfjs-backend-wasm/src/cc/batch_mat_mul_impl.cc @@ -240,12 +240,16 @@ void slow_batch_matmul(const size_t a_id, const size_t* a_shape_ptr, size_t out_buf_index = b * size + innermost_dim; float current = out_buf[out_buf_index]; - // Handles 1D broadcasting. - size_t bias_index = std::min(innermost_dim, bias_buf_size - 1); + float bias_val = 0; + if (bias_id != 0) { + // Handles 1D broadcasting. + size_t bias_index = std::min(innermost_dim, bias_buf_size - 1); + + bias_val = bias_buf[bias_index]; + } out_buf[out_buf_index] = std::max( - std::min(current + sum + bias_buf[bias_index], output_max), - output_min); + std::min(current + sum + bias_val, output_max), output_min); } } } From a3a0788d521b6bef8da7cadf7ffca6e7cca77e5d Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Tue, 21 Apr 2020 12:55:42 -0400 Subject: [PATCH 44/85] add cpy --- tfjs-backend-wasm/scripts/build-wasm.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tfjs-backend-wasm/scripts/build-wasm.sh b/tfjs-backend-wasm/scripts/build-wasm.sh index 1376f16dac3..a76edfb7d20 100755 --- a/tfjs-backend-wasm/scripts/build-wasm.sh +++ b/tfjs-backend-wasm/scripts/build-wasm.sh @@ -21,6 +21,7 @@ yarn bazel build -c opt //src/cc:tfjs-backend-wasm.js --config=wasm --copt="-pth # wasm-out/ so we copy the bazel output there. cp -f bazel-bin/src/cc/tfjs-backend-wasm.js \ bazel-bin/src/cc/tfjs-backend-wasm.wasm \ + bazel-bin/src/cc/tfjs-backend-wasm.worker.js \ wasm-out/ mkdir -p dist From 922c6faaf309bd6a65ea75a7f6cc636603f344b2 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Tue, 21 Apr 2020 12:57:03 -0400 Subject: [PATCH 45/85] add opts --- tfjs-backend-wasm/src/cc/BUILD | 1 + 1 file changed, 1 insertion(+) diff --git a/tfjs-backend-wasm/src/cc/BUILD b/tfjs-backend-wasm/src/cc/BUILD index 286fd5f247d..94b45dc4f3d 100644 --- a/tfjs-backend-wasm/src/cc/BUILD +++ b/tfjs-backend-wasm/src/cc/BUILD @@ -22,6 +22,7 @@ cc_binary( "-s EXPORT_NAME=WasmBackendModule", "-s MALLOC=emmalloc", "-s USE_PTHREADS=1", + "-s PTHREAD_POOL_SIZE=10", "-s MAXIMUM_MEMORY=1Gb", "-s ASSERTIONS=1", ], From 5c0368e0644a854c2b41aa7cee655d5366aef6e6 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Tue, 21 Apr 2020 12:57:30 -0400 Subject: [PATCH 46/85] add --- tfjs-core/yarn.lock | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tfjs-core/yarn.lock b/tfjs-core/yarn.lock index 90dfb1e96f2..bbebade706d 100644 --- a/tfjs-core/yarn.lock +++ b/tfjs-core/yarn.lock @@ -208,11 +208,6 @@ acorn@^6.0.5: resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.0.tgz#b659d2ffbafa24baf5db1cdbb2c94a983ecd2784" integrity sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw== -acorn@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.1.tgz#e35668de0b402f359de515c5482a1ab9f89a69bf" - integrity sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg== - after@0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" From 5260b23a9dfeded70011cb54d6e3fab44659e837 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Tue, 21 Apr 2020 13:02:19 -0400 Subject: [PATCH 47/85] add cpy --- tfjs-backend-wasm/karma.conf.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tfjs-backend-wasm/karma.conf.js b/tfjs-backend-wasm/karma.conf.js index 44ed09a3a12..fbce77f10eb 100644 --- a/tfjs-backend-wasm/karma.conf.js +++ b/tfjs-backend-wasm/karma.conf.js @@ -64,6 +64,8 @@ module.exports = function(config) { proxies: { '/base/node_modules/karma-typescript/dist/client/tfjs-backend-wasm.wasm': '/base/wasm-out/tfjs-backend-wasm.wasm', + '/base/node_modules/karma-typescript/dist/client/tfjs-backend-wasm.worker.js': + '/base/wasm-out/tfjs-backend-wasm.worker.js', }, reporters: ['dots', 'karma-typescript'], port: 9876, From d99cc6590fa30a98c586293a23b55398d40fbfc6 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Tue, 21 Apr 2020 16:52:55 -0400 Subject: [PATCH 48/85] add --- tfjs-backend-wasm/scripts/build-wasm.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tfjs-backend-wasm/scripts/build-wasm.sh b/tfjs-backend-wasm/scripts/build-wasm.sh index a76edfb7d20..97e84e038f2 100755 --- a/tfjs-backend-wasm/scripts/build-wasm.sh +++ b/tfjs-backend-wasm/scripts/build-wasm.sh @@ -26,3 +26,4 @@ cp -f bazel-bin/src/cc/tfjs-backend-wasm.js \ mkdir -p dist cp wasm-out/*.wasm dist/ +cp wasm-out/*.worker.js dist/ From 163dbcb3f99d348cb6c07b917d11130c6707e73b Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Fri, 24 Apr 2020 07:11:34 -0400 Subject: [PATCH 49/85] fix --- tfjs-backend-wasm/karma.conf.js | 2 +- tfjs-backend-wasm/src/index_test.ts | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/tfjs-backend-wasm/karma.conf.js b/tfjs-backend-wasm/karma.conf.js index fbce77f10eb..ad075e5886e 100644 --- a/tfjs-backend-wasm/karma.conf.js +++ b/tfjs-backend-wasm/karma.conf.js @@ -56,7 +56,7 @@ module.exports = function(config) { ], exclude: ['src/test_node.ts'], preprocessors: { - 'wasm-out/**/*.js': ['karma-typescript'], + 'wasm-out/tfjs-backend-wasm.js': ['karma-typescript'], '**/*.ts': ['karma-typescript'] }, karmaTypescriptConfig, diff --git a/tfjs-backend-wasm/src/index_test.ts b/tfjs-backend-wasm/src/index_test.ts index fb1404f8416..b909ac7dab7 100644 --- a/tfjs-backend-wasm/src/index_test.ts +++ b/tfjs-backend-wasm/src/index_test.ts @@ -58,8 +58,8 @@ describeWithFlags('wasm init', BROWSER_ENVS, () => { }, 100); // Silences backend registration warnings. - spyOn(console, 'warn'); - spyOn(console, 'log'); + // spyOn(console, 'warn'); + // spyOn(console, 'log'); }); afterEach(() => { @@ -121,4 +121,16 @@ describeWithFlags('wasm init', BROWSER_ENVS, () => { expect(() => setWasmPath('too/late')) .toThrowError(/The WASM backend was already initialized. Make sure/); }); + + fit('A x B', async () => { + const a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + const b = tf.tensor2d([0, 1, -3, 2, 2, 1], [3, 2]); + + const c = tf.matMul(a, b); + + expect(c.shape).toEqual([2, 2]); + const d = await c.data(); + console.log(Array.from(d)); + // expectArraysClose(await c.data(), [0, 8, -3, 20]); + }); }); From d006737ba8d9334567bac8de71fcf8af2ceb94a0 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Fri, 24 Apr 2020 07:24:47 -0400 Subject: [PATCH 50/85] add to bench --- tfjs-core/benchmarks/index.html | 3 +- tfjs-core/benchmarks/tf-backend-wasm.js | 2977 +++++++++++++++++ tfjs-core/benchmarks/tfjs-backend-wasm.wasm | Bin 0 -> 153337 bytes .../benchmarks/tfjs-backend-wasm.worker.js | 154 + 4 files changed, 3133 insertions(+), 1 deletion(-) create mode 100644 tfjs-core/benchmarks/tf-backend-wasm.js create mode 100644 tfjs-core/benchmarks/tfjs-backend-wasm.wasm create mode 100644 tfjs-core/benchmarks/tfjs-backend-wasm.worker.js diff --git a/tfjs-core/benchmarks/index.html b/tfjs-core/benchmarks/index.html index 73afdccff83..cf3730465ce 100644 --- a/tfjs-core/benchmarks/index.html +++ b/tfjs-core/benchmarks/index.html @@ -60,7 +60,8 @@

TensorFlow.js Model Benchmark

- + + diff --git a/tfjs-core/benchmarks/tf-backend-wasm.js b/tfjs-core/benchmarks/tf-backend-wasm.js new file mode 100644 index 00000000000..a31566392da --- /dev/null +++ b/tfjs-core/benchmarks/tf-backend-wasm.js @@ -0,0 +1,2977 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tensorflow/tfjs-core'), require('path'), require('fs'), require('worker_threads'), require('perf_hooks')) : + typeof define === 'function' && define.amd ? define(['exports', '@tensorflow/tfjs-core', 'path', 'fs', 'worker_threads', 'perf_hooks'], factory) : + (global = global || self, factory((global.tf = global.tf || {}, global.tf.wasm = global.tf.wasm || {}), global.tf, global.path, global.fs, global.worker_threads, global.perf_hooks)); +}(this, (function (exports, tfjsCore, path, fs, worker_threads, perf_hooks) { 'use strict'; + + path = path && path.hasOwnProperty('default') ? path['default'] : path; + fs = fs && fs.hasOwnProperty('default') ? fs['default'] : fs; + worker_threads = worker_threads && worker_threads.hasOwnProperty('default') ? worker_threads['default'] : worker_threads; + perf_hooks = perf_hooks && perf_hooks.hasOwnProperty('default') ? perf_hooks['default'] : perf_hooks; + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + // This enum must align with the enum defined in cc/backend.h. + var CppDType; + (function (CppDType) { + CppDType[CppDType["float32"] = 0] = "float32"; + CppDType[CppDType["int32"] = 1] = "int32"; + CppDType[CppDType["bool"] = 2] = "bool"; + CppDType[CppDType["string"] = 3] = "string"; + CppDType[CppDType["complex64"] = 4] = "complex64"; + })(CppDType || (CppDType = {})); + // Must match enum in cc/fusable_activations.h. + var FusableActivation; + (function (FusableActivation) { + FusableActivation[FusableActivation["linear"] = 0] = "linear"; + FusableActivation[FusableActivation["relu"] = 1] = "relu"; + FusableActivation[FusableActivation["relu6"] = 2] = "relu6"; + FusableActivation[FusableActivation["prelu"] = 3] = "prelu"; + })(FusableActivation || (FusableActivation = {})); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmFusedMatMul; + function setup(backend) { + wasmFusedMatMul = backend.wasm.cwrap('_FusedMatMul', null /* void */, [ + 'number', + 'array', + 'number', + 'number', + 'array', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number' // out_id + ]); + } + function fusedBatchMatMul(args) { + var inputs = args.inputs, backend = args.backend, attrs = args.attrs; + var a = inputs.a, b = inputs.b, bias = inputs.bias, preluActivationWeights = inputs.preluActivationWeights; + if (a.dtype !== 'float32' || b.dtype !== 'float32') { + throw new Error("_FusedMatMul for non non-float32 tensors not yet supported."); + } + var transposeA = attrs.transposeA, transposeB = attrs.transposeB, activation = attrs.activation; + var aId = backend.dataIdMap.get(a.dataId).id; + var bId = backend.dataIdMap.get(b.dataId).id; + var biasId = 0; + if (bias != null) { + var biasData = backend.dataIdMap.get(bias.dataId); + if (biasData.shape.length !== 1) { + throw new Error("_FusedMatMul only supports rank-1 bias but got " + + ("rank " + biasData.shape.length + ".")); + } + biasId = biasData.id; + } + var preluActivationWeightsId = preluActivationWeights == null ? + 0 : + backend.dataIdMap.get(preluActivationWeights.dataId).id; + var fusedActivation = FusableActivation[activation]; + if (fusedActivation == null) { + throw new Error(activation + " activation not yet supported for FusedConv2D " + + "in the wasm backend."); + } + var leftDim = transposeA ? a.shape[2] : a.shape[1]; + var rightDim = transposeB ? b.shape[1] : b.shape[2]; + var batchDim = a.shape[0]; + var out = backend.makeOutput([batchDim, leftDim, rightDim], a.dtype); + var outId = backend.dataIdMap.get(out.dataId).id; + var aShapeBytes = new Uint8Array(new Int32Array(a.shape).buffer); + var bShapeBytes = new Uint8Array(new Int32Array(b.shape).buffer); + wasmFusedMatMul(aId, aShapeBytes, a.shape.length, bId, bShapeBytes, b.shape.length, transposeA, transposeB, fusedActivation, biasId, preluActivationWeightsId, outId); + return out; + } + tfjsCore.registerKernel({ + kernelName: '_FusedMatMul', + backendName: 'wasm', + setupFunc: setup, + kernelFunc: fusedBatchMatMul + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + function registerUnaryKernel(kernelName) { + var wasmFunc; + function setupFunc(backend) { + wasmFunc = + backend.wasm.cwrap(kernelName, null /* void */, ['number', 'number']); + } + function kernelFunc(args) { + var backend = args.backend, x = args.inputs.x; + var xId = backend.dataIdMap.get(x.dataId).id; + var out = backend.makeOutput(x.shape, x.dtype); + var outId = backend.dataIdMap.get(out.dataId).id; + // Short-circuit zero-sized tensors. + if (tfjsCore.util.sizeFromShape(out.shape) === 0) { + return out; + } + wasmFunc(xId, outId); + return out; + } + tfjsCore.registerKernel({ kernelName: kernelName, backendName: 'wasm', setupFunc: setupFunc, kernelFunc: kernelFunc }); + } + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + registerUnaryKernel('Abs'); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + function registerBinaryKernel(kernelName, supportsFullBroadcast, dtype) { + var wasmFunc; + function setupFunc(backend) { + wasmFunc = backend.wasm.cwrap(kernelName, null /* void */, [ + 'number', + 'array', + 'number', + 'number', + 'array', + 'number', + 'number', + 'number' // out_id + ]); + } + function kernelFunc(args) { + var backend = args.backend, inputs = args.inputs; + var a = inputs.a, b = inputs.b; + var aId = backend.dataIdMap.get(a.dataId).id; + var bId = backend.dataIdMap.get(b.dataId).id; + var outputType = dtype != null ? dtype : a.dtype; + var newShape = tfjsCore.backend_util.assertAndGetBroadcastShape(a.shape, b.shape); + var out = backend.makeOutput(newShape, outputType); + // Short-circuit zero-sized tensors. + if (tfjsCore.util.sizeFromShape(newShape) === 0) { + return out; + } + var aShapeBytes = new Uint8Array(new Int32Array(a.shape).buffer); + var bShapeBytes = new Uint8Array(new Int32Array(b.shape).buffer); + var outId = backend.dataIdMap.get(out.dataId).id; + var kernelFunc = function () { return wasmFunc(aId, aShapeBytes, a.shape.length, bId, bShapeBytes, b.shape.length, CppDType[a.dtype], outId); }; + if (supportsFullBroadcast) { + kernelFunc(); + return out; + } + var aBroadcastDims = tfjsCore.backend_util.getBroadcastDims(a.shape, newShape); + var bBroadcastDims = tfjsCore.backend_util.getBroadcastDims(b.shape, newShape); + var loopsOverAllOfA = aBroadcastDims.every(function (v, i) { return v === i; }); + var loopsOverAllOfB = bBroadcastDims.every(function (v, i) { return v === i; }); + if (loopsOverAllOfA && loopsOverAllOfB) { + kernelFunc(); + return out; + } + else { + throw new Error("Broadcasting along outer dims is not yet " + + ("supported for " + kernelName + ".")); + } + } + tfjsCore.registerKernel({ kernelName: kernelName, backendName: 'wasm', setupFunc: setupFunc, kernelFunc: kernelFunc }); + } + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var supportsFullBroadcast = true; + registerBinaryKernel('Add', supportsFullBroadcast); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmFunc; + function setupFunc(backend) { + wasmFunc = backend.wasm.cwrap('AddN', null /* void */, [ + 'array', + 'number', + 'number', + 'number', + ]); + } + function addn(args) { + var inputs = args.inputs, backend = args.backend; + var out = backend.makeOutput(inputs[0].shape, inputs[0].dtype); + // Short-circuit zero-sized tensors. + if (tfjsCore.util.sizeFromShape(out.shape) === 0) { + return out; + } + var inputIds = inputs.map(function (x) { return backend.dataIdMap.get(x.dataId).id; }); + var inputIdsBytes = new Uint8Array(new Int32Array(inputIds).buffer); + var outId = backend.dataIdMap.get(out.dataId).id; + wasmFunc(inputIdsBytes, inputIds.length, CppDType[out.dtype], outId); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'AddN', + backendName: 'wasm', + setupFunc: setupFunc, + kernelFunc: addn, + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmFunc$1; + function setup$1(backend) { + wasmFunc$1 = backend.wasm.cwrap('ArgMax', null /* void */, [ + 'number', + 'number', + 'number', + 'number', + 'number' // out_id + ]); + } + function argmax(args) { + var x = args.inputs.x, backend = args.backend, axis = args.attrs.axis; + var outShape = x.shape.slice(0, -1); + var out = backend.makeOutput(outShape, 'int32'); + var xId = backend.dataIdMap.get(x.dataId).id; + var outId = backend.dataIdMap.get(out.dataId).id; + var outerSize = tfjsCore.util.sizeFromShape(out.shape); + var innerSize = x.shape[axis]; + wasmFunc$1(xId, CppDType[x.dtype], outerSize, innerSize, outId); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'ArgMax', + backendName: 'wasm', + kernelFunc: argmax, + setupFunc: setup$1 + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmAvgPool; + function setup$2(backend) { + wasmAvgPool = backend.wasm.cwrap('AvgPool', null /* void */, [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + ]); + } + function avgPool(args) { + var inputs = args.inputs, attrs = args.attrs, backend = args.backend; + var convInfo = attrs; + var x = inputs.x; + var xId = backend.dataIdMap.get(x.dataId).id; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var padTop = convInfo.padInfo.top; + var padRight = convInfo.padInfo.right; + var padBottom = convInfo.padInfo.bottom; + var padLeft = convInfo.padInfo.left; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var channels = convInfo.inChannels; + if (convInfo.dataFormat !== 'channelsLast') { + throw new Error("wasm backend does not support dataFormat:'" + + (convInfo.dataFormat + "'. Please use 'channelsLast'.")); + } + if (convInfo.dilationWidth !== 1 || convInfo.dilationHeight !== 1) { + throw new Error("was backend only supports average pooling with dilation = [1, 1], " + + ("got [" + convInfo.dilationHeight + ", " + convInfo.dilationWidth + "].")); + } + var out = backend.makeOutput(convInfo.outShape, 'float32'); + var outId = backend.dataIdMap.get(out.dataId).id; + wasmAvgPool(xId, x.shape[0], x.shape[1], x.shape[2], filterHeight, filterWidth, padTop, padRight, padBottom, padLeft, strideHeight, strideWidth, channels, outId); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'AvgPool', + backendName: 'wasm', + setupFunc: setup$2, + kernelFunc: avgPool + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmBatchMatMul; + function setup$3(backend) { + wasmBatchMatMul = backend.wasm.cwrap('BatchMatMul', null /* void */, [ + 'number', + 'array', + 'number', + 'number', + 'array', + 'number', + 'number', + 'number', + 'number' // out_id + ]); + } + function batchMatMul(args) { + var inputs = args.inputs, backend = args.backend, attrs = args.attrs; + var a = inputs.a, b = inputs.b; + if (a.dtype !== 'float32' || b.dtype !== 'float32') { + throw new Error("BatchMatMul for non non-float32 tensors not yet supported."); + } + var transposeA = attrs.transposeA, transposeB = attrs.transposeB; + var aId = backend.dataIdMap.get(a.dataId).id; + var bId = backend.dataIdMap.get(b.dataId).id; + var leftDim = transposeA ? a.shape[2] : a.shape[1]; + var rightDim = transposeB ? b.shape[1] : b.shape[2]; + var batchDim = a.shape[0]; + var out = backend.makeOutput([batchDim, leftDim, rightDim], a.dtype); + var outId = backend.dataIdMap.get(out.dataId).id; + var aShapeBytes = new Uint8Array(new Int32Array(a.shape).buffer); + var bShapeBytes = new Uint8Array(new Int32Array(b.shape).buffer); + wasmBatchMatMul(aId, aShapeBytes, a.shape.length, bId, bShapeBytes, b.shape.length, transposeA, transposeB, outId); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'BatchMatMul', + backendName: 'wasm', + setupFunc: setup$3, + kernelFunc: batchMatMul + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + function cast(args) { + var x = args.inputs.x, dtype = args.attrs.dtype, backend = args.backend; + var out = backend.makeOutput(x.shape, dtype); + var inVals = backend.typedArrayFromHeap(x); + var outVals = backend.typedArrayFromHeap(out); + outVals.set(inVals); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'Cast', + backendName: 'wasm', + kernelFunc: cast, + }); + + /** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmClip; + function setup$4(backend) { + wasmClip = backend.wasm.cwrap('ClipByValue', null /* void */, [ + 'number', + 'number', + 'number', + 'number' // out_id + ]); + } + function clip(args) { + var inputs = args.inputs, backend = args.backend, attrs = args.attrs; + var x = inputs.x; + var min = attrs.min, max = attrs.max; + var xId = backend.dataIdMap.get(x.dataId).id; + var out = backend.makeOutput(x.shape, 'float32'); + var outId = backend.dataIdMap.get(out.dataId).id; + wasmClip(xId, min, max, outId); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'ClipByValue', + backendName: 'wasm', + setupFunc: setup$4, + kernelFunc: clip + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + function concat(args) { + var inputs = args.inputs, backend = args.backend, axis = args.attrs.axis; + var outShape = tfjsCore.backend_util.computeOutShape(inputs.map(function (t) { return t.shape; }), axis); + var out = backend.makeOutput(outShape, inputs[0].dtype); + var batchDim = tfjsCore.util.sizeFromShape(inputs[0].shape.slice(0, axis)); + var sumInnerDims = 0; + var innerDims = inputs.map(function (input) { + var innerDim = tfjsCore.util.sizeFromShape(input.shape.slice(axis)); + sumInnerDims += innerDim; + return innerDim; + }); + var inVals = inputs.map(function (input) { return backend.typedArrayFromHeap(input); }); + var outVals = backend.typedArrayFromHeap(out); + for (var b = 0; b < batchDim; b++) { + var outOffset = b * sumInnerDims; + for (var i = 0; i < inVals.length; i++) { + var innerDim = innerDims[i]; + var inOffset = b * innerDim; + var vals = inVals[i].subarray(inOffset, inOffset + innerDim); + outVals.set(vals, outOffset); + outOffset += innerDim; + } + } + return out; + } + tfjsCore.registerKernel({ + kernelName: 'Concat', + backendName: 'wasm', + kernelFunc: concat, + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmConv2d; + function setup$5(backend) { + wasmConv2d = backend.wasm.cwrap('Conv2D', null /* void */, [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + ]); + } + function conv2d(args) { + var inputs = args.inputs, attrs = args.attrs, backend = args.backend; + var convInfo = attrs; + var x = inputs.x, filter = inputs.filter; + var xId = backend.dataIdMap.get(x.dataId).id; + var filterId = backend.dataIdMap.get(filter.dataId).id; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var padTop = convInfo.padInfo.top; + var padRight = convInfo.padInfo.right; + var padBottom = convInfo.padInfo.bottom; + var padLeft = convInfo.padInfo.left; + var dilationHeight = convInfo.dilationHeight; + var dilationWidth = convInfo.dilationWidth; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var inputChannels = convInfo.inChannels; + var outputChannels = convInfo.outChannels; + var isSamePad = convInfo.padInfo.type === 'SAME' ? 1 : 0; + if (convInfo.dataFormat !== 'channelsLast') { + throw new Error("wasm backend Conv2D does not support dataFormat:'" + + (convInfo.dataFormat + "'. Please use 'channelsLast'.")); + } + var out = backend.makeOutput(convInfo.outShape, 'float32'); + var outId = backend.dataIdMap.get(out.dataId).id; + wasmConv2d(xId, x.shape[0], x.shape[1], x.shape[2], filterId, filterHeight, filterWidth, padTop, padRight, padBottom, padLeft, isSamePad, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, outId); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'Conv2D', + backendName: 'wasm', + setupFunc: setup$5, + kernelFunc: conv2d + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + registerUnaryKernel('Cos'); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + // Must match enum in CropAndResize.cc + var InterpolationMethod; + (function (InterpolationMethod) { + InterpolationMethod[InterpolationMethod["bilinear"] = 0] = "bilinear"; + InterpolationMethod[InterpolationMethod["nearest"] = 1] = "nearest"; + })(InterpolationMethod || (InterpolationMethod = {})); + var wasmCropAndResize; + function setup$6(backend) { + wasmCropAndResize = backend.wasm.cwrap('CropAndResize', null /*void*/, [ + 'number', + 'number', + 'number', + 'number', + 'array', + 'number', + 'number', + 'number', + 'number', + 'number' // out id + ]); + } + function cropAndResize(args) { + var backend = args.backend, inputs = args.inputs, attrs = args.attrs; + var method = attrs.method, extrapolationValue = attrs.extrapolationValue, cropSize = attrs.cropSize; + var images = inputs.images, boxes = inputs.boxes, boxInd = inputs.boxInd; + var numBoxes = boxes.shape[0]; + var _a = cropSize, cropHeight = _a[0], cropWidth = _a[1]; + var outShape = [numBoxes, cropHeight, cropWidth, images.shape[3]]; + var imagesData = backend.dataIdMap.get(images.dataId); + var castedData; + if (images.dtype !== 'float32') { + castedData = + cast({ backend: backend, inputs: { x: images }, attrs: { dtype: 'float32' } }); + imagesData = backend.dataIdMap.get(castedData.dataId); + } + var imagesId = imagesData.id; + var boxesId = backend.dataIdMap.get(boxes.dataId).id; + var boxIndId = backend.dataIdMap.get(boxInd.dataId).id; + var out = backend.makeOutput(outShape, 'float32'); + var outId = backend.dataIdMap.get(out.dataId).id; + var imagesShapeBytes = new Uint8Array(new Int32Array(images.shape).buffer); + wasmCropAndResize(imagesId, boxesId, boxIndId, numBoxes, imagesShapeBytes, cropHeight, cropWidth, InterpolationMethod[method], extrapolationValue, outId); + if (castedData != null) { + backend.disposeData(castedData.dataId); + } + return out; + } + tfjsCore.registerKernel({ + kernelName: 'CropAndResize', + backendName: 'wasm', + setupFunc: setup$6, + kernelFunc: cropAndResize + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmDepthwiseConv2d; + function setup$7(backend) { + wasmDepthwiseConv2d = + backend.wasm.cwrap('DepthwiseConv2dNative', null /* void */, [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + ]); + } + function depthwiseConv2d(args) { + var inputs = args.inputs, attrs = args.attrs, backend = args.backend; + var convInfo = attrs; + var x = inputs.x, filter = inputs.filter; + var xId = backend.dataIdMap.get(x.dataId).id; + var filterId = backend.dataIdMap.get(filter.dataId).id; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var padTop = convInfo.padInfo.top; + var padRight = convInfo.padInfo.right; + var padBottom = convInfo.padInfo.bottom; + var padLeft = convInfo.padInfo.left; + var dilationHeight = convInfo.dilationHeight; + var dilationWidth = convInfo.dilationWidth; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var inputChannels = convInfo.inChannels; + var outputChannels = convInfo.outChannels; + var isSamePad = convInfo.padInfo.type === 'SAME' ? 1 : 0; + if (convInfo.dataFormat !== 'channelsLast') { + throw new Error("wasm backend DepthwiseConv2dNative does not support dataFormat:'" + + (convInfo.dataFormat + "'. Please use 'channelsLast'.")); + } + var out = backend.makeOutput(convInfo.outShape, 'float32'); + var outId = backend.dataIdMap.get(out.dataId).id; + wasmDepthwiseConv2d(xId, x.shape[0], x.shape[1], x.shape[2], filterId, filterHeight, filterWidth, padTop, padRight, padBottom, padLeft, isSamePad, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, outId); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'DepthwiseConv2dNative', + backendName: 'wasm', + setupFunc: setup$7, + kernelFunc: depthwiseConv2d + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var supportsFullBroadcast$1 = false; + registerBinaryKernel('Div', supportsFullBroadcast$1); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + registerUnaryKernel('Exp'); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var supportsFullBroadcast$2 = false; + registerBinaryKernel('FloorDiv', supportsFullBroadcast$2); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmBatchNorm; + function setup$8(backend) { + wasmBatchNorm = backend.wasm.cwrap('FusedBatchNorm', null /* void */, ['number', 'number', 'number', 'number', 'number', 'number', 'number']); + } + function fusedBatchNorm(args) { + var backend = args.backend, inputs = args.inputs, attrs = args.attrs; + var varianceEpsilon = attrs.varianceEpsilon; + var x = inputs.x, mean = inputs.mean, variance = inputs.variance, offset = inputs.offset, scale = inputs.scale; + var xId = backend.dataIdMap.get(x.dataId).id; + var meanId = backend.dataIdMap.get(mean.dataId).id; + var varianceId = backend.dataIdMap.get(variance.dataId).id; + var offsetId = offset != null ? backend.dataIdMap.get(offset.dataId).id : 0; + var scaleId = scale != null ? backend.dataIdMap.get(scale.dataId).id : 0; + var out = backend.makeOutput(x.shape, x.dtype); + // Short-circuit zero-sized tensors. + if (tfjsCore.util.sizeFromShape(x.shape) === 0) { + return out; + } + var outId = backend.dataIdMap.get(out.dataId).id; + wasmBatchNorm(xId, meanId, varianceId, offsetId, scaleId, varianceEpsilon, outId); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'FusedBatchNorm', + backendName: 'wasm', + setupFunc: setup$8, + kernelFunc: fusedBatchNorm + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmFusedConv2d; + function setup$9(backend) { + wasmFusedConv2d = backend.wasm.cwrap('FusedConv2D', null /* void */, [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + ]); + } + function fusedConv2d(args) { + var inputs = args.inputs, attrs = args.attrs, backend = args.backend; + var convInfo = attrs.convInfo, activation = attrs.activation; + var fusedActivation = FusableActivation[activation]; + if (fusedActivation == null) { + throw new Error(activation + " activation not yet supported for FusedConv2D " + + "in the wasm backend."); + } + var x = inputs.x, filter = inputs.filter, bias = inputs.bias, preluActivationWeights = inputs.preluActivationWeights; + var xId = backend.dataIdMap.get(x.dataId).id; + var filterId = backend.dataIdMap.get(filter.dataId).id; + var outputChannels = convInfo.outChannels; + var biasId = 0; + if (bias != null) { + var biasData = backend.dataIdMap.get(bias.dataId); + if (biasData.shape.length !== 1) { + throw new Error("FusedConv2D only supports rank-1 bias but got " + + ("rank " + biasData.shape.length + ".")); + } + if (biasData.shape[0] !== outputChannels) { + throw new Error("FusedConv2D bias shape (" + biasData.shape + ") does not " + + ("match the number of output channels (" + outputChannels + ")")); + } + biasId = biasData.id; + } + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var padTop = convInfo.padInfo.top; + var padRight = convInfo.padInfo.right; + var padBottom = convInfo.padInfo.bottom; + var padLeft = convInfo.padInfo.left; + var dilationHeight = convInfo.dilationHeight; + var dilationWidth = convInfo.dilationWidth; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var inputChannels = convInfo.inChannels; + var isSamePad = convInfo.padInfo.type === 'SAME' ? 1 : 0; + var batchSize = convInfo.batchSize; + var inHeight = convInfo.inHeight; + var inWidth = convInfo.inWidth; + if (convInfo.dataFormat !== 'channelsLast') { + throw new Error("wasm backend FusedConv2D does not support dataFormat:'" + + (convInfo.dataFormat + "'. Please use 'channelsLast'.")); + } + var out = backend.makeOutput(convInfo.outShape, 'float32'); + var outId = backend.dataIdMap.get(out.dataId).id; + var preluActivationWeightsId = preluActivationWeights == null ? + 0 : + backend.dataIdMap.get(preluActivationWeights.dataId).id; + wasmFusedConv2d(xId, batchSize, inHeight, inWidth, filterId, filterHeight, filterWidth, biasId, padTop, padRight, padBottom, padLeft, isSamePad, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, fusedActivation, preluActivationWeightsId, outId); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'FusedConv2D', + backendName: 'wasm', + setupFunc: setup$9, + kernelFunc: fusedConv2d + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmFusedDepthwiseConv2d; + function setup$a(backend) { + wasmFusedDepthwiseConv2d = + backend.wasm.cwrap('FusedDepthwiseConv2D', null /* void */, [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + ]); + } + function fusedDepthwiseConv2d(args) { + var inputs = args.inputs, attrs = args.attrs, backend = args.backend; + var convInfo = attrs.convInfo, activation = attrs.activation; + var fusedActivation = FusableActivation[activation]; + if (fusedActivation == null) { + throw new Error(activation + " activation not yet supported for FusedDepthwiseConv2D " + + "in the wasm backend."); + } + var x = inputs.x, filter = inputs.filter, bias = inputs.bias, preluActivationWeights = inputs.preluActivationWeights; + var xId = backend.dataIdMap.get(x.dataId).id; + var filterId = backend.dataIdMap.get(filter.dataId).id; + var outputChannels = convInfo.outChannels; + var biasId = 0; + if (bias != null) { + var biasData = backend.dataIdMap.get(bias.dataId); + if (biasData.shape.length !== 1) { + throw new Error("FusedDepthwiseConv2D only supports rank-1 bias but got " + + ("rank " + biasData.shape.length + ".")); + } + if (biasData.shape[0] !== outputChannels) { + throw new Error("FusedDepthwiseConv2D bias shape (" + biasData.shape + ") does not " + + ("match the number of output channels (" + outputChannels + ")")); + } + biasId = biasData.id; + } + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var padTop = convInfo.padInfo.top; + var padRight = convInfo.padInfo.right; + var padBottom = convInfo.padInfo.bottom; + var padLeft = convInfo.padInfo.left; + var dilationHeight = convInfo.dilationHeight; + var dilationWidth = convInfo.dilationWidth; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var inputChannels = convInfo.inChannels; + var isSamePad = convInfo.padInfo.type === 'SAME' ? 1 : 0; + var batchSize = convInfo.batchSize; + var inHeight = convInfo.inHeight; + var inWidth = convInfo.inWidth; + if (convInfo.dataFormat !== 'channelsLast') { + throw new Error("wasm backend FusedDepthwiseConv2D does not support dataFormat:'" + + (convInfo.dataFormat + "'. Please use 'channelsLast'.")); + } + var out = backend.makeOutput(convInfo.outShape, 'float32'); + var outId = backend.dataIdMap.get(out.dataId).id; + var preluActivationWeightsId = preluActivationWeights == null ? + 0 : + backend.dataIdMap.get(preluActivationWeights.dataId).id; + wasmFusedDepthwiseConv2d(xId, batchSize, inHeight, inWidth, filterId, filterHeight, filterWidth, biasId, padTop, padRight, padBottom, padLeft, isSamePad, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, fusedActivation, preluActivationWeightsId, outId); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'FusedDepthwiseConv2D', + backendName: 'wasm', + setupFunc: setup$a, + kernelFunc: fusedDepthwiseConv2d + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmGather; + function setup$b(backend) { + wasmGather = backend.wasm.cwrap('Gather', null /*void*/, [ + 'number', + 'number', + 'array', + 'number', + 'number', + 'number', + 'array', + 'number' // outId + ]); + } + function gather(args) { + var backend = args.backend, inputs = args.inputs, attrs = args.attrs; + var x = inputs.x, indices = inputs.indices; + var axis = attrs.axis; + var newShape = x.shape.slice(); + newShape[axis] = tfjsCore.util.sizeFromShape(indices.shape); + var stridesSize = x.shape.length - 1; + var out = backend.makeOutput(newShape, x.dtype); + if (tfjsCore.util.sizeFromShape(x.shape) === 0) { + return out; + } + var xData = backend.dataIdMap.get(x.dataId); + var xId = xData.id; + var indicesData = backend.dataIdMap.get(indices.dataId); + var indicesId = indicesData.id; + var outId = backend.dataIdMap.get(out.dataId).id; + var xStridesBytes = new Uint8Array(new Int32Array(tfjsCore.util.computeStrides(x.shape)).buffer); + var outStridesBytes = new Uint8Array(new Int32Array(tfjsCore.util.computeStrides(newShape)).buffer); + wasmGather(xId, CppDType[x.dtype], xStridesBytes, stridesSize, indicesId, axis, outStridesBytes, outId); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'Gather', + backendName: 'wasm', + setupFunc: setup$b, + kernelFunc: gather + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmGatherNd; + function setup$c(backend) { + wasmGatherNd = backend.wasm.cwrap('GatherNd', null /*void*/, [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'array', + 'number' // outId + ]); + } + function gatherNd(args) { + var backend = args.backend, inputs = args.inputs; + var x = inputs.x, indices = inputs.indices; + var _a = tfjsCore.gather_util.prepareAndValidate(x, indices), resultShape = _a[0], numSlices = _a[1], sliceSize = _a[2], strides = _a[3]; + var out = backend.makeOutput(resultShape, x.dtype); + if (numSlices === 0) { + return out; + } + var indicesShape = indices.shape; + var sliceRank = indicesShape[indicesShape.length - 1]; + var xData = backend.dataIdMap.get(x.dataId); + var xId = xData.id; + var indicesData = backend.dataIdMap.get(indices.dataId); + var indicesId = indicesData.id; + var stridesBytes = new Uint8Array(new Int32Array(strides).buffer); + var outId = backend.dataIdMap.get(out.dataId).id; + wasmGatherNd(xId, CppDType[x.dtype], indicesId, numSlices, sliceRank, sliceSize, stridesBytes, outId); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'GatherNd', + backendName: 'wasm', + setupFunc: setup$c, + kernelFunc: gatherNd + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var supportsFullBroadcast$3 = false; + registerBinaryKernel('Greater', supportsFullBroadcast$3, 'bool'); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var supportsFullBroadcast$4 = false; + registerBinaryKernel('GreaterEqual', supportsFullBroadcast$4, 'bool'); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var supportsFullBroadcast$5 = false; + registerBinaryKernel('Less', supportsFullBroadcast$5, 'bool'); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var supportsFullBroadcast$6 = false; + registerBinaryKernel('LessEqual', supportsFullBroadcast$6, 'bool'); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + registerUnaryKernel('Log'); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var supportsFullBroadcast$7 = false; + registerBinaryKernel('LogicalAnd', supportsFullBroadcast$7, 'bool'); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmMax; + function setup$d(backend) { + wasmMax = + backend.wasm.cwrap('Max', null /*void*/, ['number, number, number']); + } + function max(args) { + var backend = args.backend, inputs = args.inputs, attrs = args.attrs; + var axes = attrs.axes; + var x = inputs.x; + var xId = backend.dataIdMap.get(x.dataId).id; + tfjsCore.backend_util.assertAxesAreInnerMostDims('max', axes, x.shape.length); + var _a = tfjsCore.backend_util.computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var reduceSize = tfjsCore.util.sizeFromShape(reduceShape); + var out = backend.makeOutput(outShape, x.dtype); + if (tfjsCore.util.sizeFromShape(x.shape) === 0) { + return out; + } + var outId = backend.dataIdMap.get(out.dataId).id; + wasmMax(xId, reduceSize, outId); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'Max', + backendName: 'wasm', + setupFunc: setup$d, + kernelFunc: max + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var supportsFullBroadcast$8 = false; + registerBinaryKernel('Maximum', supportsFullBroadcast$8); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmMaxPool; + function setup$e(backend) { + wasmMaxPool = backend.wasm.cwrap('MaxPool', null /* void */, [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + ]); + } + function maxPool(args) { + var inputs = args.inputs, attrs = args.attrs, backend = args.backend; + var convInfo = attrs; + var x = inputs.x; + var xId = backend.dataIdMap.get(x.dataId).id; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var padTop = convInfo.padInfo.top; + var padRight = convInfo.padInfo.right; + var padBottom = convInfo.padInfo.bottom; + var padLeft = convInfo.padInfo.left; + var dilationHeight = convInfo.dilationHeight; + var dilationWidth = convInfo.dilationWidth; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var inputChannels = convInfo.inChannels; + var outputChannels = convInfo.outChannels; + if (convInfo.dataFormat !== 'channelsLast') { + throw new Error("wasm backend does not support dataFormat:'" + + (convInfo.dataFormat + "'. Please use 'channelsLast'.")); + } + var out = backend.makeOutput(convInfo.outShape, 'float32'); + var outId = backend.dataIdMap.get(out.dataId).id; + wasmMaxPool(xId, x.shape[0], x.shape[1], x.shape[2], filterHeight, filterWidth, padTop, padRight, padBottom, padLeft, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, outId); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'MaxPool', + backendName: 'wasm', + setupFunc: setup$e, + kernelFunc: maxPool + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmMin; + function setup$f(backend) { + wasmMin = + backend.wasm.cwrap('Min', null /*void*/, ['number, number, number']); + } + function min(args) { + var backend = args.backend, inputs = args.inputs, attrs = args.attrs; + var axes = attrs.axes; + var x = inputs.x; + var xId = backend.dataIdMap.get(x.dataId).id; + tfjsCore.backend_util.assertAxesAreInnerMostDims('min', axes, x.shape.length); + var _a = tfjsCore.backend_util.computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var reduceSize = tfjsCore.util.sizeFromShape(reduceShape); + var out = backend.makeOutput(outShape, x.dtype); + if (tfjsCore.util.sizeFromShape(x.shape) === 0) { + return out; + } + var outId = backend.dataIdMap.get(out.dataId).id; + wasmMin(xId, reduceSize, outId); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'Min', + backendName: 'wasm', + setupFunc: setup$f, + kernelFunc: min + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var supportsFullBroadcast$9 = false; + registerBinaryKernel('Minimum', supportsFullBroadcast$9); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var supportsFullBroadcast$a = true; + registerBinaryKernel('Mul', supportsFullBroadcast$a); + + /** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + registerUnaryKernel('Neg'); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Parse the result of the c++ method, which has the shape equivalent to + * `Result`. + */ + function parseResultStruct(backend, resOffset) { + var result = new Int32Array(backend.wasm.HEAPU8.buffer, resOffset, 3); + var pSelectedIndices = result[0]; + var selectedSize = result[1]; + var pSelectedScores = result[2]; + // Since the result was allocated on the heap, we have to delete it. + backend.wasm._free(resOffset); + return { pSelectedIndices: pSelectedIndices, selectedSize: selectedSize, pSelectedScores: pSelectedScores }; + } + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmFunc$2; + function setup$g(backend) { + wasmFunc$2 = backend.wasm.cwrap('NonMaxSuppressionV3', 'number', // Result* + [ + 'number', + 'number', + 'number', + 'number', + 'number', + ]); + } + function kernelFunc(args) { + var backend = args.backend, inputs = args.inputs, attrs = args.attrs; + var iouThreshold = attrs.iouThreshold, maxOutputSize = attrs.maxOutputSize, scoreThreshold = attrs.scoreThreshold; + var boxes = inputs.boxes, scores = inputs.scores; + var boxesId = backend.dataIdMap.get(boxes.dataId).id; + var scoresId = backend.dataIdMap.get(scores.dataId).id; + var resOffset = wasmFunc$2(boxesId, scoresId, maxOutputSize, iouThreshold, scoreThreshold); + var _a = parseResultStruct(backend, resOffset), pSelectedIndices = _a.pSelectedIndices, selectedSize = _a.selectedSize, pSelectedScores = _a.pSelectedScores; + // Since we are not using scores for V3, we have to delete it from the heap. + backend.wasm._free(pSelectedScores); + var selectedIndicesTensor = backend.makeOutput([selectedSize], 'int32', pSelectedIndices); + return selectedIndicesTensor; + } + tfjsCore.registerKernel({ + kernelName: 'NonMaxSuppressionV3', + backendName: 'wasm', + setupFunc: setup$g, + kernelFunc: kernelFunc, + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmFunc$3; + function setup$h(backend) { + wasmFunc$3 = backend.wasm.cwrap('NonMaxSuppressionV5', 'number', // Result* + [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + ]); + } + function kernelFunc$1(args) { + var backend = args.backend, inputs = args.inputs, attrs = args.attrs; + var iouThreshold = attrs.iouThreshold, maxOutputSize = attrs.maxOutputSize, scoreThreshold = attrs.scoreThreshold, softNmsSigma = attrs.softNmsSigma; + var boxes = inputs.boxes, scores = inputs.scores; + var boxesId = backend.dataIdMap.get(boxes.dataId).id; + var scoresId = backend.dataIdMap.get(scores.dataId).id; + var resOffset = wasmFunc$3(boxesId, scoresId, maxOutputSize, iouThreshold, scoreThreshold, softNmsSigma); + var _a = parseResultStruct(backend, resOffset), pSelectedIndices = _a.pSelectedIndices, selectedSize = _a.selectedSize, pSelectedScores = _a.pSelectedScores; + var selectedIndicesTensor = backend.makeOutput([selectedSize], 'int32', pSelectedIndices); + var selectedScoresTensor = backend.makeOutput([selectedSize], 'float32', pSelectedScores); + return [selectedIndicesTensor, selectedScoresTensor]; + } + tfjsCore.registerKernel({ + kernelName: 'NonMaxSuppressionV5', + backendName: 'wasm', + setupFunc: setup$h, + kernelFunc: kernelFunc$1, + }); + + /** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var supportsFullBroadcast$b = false; + registerBinaryKernel('NotEqual', supportsFullBroadcast$b, 'bool'); + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + function onesLike(args) { + var x = args.inputs.x, backend = args.backend; + var out = backend.makeOutput(x.shape, x.dtype); + var outVals = backend.typedArrayFromHeap(out); + outVals.fill(1); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'OnesLike', + backendName: 'wasm', + kernelFunc: onesLike, + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmPadV2; + function setup$i(backend) { + wasmPadV2 = backend.wasm.cwrap('PadV2', null /* void */, [ + 'number', + 'array', + 'number', + 'number', + 'array', + 'number', + 'number', + ]); + } + function pad(args) { + var x = args.inputs.x, backend = args.backend, _a = args.attrs, paddings = _a.paddings, constantValue = _a.constantValue; + var outShape = paddings.map(function (p, i) { return p[0] /* beforePad */ + x.shape[i] + p[1]; } /* afterPad */); + var xId = backend.dataIdMap.get(x.dataId).id; + var out = backend.makeOutput(outShape, x.dtype); + var outId = backend.dataIdMap.get(out.dataId).id; + var xShapeBytes = new Uint8Array(new Int32Array(x.shape).buffer); + var paddingsFlat = [].concat.apply([], paddings); + var paddingsBytes = new Uint8Array(new Int32Array(paddingsFlat).buffer); + wasmPadV2(xId, xShapeBytes, x.shape.length, CppDType[x.dtype], paddingsBytes, constantValue, outId); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'PadV2', + backendName: 'wasm', + kernelFunc: pad, + setupFunc: setup$i + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var supportsFullBroadcast$c = false; + registerBinaryKernel('Pow', supportsFullBroadcast$c); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmPrelu; + function setup$j(backend) { + wasmPrelu = backend.wasm.cwrap('Prelu', null /* void */, [ + 'number', + 'number', + 'number' // out_id + ]); + } + function prelu(args) { + var inputs = args.inputs, backend = args.backend; + var x = inputs.x, alpha = inputs.alpha; + var xId = backend.dataIdMap.get(x.dataId).id; + var weightsId = backend.dataIdMap.get(alpha.dataId).id; + var out = backend.makeOutput(x.shape, 'float32'); + var outId = backend.dataIdMap.get(out.dataId).id; + wasmPrelu(xId, weightsId, outId); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'Prelu', + backendName: 'wasm', + setupFunc: setup$j, + kernelFunc: prelu + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + registerUnaryKernel('Relu'); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + registerUnaryKernel('Relu6'); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + function reshape(args) { + var x = args.inputs.x, shape = args.attrs.shape; + return { dataId: x.dataId, shape: shape, dtype: x.dtype }; + } + tfjsCore.registerKernel({ + kernelName: 'Reshape', + backendName: 'wasm', + kernelFunc: reshape, + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmResizeBilinear; + function setup$k(backend) { + wasmResizeBilinear = backend.wasm.cwrap('ResizeBilinear', null /*void*/, [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number' // outId + ]); + } + function resizeBilinear(args) { + var backend = args.backend, inputs = args.inputs, attrs = args.attrs; + var x = inputs.x; + var alignCorners = attrs.alignCorners, newHeight = attrs.newHeight, newWidth = attrs.newWidth; + var _a = x.shape, batch = _a[0], oldHeight = _a[1], oldWidth = _a[2], numChannels = _a[3]; + var outShape = [batch, newHeight, newWidth, numChannels]; + var xData = backend.dataIdMap.get(x.dataId); + var castedData; + if (xData.dtype !== 'float32') { + castedData = cast({ backend: backend, inputs: { x: x }, attrs: { dtype: 'float32' } }); + xData = backend.dataIdMap.get(castedData.dataId); + } + var xId = xData.id; + var out = backend.makeOutput(outShape, 'float32'); + if (tfjsCore.util.sizeFromShape(x.shape) === 0) { + return out; + } + var outId = backend.dataIdMap.get(out.dataId).id; + wasmResizeBilinear(xId, batch, oldHeight, oldWidth, numChannels, newHeight, newWidth, alignCorners ? 1 : 0, outId); + if (castedData != null) { + backend.disposeData(castedData.dataId); + } + return out; + } + tfjsCore.registerKernel({ + kernelName: 'ResizeBilinear', + backendName: 'wasm', + setupFunc: setup$k, + kernelFunc: resizeBilinear + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + registerUnaryKernel('Rsqrt'); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmScatterNd; + function setup$l(backend) { + wasmScatterNd = backend.wasm.cwrap('ScatterNd', null /*void*/, [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'array', + 'number', + 'number' // outId + ]); + } + function scatterNd(args) { + var backend = args.backend, inputs = args.inputs, attrs = args.attrs; + var indices = inputs.indices, updates = inputs.updates; + var shape = attrs.shape; + var out = backend.makeOutput(shape, updates.dtype); + if (tfjsCore.util.sizeFromShape(shape) === 0) { + return out; + } + var _a = tfjsCore.scatter_util.calculateShapes(updates, indices, shape), sliceRank = _a.sliceRank, numUpdates = _a.numUpdates, sliceSize = _a.sliceSize, strides = _a.strides, outputSize = _a.outputSize; + var indicesData = backend.dataIdMap.get(indices.dataId); + var indicesId = indicesData.id; + var updatesData = backend.dataIdMap.get(updates.dataId); + var updatesId = updatesData.id; + var stridesBytes = new Uint8Array(new Int32Array(strides).buffer); + var outId = backend.dataIdMap.get(out.dataId).id; + wasmScatterNd(indicesId, updatesId, CppDType[updates.dtype], sliceRank, numUpdates, sliceSize, stridesBytes, outputSize, outId); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'ScatterNd', + backendName: 'wasm', + setupFunc: setup$l, + kernelFunc: scatterNd + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmFunc$4; + function setup$m(backend) { + wasmFunc$4 = + backend.wasm.cwrap('Sigmoid', null /* void */, ['number', 'number']); + } + function sigmoid(args) { + var backend = args.backend, x = args.inputs.x; + var xId = backend.dataIdMap.get(x.dataId).id; + var out = backend.makeOutput(x.shape, x.dtype); + var outId = backend.dataIdMap.get(out.dataId).id; + // Short-circuit zero-sized tensors. + if (tfjsCore.util.sizeFromShape(out.shape) === 0) { + return out; + } + wasmFunc$4(xId, outId); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'Sigmoid', + backendName: 'wasm', + setupFunc: setup$m, + kernelFunc: sigmoid + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + registerUnaryKernel('Sin'); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + function slice(args) { + var x = args.inputs.x, _a = args.attrs, begin = _a.begin, size = _a.size, backend = args.backend; + var isContinous = tfjsCore.slice_util.isSliceContinous(x.shape, begin, size); + var xVals = backend.typedArrayFromHeap(x); + var out = backend.makeOutput(size, x.dtype); + var outVals = backend.typedArrayFromHeap(out); + var xStrides = tfjsCore.util.computeStrides(x.shape); + if (isContinous) { + var flatOffset = tfjsCore.slice_util.computeFlatOffset(begin, xStrides); + outVals.set(xVals.subarray(flatOffset, flatOffset + tfjsCore.util.sizeFromShape(size))); + return out; + } + var rank = x.shape.length; + if (rank === 2) { + slice2d(xVals, xStrides[0], outVals, begin, size); + } + else if (rank === 3) { + slice3d(xVals, xStrides[0], xStrides[1], outVals, begin, size); + } + else if (rank === 4) { + slice4d(xVals, xStrides[0], xStrides[1], xStrides[2], outVals, begin, size); + } + else { + genericSliceSlow(xVals, x, outVals, begin, size); + } + return out; + } + function slice2d(xVals, xStride, outVals, begin, size) { + var outOffset = 0; + var beginI = begin[0]; + var beginJ = begin[1]; + var endI = beginI + size[0]; + for (var i = beginI; i < endI; i++) { + var xOffset = i * xStride + beginJ; + outVals.set(xVals.subarray(xOffset, xOffset + size[1]), outOffset); + outOffset += size[1]; + } + } + function slice3d(xVals, xStride1, xStride2, outVals, begin, size) { + var outOffset = 0; + var beginI = begin[0]; + var beginJ = begin[1]; + var beginK = begin[2]; + var endI = beginI + size[0]; + var endJ = beginJ + size[1]; + for (var i = beginI; i < endI; i++) { + for (var j = beginJ; j < endJ; j++) { + var xOffset = i * xStride1 + j * xStride2 + beginK; + outVals.set(xVals.subarray(xOffset, xOffset + size[2]), outOffset); + outOffset += size[2]; + } + } + } + function slice4d(xVals, xStride1, xStride2, xStride3, outVals, begin, size) { + var outOffset = 0; + var beginI = begin[0]; + var beginJ = begin[1]; + var beginK = begin[2]; + var endI = beginI + size[0]; + var endJ = beginJ + size[1]; + var endK = beginK + size[2]; + var beginL = begin[3]; + for (var i = beginI; i < endI; i++) { + for (var j = beginJ; j < endJ; j++) { + for (var k = beginK; k < endK; k++) { + var xOffset = i * xStride1 + j * xStride2 + k * xStride3 + beginL; + outVals.set(xVals.subarray(xOffset, xOffset + size[3]), outOffset); + outOffset += size[3]; + } + } + } + } + function genericSliceSlow(xVals, xInfo, outVals, begin, size) { + var outBuf = tfjsCore.buffer(size, xInfo.dtype, outVals); + var xBuf = tfjsCore.buffer(xInfo.shape, xInfo.dtype, xVals); + for (var i = 0; i < outBuf.size; ++i) { + var loc = outBuf.indexToLoc(i); + var xLoc = loc.map(function (idx, j) { return idx + begin[j]; }); + outVals[i] = xBuf.get.apply(xBuf, xLoc); + } + } + tfjsCore.registerKernel({ + kernelName: 'Slice', + backendName: 'wasm', + kernelFunc: slice, + }); + + /** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmFunc$5; + function setup$n(backend) { + wasmFunc$5 = backend.wasm.cwrap('Softmax', null /* void */, [ + 'number', + 'number', + 'number', + 'number' // batch + ]); + } + function softmax(args) { + var backend = args.backend, logits = args.inputs.logits, dim = args.attrs.dim; + var xId = backend.dataIdMap.get(logits.dataId).id; + var out = backend.makeOutput(logits.shape, logits.dtype); + var outId = backend.dataIdMap.get(out.dataId).id; + var channels = logits.shape[dim]; + var batch = tfjsCore.util.sizeFromShape(logits.shape) / channels; + // Short-circuit zero-sized tensors. + if (tfjsCore.util.sizeFromShape(out.shape) === 0) { + return out; + } + wasmFunc$5(xId, outId, channels, batch); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'Softmax', + backendName: 'wasm', + setupFunc: setup$n, + kernelFunc: softmax + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + registerUnaryKernel('Square'); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var supportsFullBroadcast$d = true; + registerBinaryKernel('Sub', supportsFullBroadcast$d); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmSum; + function setup$o(backend) { + wasmSum = + backend.wasm.cwrap('Sum', null /*void*/, ['number, number, number']); + } + function sum(args) { + var backend = args.backend, inputs = args.inputs, attrs = args.attrs; + var axes = attrs.axes; + var x = inputs.x; + var xId = backend.dataIdMap.get(x.dataId).id; + tfjsCore.backend_util.assertAxesAreInnerMostDims('sum', axes, x.shape.length); + var _a = tfjsCore.backend_util.computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; + var reduceSize = tfjsCore.util.sizeFromShape(reduceShape); + var out = backend.makeOutput(outShape, x.dtype); + if (tfjsCore.util.sizeFromShape(x.shape) === 0) { + return out; + } + var outId = backend.dataIdMap.get(out.dataId).id; + wasmSum(xId, reduceSize, outId); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'Sum', + backendName: 'wasm', + setupFunc: setup$o, + kernelFunc: sum + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + registerUnaryKernel('Tanh'); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmTile; + function setup$p(backend) { + wasmTile = backend.wasm.cwrap('Tile', null /* void */, [ + 'number', + 'array', + 'number', + 'array', + 'number', + 'number' // out_id + ]); + } + function tile(args) { + var inputs = args.inputs, backend = args.backend, attrs = args.attrs; + var x = inputs.x; + var xId = backend.dataIdMap.get(x.dataId).id; + var reps = attrs.reps; + var newShape = new Array(x.shape.length); + for (var i = 0; i < newShape.length; i++) { + newShape[i] = x.shape[i] * reps[i]; + } + var xShapeBytes = new Uint8Array(new Int32Array(x.shape).buffer); + var newShapeBytes = new Uint8Array(new Int32Array(newShape).buffer); + var out = backend.makeOutput(newShape, x.dtype); + var outId = backend.dataIdMap.get(out.dataId).id; + wasmTile(xId, xShapeBytes, x.shape.length, newShapeBytes, newShape.length, CppDType[out.dtype], outId); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'Tile', + backendName: 'wasm', + setupFunc: setup$p, + kernelFunc: tile + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var wasmTranspose; + function setup$q(backend) { + wasmTranspose = backend.wasm.cwrap('Transpose', null /* void */, [ + 'number', + 'array', + 'number', + 'number', + 'number', + 'array', + 'number', + ]); + } + function transpose(args) { + var inputs = args.inputs, backend = args.backend, attrs = args.attrs; + // Reduce any dimensions with size one. Lower-rank transpose kernel performs + // better due to simpler memory access pattern. + var _a = removeOneSizeDims(inputs.x.shape, attrs.perm), reducedShape = _a[0], perm = _a[1]; + var x = { + dataId: inputs.x.dataId, + shape: reducedShape, + dtype: inputs.x.dtype + }; + var permIsNoOp = true; + for (var i = 0; i < perm.length; i++) { + if (perm[i] !== i) { + permIsNoOp = false; + } + } + var outShape = computeOutShape(inputs.x.shape, attrs.perm); + if (permIsNoOp) { + return { dataId: x.dataId, shape: outShape, dtype: x.dtype }; + } + var out = backend.makeOutput(outShape, x.dtype); + var xId = backend.dataIdMap.get(x.dataId).id; + var outId = backend.dataIdMap.get(out.dataId).id; + var permBytes = new Uint8Array(new Int32Array(perm).buffer); + var xShapeBytes = new Uint8Array(new Int32Array(x.shape).buffer); + wasmTranspose(xId, xShapeBytes, x.shape.length, CppDType[x.dtype], outId, permBytes, perm.length); + return out; + } + function computeOutShape(inShape, perm) { + var outShape = new Array(inShape.length); + for (var i = 0; i < outShape.length; i++) { + outShape[i] = inShape[perm[i]]; + } + return outShape; + } + function removeOneSizeDims(shape, perm) { + var newShape = []; + var newPerm = []; + for (var i = 0; i < shape.length; ++i) { + if (shape[i] !== 1) { + newShape.push(shape[i]); + } + if (shape[perm[i]] !== 1) { + newPerm.push(perm[i]); + } + } + for (var i = 0; i < newPerm.length; ++i) { + var minValIdx = -1; + for (var j = 0; j < newPerm.length; ++j) { + if (newPerm[j] >= i && + (minValIdx === -1 || newPerm[minValIdx] > newPerm[j])) { + minValIdx = j; + } + } + newPerm[minValIdx] = i; + } + return [newShape, newPerm]; + } + tfjsCore.registerKernel({ + kernelName: 'Transpose', + backendName: 'wasm', + kernelFunc: transpose, + setupFunc: setup$q, + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + function unpack(args) { + var x = args.inputs.x, backend = args.backend, axis = args.attrs.axis; + var numOutputs = x.shape[axis]; + var rank = x.shape.length; + var outShape = new Array(rank - 1); + var outIndex = 0; + for (var i = 0; i < rank; i++) { + if (i !== axis) { + outShape[outIndex++] = x.shape[i]; + } + } + var outs = new Array(numOutputs); + var begin = new Array(rank).fill(0); + var size = x.shape.slice(); + size[axis] = 1; + for (var i = 0; i < outs.length; i++) { + begin[axis] = i; + outs[i] = slice({ inputs: { x: x }, attrs: { begin: begin, size: size }, backend: backend }); + } + return outs.map(function (_a) { + var dataId = _a.dataId, dtype = _a.dtype; + return ({ dataId: dataId, dtype: dtype, shape: outShape }); + }); + } + tfjsCore.registerKernel({ + kernelName: 'Unpack', + backendName: 'wasm', + kernelFunc: unpack, + }); + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + function zerosLike(args) { + var x = args.inputs.x, backend = args.backend; + var out = backend.makeOutput(x.shape, x.dtype); + var outVals = backend.typedArrayFromHeap(out); + outVals.fill(0); + return out; + } + tfjsCore.registerKernel({ + kernelName: 'ZerosLike', + backendName: 'wasm', + kernelFunc: zerosLike, + }); + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + /* global Reflect, Promise */ + + var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + + function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + + function __awaiter(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + } + + function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + } + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + var tfjsBackendWasm = createCommonjsModule(function (module, exports) { + var WasmBackendModule = (function() { + var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; + if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; + return ( + function(WasmBackendModule) { + WasmBackendModule = WasmBackendModule || {}; + + function GROWABLE_HEAP_I8(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer);}return HEAP8}function GROWABLE_HEAP_U8(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer);}return HEAPU8}function GROWABLE_HEAP_I32(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer);}return HEAP32}function GROWABLE_HEAP_U32(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer);}return HEAPU32}function GROWABLE_HEAP_F64(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer);}return HEAPF64}var Module=typeof WasmBackendModule!=="undefined"?WasmBackendModule:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key];}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(Module["ENVIRONMENT"]){throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)")}var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"];DYNAMIC_BASE=Module["DYNAMIC_BASE"];DYNAMICTOP_PTR=Module["DYNAMICTOP_PTR"];}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readBinary;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=path.dirname(scriptDirectory)+"/";}else{scriptDirectory=__dirname+"/";}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=fs;if(!nodePath)nodePath=path;filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret);}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/");}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status);};Module["inspect"]=function(){return "[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=worker_threads;}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}Worker=nodeWorkerThreads.Worker;}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)};}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs;}else if(typeof arguments!="undefined"){arguments_=arguments;}if(typeof quit==="function"){quit_=function(status){quit(status);};}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print;}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href;}else if(document.currentScript){scriptDirectory=document.currentScript.src;}if(_scriptDir){scriptDirectory=_scriptDir;}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1);}else{scriptDirectory="";}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=fs;if(!nodePath)nodePath=path;filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret);}assert(ret.buffer);return ret};}else{read_=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)};}}}else{throw new Error("environment detection error")}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){performance=perf_hooks.performance;}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key];}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(!Object.getOwnPropertyDescriptor(Module,"arguments"))Object.defineProperty(Module,"arguments",{configurable:true,get:function(){abort("Module.arguments has been replaced with plain arguments_");}});if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(!Object.getOwnPropertyDescriptor(Module,"thisProgram"))Object.defineProperty(Module,"thisProgram",{configurable:true,get:function(){abort("Module.thisProgram has been replaced with plain thisProgram");}});if(Module["quit"])quit_=Module["quit"];if(!Object.getOwnPropertyDescriptor(Module,"quit"))Object.defineProperty(Module,"quit",{configurable:true,get:function(){abort("Module.quit has been replaced with plain quit_");}});assert(typeof Module["memoryInitializerPrefixURL"]==="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["pthreadMainPrefixURL"]==="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["cdInitializerPrefixURL"]==="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["filePackagePrefixURL"]==="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["read"]==="undefined","Module.read option was removed (modify read_ in JS)");assert(typeof Module["readAsync"]==="undefined","Module.readAsync option was removed (modify readAsync in JS)");assert(typeof Module["readBinary"]==="undefined","Module.readBinary option was removed (modify readBinary in JS)");assert(typeof Module["setWindowTitle"]==="undefined","Module.setWindowTitle option was removed (modify setWindowTitle in JS)");assert(typeof Module["TOTAL_MEMORY"]==="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY");if(!Object.getOwnPropertyDescriptor(Module,"read"))Object.defineProperty(Module,"read",{configurable:true,get:function(){abort("Module.read has been replaced with plain read_");}});if(!Object.getOwnPropertyDescriptor(Module,"readAsync"))Object.defineProperty(Module,"readAsync",{configurable:true,get:function(){abort("Module.readAsync has been replaced with plain readAsync");}});if(!Object.getOwnPropertyDescriptor(Module,"readBinary"))Object.defineProperty(Module,"readBinary",{configurable:true,get:function(){abort("Module.readBinary has been replaced with plain readBinary");}});if(!Object.getOwnPropertyDescriptor(Module,"setWindowTitle"))Object.defineProperty(Module,"setWindowTitle",{configurable:true,get:function(){abort("Module.setWindowTitle has been replaced with plain setWindowTitle");}});assert(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER||ENVIRONMENT_IS_NODE,"Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)");var stackSave;var stackRestore;var stackAlloc;stackSave=stackRestore=stackAlloc=function(){abort("cannot use the stack before compiled code is ready to run, and has provided stack access");};function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text);}}var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(!Object.getOwnPropertyDescriptor(Module,"wasmBinary"))Object.defineProperty(Module,"wasmBinary",{configurable:true,get:function(){abort("Module.wasmBinary has been replaced with plain wasmBinary");}});var noExitRuntime;if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(!Object.getOwnPropertyDescriptor(Module,"noExitRuntime"))Object.defineProperty(Module,"noExitRuntime",{configurable:true,get:function(){abort("Module.noExitRuntime has been replaced with plain noExitRuntime");}});if(typeof WebAssembly!=="object"){abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.");}var wasmMemory;var wasmTable=new WebAssembly.Table({"initial":118,"maximum":118+0,"element":"anyfunc"});var wasmModule;var threadInfoStruct=0;var selfThreadId=0;var ABORT=false;function assert(condition,text){if(!condition){abort("Assertion failed: "+text);}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len);}return ret},"array":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string")return UTF8ToString(ret);if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2;}else{if((u0&248)!=240)warnOnce("Invalid UTF-8 leading byte 0x"+u0.toString(16)+" encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!");u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63;}if(u0<65536){str+=String.fromCharCode(u0);}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023);}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(GROWABLE_HEAP_U8(),ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023;}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u;}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63;}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63;}else{if(outIdx+3>=endIdx)break;if(u>=2097152)warnOnce("Invalid Unicode code point 0x"+u.toString(16)+" encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF).");heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63;}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,GROWABLE_HEAP_U8(),outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4;}return len}function writeArrayToMemory(array,buffer){assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");GROWABLE_HEAP_I8().set(array,buffer);}var WASM_PAGE_SIZE=65536;function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple;}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf);}var STACK_BASE=5255808,STACKTOP=STACK_BASE,STACK_MAX=12928,DYNAMIC_BASE=5255808,DYNAMICTOP_PTR=12e3;assert(STACK_BASE%16===0,"stack must start aligned");assert(DYNAMIC_BASE%16===0,"heap must start aligned");if(ENVIRONMENT_IS_PTHREAD){STACK_MAX=STACKTOP=STACK_MAX=2147483647;}var TOTAL_STACK=5242880;if(Module["TOTAL_STACK"])assert(TOTAL_STACK===Module["TOTAL_STACK"],"the stack size can no longer be determined at runtime");var INITIAL_INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(!Object.getOwnPropertyDescriptor(Module,"INITIAL_MEMORY"))Object.defineProperty(Module,"INITIAL_MEMORY",{configurable:true,get:function(){abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY");}});assert(INITIAL_INITIAL_MEMORY>=TOTAL_STACK,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+INITIAL_INITIAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");assert(typeof Int32Array!=="undefined"&&typeof Float64Array!=="undefined"&&Int32Array.prototype.subarray!==undefined&&Int32Array.prototype.set!==undefined,"JS engine does not provide full typed array support");if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"];}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"];}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,"maximum":1073741824/WASM_PAGE_SIZE,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)");}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer;}INITIAL_INITIAL_MEMORY=buffer.byteLength;assert(INITIAL_INITIAL_MEMORY%WASM_PAGE_SIZE===0);assert(65536%WASM_PAGE_SIZE===0);updateGlobalBufferAndViews(buffer);if(!ENVIRONMENT_IS_PTHREAD){GROWABLE_HEAP_I32()[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE;}function writeStackCookie(){assert((STACK_MAX&3)==0);GROWABLE_HEAP_U32()[(STACK_MAX>>2)+1]=34821223;GROWABLE_HEAP_U32()[(STACK_MAX>>2)+2]=2310721022;GROWABLE_HEAP_I32()[0]=1668509029;}function checkStackCookie(){var cookie1=GROWABLE_HEAP_U32()[(STACK_MAX>>2)+1];var cookie2=GROWABLE_HEAP_U32()[(STACK_MAX>>2)+2];if(cookie1!=34821223||cookie2!=2310721022){abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+cookie2.toString(16)+" "+cookie1.toString(16));}if(GROWABLE_HEAP_I32()[0]!==1668509029)abort("Runtime error: The application has corrupted its heap memory area (address zero)!");}function abortStackOverflow(allocSize){abort("Stack overflow! Attempted to allocate "+allocSize+" bytes on the stack, but stack has only "+(STACK_MAX-stackSave()+allocSize)+" bytes available!");}(function(){var h16=new Int16Array(1);var h8=new Int8Array(h16.buffer);h16[0]=25459;if(h8[0]!==115||h8[1]!==99)throw "Runtime error: expected the system to be little-endian!"})();function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func);}else{Module["dynCall_vi"](func,callback.arg);}}else{func(callback.arg===undefined?null:callback.arg);}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;if(ENVIRONMENT_IS_PTHREAD)runtimeInitialized=true;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift());}}callRuntimeCallbacks(__ATPRERUN__);}function initRuntime(){checkStackCookie();assert(!runtimeInitialized);runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__);}function preMain(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATMAIN__);}function postRun(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift());}}callRuntimeCallbacks(__ATPOSTRUN__);}function addOnPreRun(cb){__ATPRERUN__.unshift(cb);}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb);}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Math_ceil=Math.ceil;var Math_floor=Math.floor;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies);}if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!=="undefined"){runDependencyWatcher=setInterval(function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;err("still waiting on run dependencies:");}err("dependency: "+dep);}if(shown){err("(end of list)");}},1e4);}}else{err("warning: run dependency added without ID");}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies);}if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id];}else{err("warning: run dependency removed without ID");}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null;}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback();}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what);}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";out(what);err(what);ABORT=true;var output="abort("+what+") at "+stackTrace();what=output;throw new WebAssembly.RuntimeError(what)}var FS={error:function(){abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1");},init:function(){FS.error();},createDataFile:function(){FS.error();},createPreloadedFile:function(){FS.error();},createLazyFile:function(){FS.error();},open:function(){FS.error();},mkdev:function(){FS.error();},registerDevice:function(){FS.error();},analyzePath:function(){FS.error();},loadFilesFromDB:function(){FS.error();},ErrnoError:function ErrnoError(){FS.error();}};Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;function hasPrefix(str,prefix){return String.prototype.startsWith?str.startsWith(prefix):str.indexOf(prefix)===0}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return hasPrefix(filename,dataURIPrefix)}var fileURIPrefix="file://";function isFileURI(filename){return hasPrefix(filename,fileURIPrefix)}var wasmBinaryFile="tfjs-backend-wasm.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile);}function getBinary(){try{if(wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(wasmBinaryFile)}else{throw "both async and sync fetching of the wasm failed"}}catch(err){abort(err);}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw "failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary()})}return new Promise(function(resolve,reject){resolve(getBinary());})}function createWasm(){var info={"env":asmLibraryArg,"wasi_snapshot_preview1":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){var numWorkersToLoad=PThread.unusedWorkers.length;PThread.unusedWorkers.forEach(function(w){PThread.loadWasmModuleToWorker(w,function(){if(!--numWorkersToLoad)removeRunDependency("wasm-instantiate");});});}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate");}var trueModule=Module;function receiveInstantiatedSource(output){assert(Module===trueModule,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");trueModule=null;receiveInstance(output["instance"],output["module"]);}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason);})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource);})});}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return {}}var ASM_CONSTS={};function initPthreadsJS(){PThread.initRuntime();}if(!ENVIRONMENT_IS_PTHREAD)__ATINIT__.push({func:function(){___wasm_call_ctors();}});function demangle(func){warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return func}function demangleAll(text){var regex=/\b_Z[\w\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"})}var __pthread_ptr=0;var __pthread_is_main_runtime_thread=0;var __pthread_is_main_browser_thread=0;function __register_pthread_ptr(pthreadPtr,isMainBrowserThread,isMainRuntimeThread){pthreadPtr=pthreadPtr|0;isMainBrowserThread=isMainBrowserThread|0;isMainRuntimeThread=isMainRuntimeThread|0;__pthread_ptr=pthreadPtr;__pthread_is_main_browser_thread=isMainBrowserThread;__pthread_is_main_runtime_thread=isMainRuntimeThread;}Module["__register_pthread_ptr"]=__register_pthread_ptr;var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var __main_thread_futex_wait_address=12912;function _emscripten_futex_wake(addr,count){if(addr<=0||addr>GROWABLE_HEAP_I8().length||addr&3!=0||count<0)return -28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(GROWABLE_HEAP_I32(),addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw "Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function __kill_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw "Internal Error! _kill_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw "Internal Error! Null pthread_ptr in _kill_thread!";GROWABLE_HEAP_I32()[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined;}function __cancel_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw "Internal Error! _cancel_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw "Internal Error! Null pthread_ptr in _cancel_thread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"});}function __cleanup_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw "Internal Error! _cleanup_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw "Internal Error! Null pthread_ptr in _cleanup_thread!";GROWABLE_HEAP_I32()[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];if(pthread){var worker=pthread.worker;PThread.returnWorkerToPool(worker);}}var PThread={MAIN_THREAD_ID:1,mainThreadInfo:{schedPolicy:0,schedPrio:0},unusedWorkers:[],runningWorkers:[],initRuntime:function(){__register_pthread_ptr(PThread.mainThreadBlock,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(PThread.mainThreadBlock);},initMainThreadBlock:function(){assert(!ENVIRONMENT_IS_PTHREAD);var pthreadPoolSize=8;for(var i=0;i>2]=PThread.mainThreadBlock;var headPtr=PThread.mainThreadBlock+156;GROWABLE_HEAP_I32()[headPtr>>2]=headPtr;var tlsMemory=12400;for(var i=0;i<128;++i)GROWABLE_HEAP_U32()[tlsMemory/4+i]=0;Atomics.store(GROWABLE_HEAP_U32(),PThread.mainThreadBlock+104>>2,tlsMemory);Atomics.store(GROWABLE_HEAP_U32(),PThread.mainThreadBlock+40>>2,PThread.mainThreadBlock);Atomics.store(GROWABLE_HEAP_U32(),PThread.mainThreadBlock+44>>2,42);},initWorker:function(){},pthreads:{},exitHandlers:null,setThreadStatus:function(){},runExitHandlers:function(){if(PThread.exitHandlers!==null){while(PThread.exitHandlers.length>0){PThread.exitHandlers.pop()();}PThread.exitHandlers=null;}if(ENVIRONMENT_IS_PTHREAD&&threadInfoStruct)___pthread_tsd_run_dtors();},threadExit:function(exitCode){var tb=_pthread_self();if(tb){err("Pthread 0x"+tb.toString(16)+" exited.");Atomics.store(GROWABLE_HEAP_U32(),tb+4>>2,exitCode);Atomics.store(GROWABLE_HEAP_U32(),tb+0>>2,1);Atomics.store(GROWABLE_HEAP_U32(),tb+60>>2,1);Atomics.store(GROWABLE_HEAP_U32(),tb+64>>2,0);PThread.runExitHandlers();_emscripten_futex_wake(tb+0,2147483647);__register_pthread_ptr(0,0,0);threadInfoStruct=0;if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"});}}},threadCancel:function(){PThread.runExitHandlers();Atomics.store(GROWABLE_HEAP_U32(),threadInfoStruct+4>>2,-1);Atomics.store(GROWABLE_HEAP_U32(),threadInfoStruct+0>>2,1);_emscripten_futex_wake(threadInfoStruct+0,2147483647);threadInfoStruct=selfThreadId=0;__register_pthread_ptr(0,0,0);postMessage({"cmd":"cancelDone"});},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker);}}PThread.pthreads={};for(var i=0;i>2];GROWABLE_HEAP_I32()[pthread.threadInfoStruct+104>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct);}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null;},returnWorkerToPool:function(worker){delete PThread.pthreads[worker.pthread.thread];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined;},receiveObjectTransfer:function(data){},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"]);}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!");}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls();}else if(cmd==="spawnThread"){__spawn_thread(e.data);}else if(cmd==="cleanupThread"){__cleanup_thread(d["thread"]);}else if(cmd==="killThread"){__kill_thread(d["thread"]);}else if(cmd==="cancelThread"){__cancel_thread(d["thread"]);}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread;}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"]);}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"]);}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"]);}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(GROWABLE_HEAP_U32(),worker.pthread.thread+68>>2);if(detached){PThread.returnWorkerToPool(worker);}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker);}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data);}else if(e.data.target==="setimmediate"){worker.postMessage(e.data);}else{err("worker sent an unknown command "+cmd);}PThread.currentProxiedOperationCallerThread=undefined;};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message);};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data});});worker.on("error",function(data){worker.onerror(data);});worker.on("exit",function(data){console.log("worker exited - TODO: update the worker queue?");});}assert(wasmMemory instanceof WebAssembly.Memory,"WebAssembly memory should have been loaded by now!");assert(wasmModule instanceof WebAssembly.Module,"WebAssembly Module should have been loaded by now!");worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule,"DYNAMIC_BASE":DYNAMIC_BASE,"DYNAMICTOP_PTR":DYNAMICTOP_PTR});},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("tfjs-backend-wasm.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs));},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0]);}if(PThread.unusedWorkers.length>0)return PThread.unusedWorkers.pop();else return null},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()GROWABLE_HEAP_I8().length||addr&3!=0)return -28;if(ENVIRONMENT_IS_WORKER){var ret=Atomics.wait(GROWABLE_HEAP_I32(),addr>>2,val,timeout);if(ret==="timed-out")return -73;if(ret==="not-equal")return -6;if(ret==="ok")return 0;throw "Atomics.wait returned an unexpected value "+ret}else{var loadedVal=Atomics.load(GROWABLE_HEAP_I32(),addr>>2);if(val!=loadedVal)return -6;var tNow=performance.now();var tEnd=tNow+timeout;Atomics.store(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2,addr);var ourWaitAddress=addr;while(addr==ourWaitAddress){tNow=performance.now();if(tNow>tEnd){return -73}_emscripten_main_thread_process_queued_calls();addr=Atomics.load(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2);}return 0}}function _emscripten_is_main_browser_thread(){return __pthread_is_main_browser_thread|0}function _emscripten_is_main_runtime_thread(){return __pthread_is_main_runtime_thread|0}function _emscripten_memcpy_big(dest,src,num){GROWABLE_HEAP_U8().copyWithin(dest,src,src+num);}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;if(numCallArgs>20-1)throw "emscripten_proxy_to_main_thread_js: Too many arguments "+numCallArgs+" to proxied function idx="+index+", maximum supported is "+(20-1)+"!";var stack=stackSave();var args=stackAlloc(numCallArgs*8);var b=args>>3;for(var i=0;i>3]);buf+=8;}else if(ch===105){buf=buf+3&~3;args.push(GROWABLE_HEAP_I32()[buf>>2]);buf+=4;}else abort("unexpected char in asm const signature "+ch);}return args}function _emscripten_receive_on_main_thread_js(index,numCallArgs,args){_emscripten_receive_on_main_thread_js_callArgs.length=numCallArgs;var b=args>>3;for(var i=0;i>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){console.error("emscripten_realloc_buffer: Attempted to grow heap from "+buffer.byteLength+" bytes to "+size+" bytes, but got error: "+e);}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();if(requestedSize<=oldSize){return false}var PAGE_MULTIPLE=65536;var maxHeapSize=1073741824;if(requestedSize>maxHeapSize){err("Cannot enlarge memory, asked to go up to "+requestedSize+" bytes, but the limit is "+maxHeapSize+" bytes!");return false}var minHeapSize=16777216;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(minHeapSize,requestedSize,overGrownHeapSize),PAGE_MULTIPLE));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}err("Failed to grow the heap from "+oldSize+" bytes to "+newSize+" bytes, not enough memory!");return false}var JSEvents={keyEvent:0,mouseEvent:0,wheelEvent:0,uiEvent:0,focusEvent:0,deviceOrientationEvent:0,deviceMotionEvent:0,fullscreenChangeEvent:0,pointerlockChangeEvent:0,visibilityChangeEvent:0,touchEvent:0,previousFullscreenElement:null,previousScreenX:null,previousScreenY:null,removeEventListenersRegistered:false,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i);}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[];},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){JSEvents.removeEventListenersRegistered=true;}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;GROWABLE_HEAP_I32()[varargs+4>>2]=eventData;GROWABLE_HEAP_I32()[varargs+8>>2]=userData;_emscripten_async_queue_on_thread_(targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop);},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return "";if(target==window)return "#window";if(target==screen)return "#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas);}GROWABLE_HEAP_I32()[varargs>>2]=targetCanvasPtr;GROWABLE_HEAP_I32()[varargs+4>>2]=width;GROWABLE_HEAP_I32()[varargs+8>>2]=height;_emscripten_async_queue_on_thread_(targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop);}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height);}function __maybeCStringToJsString(cString){return cString===cString+0?UTF8ToString(cString):cString}var __specialEventTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function __findEventTarget(target){var domElement=__specialEventTargets[target]||(typeof document!=="undefined"?document.querySelector(__maybeCStringToJsString(target)):undefined);return domElement}function __findCanvasEventTarget(target){return __findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=__findCanvasEventTarget(target);if(!canvas)return -4;if(canvas.canvasSharedPtr){GROWABLE_HEAP_I32()[canvas.canvasSharedPtr>>2]=width;GROWABLE_HEAP_I32()[canvas.canvasSharedPtr+4>>2]=height;}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height;}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height);}}else if(canvas.canvasSharedPtr){var targetThread=GROWABLE_HEAP_I32()[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return -4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=__findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function __webgl_acquireInstancedArraysExtension(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor);};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount);};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount);};}}function __webgl_acquireVertexArrayObjectExtension(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao);};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao);};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};}}function __webgl_acquireDrawBuffersExtension(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs);};}}var GL={counter:1,lastError:0,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},currentContext:null,offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,init:function(){var miniTempFloatBuffer=new Float32Array(GL.MINI_TEMP_BUFFER_SIZE);for(var i=0;i>2]:-1;source+=UTF8ToString(GROWABLE_HEAP_I32()[string+i*4>>2],len<0?undefined:len);}return source},createContext:function(canvas,webGLContextAttributes){var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);GROWABLE_HEAP_I32()[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context);}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return !(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null;},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;if(context.version<2){__webgl_acquireInstancedArraysExtension(GLctx);__webgl_acquireVertexArrayObjectExtension(GLctx);__webgl_acquireDrawBuffersExtension(GLctx);}GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query");var automaticallyEnabledExtensions=["OES_texture_float","OES_texture_half_float","OES_standard_derivatives","OES_vertex_array_object","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","OES_element_index_uint","EXT_texture_filter_anisotropic","EXT_frag_depth","WEBGL_draw_buffers","ANGLE_instanced_arrays","OES_texture_float_linear","OES_texture_half_float_linear","EXT_blend_minmax","EXT_shader_texture_lod","EXT_texture_norm16","WEBGL_compressed_texture_pvrtc","EXT_color_buffer_half_float","WEBGL_color_buffer_float","EXT_sRGB","WEBGL_compressed_texture_etc1","EXT_disjoint_timer_query","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_astc","EXT_color_buffer_float","WEBGL_compressed_texture_s3tc_srgb","EXT_disjoint_timer_query_webgl2","WEBKIT_WEBGL_compressed_texture_pvrtc"];var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(automaticallyEnabledExtensions.indexOf(ext)!=-1){GLctx.getExtension(ext);}});},populateUniformTable:function(program){var p=GL.programs[program];var ptable=GL.programInfos[program]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1};var utable=ptable.uniforms;var numUniforms=GLctx.getProgramParameter(p,35718);for(var i=0;i>2;contextAttributes["alpha"]=!!GROWABLE_HEAP_I32()[a+(0>>2)];contextAttributes["depth"]=!!GROWABLE_HEAP_I32()[a+(4>>2)];contextAttributes["stencil"]=!!GROWABLE_HEAP_I32()[a+(8>>2)];contextAttributes["antialias"]=!!GROWABLE_HEAP_I32()[a+(12>>2)];contextAttributes["premultipliedAlpha"]=!!GROWABLE_HEAP_I32()[a+(16>>2)];contextAttributes["preserveDrawingBuffer"]=!!GROWABLE_HEAP_I32()[a+(20>>2)];var powerPreference=GROWABLE_HEAP_I32()[a+(24>>2)];contextAttributes["powerPreference"]=__emscripten_webgl_power_preferences[powerPreference];contextAttributes["failIfMajorPerformanceCaveat"]=!!GROWABLE_HEAP_I32()[a+(28>>2)];contextAttributes.majorVersion=GROWABLE_HEAP_I32()[a+(32>>2)];contextAttributes.minorVersion=GROWABLE_HEAP_I32()[a+(36>>2)];contextAttributes.enableExtensionsByDefault=GROWABLE_HEAP_I32()[a+(40>>2)];contextAttributes.explicitSwapControl=GROWABLE_HEAP_I32()[a+(44>>2)];contextAttributes.proxyContextToMainThread=GROWABLE_HEAP_I32()[a+(48>>2)];contextAttributes.renderViaOffscreenBackBuffer=GROWABLE_HEAP_I32()[a+(52>>2)];var canvas=__findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];assert(buffer);if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0;}else{buffer.push(curr);}},varargs:undefined,get:function(){assert(SYSCALLS.varargs!=undefined);SYSCALLS.varargs+=4;var ret=GROWABLE_HEAP_I32()[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){if(low>=0)assert(high===0);else assert(high===-1);return low}};function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,fd);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM");return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,fd,offset_low,offset_high,whence,newOffset);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM");}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd,iov,iovcnt,pnum);var num=0;for(var i=0;i>2];var len=GROWABLE_HEAP_I32()[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}function _pthread_cleanup_pop(execute){var routine=PThread.exitHandlers.pop();if(execute)routine();}function _pthread_cleanup_push(routine,arg){if(PThread.exitHandlers===null){PThread.exitHandlers=[];}PThread.exitHandlers.push(function(){dynCall_vi(routine,arg);});}function __spawn_thread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw "Internal Error! _spawn_thread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(worker.pthread!==undefined)throw "Internal error!";if(!threadParams.pthread_ptr)throw "Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){GROWABLE_HEAP_I32()[tlsMemory+i*4>>2]=0;}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,thread:threadParams.pthread_ptr,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(GROWABLE_HEAP_U32(),tis+(0>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(4>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(8>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(68>>2),threadParams.detached);Atomics.store(GROWABLE_HEAP_U32(),tis+(104>>2),tlsMemory);Atomics.store(GROWABLE_HEAP_U32(),tis+(48>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(40>>2),pthread.threadInfoStruct);Atomics.store(GROWABLE_HEAP_U32(),tis+(44>>2),42);Atomics.store(GROWABLE_HEAP_U32(),tis+(108>>2),threadParams.stackSize);Atomics.store(GROWABLE_HEAP_U32(),tis+(84>>2),threadParams.stackSize);Atomics.store(GROWABLE_HEAP_U32(),tis+(80>>2),stackHigh);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+8>>2),stackHigh);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+12>>2),threadParams.detached);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+20>>2),threadParams.schedPolicy);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+24>>2),threadParams.schedPrio);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(GROWABLE_HEAP_U32(),tis+(176>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"selfThreadId":threadParams.pthread_ptr,"parentThreadId":threadParams.parent_pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList);};if(worker.loaded){worker.runPthread();delete worker.runPthread;}}function _pthread_getschedparam(thread,policy,schedparam){if(!policy&&!schedparam)return ERRNO_CODES.EINVAL;if(!thread){err("pthread_getschedparam called with a null thread pointer!");return ERRNO_CODES.ESRCH}var self=GROWABLE_HEAP_I32()[thread+12>>2];if(self!==thread){err("pthread_getschedparam attempted on thread "+thread+", which does not point to a valid thread, or does not exist anymore!");return ERRNO_CODES.ESRCH}var schedPolicy=Atomics.load(GROWABLE_HEAP_U32(),thread+108+20>>2);var schedPrio=Atomics.load(GROWABLE_HEAP_U32(),thread+108+24>>2);if(policy)GROWABLE_HEAP_I32()[policy>>2]=schedPolicy;if(schedparam)GROWABLE_HEAP_I32()[schedparam>>2]=schedPrio;return 0}function _pthread_self(){return __pthread_ptr|0}Module["_pthread_self"]=_pthread_self;function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}var stackSize=0;var stackBase=0;var detached=0;var schedPolicy=0;var schedPrio=0;if(attr){stackSize=GROWABLE_HEAP_I32()[attr>>2];stackSize+=81920;stackBase=GROWABLE_HEAP_I32()[attr+8>>2];detached=GROWABLE_HEAP_I32()[attr+12>>2]!==0;var inheritSched=GROWABLE_HEAP_I32()[attr+16>>2]===0;if(inheritSched){var prevSchedPolicy=GROWABLE_HEAP_I32()[attr+20>>2];var prevSchedPrio=GROWABLE_HEAP_I32()[attr+24>>2];var parentThreadPtr=PThread.currentProxiedOperationCallerThread?PThread.currentProxiedOperationCallerThread:_pthread_self();_pthread_getschedparam(parentThreadPtr,attr+20,attr+24);schedPolicy=GROWABLE_HEAP_I32()[attr+20>>2];schedPrio=GROWABLE_HEAP_I32()[attr+24>>2];GROWABLE_HEAP_I32()[attr+20>>2]=prevSchedPolicy;GROWABLE_HEAP_I32()[attr+24>>2]=prevSchedPrio;}else{schedPolicy=GROWABLE_HEAP_I32()[attr+20>>2];schedPrio=GROWABLE_HEAP_I32()[attr+24>>2];}}else{stackSize=2097152;}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize);}else{stackBase-=stackSize;assert(stackBase>0);}var threadInfoStruct=_malloc(232);for(var i=0;i<232>>2;++i)GROWABLE_HEAP_U32()[(threadInfoStruct>>2)+i]=0;GROWABLE_HEAP_I32()[pthread_ptr>>2]=threadInfoStruct;GROWABLE_HEAP_I32()[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+156;GROWABLE_HEAP_I32()[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,schedPolicy:schedPolicy,schedPrio:schedPrio,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,parent_pthread_ptr:_pthread_self(),arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);}else{__spawn_thread(threadParams);}return 0}function _roundf(d){d=+d;return d>=+0?+Math_floor(d+ +.5):+Math_ceil(d-+.5)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();else PThread.initWorker();var GLctx;GL.init();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_fd_close,_fd_seek,_fd_write];var asmLibraryArg={"__assert_fail":___assert_fail,"__handle_stack_overflow":___handle_stack_overflow,"_emscripten_notify_thread_queue":__emscripten_notify_thread_queue,"abort":_abort,"emscripten_conditional_set_current_thread_status":_emscripten_conditional_set_current_thread_status,"emscripten_futex_wait":_emscripten_futex_wait,"emscripten_futex_wake":_emscripten_futex_wake,"emscripten_get_now":_emscripten_get_now,"emscripten_is_main_browser_thread":_emscripten_is_main_browser_thread,"emscripten_is_main_runtime_thread":_emscripten_is_main_runtime_thread,"emscripten_memcpy_big":_emscripten_memcpy_big,"emscripten_receive_on_main_thread_js":_emscripten_receive_on_main_thread_js,"emscripten_resize_heap":_emscripten_resize_heap,"emscripten_set_canvas_element_size":_emscripten_set_canvas_element_size,"emscripten_set_current_thread_status":_emscripten_set_current_thread_status,"emscripten_webgl_create_context":_emscripten_webgl_create_context,"fd_close":_fd_close,"fd_seek":_fd_seek,"fd_write":_fd_write,"initPthreadsJS":initPthreadsJS,"memory":wasmMemory||Module["wasmMemory"],"pthread_cleanup_pop":_pthread_cleanup_pop,"pthread_cleanup_push":_pthread_cleanup_push,"pthread_create":_pthread_create,"pthread_self":_pthread_self,"roundf":_roundf,"table":wasmTable};var asm=createWasm();Module["asm"]=asm;var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__wasm_call_ctors"].apply(null,arguments)};var _init=Module["_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["init"].apply(null,arguments)};var _register_tensor=Module["_register_tensor"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["register_tensor"].apply(null,arguments)};var _dispose_data=Module["_dispose_data"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose_data"].apply(null,arguments)};var _dispose=Module["_dispose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose"].apply(null,arguments)};var _Abs=Module["_Abs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Abs"].apply(null,arguments)};var _Add=Module["_Add"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Add"].apply(null,arguments)};var _AddN=Module["_AddN"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AddN"].apply(null,arguments)};var _ArgMax=Module["_ArgMax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ArgMax"].apply(null,arguments)};var _AvgPool=Module["_AvgPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AvgPool"].apply(null,arguments)};var _BatchMatMul=Module["_BatchMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["BatchMatMul"].apply(null,arguments)};var _ClipByValue=Module["_ClipByValue"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ClipByValue"].apply(null,arguments)};var _Conv2D=Module["_Conv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Conv2D"].apply(null,arguments)};var _Cos=Module["_Cos"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Cos"].apply(null,arguments)};var _CropAndResize=Module["_CropAndResize"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["CropAndResize"].apply(null,arguments)};var _DepthwiseConv2dNative=Module["_DepthwiseConv2dNative"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["DepthwiseConv2dNative"].apply(null,arguments)};var _Div=Module["_Div"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Div"].apply(null,arguments)};var _Exp=Module["_Exp"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Exp"].apply(null,arguments)};var _FloorDiv=Module["_FloorDiv"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FloorDiv"].apply(null,arguments)};var _FusedBatchNorm=Module["_FusedBatchNorm"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedBatchNorm"].apply(null,arguments)};var _FusedConv2D=Module["_FusedConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedConv2D"].apply(null,arguments)};var _FusedDepthwiseConv2D=Module["_FusedDepthwiseConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedDepthwiseConv2D"].apply(null,arguments)};var _Gather=Module["_Gather"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Gather"].apply(null,arguments)};var _GatherNd=Module["_GatherNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GatherNd"].apply(null,arguments)};var _Greater=Module["_Greater"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Greater"].apply(null,arguments)};var _GreaterEqual=Module["_GreaterEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GreaterEqual"].apply(null,arguments)};var _Less=Module["_Less"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Less"].apply(null,arguments)};var _LessEqual=Module["_LessEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LessEqual"].apply(null,arguments)};var _Log=Module["_Log"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Log"].apply(null,arguments)};var _LogicalAnd=Module["_LogicalAnd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LogicalAnd"].apply(null,arguments)};var _Max=Module["_Max"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Max"].apply(null,arguments)};var _MaxPool=Module["_MaxPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["MaxPool"].apply(null,arguments)};var _Maximum=Module["_Maximum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Maximum"].apply(null,arguments)};var _Min=Module["_Min"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Min"].apply(null,arguments)};var _Minimum=Module["_Minimum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Minimum"].apply(null,arguments)};var _Mul=Module["_Mul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Mul"].apply(null,arguments)};var _Neg=Module["_Neg"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Neg"].apply(null,arguments)};var _NonMaxSuppressionV3=Module["_NonMaxSuppressionV3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV3"].apply(null,arguments)};var _NonMaxSuppressionV5=Module["_NonMaxSuppressionV5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV5"].apply(null,arguments)};var _NotEqual=Module["_NotEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NotEqual"].apply(null,arguments)};var _PadV2=Module["_PadV2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["PadV2"].apply(null,arguments)};var _Pow=Module["_Pow"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Pow"].apply(null,arguments)};var _Prelu=Module["_Prelu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Prelu"].apply(null,arguments)};var _Relu=Module["_Relu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu"].apply(null,arguments)};var _Relu6=Module["_Relu6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu6"].apply(null,arguments)};var _ResizeBilinear=Module["_ResizeBilinear"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ResizeBilinear"].apply(null,arguments)};var _Rsqrt=Module["_Rsqrt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Rsqrt"].apply(null,arguments)};var _ScatterNd=Module["_ScatterNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ScatterNd"].apply(null,arguments)};var _Sigmoid=Module["_Sigmoid"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sigmoid"].apply(null,arguments)};var _Sin=Module["_Sin"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sin"].apply(null,arguments)};var _Softmax=Module["_Softmax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Softmax"].apply(null,arguments)};var _Square=Module["_Square"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Square"].apply(null,arguments)};var _Sub=Module["_Sub"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sub"].apply(null,arguments)};var _Sum=Module["_Sum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sum"].apply(null,arguments)};var _Tanh=Module["_Tanh"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tanh"].apply(null,arguments)};var _Tile=Module["_Tile"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tile"].apply(null,arguments)};var _Transpose=Module["_Transpose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Transpose"].apply(null,arguments)};var __FusedMatMul=Module["__FusedMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_FusedMatMul"].apply(null,arguments)};var _malloc=Module["_malloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["malloc"].apply(null,arguments)};var _free=Module["_free"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["free"].apply(null,arguments)};var ___em_js__initPthreadsJS=Module["___em_js__initPthreadsJS"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__em_js__initPthreadsJS"].apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_get_global_libc"].apply(null,arguments)};var _memalign=Module["_memalign"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["memalign"].apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__pthread_tsd_run_dtors"].apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null,arguments)};var _emscripten_main_browser_thread_id=Module["_emscripten_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_browser_thread_id"].apply(null,arguments)};var _emscripten_async_run_in_main_thread=Module["_emscripten_async_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread=Module["_emscripten_sync_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_0=Module["_emscripten_sync_run_in_main_thread_0"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_1=Module["_emscripten_sync_run_in_main_thread_1"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_2=Module["_emscripten_sync_run_in_main_thread_2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_xprintf_varargs=Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_3=Module["_emscripten_sync_run_in_main_thread_3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_5=Module["_emscripten_sync_run_in_main_thread_5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_6=Module["_emscripten_sync_run_in_main_thread_6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_7=Module["_emscripten_sync_run_in_main_thread_7"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null,arguments)};var _emscripten_async_queue_on_thread_=Module["_emscripten_async_queue_on_thread_"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_tls_init"].apply(null,arguments)};var ___set_stack_limit=Module["___set_stack_limit"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__set_stack_limit"].apply(null,arguments)};var stackSave=Module["stackSave"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackSave"].apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackAlloc"].apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackRestore"].apply(null,arguments)};var dynCall_vi=Module["dynCall_vi"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_vi"].apply(null,arguments)};var dynCall_v=Module["dynCall_v"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_v"].apply(null,arguments)};var dynCall_ii=Module["dynCall_ii"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_ii"].apply(null,arguments)};Module["asm"]=asm;if(!Object.getOwnPropertyDescriptor(Module,"intArrayFromString"))Module["intArrayFromString"]=function(){abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"intArrayToString"))Module["intArrayToString"]=function(){abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"ccall"))Module["ccall"]=function(){abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};Module["cwrap"]=cwrap;if(!Object.getOwnPropertyDescriptor(Module,"setValue"))Module["setValue"]=function(){abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getValue"))Module["getValue"]=function(){abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"allocate"))Module["allocate"]=function(){abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getMemory"))Module["getMemory"]=function(){abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ArrayToString"))Module["UTF8ArrayToString"]=function(){abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ToString"))Module["UTF8ToString"]=function(){abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8Array"))Module["stringToUTF8Array"]=function(){abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8"))Module["stringToUTF8"]=function(){abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF8"))Module["lengthBytesUTF8"]=function(){abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreRun"))Module["addOnPreRun"]=function(){abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"addOnInit"))Module["addOnInit"]=function(){abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreMain"))Module["addOnPreMain"]=function(){abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"addOnExit"))Module["addOnExit"]=function(){abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"addOnPostRun"))Module["addOnPostRun"]=function(){abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeStringToMemory"))Module["writeStringToMemory"]=function(){abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeArrayToMemory"))Module["writeArrayToMemory"]=function(){abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeAsciiToMemory"))Module["writeAsciiToMemory"]=function(){abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"addRunDependency"))Module["addRunDependency"]=function(){abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"removeRunDependency"))Module["removeRunDependency"]=function(){abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"FS_createFolder"))Module["FS_createFolder"]=function(){abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPath"))Module["FS_createPath"]=function(){abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDataFile"))Module["FS_createDataFile"]=function(){abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPreloadedFile"))Module["FS_createPreloadedFile"]=function(){abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLazyFile"))Module["FS_createLazyFile"]=function(){abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLink"))Module["FS_createLink"]=function(){abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDevice"))Module["FS_createDevice"]=function(){abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"FS_unlink"))Module["FS_unlink"]=function(){abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"dynamicAlloc"))Module["dynamicAlloc"]=function(){abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"loadDynamicLibrary"))Module["loadDynamicLibrary"]=function(){abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"loadWebAssemblyModule"))Module["loadWebAssemblyModule"]=function(){abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getLEB"))Module["getLEB"]=function(){abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getFunctionTables"))Module["getFunctionTables"]=function(){abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"alignFunctionTables"))Module["alignFunctionTables"]=function(){abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registerFunctions"))Module["registerFunctions"]=function(){abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"addFunction"))Module["addFunction"]=function(){abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"removeFunction"))Module["removeFunction"]=function(){abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getFuncWrapper"))Module["getFuncWrapper"]=function(){abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"prettyPrint"))Module["prettyPrint"]=function(){abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"makeBigInt"))Module["makeBigInt"]=function(){abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"dynCall"))Module["dynCall"]=function(){abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getCompilerSetting"))Module["getCompilerSetting"]=function(){abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"print"))Module["print"]=function(){abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"printErr"))Module["printErr"]=function(){abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getTempRet0"))Module["getTempRet0"]=function(){abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"setTempRet0"))Module["setTempRet0"]=function(){abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"callMain"))Module["callMain"]=function(){abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"abort"))Module["abort"]=function(){abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stringToNewUTF8"))Module["stringToNewUTF8"]=function(){abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"emscripten_realloc_buffer"))Module["emscripten_realloc_buffer"]=function(){abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"ENV"))Module["ENV"]=function(){abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"setjmpId"))Module["setjmpId"]=function(){abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_CODES"))Module["ERRNO_CODES"]=function(){abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_MESSAGES"))Module["ERRNO_MESSAGES"]=function(){abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"setErrNo"))Module["setErrNo"]=function(){abort("'setErrNo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"DNS"))Module["DNS"]=function(){abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"GAI_ERRNO_MESSAGES"))Module["GAI_ERRNO_MESSAGES"]=function(){abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"Protocols"))Module["Protocols"]=function(){abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"Sockets"))Module["Sockets"]=function(){abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"UNWIND_CACHE"))Module["UNWIND_CACHE"]=function(){abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"readAsmConstArgs"))Module["readAsmConstArgs"]=function(){abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_q"))Module["jstoi_q"]=function(){abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_s"))Module["jstoi_s"]=function(){abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"PATH"))Module["PATH"]=function(){abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"PATH_FS"))Module["PATH_FS"]=function(){abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"SYSCALLS"))Module["SYSCALLS"]=function(){abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"syscallMmap2"))Module["syscallMmap2"]=function(){abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"syscallMunmap"))Module["syscallMunmap"]=function(){abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"flush_NO_FILESYSTEM"))Module["flush_NO_FILESYSTEM"]=function(){abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"JSEvents"))Module["JSEvents"]=function(){abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"demangle"))Module["demangle"]=function(){abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"demangleAll"))Module["demangleAll"]=function(){abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"jsStackTrace"))Module["jsStackTrace"]=function(){abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getEnvStrings"))Module["getEnvStrings"]=function(){abort("'getEnvStrings' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64"))Module["writeI53ToI64"]=function(){abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Clamped"))Module["writeI53ToI64Clamped"]=function(){abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Signaling"))Module["writeI53ToI64Signaling"]=function(){abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Clamped"))Module["writeI53ToU64Clamped"]=function(){abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Signaling"))Module["writeI53ToU64Signaling"]=function(){abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromI64"))Module["readI53FromI64"]=function(){abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromU64"))Module["readI53FromU64"]=function(){abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"convertI32PairToI53"))Module["convertI32PairToI53"]=function(){abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"convertU32PairToI53"))Module["convertU32PairToI53"]=function(){abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"Browser"))Module["Browser"]=function(){abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"GL"))Module["GL"]=function(){abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGet"))Module["emscriptenWebGLGet"]=function(){abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetTexPixelData"))Module["emscriptenWebGLGetTexPixelData"]=function(){abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetUniform"))Module["emscriptenWebGLGetUniform"]=function(){abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetVertexAttrib"))Module["emscriptenWebGLGetVertexAttrib"]=function(){abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"AL"))Module["AL"]=function(){abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"SDL_unicode"))Module["SDL_unicode"]=function(){abort("'SDL_unicode' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"SDL_ttfContext"))Module["SDL_ttfContext"]=function(){abort("'SDL_ttfContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"SDL_audio"))Module["SDL_audio"]=function(){abort("'SDL_audio' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"SDL"))Module["SDL"]=function(){abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"SDL_gfx"))Module["SDL_gfx"]=function(){abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"GLUT"))Module["GLUT"]=function(){abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"EGL"))Module["EGL"]=function(){abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"GLFW_Window"))Module["GLFW_Window"]=function(){abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"GLFW"))Module["GLFW"]=function(){abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"GLEW"))Module["GLEW"]=function(){abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"IDBStore"))Module["IDBStore"]=function(){abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"runAndAbortIfError"))Module["runAndAbortIfError"]=function(){abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};Module["PThread"]=PThread;if(!Object.getOwnPropertyDescriptor(Module,"establishStackSpace"))Module["establishStackSpace"]=function(){abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getNoExitRuntime"))Module["getNoExitRuntime"]=function(){abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"resetPrototype"))Module["resetPrototype"]=function(){abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"warnOnce"))Module["warnOnce"]=function(){abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stackSave"))Module["stackSave"]=function(){abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stackRestore"))Module["stackRestore"]=function(){abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stackAlloc"))Module["stackAlloc"]=function(){abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"AsciiToString"))Module["AsciiToString"]=function(){abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stringToAscii"))Module["stringToAscii"]=function(){abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"UTF16ToString"))Module["UTF16ToString"]=function(){abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF16"))Module["stringToUTF16"]=function(){abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF16"))Module["lengthBytesUTF16"]=function(){abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"UTF32ToString"))Module["UTF32ToString"]=function(){abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF32"))Module["stringToUTF32"]=function(){abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF32"))Module["lengthBytesUTF32"]=function(){abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8"))Module["allocateUTF8"]=function(){abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8OnStack"))Module["allocateUTF8OnStack"]=function(){abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};Module["writeStackCookie"]=writeStackCookie;Module["checkStackCookie"]=checkStackCookie;Module["abortStackOverflow"]=abortStackOverflow;Module["PThread"]=PThread;Module["_pthread_self"]=_pthread_self;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NORMAL"))Object.defineProperty(Module,"ALLOC_NORMAL",{configurable:true,get:function(){abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_STACK"))Object.defineProperty(Module,"ALLOC_STACK",{configurable:true,get:function(){abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_DYNAMIC"))Object.defineProperty(Module,"ALLOC_DYNAMIC",{configurable:true,get:function(){abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NONE"))Object.defineProperty(Module,"ALLOC_NONE",{configurable:true,get:function(){abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");}});var calledRun;Module["then"]=function(func){if(calledRun){func(Module);}else{var old=Module["onRuntimeInitialized"];Module["onRuntimeInitialized"]=function(){if(old)old();func(Module);};}return Module};function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status;}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller;};function run(args){if(runDependencies>0){return}writeStackCookie();preRun();if(runDependencies>0)return;function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();assert(!Module["_main"],'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');postRun();}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("");},1);doRun();},1);}else{doRun();}checkStackCookie();}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()();}}if(!ENVIRONMENT_IS_PTHREAD)noExitRuntime=true;if(!ENVIRONMENT_IS_PTHREAD)run(); + + + return WasmBackendModule + } + ); + })(); + module.exports = WasmBackendModule; + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + var _this = undefined; + var WASM_PRIORITY = 2; + var BackendWasm = /** @class */ (function (_super) { + __extends(BackendWasm, _super); + function BackendWasm(wasm) { + var _this = _super.call(this) || this; + _this.wasm = wasm; + // 0 is reserved for null data ids. + _this.dataIdNextNumber = 1; + _this.wasm.tfjs.init(); + _this.dataIdMap = new tfjsCore.DataStorage(_this, tfjsCore.engine()); + return _this; + } + BackendWasm.prototype.write = function (values, shape, dtype) { + var dataId = {}; + this.move(dataId, values, shape, dtype); + return dataId; + }; + BackendWasm.prototype.numDataIds = function () { + return this.dataIdMap.numDataIds(); + }; + BackendWasm.prototype.time = function (f) { + return __awaiter(this, void 0, void 0, function () { + var start, kernelMs; + return __generator(this, function (_a) { + start = tfjsCore.util.now(); + f(); + kernelMs = tfjsCore.util.now() - start; + return [2 /*return*/, { kernelMs: kernelMs }]; + }); + }); + }; + BackendWasm.prototype.move = function (dataId, values, shape, dtype) { + var id = this.dataIdNextNumber++; + if (dtype === 'string') { + var stringBytes = values; + this.dataIdMap.set(dataId, { id: id, stringBytes: stringBytes, shape: shape, dtype: dtype, memoryOffset: null }); + return; + } + var size = tfjsCore.util.sizeFromShape(shape); + var numBytes = size * tfjsCore.util.bytesPerElement(dtype); + var memoryOffset = this.wasm._malloc(numBytes); + this.dataIdMap.set(dataId, { id: id, memoryOffset: memoryOffset, shape: shape, dtype: dtype }); + this.wasm.tfjs.registerTensor(id, size, memoryOffset); + if (values != null) { + this.wasm.HEAPU8.set(new Uint8Array(values.buffer, 0, numBytes), memoryOffset); + } + }; + BackendWasm.prototype.read = function (dataId) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, this.readSync(dataId)]; + }); + }); + }; + BackendWasm.prototype.readSync = function (dataId) { + var _a = this.dataIdMap.get(dataId), memoryOffset = _a.memoryOffset, dtype = _a.dtype, shape = _a.shape, stringBytes = _a.stringBytes; + if (dtype === 'string') { + return stringBytes; + } + var bytes = this.wasm.HEAPU8.slice(memoryOffset, memoryOffset + tfjsCore.util.sizeFromShape(shape) * tfjsCore.util.bytesPerElement(dtype)); + return typedArrayFromBuffer(bytes.buffer, dtype); + }; + BackendWasm.prototype.disposeData = function (dataId) { + var data = this.dataIdMap.get(dataId); + this.wasm._free(data.memoryOffset); + this.wasm.tfjs.disposeData(data.id); + this.dataIdMap.delete(dataId); + }; + BackendWasm.prototype.floatPrecision = function () { + return 32; + }; + // Returns the memory offset of a tensor. Useful for debugging and unit + // testing. + BackendWasm.prototype.getMemoryOffset = function (dataId) { + return this.dataIdMap.get(dataId).memoryOffset; + }; + BackendWasm.prototype.dispose = function () { + this.wasm.tfjs.dispose(); + this.wasm = null; + }; + BackendWasm.prototype.memory = function () { + return { unreliable: false }; + }; + /** + * Make a tensor info for the output of an op. If `memoryOffset` is not + * present, this method allocates memory on the WASM heap. If `memoryOffset` + * is present, the memory was allocated elsewhere (in c++) and we just record + * the pointer where that memory lives. + */ + BackendWasm.prototype.makeOutput = function (shape, dtype, memoryOffset) { + var dataId; + if (memoryOffset == null) { + dataId = this.write(null /* values */, shape, dtype); + } + else { + dataId = {}; + var id = this.dataIdNextNumber++; + this.dataIdMap.set(dataId, { id: id, memoryOffset: memoryOffset, shape: shape, dtype: dtype }); + var size = tfjsCore.util.sizeFromShape(shape); + this.wasm.tfjs.registerTensor(id, size, memoryOffset); + } + return { dataId: dataId, shape: shape, dtype: dtype }; + }; + BackendWasm.prototype.typedArrayFromHeap = function (_a) { + var shape = _a.shape, dtype = _a.dtype, dataId = _a.dataId; + var buffer = this.wasm.HEAPU8.buffer; + var memoryOffset = this.dataIdMap.get(dataId).memoryOffset; + var size = tfjsCore.util.sizeFromShape(shape); + switch (dtype) { + case 'float32': + return new Float32Array(buffer, memoryOffset, size); + case 'int32': + return new Int32Array(buffer, memoryOffset, size); + case 'bool': + return new Uint8Array(buffer, memoryOffset, size); + default: + throw new Error("Uknown dtype " + dtype); + } + }; + return BackendWasm; + }(tfjsCore.KernelBackend)); + tfjsCore.registerBackend('wasm', function () { return __awaiter(_this, void 0, void 0, function () { + var wasm; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, init()]; + case 1: + wasm = (_a.sent()).wasm; + return [2 /*return*/, new BackendWasm(wasm)]; + } + }); + }); }, WASM_PRIORITY); + function createInstantiateWasmFunc(path) { + // tslint:disable-next-line:no-any + return function (imports, callback) { + tfjsCore.util.fetch(path, { credentials: 'same-origin' }).then(function (response) { + if (!response['ok']) { + imports.env.a("failed to load wasm binary file at '" + path + "'"); + } + response.arrayBuffer().then(function (binary) { + WebAssembly.instantiate(binary, imports).then(function (output) { + callback(output.instance); + }); + }); + }); + return {}; + }; + } + /** + * Initializes the wasm module and creates the js <--> wasm bridge. + * + * NOTE: We wrap the wasm module in a object with property 'wasm' instead of + * returning Promise to avoid freezing Chrome (last tested + * in Chrome 76). + */ + function init() { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, new Promise(function (resolve, reject) { + var factoryConfig = {}; + if (wasmPath != null) { + factoryConfig.locateFile = function (path, prefix) { + if (path.endsWith('.wasm')) { + return wasmPath; + } + return prefix + path; + }; + // use wasm instantiateWasm override when system fetch is not available. + // For detail references + // https://github.com/emscripten-core/emscripten/blob/2bca083cbbd5a4133db61fbd74d04f7feecfa907/tests/manual_wasm_instantiate.html#L170 + if (customFetch) { + factoryConfig.instantiateWasm = createInstantiateWasmFunc(wasmPath); + } + } + var wasm = tfjsBackendWasm(factoryConfig); + var voidReturnType = null; + // Using the tfjs namespace to avoid conflict with emscripten's API. + wasm.tfjs = { + init: wasm.cwrap('init', null, []), + registerTensor: wasm.cwrap('register_tensor', null, [ + 'number', + 'number', + 'number', + ]), + disposeData: wasm.cwrap('dispose_data', voidReturnType, ['number']), + dispose: wasm.cwrap('dispose', voidReturnType, []), + }; + var initialized = false; + wasm.onRuntimeInitialized = function () { + initialized = true; + initAborted = false; + resolve({ wasm: wasm }); + }; + wasm.onAbort = function () { + if (initialized) { + // Emscripten already called console.warn so no need to double log. + return; + } + if (initAborted) { + // Emscripten calls `onAbort` twice, resulting in double error + // messages. + return; + } + initAborted = true; + var rejectMsg = 'Make sure the server can serve the `.wasm` file relative to the ' + + 'bundled js file. For more details see https://github.com/tensorflow/tfjs/blob/master/tfjs-backend-wasm/README.md#using-bundlers'; + reject({ message: rejectMsg }); + }; + })]; + }); + }); + } + function typedArrayFromBuffer(buffer, dtype) { + switch (dtype) { + case 'float32': + return new Float32Array(buffer); + case 'int32': + return new Int32Array(buffer); + case 'bool': + return new Uint8Array(buffer); + default: + throw new Error("Unknown dtype " + dtype); + } + } + var wasmPath = null; + var initAborted = false; + var customFetch = false; + /** + * Sets the path to the `.wasm` file which will be fetched when the wasm + * backend is initialized. See + * https://github.com/tensorflow/tfjs/blob/master/tfjs-backend-wasm/README.md#using-bundlers + * for more details. + * @param path wasm file path or url + * @param usePlatformFetch optional boolean to use platform fetch to download + * the wasm file, default to false. + */ + /** @doc {heading: 'Environment', namespace: 'wasm'} */ + function setWasmPath(path, usePlatformFetch) { + if (usePlatformFetch === void 0) { usePlatformFetch = false; } + if (initAborted) { + throw new Error('The WASM backend was already initialized. Make sure you call ' + + '`setWasmPath()` before you call `tf.setBackend()` or `tf.ready()`'); + } + wasmPath = path; + customFetch = usePlatformFetch; + } + + /** @license See the LICENSE file. */ + // This code is auto-generated, do not modify this file! + var version = '0.0.0'; + + exports.BackendWasm = BackendWasm; + exports.setWasmPath = setWasmPath; + exports.version_wasm = version; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=tf-backend-wasm.js.map diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.wasm b/tfjs-core/benchmarks/tfjs-backend-wasm.wasm new file mode 100644 index 0000000000000000000000000000000000000000..6b02bba45fd27c6770060a736485313cc607dd1c GIT binary patch literal 153337 zcmeFa3!Gk6dGEj0-tTqZ_nmns_hbUu?$2M!nn9Y{%QL&NRjo|5fbw|!arcJ9^XB@fUK>+S(V2fu}x+isiNIqDYJ z2M!#tyIWNgchPP7^|#WG=++s3>-PTnO$^RW;K^-Yeo|UU=s~Ao>eO{W?HX7!N{?m? z(2xQ?1h2g>=J`DDBfXA8u~2%>NC0)G`p`HjOHYC;$96shJdsPNGBiLsxAGj{7Eoa? zX;FFN84znt@ z+tl=q>&Lh4xp`#rhKW6|aV5R2@14GBa%9KOZBru?H@E>M6?eRP&*XG?-PpEm$JErw z1c8pHAvfeKp*)?_jS(SwR^|jshjpp zZ`(ULa`WiOYo1%VVdu8jOpZ>ExQ4Q??Wt#qdamC;IXSX>I&VwZnBG6-yt1zE$$I^s z-8)C8NB8XBF#%E*D&|ydNgH|BPmJu?y?^hvz5Azba`tLjPmPl!Q=>mUvhAjk9eZ8n zG_YSkv1e*z!5n3JH#IUc?iQ)({?Xl|(^m(yO}+G*Fj~DMvukA6^?P5t?bV|u!nA$cnF|tcYRS!c$YkD%i zX5`g3PHem0s@Vo&A(rVtC~LO$WZS)Gdh~|Zwg+b4{*nDTIh~4RCim~29^ExEhh!Fa zAZ`!Dp1omYOWjD4x$Dy68hdGIAKu2$p9+G5!?E^=iT_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Dk|+drJ|}Db5xUfIkvK-0yDi` ztIn&cE}qnNV#(QEE2_`I-6F!3g_Y+O*y}E1rSAEH!m9J&i=8~BcuH{r3oj@yD=_a# zbz$ZBVoZnWSEOvpqyl7Ab?ojOd6aX^(1Mdj95dpW0R_jNQqVti{P6`tLn8}9Cl5L$ z`s0;T$_h%#3MLie58!IF-hQrNLY3ef14j(&UvSEhK?TD`*b97O#L#1g4L_ybs5 j2;v^lJM3a0C}sNh*MG{91yfg!Y!`cvf*SRovc~@hm!x-Q literal 0 HcmV?d00001 diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js b/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js new file mode 100644 index 00000000000..5fa28b8b535 --- /dev/null +++ b/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js @@ -0,0 +1,154 @@ +var threadInfoStruct = 0; +var selfThreadId = 0; +var parentThreadId = 0; +var Module = {}; + +function assert(condition, text) { + if (!condition) abort("Assertion failed: " + text) +} + +function threadPrintErr() { + var text = Array.prototype.slice.call(arguments).join(" "); + console.error(text) +} + +function threadAlert() { + var text = Array.prototype.slice.call(arguments).join(" "); + postMessage({ + cmd: "alert", + text: text, + threadId: selfThreadId + }) +} +var out = function () { + throw "out() is not defined in worker.js." +}; +var err = threadPrintErr; +this.alert = threadAlert; +Module["instantiateWasm"] = function (info, receiveInstance) { + var instance = new WebAssembly.Instance(Module["wasmModule"], info); + Module["wasmModule"] = null; + receiveInstance(instance); + return instance.exports +}; +this.onmessage = function (e) { + try { + if (e.data.cmd === "load") { + Module["DYNAMIC_BASE"] = e.data.DYNAMIC_BASE; + Module["DYNAMICTOP_PTR"] = e.data.DYNAMICTOP_PTR; + Module["wasmModule"] = e.data.wasmModule; + Module["wasmMemory"] = e.data.wasmMemory; + Module["buffer"] = Module["wasmMemory"].buffer; + Module["ENVIRONMENT_IS_PTHREAD"] = true; + console.log("URL IN WORKER"); + console.log(e.data.urlOrBlob); + if (typeof e.data.urlOrBlob === "string") { + importScripts(e.data.urlOrBlob) + } else { + var objectUrl = URL.createObjectURL(e.data.urlOrBlob); + importScripts(objectUrl); + URL.revokeObjectURL(objectUrl) + } + Module = WasmBackendModule(Module); + postMessage({ + "cmd": "loaded" + }) + } else if (e.data.cmd === "objectTransfer") { + Module["PThread"].receiveObjectTransfer(e.data) + } else if (e.data.cmd === "run") { + Module["__performance_now_clock_drift"] = performance.now() - e.data.time; + threadInfoStruct = e.data.threadInfoStruct; + Module["__register_pthread_ptr"](threadInfoStruct, 0, 0); + selfThreadId = e.data.selfThreadId; + parentThreadId = e.data.parentThreadId; + var max = e.data.stackBase; + var top = e.data.stackBase + e.data.stackSize; + assert(threadInfoStruct); + assert(selfThreadId); + assert(parentThreadId); + assert(top != 0); + assert(max != 0); + assert(top > max); + Module["establishStackSpace"](top, max); + Module["_emscripten_tls_init"](); + Module["writeStackCookie"](); + Module["PThread"].receiveObjectTransfer(e.data); + Module["PThread"].setThreadStatus(Module["_pthread_self"](), 1); + try { + var result = Module["dynCall_ii"](e.data.start_routine, e.data.arg); + Module["checkStackCookie"](); + if (!Module["getNoExitRuntime"]()) Module["PThread"].threadExit(result) + } catch (ex) { + if (ex === "Canceled!") { + Module["PThread"].threadCancel() + } else if (ex != "unwind") { + Atomics.store(Module["HEAPU32"], threadInfoStruct + 4 >> 2, ex instanceof Module["ExitStatus"] ? ex.status : -2); + Atomics.store(Module["HEAPU32"], threadInfoStruct + 0 >> 2, 1); + if (typeof Module["_emscripten_futex_wake"] !== "function") { + err("Thread Initialisation failed."); + throw ex + } + Module["_emscripten_futex_wake"](threadInfoStruct + 0, 2147483647); + if (!(ex instanceof Module["ExitStatus"])) throw ex + } else { + err("Pthread 0x" + threadInfoStruct.toString(16) + " completed its pthread main entry point with an unwind, keeping the pthread worker alive for asynchronous operation.") + } + } + } else if (e.data.cmd === "cancel") { + if (threadInfoStruct) { + Module["PThread"].threadCancel() + } + } else if (e.data.target === "setimmediate") {} else if (e.data.cmd === "processThreadQueue") { + if (threadInfoStruct) { + Module["_emscripten_current_thread_process_queued_calls"]() + } + } else { + err("worker.js received unknown command " + e.data.cmd); + err(e.data) + } + } catch (ex) { + err("worker.js onmessage() captured an uncaught exception: " + ex); + console.log("in response to", e.data.cmd); + if (ex.stack) err(ex.stack); + throw ex + } +}; +if (typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string") { + self = { + location: { + href: __filename + } + }; + var onmessage = this.onmessage; + var nodeWorkerThreads = require("worker_threads"); + Worker = nodeWorkerThreads.Worker; + var parentPort = nodeWorkerThreads.parentPort; + parentPort.on("message", function (data) { + onmessage({ + data: data + }) + }); + var nodeFS = require("fs"); + var nodeRead = function (filename) { + return nodeFS.readFileSync(filename, "utf8") + }; + + function globalEval(x) { + global.require = require; + global.Module = Module; + eval.call(null, x) + } + importScripts = function (f) { + globalEval(nodeRead(f)) + }; + postMessage = function (msg) { + parentPort.postMessage(msg) + }; + if (typeof performance === "undefined") { + performance = { + now: function () { + return Date.now() + } + } + } +} From 132f2049ef4d6d7766f9a0e0c3b0435a25a062d9 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Fri, 24 Apr 2020 15:21:12 -0400 Subject: [PATCH 51/85] update build --- .../benchmarks/tfjs-backend-wasm.worker.js | 155 +----------------- 1 file changed, 1 insertion(+), 154 deletions(-) diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js b/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js index 5fa28b8b535..255cb67140c 100644 --- a/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js +++ b/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js @@ -1,154 +1 @@ -var threadInfoStruct = 0; -var selfThreadId = 0; -var parentThreadId = 0; -var Module = {}; - -function assert(condition, text) { - if (!condition) abort("Assertion failed: " + text) -} - -function threadPrintErr() { - var text = Array.prototype.slice.call(arguments).join(" "); - console.error(text) -} - -function threadAlert() { - var text = Array.prototype.slice.call(arguments).join(" "); - postMessage({ - cmd: "alert", - text: text, - threadId: selfThreadId - }) -} -var out = function () { - throw "out() is not defined in worker.js." -}; -var err = threadPrintErr; -this.alert = threadAlert; -Module["instantiateWasm"] = function (info, receiveInstance) { - var instance = new WebAssembly.Instance(Module["wasmModule"], info); - Module["wasmModule"] = null; - receiveInstance(instance); - return instance.exports -}; -this.onmessage = function (e) { - try { - if (e.data.cmd === "load") { - Module["DYNAMIC_BASE"] = e.data.DYNAMIC_BASE; - Module["DYNAMICTOP_PTR"] = e.data.DYNAMICTOP_PTR; - Module["wasmModule"] = e.data.wasmModule; - Module["wasmMemory"] = e.data.wasmMemory; - Module["buffer"] = Module["wasmMemory"].buffer; - Module["ENVIRONMENT_IS_PTHREAD"] = true; - console.log("URL IN WORKER"); - console.log(e.data.urlOrBlob); - if (typeof e.data.urlOrBlob === "string") { - importScripts(e.data.urlOrBlob) - } else { - var objectUrl = URL.createObjectURL(e.data.urlOrBlob); - importScripts(objectUrl); - URL.revokeObjectURL(objectUrl) - } - Module = WasmBackendModule(Module); - postMessage({ - "cmd": "loaded" - }) - } else if (e.data.cmd === "objectTransfer") { - Module["PThread"].receiveObjectTransfer(e.data) - } else if (e.data.cmd === "run") { - Module["__performance_now_clock_drift"] = performance.now() - e.data.time; - threadInfoStruct = e.data.threadInfoStruct; - Module["__register_pthread_ptr"](threadInfoStruct, 0, 0); - selfThreadId = e.data.selfThreadId; - parentThreadId = e.data.parentThreadId; - var max = e.data.stackBase; - var top = e.data.stackBase + e.data.stackSize; - assert(threadInfoStruct); - assert(selfThreadId); - assert(parentThreadId); - assert(top != 0); - assert(max != 0); - assert(top > max); - Module["establishStackSpace"](top, max); - Module["_emscripten_tls_init"](); - Module["writeStackCookie"](); - Module["PThread"].receiveObjectTransfer(e.data); - Module["PThread"].setThreadStatus(Module["_pthread_self"](), 1); - try { - var result = Module["dynCall_ii"](e.data.start_routine, e.data.arg); - Module["checkStackCookie"](); - if (!Module["getNoExitRuntime"]()) Module["PThread"].threadExit(result) - } catch (ex) { - if (ex === "Canceled!") { - Module["PThread"].threadCancel() - } else if (ex != "unwind") { - Atomics.store(Module["HEAPU32"], threadInfoStruct + 4 >> 2, ex instanceof Module["ExitStatus"] ? ex.status : -2); - Atomics.store(Module["HEAPU32"], threadInfoStruct + 0 >> 2, 1); - if (typeof Module["_emscripten_futex_wake"] !== "function") { - err("Thread Initialisation failed."); - throw ex - } - Module["_emscripten_futex_wake"](threadInfoStruct + 0, 2147483647); - if (!(ex instanceof Module["ExitStatus"])) throw ex - } else { - err("Pthread 0x" + threadInfoStruct.toString(16) + " completed its pthread main entry point with an unwind, keeping the pthread worker alive for asynchronous operation.") - } - } - } else if (e.data.cmd === "cancel") { - if (threadInfoStruct) { - Module["PThread"].threadCancel() - } - } else if (e.data.target === "setimmediate") {} else if (e.data.cmd === "processThreadQueue") { - if (threadInfoStruct) { - Module["_emscripten_current_thread_process_queued_calls"]() - } - } else { - err("worker.js received unknown command " + e.data.cmd); - err(e.data) - } - } catch (ex) { - err("worker.js onmessage() captured an uncaught exception: " + ex); - console.log("in response to", e.data.cmd); - if (ex.stack) err(ex.stack); - throw ex - } -}; -if (typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string") { - self = { - location: { - href: __filename - } - }; - var onmessage = this.onmessage; - var nodeWorkerThreads = require("worker_threads"); - Worker = nodeWorkerThreads.Worker; - var parentPort = nodeWorkerThreads.parentPort; - parentPort.on("message", function (data) { - onmessage({ - data: data - }) - }); - var nodeFS = require("fs"); - var nodeRead = function (filename) { - return nodeFS.readFileSync(filename, "utf8") - }; - - function globalEval(x) { - global.require = require; - global.Module = Module; - eval.call(null, x) - } - importScripts = function (f) { - globalEval(nodeRead(f)) - }; - postMessage = function (msg) { - parentPort.postMessage(msg) - }; - if (typeof performance === "undefined") { - performance = { - now: function () { - return Date.now() - } - } - } -} +var threadInfoStruct=0;var selfThreadId=0;var parentThreadId=0;var Module={};function assert(condition,text){if(!condition)abort("Assertion failed: "+text)}function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:selfThreadId})}var out=function(){throw"out() is not defined in worker.js."};var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);Module["wasmModule"]=null;receiveInstance(instance);return instance.exports};this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["DYNAMIC_BASE"]=e.data.DYNAMIC_BASE;Module["DYNAMICTOP_PTR"]=e.data.DYNAMICTOP_PTR;Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}Module=WasmBackendModule(Module);postMessage({"cmd":"loaded"})}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;threadInfoStruct=e.data.threadInfoStruct;Module["__register_pthread_ptr"](threadInfoStruct,0,0);selfThreadId=e.data.selfThreadId;parentThreadId=e.data.parentThreadId;var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;assert(threadInfoStruct);assert(selfThreadId);assert(parentThreadId);assert(top!=0);assert(max!=0);assert(top>max);Module["establishStackSpace"](top,max);Module["_emscripten_tls_init"]();Module["writeStackCookie"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].setThreadStatus(Module["_pthread_self"](),1);try{var result=Module["dynCall_ii"](e.data.start_routine,e.data.arg);Module["checkStackCookie"]();if(!Module["getNoExitRuntime"]())Module["PThread"].threadExit(result)}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){Atomics.store(Module["HEAPU32"],threadInfoStruct+4>>2,ex instanceof Module["ExitStatus"]?ex.status:-2);Atomics.store(Module["HEAPU32"],threadInfoStruct+0>>2,1);if(typeof Module["_emscripten_futex_wake"]!=="function"){err("Thread Initialisation failed.");throw ex}Module["_emscripten_futex_wake"](threadInfoStruct+0,2147483647);if(!(ex instanceof Module["ExitStatus"]))throw ex}else{err("Pthread 0x"+threadInfoStruct.toString(16)+" completed its pthread main entry point with an unwind, keeping the pthread worker alive for asynchronous operation.")}}}else if(e.data.cmd==="cancel"){if(threadInfoStruct){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(threadInfoStruct){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} From 9b6ab354eb1809c098c411137d01a0599d28b219 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Fri, 24 Apr 2020 15:23:50 -0400 Subject: [PATCH 52/85] beautify --- tfjs-core/benchmarks/tf-backend-wasm.js | 6763 +++++++++++++---- .../benchmarks/tfjs-backend-wasm.worker.js | 152 +- 2 files changed, 5309 insertions(+), 1606 deletions(-) diff --git a/tfjs-core/benchmarks/tf-backend-wasm.js b/tfjs-core/benchmarks/tf-backend-wasm.js index a31566392da..37128de6fe3 100644 --- a/tfjs-core/benchmarks/tf-backend-wasm.js +++ b/tfjs-core/benchmarks/tf-backend-wasm.js @@ -1,30 +1,31 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tensorflow/tfjs-core'), require('path'), require('fs'), require('worker_threads'), require('perf_hooks')) : - typeof define === 'function' && define.amd ? define(['exports', '@tensorflow/tfjs-core', 'path', 'fs', 'worker_threads', 'perf_hooks'], factory) : - (global = global || self, factory((global.tf = global.tf || {}, global.tf.wasm = global.tf.wasm || {}), global.tf, global.path, global.fs, global.worker_threads, global.perf_hooks)); -}(this, (function (exports, tfjsCore, path, fs, worker_threads, perf_hooks) { 'use strict'; - - path = path && path.hasOwnProperty('default') ? path['default'] : path; - fs = fs && fs.hasOwnProperty('default') ? fs['default'] : fs; - worker_threads = worker_threads && worker_threads.hasOwnProperty('default') ? worker_threads['default'] : worker_threads; - perf_hooks = perf_hooks && perf_hooks.hasOwnProperty('default') ? perf_hooks['default'] : perf_hooks; - +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tensorflow/tfjs-core'), require('path'), require('fs'), require('worker_threads'), require('perf_hooks')) : + typeof define === 'function' && define.amd ? define(['exports', '@tensorflow/tfjs-core', 'path', 'fs', 'worker_threads', 'perf_hooks'], factory) : + (global = global || self, factory((global.tf = global.tf || {}, global.tf.wasm = global.tf.wasm || {}), global.tf, global.path, global.fs, global.worker_threads, global.perf_hooks)); +}(this, (function (exports, tfjsCore, path, fs, worker_threads, perf_hooks) { + 'use strict'; + + path = path && path.hasOwnProperty('default') ? path['default'] : path; + fs = fs && fs.hasOwnProperty('default') ? fs['default'] : fs; + worker_threads = worker_threads && worker_threads.hasOwnProperty('default') ? worker_threads['default'] : worker_threads; + perf_hooks = perf_hooks && perf_hooks.hasOwnProperty('default') ? perf_hooks['default'] : perf_hooks; + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -44,21 +45,21 @@ // This enum must align with the enum defined in cc/backend.h. var CppDType; (function (CppDType) { - CppDType[CppDType["float32"] = 0] = "float32"; - CppDType[CppDType["int32"] = 1] = "int32"; - CppDType[CppDType["bool"] = 2] = "bool"; - CppDType[CppDType["string"] = 3] = "string"; - CppDType[CppDType["complex64"] = 4] = "complex64"; + CppDType[CppDType["float32"] = 0] = "float32"; + CppDType[CppDType["int32"] = 1] = "int32"; + CppDType[CppDType["bool"] = 2] = "bool"; + CppDType[CppDType["string"] = 3] = "string"; + CppDType[CppDType["complex64"] = 4] = "complex64"; })(CppDType || (CppDType = {})); // Must match enum in cc/fusable_activations.h. var FusableActivation; (function (FusableActivation) { - FusableActivation[FusableActivation["linear"] = 0] = "linear"; - FusableActivation[FusableActivation["relu"] = 1] = "relu"; - FusableActivation[FusableActivation["relu6"] = 2] = "relu6"; - FusableActivation[FusableActivation["prelu"] = 3] = "prelu"; - })(FusableActivation || (FusableActivation = {})); - + FusableActivation[FusableActivation["linear"] = 0] = "linear"; + FusableActivation[FusableActivation["relu"] = 1] = "relu"; + FusableActivation[FusableActivation["relu6"] = 2] = "relu6"; + FusableActivation[FusableActivation["prelu"] = 3] = "prelu"; + })(FusableActivation || (FusableActivation = {})); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -76,65 +77,74 @@ * ============================================================================= */ var wasmFusedMatMul; + function setup(backend) { - wasmFusedMatMul = backend.wasm.cwrap('_FusedMatMul', null /* void */, [ - 'number', - 'array', - 'number', - 'number', - 'array', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number' // out_id - ]); + wasmFusedMatMul = backend.wasm.cwrap('_FusedMatMul', null /* void */ , [ + 'number', + 'array', + 'number', + 'number', + 'array', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number' // out_id + ]); } + function fusedBatchMatMul(args) { - var inputs = args.inputs, backend = args.backend, attrs = args.attrs; - var a = inputs.a, b = inputs.b, bias = inputs.bias, preluActivationWeights = inputs.preluActivationWeights; - if (a.dtype !== 'float32' || b.dtype !== 'float32') { - throw new Error("_FusedMatMul for non non-float32 tensors not yet supported."); - } - var transposeA = attrs.transposeA, transposeB = attrs.transposeB, activation = attrs.activation; - var aId = backend.dataIdMap.get(a.dataId).id; - var bId = backend.dataIdMap.get(b.dataId).id; - var biasId = 0; - if (bias != null) { - var biasData = backend.dataIdMap.get(bias.dataId); - if (biasData.shape.length !== 1) { - throw new Error("_FusedMatMul only supports rank-1 bias but got " + - ("rank " + biasData.shape.length + ".")); - } - biasId = biasData.id; - } - var preluActivationWeightsId = preluActivationWeights == null ? - 0 : - backend.dataIdMap.get(preluActivationWeights.dataId).id; - var fusedActivation = FusableActivation[activation]; - if (fusedActivation == null) { - throw new Error(activation + " activation not yet supported for FusedConv2D " + - "in the wasm backend."); + var inputs = args.inputs, + backend = args.backend, + attrs = args.attrs; + var a = inputs.a, + b = inputs.b, + bias = inputs.bias, + preluActivationWeights = inputs.preluActivationWeights; + if (a.dtype !== 'float32' || b.dtype !== 'float32') { + throw new Error("_FusedMatMul for non non-float32 tensors not yet supported."); + } + var transposeA = attrs.transposeA, + transposeB = attrs.transposeB, + activation = attrs.activation; + var aId = backend.dataIdMap.get(a.dataId).id; + var bId = backend.dataIdMap.get(b.dataId).id; + var biasId = 0; + if (bias != null) { + var biasData = backend.dataIdMap.get(bias.dataId); + if (biasData.shape.length !== 1) { + throw new Error("_FusedMatMul only supports rank-1 bias but got " + + ("rank " + biasData.shape.length + ".")); } - var leftDim = transposeA ? a.shape[2] : a.shape[1]; - var rightDim = transposeB ? b.shape[1] : b.shape[2]; - var batchDim = a.shape[0]; - var out = backend.makeOutput([batchDim, leftDim, rightDim], a.dtype); - var outId = backend.dataIdMap.get(out.dataId).id; - var aShapeBytes = new Uint8Array(new Int32Array(a.shape).buffer); - var bShapeBytes = new Uint8Array(new Int32Array(b.shape).buffer); - wasmFusedMatMul(aId, aShapeBytes, a.shape.length, bId, bShapeBytes, b.shape.length, transposeA, transposeB, fusedActivation, biasId, preluActivationWeightsId, outId); - return out; + biasId = biasData.id; + } + var preluActivationWeightsId = preluActivationWeights == null ? + 0 : + backend.dataIdMap.get(preluActivationWeights.dataId).id; + var fusedActivation = FusableActivation[activation]; + if (fusedActivation == null) { + throw new Error(activation + " activation not yet supported for FusedConv2D " + + "in the wasm backend."); + } + var leftDim = transposeA ? a.shape[2] : a.shape[1]; + var rightDim = transposeB ? b.shape[1] : b.shape[2]; + var batchDim = a.shape[0]; + var out = backend.makeOutput([batchDim, leftDim, rightDim], a.dtype); + var outId = backend.dataIdMap.get(out.dataId).id; + var aShapeBytes = new Uint8Array(new Int32Array(a.shape).buffer); + var bShapeBytes = new Uint8Array(new Int32Array(b.shape).buffer); + wasmFusedMatMul(aId, aShapeBytes, a.shape.length, bId, bShapeBytes, b.shape.length, transposeA, transposeB, fusedActivation, biasId, preluActivationWeightsId, outId); + return out; } tfjsCore.registerKernel({ - kernelName: '_FusedMatMul', - backendName: 'wasm', - setupFunc: setup, - kernelFunc: fusedBatchMatMul - }); - + kernelName: '_FusedMatMul', + backendName: 'wasm', + setupFunc: setup, + kernelFunc: fusedBatchMatMul + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -152,26 +162,34 @@ * ============================================================================= */ function registerUnaryKernel(kernelName) { - var wasmFunc; - function setupFunc(backend) { - wasmFunc = - backend.wasm.cwrap(kernelName, null /* void */, ['number', 'number']); - } - function kernelFunc(args) { - var backend = args.backend, x = args.inputs.x; - var xId = backend.dataIdMap.get(x.dataId).id; - var out = backend.makeOutput(x.shape, x.dtype); - var outId = backend.dataIdMap.get(out.dataId).id; - // Short-circuit zero-sized tensors. - if (tfjsCore.util.sizeFromShape(out.shape) === 0) { - return out; - } - wasmFunc(xId, outId); - return out; + var wasmFunc; + + function setupFunc(backend) { + wasmFunc = + backend.wasm.cwrap(kernelName, null /* void */ , ['number', 'number']); + } + + function kernelFunc(args) { + var backend = args.backend, + x = args.inputs.x; + var xId = backend.dataIdMap.get(x.dataId).id; + var out = backend.makeOutput(x.shape, x.dtype); + var outId = backend.dataIdMap.get(out.dataId).id; + // Short-circuit zero-sized tensors. + if (tfjsCore.util.sizeFromShape(out.shape) === 0) { + return out; } - tfjsCore.registerKernel({ kernelName: kernelName, backendName: 'wasm', setupFunc: setupFunc, kernelFunc: kernelFunc }); - } - + wasmFunc(xId, outId); + return out; + } + tfjsCore.registerKernel({ + kernelName: kernelName, + backendName: 'wasm', + setupFunc: setupFunc, + kernelFunc: kernelFunc + }); + } + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -188,8 +206,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Abs'); - + registerUnaryKernel('Abs'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -207,55 +225,69 @@ * ============================================================================= */ function registerBinaryKernel(kernelName, supportsFullBroadcast, dtype) { - var wasmFunc; - function setupFunc(backend) { - wasmFunc = backend.wasm.cwrap(kernelName, null /* void */, [ - 'number', - 'array', - 'number', - 'number', - 'array', - 'number', - 'number', - 'number' // out_id - ]); + var wasmFunc; + + function setupFunc(backend) { + wasmFunc = backend.wasm.cwrap(kernelName, null /* void */ , [ + 'number', + 'array', + 'number', + 'number', + 'array', + 'number', + 'number', + 'number' // out_id + ]); + } + + function kernelFunc(args) { + var backend = args.backend, + inputs = args.inputs; + var a = inputs.a, + b = inputs.b; + var aId = backend.dataIdMap.get(a.dataId).id; + var bId = backend.dataIdMap.get(b.dataId).id; + var outputType = dtype != null ? dtype : a.dtype; + var newShape = tfjsCore.backend_util.assertAndGetBroadcastShape(a.shape, b.shape); + var out = backend.makeOutput(newShape, outputType); + // Short-circuit zero-sized tensors. + if (tfjsCore.util.sizeFromShape(newShape) === 0) { + return out; } - function kernelFunc(args) { - var backend = args.backend, inputs = args.inputs; - var a = inputs.a, b = inputs.b; - var aId = backend.dataIdMap.get(a.dataId).id; - var bId = backend.dataIdMap.get(b.dataId).id; - var outputType = dtype != null ? dtype : a.dtype; - var newShape = tfjsCore.backend_util.assertAndGetBroadcastShape(a.shape, b.shape); - var out = backend.makeOutput(newShape, outputType); - // Short-circuit zero-sized tensors. - if (tfjsCore.util.sizeFromShape(newShape) === 0) { - return out; - } - var aShapeBytes = new Uint8Array(new Int32Array(a.shape).buffer); - var bShapeBytes = new Uint8Array(new Int32Array(b.shape).buffer); - var outId = backend.dataIdMap.get(out.dataId).id; - var kernelFunc = function () { return wasmFunc(aId, aShapeBytes, a.shape.length, bId, bShapeBytes, b.shape.length, CppDType[a.dtype], outId); }; - if (supportsFullBroadcast) { - kernelFunc(); - return out; - } - var aBroadcastDims = tfjsCore.backend_util.getBroadcastDims(a.shape, newShape); - var bBroadcastDims = tfjsCore.backend_util.getBroadcastDims(b.shape, newShape); - var loopsOverAllOfA = aBroadcastDims.every(function (v, i) { return v === i; }); - var loopsOverAllOfB = bBroadcastDims.every(function (v, i) { return v === i; }); - if (loopsOverAllOfA && loopsOverAllOfB) { - kernelFunc(); - return out; - } - else { - throw new Error("Broadcasting along outer dims is not yet " + - ("supported for " + kernelName + ".")); - } + var aShapeBytes = new Uint8Array(new Int32Array(a.shape).buffer); + var bShapeBytes = new Uint8Array(new Int32Array(b.shape).buffer); + var outId = backend.dataIdMap.get(out.dataId).id; + var kernelFunc = function () { + return wasmFunc(aId, aShapeBytes, a.shape.length, bId, bShapeBytes, b.shape.length, CppDType[a.dtype], outId); + }; + if (supportsFullBroadcast) { + kernelFunc(); + return out; + } + var aBroadcastDims = tfjsCore.backend_util.getBroadcastDims(a.shape, newShape); + var bBroadcastDims = tfjsCore.backend_util.getBroadcastDims(b.shape, newShape); + var loopsOverAllOfA = aBroadcastDims.every(function (v, i) { + return v === i; + }); + var loopsOverAllOfB = bBroadcastDims.every(function (v, i) { + return v === i; + }); + if (loopsOverAllOfA && loopsOverAllOfB) { + kernelFunc(); + return out; + } else { + throw new Error("Broadcasting along outer dims is not yet " + + ("supported for " + kernelName + ".")); } - tfjsCore.registerKernel({ kernelName: kernelName, backendName: 'wasm', setupFunc: setupFunc, kernelFunc: kernelFunc }); - } - + } + tfjsCore.registerKernel({ + kernelName: kernelName, + backendName: 'wasm', + setupFunc: setupFunc, + kernelFunc: kernelFunc + }); + } + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -273,8 +305,8 @@ * ============================================================================= */ var supportsFullBroadcast = true; - registerBinaryKernel('Add', supportsFullBroadcast); - + registerBinaryKernel('Add', supportsFullBroadcast); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -292,34 +324,39 @@ * ============================================================================= */ var wasmFunc; + function setupFunc(backend) { - wasmFunc = backend.wasm.cwrap('AddN', null /* void */, [ - 'array', - 'number', - 'number', - 'number', - ]); + wasmFunc = backend.wasm.cwrap('AddN', null /* void */ , [ + 'array', + 'number', + 'number', + 'number', + ]); } + function addn(args) { - var inputs = args.inputs, backend = args.backend; - var out = backend.makeOutput(inputs[0].shape, inputs[0].dtype); - // Short-circuit zero-sized tensors. - if (tfjsCore.util.sizeFromShape(out.shape) === 0) { - return out; - } - var inputIds = inputs.map(function (x) { return backend.dataIdMap.get(x.dataId).id; }); - var inputIdsBytes = new Uint8Array(new Int32Array(inputIds).buffer); - var outId = backend.dataIdMap.get(out.dataId).id; - wasmFunc(inputIdsBytes, inputIds.length, CppDType[out.dtype], outId); + var inputs = args.inputs, + backend = args.backend; + var out = backend.makeOutput(inputs[0].shape, inputs[0].dtype); + // Short-circuit zero-sized tensors. + if (tfjsCore.util.sizeFromShape(out.shape) === 0) { return out; + } + var inputIds = inputs.map(function (x) { + return backend.dataIdMap.get(x.dataId).id; + }); + var inputIdsBytes = new Uint8Array(new Int32Array(inputIds).buffer); + var outId = backend.dataIdMap.get(out.dataId).id; + wasmFunc(inputIdsBytes, inputIds.length, CppDType[out.dtype], outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'AddN', - backendName: 'wasm', - setupFunc: setupFunc, - kernelFunc: addn, - }); - + kernelName: 'AddN', + backendName: 'wasm', + setupFunc: setupFunc, + kernelFunc: addn, + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -337,33 +374,37 @@ * ============================================================================= */ var wasmFunc$1; + function setup$1(backend) { - wasmFunc$1 = backend.wasm.cwrap('ArgMax', null /* void */, [ - 'number', - 'number', - 'number', - 'number', - 'number' // out_id - ]); + wasmFunc$1 = backend.wasm.cwrap('ArgMax', null /* void */ , [ + 'number', + 'number', + 'number', + 'number', + 'number' // out_id + ]); } + function argmax(args) { - var x = args.inputs.x, backend = args.backend, axis = args.attrs.axis; - var outShape = x.shape.slice(0, -1); - var out = backend.makeOutput(outShape, 'int32'); - var xId = backend.dataIdMap.get(x.dataId).id; - var outId = backend.dataIdMap.get(out.dataId).id; - var outerSize = tfjsCore.util.sizeFromShape(out.shape); - var innerSize = x.shape[axis]; - wasmFunc$1(xId, CppDType[x.dtype], outerSize, innerSize, outId); - return out; + var x = args.inputs.x, + backend = args.backend, + axis = args.attrs.axis; + var outShape = x.shape.slice(0, -1); + var out = backend.makeOutput(outShape, 'int32'); + var xId = backend.dataIdMap.get(x.dataId).id; + var outId = backend.dataIdMap.get(out.dataId).id; + var outerSize = tfjsCore.util.sizeFromShape(out.shape); + var innerSize = x.shape[axis]; + wasmFunc$1(xId, CppDType[x.dtype], outerSize, innerSize, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'ArgMax', - backendName: 'wasm', - kernelFunc: argmax, - setupFunc: setup$1 - }); - + kernelName: 'ArgMax', + backendName: 'wasm', + kernelFunc: argmax, + setupFunc: setup$1 + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -381,58 +422,62 @@ * ============================================================================= */ var wasmAvgPool; + function setup$2(backend) { - wasmAvgPool = backend.wasm.cwrap('AvgPool', null /* void */, [ - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - ]); + wasmAvgPool = backend.wasm.cwrap('AvgPool', null /* void */ , [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + ]); } + function avgPool(args) { - var inputs = args.inputs, attrs = args.attrs, backend = args.backend; - var convInfo = attrs; - var x = inputs.x; - var xId = backend.dataIdMap.get(x.dataId).id; - var filterHeight = convInfo.filterHeight; - var filterWidth = convInfo.filterWidth; - var padTop = convInfo.padInfo.top; - var padRight = convInfo.padInfo.right; - var padBottom = convInfo.padInfo.bottom; - var padLeft = convInfo.padInfo.left; - var strideHeight = convInfo.strideHeight; - var strideWidth = convInfo.strideWidth; - var channels = convInfo.inChannels; - if (convInfo.dataFormat !== 'channelsLast') { - throw new Error("wasm backend does not support dataFormat:'" + - (convInfo.dataFormat + "'. Please use 'channelsLast'.")); - } - if (convInfo.dilationWidth !== 1 || convInfo.dilationHeight !== 1) { - throw new Error("was backend only supports average pooling with dilation = [1, 1], " + - ("got [" + convInfo.dilationHeight + ", " + convInfo.dilationWidth + "].")); - } - var out = backend.makeOutput(convInfo.outShape, 'float32'); - var outId = backend.dataIdMap.get(out.dataId).id; - wasmAvgPool(xId, x.shape[0], x.shape[1], x.shape[2], filterHeight, filterWidth, padTop, padRight, padBottom, padLeft, strideHeight, strideWidth, channels, outId); - return out; + var inputs = args.inputs, + attrs = args.attrs, + backend = args.backend; + var convInfo = attrs; + var x = inputs.x; + var xId = backend.dataIdMap.get(x.dataId).id; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var padTop = convInfo.padInfo.top; + var padRight = convInfo.padInfo.right; + var padBottom = convInfo.padInfo.bottom; + var padLeft = convInfo.padInfo.left; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var channels = convInfo.inChannels; + if (convInfo.dataFormat !== 'channelsLast') { + throw new Error("wasm backend does not support dataFormat:'" + + (convInfo.dataFormat + "'. Please use 'channelsLast'.")); + } + if (convInfo.dilationWidth !== 1 || convInfo.dilationHeight !== 1) { + throw new Error("was backend only supports average pooling with dilation = [1, 1], " + + ("got [" + convInfo.dilationHeight + ", " + convInfo.dilationWidth + "].")); + } + var out = backend.makeOutput(convInfo.outShape, 'float32'); + var outId = backend.dataIdMap.get(out.dataId).id; + wasmAvgPool(xId, x.shape[0], x.shape[1], x.shape[2], filterHeight, filterWidth, padTop, padRight, padBottom, padLeft, strideHeight, strideWidth, channels, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'AvgPool', - backendName: 'wasm', - setupFunc: setup$2, - kernelFunc: avgPool - }); - + kernelName: 'AvgPool', + backendName: 'wasm', + setupFunc: setup$2, + kernelFunc: avgPool + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -450,45 +495,51 @@ * ============================================================================= */ var wasmBatchMatMul; + function setup$3(backend) { - wasmBatchMatMul = backend.wasm.cwrap('BatchMatMul', null /* void */, [ - 'number', - 'array', - 'number', - 'number', - 'array', - 'number', - 'number', - 'number', - 'number' // out_id - ]); + wasmBatchMatMul = backend.wasm.cwrap('BatchMatMul', null /* void */ , [ + 'number', + 'array', + 'number', + 'number', + 'array', + 'number', + 'number', + 'number', + 'number' // out_id + ]); } + function batchMatMul(args) { - var inputs = args.inputs, backend = args.backend, attrs = args.attrs; - var a = inputs.a, b = inputs.b; - if (a.dtype !== 'float32' || b.dtype !== 'float32') { - throw new Error("BatchMatMul for non non-float32 tensors not yet supported."); - } - var transposeA = attrs.transposeA, transposeB = attrs.transposeB; - var aId = backend.dataIdMap.get(a.dataId).id; - var bId = backend.dataIdMap.get(b.dataId).id; - var leftDim = transposeA ? a.shape[2] : a.shape[1]; - var rightDim = transposeB ? b.shape[1] : b.shape[2]; - var batchDim = a.shape[0]; - var out = backend.makeOutput([batchDim, leftDim, rightDim], a.dtype); - var outId = backend.dataIdMap.get(out.dataId).id; - var aShapeBytes = new Uint8Array(new Int32Array(a.shape).buffer); - var bShapeBytes = new Uint8Array(new Int32Array(b.shape).buffer); - wasmBatchMatMul(aId, aShapeBytes, a.shape.length, bId, bShapeBytes, b.shape.length, transposeA, transposeB, outId); - return out; + var inputs = args.inputs, + backend = args.backend, + attrs = args.attrs; + var a = inputs.a, + b = inputs.b; + if (a.dtype !== 'float32' || b.dtype !== 'float32') { + throw new Error("BatchMatMul for non non-float32 tensors not yet supported."); + } + var transposeA = attrs.transposeA, + transposeB = attrs.transposeB; + var aId = backend.dataIdMap.get(a.dataId).id; + var bId = backend.dataIdMap.get(b.dataId).id; + var leftDim = transposeA ? a.shape[2] : a.shape[1]; + var rightDim = transposeB ? b.shape[1] : b.shape[2]; + var batchDim = a.shape[0]; + var out = backend.makeOutput([batchDim, leftDim, rightDim], a.dtype); + var outId = backend.dataIdMap.get(out.dataId).id; + var aShapeBytes = new Uint8Array(new Int32Array(a.shape).buffer); + var bShapeBytes = new Uint8Array(new Int32Array(b.shape).buffer); + wasmBatchMatMul(aId, aShapeBytes, a.shape.length, bId, bShapeBytes, b.shape.length, transposeA, transposeB, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'BatchMatMul', - backendName: 'wasm', - setupFunc: setup$3, - kernelFunc: batchMatMul - }); - + kernelName: 'BatchMatMul', + backendName: 'wasm', + setupFunc: setup$3, + kernelFunc: batchMatMul + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -506,19 +557,21 @@ * ============================================================================= */ function cast(args) { - var x = args.inputs.x, dtype = args.attrs.dtype, backend = args.backend; - var out = backend.makeOutput(x.shape, dtype); - var inVals = backend.typedArrayFromHeap(x); - var outVals = backend.typedArrayFromHeap(out); - outVals.set(inVals); - return out; + var x = args.inputs.x, + dtype = args.attrs.dtype, + backend = args.backend; + var out = backend.makeOutput(x.shape, dtype); + var inVals = backend.typedArrayFromHeap(x); + var outVals = backend.typedArrayFromHeap(out); + outVals.set(inVals); + return out; } tfjsCore.registerKernel({ - kernelName: 'Cast', - backendName: 'wasm', - kernelFunc: cast, - }); - + kernelName: 'Cast', + backendName: 'wasm', + kernelFunc: cast, + }); + /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -536,31 +589,36 @@ * ============================================================================= */ var wasmClip; + function setup$4(backend) { - wasmClip = backend.wasm.cwrap('ClipByValue', null /* void */, [ - 'number', - 'number', - 'number', - 'number' // out_id - ]); + wasmClip = backend.wasm.cwrap('ClipByValue', null /* void */ , [ + 'number', + 'number', + 'number', + 'number' // out_id + ]); } + function clip(args) { - var inputs = args.inputs, backend = args.backend, attrs = args.attrs; - var x = inputs.x; - var min = attrs.min, max = attrs.max; - var xId = backend.dataIdMap.get(x.dataId).id; - var out = backend.makeOutput(x.shape, 'float32'); - var outId = backend.dataIdMap.get(out.dataId).id; - wasmClip(xId, min, max, outId); - return out; + var inputs = args.inputs, + backend = args.backend, + attrs = args.attrs; + var x = inputs.x; + var min = attrs.min, + max = attrs.max; + var xId = backend.dataIdMap.get(x.dataId).id; + var out = backend.makeOutput(x.shape, 'float32'); + var outId = backend.dataIdMap.get(out.dataId).id; + wasmClip(xId, min, max, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'ClipByValue', - backendName: 'wasm', - setupFunc: setup$4, - kernelFunc: clip - }); - + kernelName: 'ClipByValue', + backendName: 'wasm', + setupFunc: setup$4, + kernelFunc: clip + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -578,36 +636,42 @@ * ============================================================================= */ function concat(args) { - var inputs = args.inputs, backend = args.backend, axis = args.attrs.axis; - var outShape = tfjsCore.backend_util.computeOutShape(inputs.map(function (t) { return t.shape; }), axis); - var out = backend.makeOutput(outShape, inputs[0].dtype); - var batchDim = tfjsCore.util.sizeFromShape(inputs[0].shape.slice(0, axis)); - var sumInnerDims = 0; - var innerDims = inputs.map(function (input) { - var innerDim = tfjsCore.util.sizeFromShape(input.shape.slice(axis)); - sumInnerDims += innerDim; - return innerDim; - }); - var inVals = inputs.map(function (input) { return backend.typedArrayFromHeap(input); }); - var outVals = backend.typedArrayFromHeap(out); - for (var b = 0; b < batchDim; b++) { - var outOffset = b * sumInnerDims; - for (var i = 0; i < inVals.length; i++) { - var innerDim = innerDims[i]; - var inOffset = b * innerDim; - var vals = inVals[i].subarray(inOffset, inOffset + innerDim); - outVals.set(vals, outOffset); - outOffset += innerDim; - } + var inputs = args.inputs, + backend = args.backend, + axis = args.attrs.axis; + var outShape = tfjsCore.backend_util.computeOutShape(inputs.map(function (t) { + return t.shape; + }), axis); + var out = backend.makeOutput(outShape, inputs[0].dtype); + var batchDim = tfjsCore.util.sizeFromShape(inputs[0].shape.slice(0, axis)); + var sumInnerDims = 0; + var innerDims = inputs.map(function (input) { + var innerDim = tfjsCore.util.sizeFromShape(input.shape.slice(axis)); + sumInnerDims += innerDim; + return innerDim; + }); + var inVals = inputs.map(function (input) { + return backend.typedArrayFromHeap(input); + }); + var outVals = backend.typedArrayFromHeap(out); + for (var b = 0; b < batchDim; b++) { + var outOffset = b * sumInnerDims; + for (var i = 0; i < inVals.length; i++) { + var innerDim = innerDims[i]; + var inOffset = b * innerDim; + var vals = inVals[i].subarray(inOffset, inOffset + innerDim); + outVals.set(vals, outOffset); + outOffset += innerDim; } - return out; + } + return out; } tfjsCore.registerKernel({ - kernelName: 'Concat', - backendName: 'wasm', - kernelFunc: concat, - }); - + kernelName: 'Concat', + backendName: 'wasm', + kernelFunc: concat, + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -625,64 +689,69 @@ * ============================================================================= */ var wasmConv2d; + function setup$5(backend) { - wasmConv2d = backend.wasm.cwrap('Conv2D', null /* void */, [ - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - ]); + wasmConv2d = backend.wasm.cwrap('Conv2D', null /* void */ , [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + ]); } + function conv2d(args) { - var inputs = args.inputs, attrs = args.attrs, backend = args.backend; - var convInfo = attrs; - var x = inputs.x, filter = inputs.filter; - var xId = backend.dataIdMap.get(x.dataId).id; - var filterId = backend.dataIdMap.get(filter.dataId).id; - var filterHeight = convInfo.filterHeight; - var filterWidth = convInfo.filterWidth; - var padTop = convInfo.padInfo.top; - var padRight = convInfo.padInfo.right; - var padBottom = convInfo.padInfo.bottom; - var padLeft = convInfo.padInfo.left; - var dilationHeight = convInfo.dilationHeight; - var dilationWidth = convInfo.dilationWidth; - var strideHeight = convInfo.strideHeight; - var strideWidth = convInfo.strideWidth; - var inputChannels = convInfo.inChannels; - var outputChannels = convInfo.outChannels; - var isSamePad = convInfo.padInfo.type === 'SAME' ? 1 : 0; - if (convInfo.dataFormat !== 'channelsLast') { - throw new Error("wasm backend Conv2D does not support dataFormat:'" + - (convInfo.dataFormat + "'. Please use 'channelsLast'.")); - } - var out = backend.makeOutput(convInfo.outShape, 'float32'); - var outId = backend.dataIdMap.get(out.dataId).id; - wasmConv2d(xId, x.shape[0], x.shape[1], x.shape[2], filterId, filterHeight, filterWidth, padTop, padRight, padBottom, padLeft, isSamePad, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, outId); - return out; + var inputs = args.inputs, + attrs = args.attrs, + backend = args.backend; + var convInfo = attrs; + var x = inputs.x, + filter = inputs.filter; + var xId = backend.dataIdMap.get(x.dataId).id; + var filterId = backend.dataIdMap.get(filter.dataId).id; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var padTop = convInfo.padInfo.top; + var padRight = convInfo.padInfo.right; + var padBottom = convInfo.padInfo.bottom; + var padLeft = convInfo.padInfo.left; + var dilationHeight = convInfo.dilationHeight; + var dilationWidth = convInfo.dilationWidth; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var inputChannels = convInfo.inChannels; + var outputChannels = convInfo.outChannels; + var isSamePad = convInfo.padInfo.type === 'SAME' ? 1 : 0; + if (convInfo.dataFormat !== 'channelsLast') { + throw new Error("wasm backend Conv2D does not support dataFormat:'" + + (convInfo.dataFormat + "'. Please use 'channelsLast'.")); + } + var out = backend.makeOutput(convInfo.outShape, 'float32'); + var outId = backend.dataIdMap.get(out.dataId).id; + wasmConv2d(xId, x.shape[0], x.shape[1], x.shape[2], filterId, filterHeight, filterWidth, padTop, padRight, padBottom, padLeft, isSamePad, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'Conv2D', - backendName: 'wasm', - setupFunc: setup$5, - kernelFunc: conv2d - }); - + kernelName: 'Conv2D', + backendName: 'wasm', + setupFunc: setup$5, + kernelFunc: conv2d + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -699,8 +768,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Cos'); - + registerUnaryKernel('Cos'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -720,57 +789,75 @@ // Must match enum in CropAndResize.cc var InterpolationMethod; (function (InterpolationMethod) { - InterpolationMethod[InterpolationMethod["bilinear"] = 0] = "bilinear"; - InterpolationMethod[InterpolationMethod["nearest"] = 1] = "nearest"; + InterpolationMethod[InterpolationMethod["bilinear"] = 0] = "bilinear"; + InterpolationMethod[InterpolationMethod["nearest"] = 1] = "nearest"; })(InterpolationMethod || (InterpolationMethod = {})); var wasmCropAndResize; + function setup$6(backend) { - wasmCropAndResize = backend.wasm.cwrap('CropAndResize', null /*void*/, [ - 'number', - 'number', - 'number', - 'number', - 'array', - 'number', - 'number', - 'number', - 'number', - 'number' // out id - ]); + wasmCropAndResize = backend.wasm.cwrap('CropAndResize', null /*void*/ , [ + 'number', + 'number', + 'number', + 'number', + 'array', + 'number', + 'number', + 'number', + 'number', + 'number' // out id + ]); } + function cropAndResize(args) { - var backend = args.backend, inputs = args.inputs, attrs = args.attrs; - var method = attrs.method, extrapolationValue = attrs.extrapolationValue, cropSize = attrs.cropSize; - var images = inputs.images, boxes = inputs.boxes, boxInd = inputs.boxInd; - var numBoxes = boxes.shape[0]; - var _a = cropSize, cropHeight = _a[0], cropWidth = _a[1]; - var outShape = [numBoxes, cropHeight, cropWidth, images.shape[3]]; - var imagesData = backend.dataIdMap.get(images.dataId); - var castedData; - if (images.dtype !== 'float32') { - castedData = - cast({ backend: backend, inputs: { x: images }, attrs: { dtype: 'float32' } }); - imagesData = backend.dataIdMap.get(castedData.dataId); - } - var imagesId = imagesData.id; - var boxesId = backend.dataIdMap.get(boxes.dataId).id; - var boxIndId = backend.dataIdMap.get(boxInd.dataId).id; - var out = backend.makeOutput(outShape, 'float32'); - var outId = backend.dataIdMap.get(out.dataId).id; - var imagesShapeBytes = new Uint8Array(new Int32Array(images.shape).buffer); - wasmCropAndResize(imagesId, boxesId, boxIndId, numBoxes, imagesShapeBytes, cropHeight, cropWidth, InterpolationMethod[method], extrapolationValue, outId); - if (castedData != null) { - backend.disposeData(castedData.dataId); - } - return out; + var backend = args.backend, + inputs = args.inputs, + attrs = args.attrs; + var method = attrs.method, + extrapolationValue = attrs.extrapolationValue, + cropSize = attrs.cropSize; + var images = inputs.images, + boxes = inputs.boxes, + boxInd = inputs.boxInd; + var numBoxes = boxes.shape[0]; + var _a = cropSize, + cropHeight = _a[0], + cropWidth = _a[1]; + var outShape = [numBoxes, cropHeight, cropWidth, images.shape[3]]; + var imagesData = backend.dataIdMap.get(images.dataId); + var castedData; + if (images.dtype !== 'float32') { + castedData = + cast({ + backend: backend, + inputs: { + x: images + }, + attrs: { + dtype: 'float32' + } + }); + imagesData = backend.dataIdMap.get(castedData.dataId); + } + var imagesId = imagesData.id; + var boxesId = backend.dataIdMap.get(boxes.dataId).id; + var boxIndId = backend.dataIdMap.get(boxInd.dataId).id; + var out = backend.makeOutput(outShape, 'float32'); + var outId = backend.dataIdMap.get(out.dataId).id; + var imagesShapeBytes = new Uint8Array(new Int32Array(images.shape).buffer); + wasmCropAndResize(imagesId, boxesId, boxIndId, numBoxes, imagesShapeBytes, cropHeight, cropWidth, InterpolationMethod[method], extrapolationValue, outId); + if (castedData != null) { + backend.disposeData(castedData.dataId); + } + return out; } tfjsCore.registerKernel({ - kernelName: 'CropAndResize', - backendName: 'wasm', - setupFunc: setup$6, - kernelFunc: cropAndResize - }); - + kernelName: 'CropAndResize', + backendName: 'wasm', + setupFunc: setup$6, + kernelFunc: cropAndResize + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -788,65 +875,70 @@ * ============================================================================= */ var wasmDepthwiseConv2d; + function setup$7(backend) { - wasmDepthwiseConv2d = - backend.wasm.cwrap('DepthwiseConv2dNative', null /* void */, [ - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - ]); + wasmDepthwiseConv2d = + backend.wasm.cwrap('DepthwiseConv2dNative', null /* void */ , [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + ]); } + function depthwiseConv2d(args) { - var inputs = args.inputs, attrs = args.attrs, backend = args.backend; - var convInfo = attrs; - var x = inputs.x, filter = inputs.filter; - var xId = backend.dataIdMap.get(x.dataId).id; - var filterId = backend.dataIdMap.get(filter.dataId).id; - var filterHeight = convInfo.filterHeight; - var filterWidth = convInfo.filterWidth; - var padTop = convInfo.padInfo.top; - var padRight = convInfo.padInfo.right; - var padBottom = convInfo.padInfo.bottom; - var padLeft = convInfo.padInfo.left; - var dilationHeight = convInfo.dilationHeight; - var dilationWidth = convInfo.dilationWidth; - var strideHeight = convInfo.strideHeight; - var strideWidth = convInfo.strideWidth; - var inputChannels = convInfo.inChannels; - var outputChannels = convInfo.outChannels; - var isSamePad = convInfo.padInfo.type === 'SAME' ? 1 : 0; - if (convInfo.dataFormat !== 'channelsLast') { - throw new Error("wasm backend DepthwiseConv2dNative does not support dataFormat:'" + - (convInfo.dataFormat + "'. Please use 'channelsLast'.")); - } - var out = backend.makeOutput(convInfo.outShape, 'float32'); - var outId = backend.dataIdMap.get(out.dataId).id; - wasmDepthwiseConv2d(xId, x.shape[0], x.shape[1], x.shape[2], filterId, filterHeight, filterWidth, padTop, padRight, padBottom, padLeft, isSamePad, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, outId); - return out; + var inputs = args.inputs, + attrs = args.attrs, + backend = args.backend; + var convInfo = attrs; + var x = inputs.x, + filter = inputs.filter; + var xId = backend.dataIdMap.get(x.dataId).id; + var filterId = backend.dataIdMap.get(filter.dataId).id; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var padTop = convInfo.padInfo.top; + var padRight = convInfo.padInfo.right; + var padBottom = convInfo.padInfo.bottom; + var padLeft = convInfo.padInfo.left; + var dilationHeight = convInfo.dilationHeight; + var dilationWidth = convInfo.dilationWidth; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var inputChannels = convInfo.inChannels; + var outputChannels = convInfo.outChannels; + var isSamePad = convInfo.padInfo.type === 'SAME' ? 1 : 0; + if (convInfo.dataFormat !== 'channelsLast') { + throw new Error("wasm backend DepthwiseConv2dNative does not support dataFormat:'" + + (convInfo.dataFormat + "'. Please use 'channelsLast'.")); + } + var out = backend.makeOutput(convInfo.outShape, 'float32'); + var outId = backend.dataIdMap.get(out.dataId).id; + wasmDepthwiseConv2d(xId, x.shape[0], x.shape[1], x.shape[2], filterId, filterHeight, filterWidth, padTop, padRight, padBottom, padLeft, isSamePad, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'DepthwiseConv2dNative', - backendName: 'wasm', - setupFunc: setup$7, - kernelFunc: depthwiseConv2d - }); - + kernelName: 'DepthwiseConv2dNative', + backendName: 'wasm', + setupFunc: setup$7, + kernelFunc: depthwiseConv2d + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -864,8 +956,8 @@ * ============================================================================= */ var supportsFullBroadcast$1 = false; - registerBinaryKernel('Div', supportsFullBroadcast$1); - + registerBinaryKernel('Div', supportsFullBroadcast$1); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -882,8 +974,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Exp'); - + registerUnaryKernel('Exp'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -901,8 +993,8 @@ * ============================================================================= */ var supportsFullBroadcast$2 = false; - registerBinaryKernel('FloorDiv', supportsFullBroadcast$2); - + registerBinaryKernel('FloorDiv', supportsFullBroadcast$2); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -920,34 +1012,42 @@ * ============================================================================= */ var wasmBatchNorm; + function setup$8(backend) { - wasmBatchNorm = backend.wasm.cwrap('FusedBatchNorm', null /* void */, ['number', 'number', 'number', 'number', 'number', 'number', 'number']); + wasmBatchNorm = backend.wasm.cwrap('FusedBatchNorm', null /* void */ , ['number', 'number', 'number', 'number', 'number', 'number', 'number']); } + function fusedBatchNorm(args) { - var backend = args.backend, inputs = args.inputs, attrs = args.attrs; - var varianceEpsilon = attrs.varianceEpsilon; - var x = inputs.x, mean = inputs.mean, variance = inputs.variance, offset = inputs.offset, scale = inputs.scale; - var xId = backend.dataIdMap.get(x.dataId).id; - var meanId = backend.dataIdMap.get(mean.dataId).id; - var varianceId = backend.dataIdMap.get(variance.dataId).id; - var offsetId = offset != null ? backend.dataIdMap.get(offset.dataId).id : 0; - var scaleId = scale != null ? backend.dataIdMap.get(scale.dataId).id : 0; - var out = backend.makeOutput(x.shape, x.dtype); - // Short-circuit zero-sized tensors. - if (tfjsCore.util.sizeFromShape(x.shape) === 0) { - return out; - } - var outId = backend.dataIdMap.get(out.dataId).id; - wasmBatchNorm(xId, meanId, varianceId, offsetId, scaleId, varianceEpsilon, outId); + var backend = args.backend, + inputs = args.inputs, + attrs = args.attrs; + var varianceEpsilon = attrs.varianceEpsilon; + var x = inputs.x, + mean = inputs.mean, + variance = inputs.variance, + offset = inputs.offset, + scale = inputs.scale; + var xId = backend.dataIdMap.get(x.dataId).id; + var meanId = backend.dataIdMap.get(mean.dataId).id; + var varianceId = backend.dataIdMap.get(variance.dataId).id; + var offsetId = offset != null ? backend.dataIdMap.get(offset.dataId).id : 0; + var scaleId = scale != null ? backend.dataIdMap.get(scale.dataId).id : 0; + var out = backend.makeOutput(x.shape, x.dtype); + // Short-circuit zero-sized tensors. + if (tfjsCore.util.sizeFromShape(x.shape) === 0) { return out; + } + var outId = backend.dataIdMap.get(out.dataId).id; + wasmBatchNorm(xId, meanId, varianceId, offsetId, scaleId, varianceEpsilon, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'FusedBatchNorm', - backendName: 'wasm', - setupFunc: setup$8, - kernelFunc: fusedBatchNorm - }); - + kernelName: 'FusedBatchNorm', + backendName: 'wasm', + setupFunc: setup$8, + kernelFunc: fusedBatchNorm + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -965,91 +1065,99 @@ * ============================================================================= */ var wasmFusedConv2d; + function setup$9(backend) { - wasmFusedConv2d = backend.wasm.cwrap('FusedConv2D', null /* void */, [ - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - ]); + wasmFusedConv2d = backend.wasm.cwrap('FusedConv2D', null /* void */ , [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + ]); } + function fusedConv2d(args) { - var inputs = args.inputs, attrs = args.attrs, backend = args.backend; - var convInfo = attrs.convInfo, activation = attrs.activation; - var fusedActivation = FusableActivation[activation]; - if (fusedActivation == null) { - throw new Error(activation + " activation not yet supported for FusedConv2D " + - "in the wasm backend."); - } - var x = inputs.x, filter = inputs.filter, bias = inputs.bias, preluActivationWeights = inputs.preluActivationWeights; - var xId = backend.dataIdMap.get(x.dataId).id; - var filterId = backend.dataIdMap.get(filter.dataId).id; - var outputChannels = convInfo.outChannels; - var biasId = 0; - if (bias != null) { - var biasData = backend.dataIdMap.get(bias.dataId); - if (biasData.shape.length !== 1) { - throw new Error("FusedConv2D only supports rank-1 bias but got " + - ("rank " + biasData.shape.length + ".")); - } - if (biasData.shape[0] !== outputChannels) { - throw new Error("FusedConv2D bias shape (" + biasData.shape + ") does not " + - ("match the number of output channels (" + outputChannels + ")")); - } - biasId = biasData.id; + var inputs = args.inputs, + attrs = args.attrs, + backend = args.backend; + var convInfo = attrs.convInfo, + activation = attrs.activation; + var fusedActivation = FusableActivation[activation]; + if (fusedActivation == null) { + throw new Error(activation + " activation not yet supported for FusedConv2D " + + "in the wasm backend."); + } + var x = inputs.x, + filter = inputs.filter, + bias = inputs.bias, + preluActivationWeights = inputs.preluActivationWeights; + var xId = backend.dataIdMap.get(x.dataId).id; + var filterId = backend.dataIdMap.get(filter.dataId).id; + var outputChannels = convInfo.outChannels; + var biasId = 0; + if (bias != null) { + var biasData = backend.dataIdMap.get(bias.dataId); + if (biasData.shape.length !== 1) { + throw new Error("FusedConv2D only supports rank-1 bias but got " + + ("rank " + biasData.shape.length + ".")); } - var filterHeight = convInfo.filterHeight; - var filterWidth = convInfo.filterWidth; - var padTop = convInfo.padInfo.top; - var padRight = convInfo.padInfo.right; - var padBottom = convInfo.padInfo.bottom; - var padLeft = convInfo.padInfo.left; - var dilationHeight = convInfo.dilationHeight; - var dilationWidth = convInfo.dilationWidth; - var strideHeight = convInfo.strideHeight; - var strideWidth = convInfo.strideWidth; - var inputChannels = convInfo.inChannels; - var isSamePad = convInfo.padInfo.type === 'SAME' ? 1 : 0; - var batchSize = convInfo.batchSize; - var inHeight = convInfo.inHeight; - var inWidth = convInfo.inWidth; - if (convInfo.dataFormat !== 'channelsLast') { - throw new Error("wasm backend FusedConv2D does not support dataFormat:'" + - (convInfo.dataFormat + "'. Please use 'channelsLast'.")); + if (biasData.shape[0] !== outputChannels) { + throw new Error("FusedConv2D bias shape (" + biasData.shape + ") does not " + + ("match the number of output channels (" + outputChannels + ")")); } - var out = backend.makeOutput(convInfo.outShape, 'float32'); - var outId = backend.dataIdMap.get(out.dataId).id; - var preluActivationWeightsId = preluActivationWeights == null ? - 0 : - backend.dataIdMap.get(preluActivationWeights.dataId).id; - wasmFusedConv2d(xId, batchSize, inHeight, inWidth, filterId, filterHeight, filterWidth, biasId, padTop, padRight, padBottom, padLeft, isSamePad, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, fusedActivation, preluActivationWeightsId, outId); - return out; + biasId = biasData.id; + } + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var padTop = convInfo.padInfo.top; + var padRight = convInfo.padInfo.right; + var padBottom = convInfo.padInfo.bottom; + var padLeft = convInfo.padInfo.left; + var dilationHeight = convInfo.dilationHeight; + var dilationWidth = convInfo.dilationWidth; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var inputChannels = convInfo.inChannels; + var isSamePad = convInfo.padInfo.type === 'SAME' ? 1 : 0; + var batchSize = convInfo.batchSize; + var inHeight = convInfo.inHeight; + var inWidth = convInfo.inWidth; + if (convInfo.dataFormat !== 'channelsLast') { + throw new Error("wasm backend FusedConv2D does not support dataFormat:'" + + (convInfo.dataFormat + "'. Please use 'channelsLast'.")); + } + var out = backend.makeOutput(convInfo.outShape, 'float32'); + var outId = backend.dataIdMap.get(out.dataId).id; + var preluActivationWeightsId = preluActivationWeights == null ? + 0 : + backend.dataIdMap.get(preluActivationWeights.dataId).id; + wasmFusedConv2d(xId, batchSize, inHeight, inWidth, filterId, filterHeight, filterWidth, biasId, padTop, padRight, padBottom, padLeft, isSamePad, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, fusedActivation, preluActivationWeightsId, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'FusedConv2D', - backendName: 'wasm', - setupFunc: setup$9, - kernelFunc: fusedConv2d - }); - + kernelName: 'FusedConv2D', + backendName: 'wasm', + setupFunc: setup$9, + kernelFunc: fusedConv2d + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1067,92 +1175,100 @@ * ============================================================================= */ var wasmFusedDepthwiseConv2d; + function setup$a(backend) { - wasmFusedDepthwiseConv2d = - backend.wasm.cwrap('FusedDepthwiseConv2D', null /* void */, [ - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - ]); + wasmFusedDepthwiseConv2d = + backend.wasm.cwrap('FusedDepthwiseConv2D', null /* void */ , [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + ]); } + function fusedDepthwiseConv2d(args) { - var inputs = args.inputs, attrs = args.attrs, backend = args.backend; - var convInfo = attrs.convInfo, activation = attrs.activation; - var fusedActivation = FusableActivation[activation]; - if (fusedActivation == null) { - throw new Error(activation + " activation not yet supported for FusedDepthwiseConv2D " + - "in the wasm backend."); + var inputs = args.inputs, + attrs = args.attrs, + backend = args.backend; + var convInfo = attrs.convInfo, + activation = attrs.activation; + var fusedActivation = FusableActivation[activation]; + if (fusedActivation == null) { + throw new Error(activation + " activation not yet supported for FusedDepthwiseConv2D " + + "in the wasm backend."); + } + var x = inputs.x, + filter = inputs.filter, + bias = inputs.bias, + preluActivationWeights = inputs.preluActivationWeights; + var xId = backend.dataIdMap.get(x.dataId).id; + var filterId = backend.dataIdMap.get(filter.dataId).id; + var outputChannels = convInfo.outChannels; + var biasId = 0; + if (bias != null) { + var biasData = backend.dataIdMap.get(bias.dataId); + if (biasData.shape.length !== 1) { + throw new Error("FusedDepthwiseConv2D only supports rank-1 bias but got " + + ("rank " + biasData.shape.length + ".")); } - var x = inputs.x, filter = inputs.filter, bias = inputs.bias, preluActivationWeights = inputs.preluActivationWeights; - var xId = backend.dataIdMap.get(x.dataId).id; - var filterId = backend.dataIdMap.get(filter.dataId).id; - var outputChannels = convInfo.outChannels; - var biasId = 0; - if (bias != null) { - var biasData = backend.dataIdMap.get(bias.dataId); - if (biasData.shape.length !== 1) { - throw new Error("FusedDepthwiseConv2D only supports rank-1 bias but got " + - ("rank " + biasData.shape.length + ".")); - } - if (biasData.shape[0] !== outputChannels) { - throw new Error("FusedDepthwiseConv2D bias shape (" + biasData.shape + ") does not " + - ("match the number of output channels (" + outputChannels + ")")); - } - biasId = biasData.id; - } - var filterHeight = convInfo.filterHeight; - var filterWidth = convInfo.filterWidth; - var padTop = convInfo.padInfo.top; - var padRight = convInfo.padInfo.right; - var padBottom = convInfo.padInfo.bottom; - var padLeft = convInfo.padInfo.left; - var dilationHeight = convInfo.dilationHeight; - var dilationWidth = convInfo.dilationWidth; - var strideHeight = convInfo.strideHeight; - var strideWidth = convInfo.strideWidth; - var inputChannels = convInfo.inChannels; - var isSamePad = convInfo.padInfo.type === 'SAME' ? 1 : 0; - var batchSize = convInfo.batchSize; - var inHeight = convInfo.inHeight; - var inWidth = convInfo.inWidth; - if (convInfo.dataFormat !== 'channelsLast') { - throw new Error("wasm backend FusedDepthwiseConv2D does not support dataFormat:'" + - (convInfo.dataFormat + "'. Please use 'channelsLast'.")); + if (biasData.shape[0] !== outputChannels) { + throw new Error("FusedDepthwiseConv2D bias shape (" + biasData.shape + ") does not " + + ("match the number of output channels (" + outputChannels + ")")); } - var out = backend.makeOutput(convInfo.outShape, 'float32'); - var outId = backend.dataIdMap.get(out.dataId).id; - var preluActivationWeightsId = preluActivationWeights == null ? - 0 : - backend.dataIdMap.get(preluActivationWeights.dataId).id; - wasmFusedDepthwiseConv2d(xId, batchSize, inHeight, inWidth, filterId, filterHeight, filterWidth, biasId, padTop, padRight, padBottom, padLeft, isSamePad, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, fusedActivation, preluActivationWeightsId, outId); - return out; + biasId = biasData.id; + } + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var padTop = convInfo.padInfo.top; + var padRight = convInfo.padInfo.right; + var padBottom = convInfo.padInfo.bottom; + var padLeft = convInfo.padInfo.left; + var dilationHeight = convInfo.dilationHeight; + var dilationWidth = convInfo.dilationWidth; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var inputChannels = convInfo.inChannels; + var isSamePad = convInfo.padInfo.type === 'SAME' ? 1 : 0; + var batchSize = convInfo.batchSize; + var inHeight = convInfo.inHeight; + var inWidth = convInfo.inWidth; + if (convInfo.dataFormat !== 'channelsLast') { + throw new Error("wasm backend FusedDepthwiseConv2D does not support dataFormat:'" + + (convInfo.dataFormat + "'. Please use 'channelsLast'.")); + } + var out = backend.makeOutput(convInfo.outShape, 'float32'); + var outId = backend.dataIdMap.get(out.dataId).id; + var preluActivationWeightsId = preluActivationWeights == null ? + 0 : + backend.dataIdMap.get(preluActivationWeights.dataId).id; + wasmFusedDepthwiseConv2d(xId, batchSize, inHeight, inWidth, filterId, filterHeight, filterWidth, biasId, padTop, padRight, padBottom, padLeft, isSamePad, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, fusedActivation, preluActivationWeightsId, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'FusedDepthwiseConv2D', - backendName: 'wasm', - setupFunc: setup$a, - kernelFunc: fusedDepthwiseConv2d - }); - + kernelName: 'FusedDepthwiseConv2D', + backendName: 'wasm', + setupFunc: setup$a, + kernelFunc: fusedDepthwiseConv2d + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1170,46 +1286,51 @@ * ============================================================================= */ var wasmGather; + function setup$b(backend) { - wasmGather = backend.wasm.cwrap('Gather', null /*void*/, [ - 'number', - 'number', - 'array', - 'number', - 'number', - 'number', - 'array', - 'number' // outId - ]); + wasmGather = backend.wasm.cwrap('Gather', null /*void*/ , [ + 'number', + 'number', + 'array', + 'number', + 'number', + 'number', + 'array', + 'number' // outId + ]); } + function gather(args) { - var backend = args.backend, inputs = args.inputs, attrs = args.attrs; - var x = inputs.x, indices = inputs.indices; - var axis = attrs.axis; - var newShape = x.shape.slice(); - newShape[axis] = tfjsCore.util.sizeFromShape(indices.shape); - var stridesSize = x.shape.length - 1; - var out = backend.makeOutput(newShape, x.dtype); - if (tfjsCore.util.sizeFromShape(x.shape) === 0) { - return out; - } - var xData = backend.dataIdMap.get(x.dataId); - var xId = xData.id; - var indicesData = backend.dataIdMap.get(indices.dataId); - var indicesId = indicesData.id; - var outId = backend.dataIdMap.get(out.dataId).id; - var xStridesBytes = new Uint8Array(new Int32Array(tfjsCore.util.computeStrides(x.shape)).buffer); - var outStridesBytes = new Uint8Array(new Int32Array(tfjsCore.util.computeStrides(newShape)).buffer); - wasmGather(xId, CppDType[x.dtype], xStridesBytes, stridesSize, indicesId, axis, outStridesBytes, outId); + var backend = args.backend, + inputs = args.inputs, + attrs = args.attrs; + var x = inputs.x, + indices = inputs.indices; + var axis = attrs.axis; + var newShape = x.shape.slice(); + newShape[axis] = tfjsCore.util.sizeFromShape(indices.shape); + var stridesSize = x.shape.length - 1; + var out = backend.makeOutput(newShape, x.dtype); + if (tfjsCore.util.sizeFromShape(x.shape) === 0) { return out; + } + var xData = backend.dataIdMap.get(x.dataId); + var xId = xData.id; + var indicesData = backend.dataIdMap.get(indices.dataId); + var indicesId = indicesData.id; + var outId = backend.dataIdMap.get(out.dataId).id; + var xStridesBytes = new Uint8Array(new Int32Array(tfjsCore.util.computeStrides(x.shape)).buffer); + var outStridesBytes = new Uint8Array(new Int32Array(tfjsCore.util.computeStrides(newShape)).buffer); + wasmGather(xId, CppDType[x.dtype], xStridesBytes, stridesSize, indicesId, axis, outStridesBytes, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'Gather', - backendName: 'wasm', - setupFunc: setup$b, - kernelFunc: gather - }); - + kernelName: 'Gather', + backendName: 'wasm', + setupFunc: setup$b, + kernelFunc: gather + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1227,44 +1348,52 @@ * ============================================================================= */ var wasmGatherNd; + function setup$c(backend) { - wasmGatherNd = backend.wasm.cwrap('GatherNd', null /*void*/, [ - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'array', - 'number' // outId - ]); + wasmGatherNd = backend.wasm.cwrap('GatherNd', null /*void*/ , [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'array', + 'number' // outId + ]); } + function gatherNd(args) { - var backend = args.backend, inputs = args.inputs; - var x = inputs.x, indices = inputs.indices; - var _a = tfjsCore.gather_util.prepareAndValidate(x, indices), resultShape = _a[0], numSlices = _a[1], sliceSize = _a[2], strides = _a[3]; - var out = backend.makeOutput(resultShape, x.dtype); - if (numSlices === 0) { - return out; - } - var indicesShape = indices.shape; - var sliceRank = indicesShape[indicesShape.length - 1]; - var xData = backend.dataIdMap.get(x.dataId); - var xId = xData.id; - var indicesData = backend.dataIdMap.get(indices.dataId); - var indicesId = indicesData.id; - var stridesBytes = new Uint8Array(new Int32Array(strides).buffer); - var outId = backend.dataIdMap.get(out.dataId).id; - wasmGatherNd(xId, CppDType[x.dtype], indicesId, numSlices, sliceRank, sliceSize, stridesBytes, outId); + var backend = args.backend, + inputs = args.inputs; + var x = inputs.x, + indices = inputs.indices; + var _a = tfjsCore.gather_util.prepareAndValidate(x, indices), + resultShape = _a[0], + numSlices = _a[1], + sliceSize = _a[2], + strides = _a[3]; + var out = backend.makeOutput(resultShape, x.dtype); + if (numSlices === 0) { return out; + } + var indicesShape = indices.shape; + var sliceRank = indicesShape[indicesShape.length - 1]; + var xData = backend.dataIdMap.get(x.dataId); + var xId = xData.id; + var indicesData = backend.dataIdMap.get(indices.dataId); + var indicesId = indicesData.id; + var stridesBytes = new Uint8Array(new Int32Array(strides).buffer); + var outId = backend.dataIdMap.get(out.dataId).id; + wasmGatherNd(xId, CppDType[x.dtype], indicesId, numSlices, sliceRank, sliceSize, stridesBytes, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'GatherNd', - backendName: 'wasm', - setupFunc: setup$c, - kernelFunc: gatherNd - }); - + kernelName: 'GatherNd', + backendName: 'wasm', + setupFunc: setup$c, + kernelFunc: gatherNd + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1282,8 +1411,8 @@ * ============================================================================= */ var supportsFullBroadcast$3 = false; - registerBinaryKernel('Greater', supportsFullBroadcast$3, 'bool'); - + registerBinaryKernel('Greater', supportsFullBroadcast$3, 'bool'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1301,8 +1430,8 @@ * ============================================================================= */ var supportsFullBroadcast$4 = false; - registerBinaryKernel('GreaterEqual', supportsFullBroadcast$4, 'bool'); - + registerBinaryKernel('GreaterEqual', supportsFullBroadcast$4, 'bool'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1320,8 +1449,8 @@ * ============================================================================= */ var supportsFullBroadcast$5 = false; - registerBinaryKernel('Less', supportsFullBroadcast$5, 'bool'); - + registerBinaryKernel('Less', supportsFullBroadcast$5, 'bool'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1339,8 +1468,8 @@ * ============================================================================= */ var supportsFullBroadcast$6 = false; - registerBinaryKernel('LessEqual', supportsFullBroadcast$6, 'bool'); - + registerBinaryKernel('LessEqual', supportsFullBroadcast$6, 'bool'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1357,8 +1486,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Log'); - + registerUnaryKernel('Log'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1376,8 +1505,8 @@ * ============================================================================= */ var supportsFullBroadcast$7 = false; - registerBinaryKernel('LogicalAnd', supportsFullBroadcast$7, 'bool'); - + registerBinaryKernel('LogicalAnd', supportsFullBroadcast$7, 'bool'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1395,33 +1524,39 @@ * ============================================================================= */ var wasmMax; + function setup$d(backend) { - wasmMax = - backend.wasm.cwrap('Max', null /*void*/, ['number, number, number']); + wasmMax = + backend.wasm.cwrap('Max', null /*void*/ , ['number, number, number']); } + function max(args) { - var backend = args.backend, inputs = args.inputs, attrs = args.attrs; - var axes = attrs.axes; - var x = inputs.x; - var xId = backend.dataIdMap.get(x.dataId).id; - tfjsCore.backend_util.assertAxesAreInnerMostDims('max', axes, x.shape.length); - var _a = tfjsCore.backend_util.computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; - var reduceSize = tfjsCore.util.sizeFromShape(reduceShape); - var out = backend.makeOutput(outShape, x.dtype); - if (tfjsCore.util.sizeFromShape(x.shape) === 0) { - return out; - } - var outId = backend.dataIdMap.get(out.dataId).id; - wasmMax(xId, reduceSize, outId); + var backend = args.backend, + inputs = args.inputs, + attrs = args.attrs; + var axes = attrs.axes; + var x = inputs.x; + var xId = backend.dataIdMap.get(x.dataId).id; + tfjsCore.backend_util.assertAxesAreInnerMostDims('max', axes, x.shape.length); + var _a = tfjsCore.backend_util.computeOutAndReduceShapes(x.shape, axes), + outShape = _a[0], + reduceShape = _a[1]; + var reduceSize = tfjsCore.util.sizeFromShape(reduceShape); + var out = backend.makeOutput(outShape, x.dtype); + if (tfjsCore.util.sizeFromShape(x.shape) === 0) { return out; + } + var outId = backend.dataIdMap.get(out.dataId).id; + wasmMax(xId, reduceSize, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'Max', - backendName: 'wasm', - setupFunc: setup$d, - kernelFunc: max - }); - + kernelName: 'Max', + backendName: 'wasm', + setupFunc: setup$d, + kernelFunc: max + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1439,8 +1574,8 @@ * ============================================================================= */ var supportsFullBroadcast$8 = false; - registerBinaryKernel('Maximum', supportsFullBroadcast$8); - + registerBinaryKernel('Maximum', supportsFullBroadcast$8); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1458,60 +1593,64 @@ * ============================================================================= */ var wasmMaxPool; + function setup$e(backend) { - wasmMaxPool = backend.wasm.cwrap('MaxPool', null /* void */, [ - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - ]); + wasmMaxPool = backend.wasm.cwrap('MaxPool', null /* void */ , [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + ]); } + function maxPool(args) { - var inputs = args.inputs, attrs = args.attrs, backend = args.backend; - var convInfo = attrs; - var x = inputs.x; - var xId = backend.dataIdMap.get(x.dataId).id; - var filterHeight = convInfo.filterHeight; - var filterWidth = convInfo.filterWidth; - var padTop = convInfo.padInfo.top; - var padRight = convInfo.padInfo.right; - var padBottom = convInfo.padInfo.bottom; - var padLeft = convInfo.padInfo.left; - var dilationHeight = convInfo.dilationHeight; - var dilationWidth = convInfo.dilationWidth; - var strideHeight = convInfo.strideHeight; - var strideWidth = convInfo.strideWidth; - var inputChannels = convInfo.inChannels; - var outputChannels = convInfo.outChannels; - if (convInfo.dataFormat !== 'channelsLast') { - throw new Error("wasm backend does not support dataFormat:'" + - (convInfo.dataFormat + "'. Please use 'channelsLast'.")); - } - var out = backend.makeOutput(convInfo.outShape, 'float32'); - var outId = backend.dataIdMap.get(out.dataId).id; - wasmMaxPool(xId, x.shape[0], x.shape[1], x.shape[2], filterHeight, filterWidth, padTop, padRight, padBottom, padLeft, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, outId); - return out; + var inputs = args.inputs, + attrs = args.attrs, + backend = args.backend; + var convInfo = attrs; + var x = inputs.x; + var xId = backend.dataIdMap.get(x.dataId).id; + var filterHeight = convInfo.filterHeight; + var filterWidth = convInfo.filterWidth; + var padTop = convInfo.padInfo.top; + var padRight = convInfo.padInfo.right; + var padBottom = convInfo.padInfo.bottom; + var padLeft = convInfo.padInfo.left; + var dilationHeight = convInfo.dilationHeight; + var dilationWidth = convInfo.dilationWidth; + var strideHeight = convInfo.strideHeight; + var strideWidth = convInfo.strideWidth; + var inputChannels = convInfo.inChannels; + var outputChannels = convInfo.outChannels; + if (convInfo.dataFormat !== 'channelsLast') { + throw new Error("wasm backend does not support dataFormat:'" + + (convInfo.dataFormat + "'. Please use 'channelsLast'.")); + } + var out = backend.makeOutput(convInfo.outShape, 'float32'); + var outId = backend.dataIdMap.get(out.dataId).id; + wasmMaxPool(xId, x.shape[0], x.shape[1], x.shape[2], filterHeight, filterWidth, padTop, padRight, padBottom, padLeft, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'MaxPool', - backendName: 'wasm', - setupFunc: setup$e, - kernelFunc: maxPool - }); - + kernelName: 'MaxPool', + backendName: 'wasm', + setupFunc: setup$e, + kernelFunc: maxPool + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1529,33 +1668,39 @@ * ============================================================================= */ var wasmMin; + function setup$f(backend) { - wasmMin = - backend.wasm.cwrap('Min', null /*void*/, ['number, number, number']); + wasmMin = + backend.wasm.cwrap('Min', null /*void*/ , ['number, number, number']); } + function min(args) { - var backend = args.backend, inputs = args.inputs, attrs = args.attrs; - var axes = attrs.axes; - var x = inputs.x; - var xId = backend.dataIdMap.get(x.dataId).id; - tfjsCore.backend_util.assertAxesAreInnerMostDims('min', axes, x.shape.length); - var _a = tfjsCore.backend_util.computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; - var reduceSize = tfjsCore.util.sizeFromShape(reduceShape); - var out = backend.makeOutput(outShape, x.dtype); - if (tfjsCore.util.sizeFromShape(x.shape) === 0) { - return out; - } - var outId = backend.dataIdMap.get(out.dataId).id; - wasmMin(xId, reduceSize, outId); + var backend = args.backend, + inputs = args.inputs, + attrs = args.attrs; + var axes = attrs.axes; + var x = inputs.x; + var xId = backend.dataIdMap.get(x.dataId).id; + tfjsCore.backend_util.assertAxesAreInnerMostDims('min', axes, x.shape.length); + var _a = tfjsCore.backend_util.computeOutAndReduceShapes(x.shape, axes), + outShape = _a[0], + reduceShape = _a[1]; + var reduceSize = tfjsCore.util.sizeFromShape(reduceShape); + var out = backend.makeOutput(outShape, x.dtype); + if (tfjsCore.util.sizeFromShape(x.shape) === 0) { return out; + } + var outId = backend.dataIdMap.get(out.dataId).id; + wasmMin(xId, reduceSize, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'Min', - backendName: 'wasm', - setupFunc: setup$f, - kernelFunc: min - }); - + kernelName: 'Min', + backendName: 'wasm', + setupFunc: setup$f, + kernelFunc: min + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1573,8 +1718,8 @@ * ============================================================================= */ var supportsFullBroadcast$9 = false; - registerBinaryKernel('Minimum', supportsFullBroadcast$9); - + registerBinaryKernel('Minimum', supportsFullBroadcast$9); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1592,8 +1737,8 @@ * ============================================================================= */ var supportsFullBroadcast$a = true; - registerBinaryKernel('Mul', supportsFullBroadcast$a); - + registerBinaryKernel('Mul', supportsFullBroadcast$a); + /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -1610,8 +1755,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Neg'); - + registerUnaryKernel('Neg'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1633,15 +1778,19 @@ * `Result`. */ function parseResultStruct(backend, resOffset) { - var result = new Int32Array(backend.wasm.HEAPU8.buffer, resOffset, 3); - var pSelectedIndices = result[0]; - var selectedSize = result[1]; - var pSelectedScores = result[2]; - // Since the result was allocated on the heap, we have to delete it. - backend.wasm._free(resOffset); - return { pSelectedIndices: pSelectedIndices, selectedSize: selectedSize, pSelectedScores: pSelectedScores }; - } - + var result = new Int32Array(backend.wasm.HEAPU8.buffer, resOffset, 3); + var pSelectedIndices = result[0]; + var selectedSize = result[1]; + var pSelectedScores = result[2]; + // Since the result was allocated on the heap, we have to delete it. + backend.wasm._free(resOffset); + return { + pSelectedIndices: pSelectedIndices, + selectedSize: selectedSize, + pSelectedScores: pSelectedScores + }; + } + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1659,36 +1808,46 @@ * ============================================================================= */ var wasmFunc$2; + function setup$g(backend) { - wasmFunc$2 = backend.wasm.cwrap('NonMaxSuppressionV3', 'number', // Result* + wasmFunc$2 = backend.wasm.cwrap('NonMaxSuppressionV3', 'number', // Result* [ - 'number', - 'number', - 'number', - 'number', - 'number', + 'number', + 'number', + 'number', + 'number', + 'number', ]); } + function kernelFunc(args) { - var backend = args.backend, inputs = args.inputs, attrs = args.attrs; - var iouThreshold = attrs.iouThreshold, maxOutputSize = attrs.maxOutputSize, scoreThreshold = attrs.scoreThreshold; - var boxes = inputs.boxes, scores = inputs.scores; - var boxesId = backend.dataIdMap.get(boxes.dataId).id; - var scoresId = backend.dataIdMap.get(scores.dataId).id; - var resOffset = wasmFunc$2(boxesId, scoresId, maxOutputSize, iouThreshold, scoreThreshold); - var _a = parseResultStruct(backend, resOffset), pSelectedIndices = _a.pSelectedIndices, selectedSize = _a.selectedSize, pSelectedScores = _a.pSelectedScores; - // Since we are not using scores for V3, we have to delete it from the heap. - backend.wasm._free(pSelectedScores); - var selectedIndicesTensor = backend.makeOutput([selectedSize], 'int32', pSelectedIndices); - return selectedIndicesTensor; + var backend = args.backend, + inputs = args.inputs, + attrs = args.attrs; + var iouThreshold = attrs.iouThreshold, + maxOutputSize = attrs.maxOutputSize, + scoreThreshold = attrs.scoreThreshold; + var boxes = inputs.boxes, + scores = inputs.scores; + var boxesId = backend.dataIdMap.get(boxes.dataId).id; + var scoresId = backend.dataIdMap.get(scores.dataId).id; + var resOffset = wasmFunc$2(boxesId, scoresId, maxOutputSize, iouThreshold, scoreThreshold); + var _a = parseResultStruct(backend, resOffset), + pSelectedIndices = _a.pSelectedIndices, + selectedSize = _a.selectedSize, + pSelectedScores = _a.pSelectedScores; + // Since we are not using scores for V3, we have to delete it from the heap. + backend.wasm._free(pSelectedScores); + var selectedIndicesTensor = backend.makeOutput([selectedSize], 'int32', pSelectedIndices); + return selectedIndicesTensor; } tfjsCore.registerKernel({ - kernelName: 'NonMaxSuppressionV3', - backendName: 'wasm', - setupFunc: setup$g, - kernelFunc: kernelFunc, - }); - + kernelName: 'NonMaxSuppressionV3', + backendName: 'wasm', + setupFunc: setup$g, + kernelFunc: kernelFunc, + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1706,36 +1865,47 @@ * ============================================================================= */ var wasmFunc$3; + function setup$h(backend) { - wasmFunc$3 = backend.wasm.cwrap('NonMaxSuppressionV5', 'number', // Result* + wasmFunc$3 = backend.wasm.cwrap('NonMaxSuppressionV5', 'number', // Result* [ - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', ]); } + function kernelFunc$1(args) { - var backend = args.backend, inputs = args.inputs, attrs = args.attrs; - var iouThreshold = attrs.iouThreshold, maxOutputSize = attrs.maxOutputSize, scoreThreshold = attrs.scoreThreshold, softNmsSigma = attrs.softNmsSigma; - var boxes = inputs.boxes, scores = inputs.scores; - var boxesId = backend.dataIdMap.get(boxes.dataId).id; - var scoresId = backend.dataIdMap.get(scores.dataId).id; - var resOffset = wasmFunc$3(boxesId, scoresId, maxOutputSize, iouThreshold, scoreThreshold, softNmsSigma); - var _a = parseResultStruct(backend, resOffset), pSelectedIndices = _a.pSelectedIndices, selectedSize = _a.selectedSize, pSelectedScores = _a.pSelectedScores; - var selectedIndicesTensor = backend.makeOutput([selectedSize], 'int32', pSelectedIndices); - var selectedScoresTensor = backend.makeOutput([selectedSize], 'float32', pSelectedScores); - return [selectedIndicesTensor, selectedScoresTensor]; + var backend = args.backend, + inputs = args.inputs, + attrs = args.attrs; + var iouThreshold = attrs.iouThreshold, + maxOutputSize = attrs.maxOutputSize, + scoreThreshold = attrs.scoreThreshold, + softNmsSigma = attrs.softNmsSigma; + var boxes = inputs.boxes, + scores = inputs.scores; + var boxesId = backend.dataIdMap.get(boxes.dataId).id; + var scoresId = backend.dataIdMap.get(scores.dataId).id; + var resOffset = wasmFunc$3(boxesId, scoresId, maxOutputSize, iouThreshold, scoreThreshold, softNmsSigma); + var _a = parseResultStruct(backend, resOffset), + pSelectedIndices = _a.pSelectedIndices, + selectedSize = _a.selectedSize, + pSelectedScores = _a.pSelectedScores; + var selectedIndicesTensor = backend.makeOutput([selectedSize], 'int32', pSelectedIndices); + var selectedScoresTensor = backend.makeOutput([selectedSize], 'float32', pSelectedScores); + return [selectedIndicesTensor, selectedScoresTensor]; } tfjsCore.registerKernel({ - kernelName: 'NonMaxSuppressionV5', - backendName: 'wasm', - setupFunc: setup$h, - kernelFunc: kernelFunc$1, - }); - + kernelName: 'NonMaxSuppressionV5', + backendName: 'wasm', + setupFunc: setup$h, + kernelFunc: kernelFunc$1, + }); + /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -1753,8 +1923,8 @@ * ============================================================================= */ var supportsFullBroadcast$b = false; - registerBinaryKernel('NotEqual', supportsFullBroadcast$b, 'bool'); - + registerBinaryKernel('NotEqual', supportsFullBroadcast$b, 'bool'); + /** * @license * Copyright 2020 Google Inc. All Rights Reserved. @@ -1772,18 +1942,19 @@ * ============================================================================= */ function onesLike(args) { - var x = args.inputs.x, backend = args.backend; - var out = backend.makeOutput(x.shape, x.dtype); - var outVals = backend.typedArrayFromHeap(out); - outVals.fill(1); - return out; + var x = args.inputs.x, + backend = args.backend; + var out = backend.makeOutput(x.shape, x.dtype); + var outVals = backend.typedArrayFromHeap(out); + outVals.fill(1); + return out; } tfjsCore.registerKernel({ - kernelName: 'OnesLike', - backendName: 'wasm', - kernelFunc: onesLike, - }); - + kernelName: 'OnesLike', + backendName: 'wasm', + kernelFunc: onesLike, + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1801,36 +1972,44 @@ * ============================================================================= */ var wasmPadV2; + function setup$i(backend) { - wasmPadV2 = backend.wasm.cwrap('PadV2', null /* void */, [ - 'number', - 'array', - 'number', - 'number', - 'array', - 'number', - 'number', - ]); + wasmPadV2 = backend.wasm.cwrap('PadV2', null /* void */ , [ + 'number', + 'array', + 'number', + 'number', + 'array', + 'number', + 'number', + ]); } + function pad(args) { - var x = args.inputs.x, backend = args.backend, _a = args.attrs, paddings = _a.paddings, constantValue = _a.constantValue; - var outShape = paddings.map(function (p, i) { return p[0] /* beforePad */ + x.shape[i] + p[1]; } /* afterPad */); - var xId = backend.dataIdMap.get(x.dataId).id; - var out = backend.makeOutput(outShape, x.dtype); - var outId = backend.dataIdMap.get(out.dataId).id; - var xShapeBytes = new Uint8Array(new Int32Array(x.shape).buffer); - var paddingsFlat = [].concat.apply([], paddings); - var paddingsBytes = new Uint8Array(new Int32Array(paddingsFlat).buffer); - wasmPadV2(xId, xShapeBytes, x.shape.length, CppDType[x.dtype], paddingsBytes, constantValue, outId); - return out; + var x = args.inputs.x, + backend = args.backend, + _a = args.attrs, + paddings = _a.paddings, + constantValue = _a.constantValue; + var outShape = paddings.map(function (p, i) { + return p[0] /* beforePad */ + x.shape[i] + p[1]; + } /* afterPad */ ); + var xId = backend.dataIdMap.get(x.dataId).id; + var out = backend.makeOutput(outShape, x.dtype); + var outId = backend.dataIdMap.get(out.dataId).id; + var xShapeBytes = new Uint8Array(new Int32Array(x.shape).buffer); + var paddingsFlat = [].concat.apply([], paddings); + var paddingsBytes = new Uint8Array(new Int32Array(paddingsFlat).buffer); + wasmPadV2(xId, xShapeBytes, x.shape.length, CppDType[x.dtype], paddingsBytes, constantValue, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'PadV2', - backendName: 'wasm', - kernelFunc: pad, - setupFunc: setup$i - }); - + kernelName: 'PadV2', + backendName: 'wasm', + kernelFunc: pad, + setupFunc: setup$i + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1848,8 +2027,8 @@ * ============================================================================= */ var supportsFullBroadcast$c = false; - registerBinaryKernel('Pow', supportsFullBroadcast$c); - + registerBinaryKernel('Pow', supportsFullBroadcast$c); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1867,30 +2046,34 @@ * ============================================================================= */ var wasmPrelu; + function setup$j(backend) { - wasmPrelu = backend.wasm.cwrap('Prelu', null /* void */, [ - 'number', - 'number', - 'number' // out_id - ]); + wasmPrelu = backend.wasm.cwrap('Prelu', null /* void */ , [ + 'number', + 'number', + 'number' // out_id + ]); } + function prelu(args) { - var inputs = args.inputs, backend = args.backend; - var x = inputs.x, alpha = inputs.alpha; - var xId = backend.dataIdMap.get(x.dataId).id; - var weightsId = backend.dataIdMap.get(alpha.dataId).id; - var out = backend.makeOutput(x.shape, 'float32'); - var outId = backend.dataIdMap.get(out.dataId).id; - wasmPrelu(xId, weightsId, outId); - return out; + var inputs = args.inputs, + backend = args.backend; + var x = inputs.x, + alpha = inputs.alpha; + var xId = backend.dataIdMap.get(x.dataId).id; + var weightsId = backend.dataIdMap.get(alpha.dataId).id; + var out = backend.makeOutput(x.shape, 'float32'); + var outId = backend.dataIdMap.get(out.dataId).id; + wasmPrelu(xId, weightsId, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'Prelu', - backendName: 'wasm', - setupFunc: setup$j, - kernelFunc: prelu - }); - + kernelName: 'Prelu', + backendName: 'wasm', + setupFunc: setup$j, + kernelFunc: prelu + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1907,8 +2090,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Relu'); - + registerUnaryKernel('Relu'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1925,8 +2108,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Relu6'); - + registerUnaryKernel('Relu6'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1944,15 +2127,20 @@ * ============================================================================= */ function reshape(args) { - var x = args.inputs.x, shape = args.attrs.shape; - return { dataId: x.dataId, shape: shape, dtype: x.dtype }; + var x = args.inputs.x, + shape = args.attrs.shape; + return { + dataId: x.dataId, + shape: shape, + dtype: x.dtype + }; } tfjsCore.registerKernel({ - kernelName: 'Reshape', - backendName: 'wasm', - kernelFunc: reshape, - }); - + kernelName: 'Reshape', + backendName: 'wasm', + kernelFunc: reshape, + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1970,50 +2158,68 @@ * ============================================================================= */ var wasmResizeBilinear; + function setup$k(backend) { - wasmResizeBilinear = backend.wasm.cwrap('ResizeBilinear', null /*void*/, [ - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number' // outId - ]); + wasmResizeBilinear = backend.wasm.cwrap('ResizeBilinear', null /*void*/ , [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number' // outId + ]); } + function resizeBilinear(args) { - var backend = args.backend, inputs = args.inputs, attrs = args.attrs; - var x = inputs.x; - var alignCorners = attrs.alignCorners, newHeight = attrs.newHeight, newWidth = attrs.newWidth; - var _a = x.shape, batch = _a[0], oldHeight = _a[1], oldWidth = _a[2], numChannels = _a[3]; - var outShape = [batch, newHeight, newWidth, numChannels]; - var xData = backend.dataIdMap.get(x.dataId); - var castedData; - if (xData.dtype !== 'float32') { - castedData = cast({ backend: backend, inputs: { x: x }, attrs: { dtype: 'float32' } }); - xData = backend.dataIdMap.get(castedData.dataId); - } - var xId = xData.id; - var out = backend.makeOutput(outShape, 'float32'); - if (tfjsCore.util.sizeFromShape(x.shape) === 0) { - return out; - } - var outId = backend.dataIdMap.get(out.dataId).id; - wasmResizeBilinear(xId, batch, oldHeight, oldWidth, numChannels, newHeight, newWidth, alignCorners ? 1 : 0, outId); - if (castedData != null) { - backend.disposeData(castedData.dataId); - } + var backend = args.backend, + inputs = args.inputs, + attrs = args.attrs; + var x = inputs.x; + var alignCorners = attrs.alignCorners, + newHeight = attrs.newHeight, + newWidth = attrs.newWidth; + var _a = x.shape, + batch = _a[0], + oldHeight = _a[1], + oldWidth = _a[2], + numChannels = _a[3]; + var outShape = [batch, newHeight, newWidth, numChannels]; + var xData = backend.dataIdMap.get(x.dataId); + var castedData; + if (xData.dtype !== 'float32') { + castedData = cast({ + backend: backend, + inputs: { + x: x + }, + attrs: { + dtype: 'float32' + } + }); + xData = backend.dataIdMap.get(castedData.dataId); + } + var xId = xData.id; + var out = backend.makeOutput(outShape, 'float32'); + if (tfjsCore.util.sizeFromShape(x.shape) === 0) { return out; + } + var outId = backend.dataIdMap.get(out.dataId).id; + wasmResizeBilinear(xId, batch, oldHeight, oldWidth, numChannels, newHeight, newWidth, alignCorners ? 1 : 0, outId); + if (castedData != null) { + backend.disposeData(castedData.dataId); + } + return out; } tfjsCore.registerKernel({ - kernelName: 'ResizeBilinear', - backendName: 'wasm', - setupFunc: setup$k, - kernelFunc: resizeBilinear - }); - + kernelName: 'ResizeBilinear', + backendName: 'wasm', + setupFunc: setup$k, + kernelFunc: resizeBilinear + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2030,8 +2236,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Rsqrt'); - + registerUnaryKernel('Rsqrt'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2049,44 +2255,54 @@ * ============================================================================= */ var wasmScatterNd; + function setup$l(backend) { - wasmScatterNd = backend.wasm.cwrap('ScatterNd', null /*void*/, [ - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'array', - 'number', - 'number' // outId - ]); + wasmScatterNd = backend.wasm.cwrap('ScatterNd', null /*void*/ , [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'array', + 'number', + 'number' // outId + ]); } + function scatterNd(args) { - var backend = args.backend, inputs = args.inputs, attrs = args.attrs; - var indices = inputs.indices, updates = inputs.updates; - var shape = attrs.shape; - var out = backend.makeOutput(shape, updates.dtype); - if (tfjsCore.util.sizeFromShape(shape) === 0) { - return out; - } - var _a = tfjsCore.scatter_util.calculateShapes(updates, indices, shape), sliceRank = _a.sliceRank, numUpdates = _a.numUpdates, sliceSize = _a.sliceSize, strides = _a.strides, outputSize = _a.outputSize; - var indicesData = backend.dataIdMap.get(indices.dataId); - var indicesId = indicesData.id; - var updatesData = backend.dataIdMap.get(updates.dataId); - var updatesId = updatesData.id; - var stridesBytes = new Uint8Array(new Int32Array(strides).buffer); - var outId = backend.dataIdMap.get(out.dataId).id; - wasmScatterNd(indicesId, updatesId, CppDType[updates.dtype], sliceRank, numUpdates, sliceSize, stridesBytes, outputSize, outId); + var backend = args.backend, + inputs = args.inputs, + attrs = args.attrs; + var indices = inputs.indices, + updates = inputs.updates; + var shape = attrs.shape; + var out = backend.makeOutput(shape, updates.dtype); + if (tfjsCore.util.sizeFromShape(shape) === 0) { return out; + } + var _a = tfjsCore.scatter_util.calculateShapes(updates, indices, shape), + sliceRank = _a.sliceRank, + numUpdates = _a.numUpdates, + sliceSize = _a.sliceSize, + strides = _a.strides, + outputSize = _a.outputSize; + var indicesData = backend.dataIdMap.get(indices.dataId); + var indicesId = indicesData.id; + var updatesData = backend.dataIdMap.get(updates.dataId); + var updatesId = updatesData.id; + var stridesBytes = new Uint8Array(new Int32Array(strides).buffer); + var outId = backend.dataIdMap.get(out.dataId).id; + wasmScatterNd(indicesId, updatesId, CppDType[updates.dtype], sliceRank, numUpdates, sliceSize, stridesBytes, outputSize, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'ScatterNd', - backendName: 'wasm', - setupFunc: setup$l, - kernelFunc: scatterNd - }); - + kernelName: 'ScatterNd', + backendName: 'wasm', + setupFunc: setup$l, + kernelFunc: scatterNd + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2104,29 +2320,32 @@ * ============================================================================= */ var wasmFunc$4; + function setup$m(backend) { - wasmFunc$4 = - backend.wasm.cwrap('Sigmoid', null /* void */, ['number', 'number']); + wasmFunc$4 = + backend.wasm.cwrap('Sigmoid', null /* void */ , ['number', 'number']); } + function sigmoid(args) { - var backend = args.backend, x = args.inputs.x; - var xId = backend.dataIdMap.get(x.dataId).id; - var out = backend.makeOutput(x.shape, x.dtype); - var outId = backend.dataIdMap.get(out.dataId).id; - // Short-circuit zero-sized tensors. - if (tfjsCore.util.sizeFromShape(out.shape) === 0) { - return out; - } - wasmFunc$4(xId, outId); + var backend = args.backend, + x = args.inputs.x; + var xId = backend.dataIdMap.get(x.dataId).id; + var out = backend.makeOutput(x.shape, x.dtype); + var outId = backend.dataIdMap.get(out.dataId).id; + // Short-circuit zero-sized tensors. + if (tfjsCore.util.sizeFromShape(out.shape) === 0) { return out; + } + wasmFunc$4(xId, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'Sigmoid', - backendName: 'wasm', - setupFunc: setup$m, - kernelFunc: sigmoid - }); - + kernelName: 'Sigmoid', + backendName: 'wasm', + setupFunc: setup$m, + kernelFunc: sigmoid + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2143,8 +2362,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Sin'); - + registerUnaryKernel('Sin'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2162,92 +2381,99 @@ * ============================================================================= */ function slice(args) { - var x = args.inputs.x, _a = args.attrs, begin = _a.begin, size = _a.size, backend = args.backend; - var isContinous = tfjsCore.slice_util.isSliceContinous(x.shape, begin, size); - var xVals = backend.typedArrayFromHeap(x); - var out = backend.makeOutput(size, x.dtype); - var outVals = backend.typedArrayFromHeap(out); - var xStrides = tfjsCore.util.computeStrides(x.shape); - if (isContinous) { - var flatOffset = tfjsCore.slice_util.computeFlatOffset(begin, xStrides); - outVals.set(xVals.subarray(flatOffset, flatOffset + tfjsCore.util.sizeFromShape(size))); - return out; - } - var rank = x.shape.length; - if (rank === 2) { - slice2d(xVals, xStrides[0], outVals, begin, size); - } - else if (rank === 3) { - slice3d(xVals, xStrides[0], xStrides[1], outVals, begin, size); - } - else if (rank === 4) { - slice4d(xVals, xStrides[0], xStrides[1], xStrides[2], outVals, begin, size); - } - else { - genericSliceSlow(xVals, x, outVals, begin, size); - } + var x = args.inputs.x, + _a = args.attrs, + begin = _a.begin, + size = _a.size, + backend = args.backend; + var isContinous = tfjsCore.slice_util.isSliceContinous(x.shape, begin, size); + var xVals = backend.typedArrayFromHeap(x); + var out = backend.makeOutput(size, x.dtype); + var outVals = backend.typedArrayFromHeap(out); + var xStrides = tfjsCore.util.computeStrides(x.shape); + if (isContinous) { + var flatOffset = tfjsCore.slice_util.computeFlatOffset(begin, xStrides); + outVals.set(xVals.subarray(flatOffset, flatOffset + tfjsCore.util.sizeFromShape(size))); return out; + } + var rank = x.shape.length; + if (rank === 2) { + slice2d(xVals, xStrides[0], outVals, begin, size); + } else if (rank === 3) { + slice3d(xVals, xStrides[0], xStrides[1], outVals, begin, size); + } else if (rank === 4) { + slice4d(xVals, xStrides[0], xStrides[1], xStrides[2], outVals, begin, size); + } else { + genericSliceSlow(xVals, x, outVals, begin, size); + } + return out; } + function slice2d(xVals, xStride, outVals, begin, size) { - var outOffset = 0; - var beginI = begin[0]; - var beginJ = begin[1]; - var endI = beginI + size[0]; - for (var i = beginI; i < endI; i++) { - var xOffset = i * xStride + beginJ; - outVals.set(xVals.subarray(xOffset, xOffset + size[1]), outOffset); - outOffset += size[1]; - } + var outOffset = 0; + var beginI = begin[0]; + var beginJ = begin[1]; + var endI = beginI + size[0]; + for (var i = beginI; i < endI; i++) { + var xOffset = i * xStride + beginJ; + outVals.set(xVals.subarray(xOffset, xOffset + size[1]), outOffset); + outOffset += size[1]; + } } + function slice3d(xVals, xStride1, xStride2, outVals, begin, size) { - var outOffset = 0; - var beginI = begin[0]; - var beginJ = begin[1]; - var beginK = begin[2]; - var endI = beginI + size[0]; - var endJ = beginJ + size[1]; - for (var i = beginI; i < endI; i++) { - for (var j = beginJ; j < endJ; j++) { - var xOffset = i * xStride1 + j * xStride2 + beginK; - outVals.set(xVals.subarray(xOffset, xOffset + size[2]), outOffset); - outOffset += size[2]; - } + var outOffset = 0; + var beginI = begin[0]; + var beginJ = begin[1]; + var beginK = begin[2]; + var endI = beginI + size[0]; + var endJ = beginJ + size[1]; + for (var i = beginI; i < endI; i++) { + for (var j = beginJ; j < endJ; j++) { + var xOffset = i * xStride1 + j * xStride2 + beginK; + outVals.set(xVals.subarray(xOffset, xOffset + size[2]), outOffset); + outOffset += size[2]; } + } } + function slice4d(xVals, xStride1, xStride2, xStride3, outVals, begin, size) { - var outOffset = 0; - var beginI = begin[0]; - var beginJ = begin[1]; - var beginK = begin[2]; - var endI = beginI + size[0]; - var endJ = beginJ + size[1]; - var endK = beginK + size[2]; - var beginL = begin[3]; - for (var i = beginI; i < endI; i++) { - for (var j = beginJ; j < endJ; j++) { - for (var k = beginK; k < endK; k++) { - var xOffset = i * xStride1 + j * xStride2 + k * xStride3 + beginL; - outVals.set(xVals.subarray(xOffset, xOffset + size[3]), outOffset); - outOffset += size[3]; - } - } + var outOffset = 0; + var beginI = begin[0]; + var beginJ = begin[1]; + var beginK = begin[2]; + var endI = beginI + size[0]; + var endJ = beginJ + size[1]; + var endK = beginK + size[2]; + var beginL = begin[3]; + for (var i = beginI; i < endI; i++) { + for (var j = beginJ; j < endJ; j++) { + for (var k = beginK; k < endK; k++) { + var xOffset = i * xStride1 + j * xStride2 + k * xStride3 + beginL; + outVals.set(xVals.subarray(xOffset, xOffset + size[3]), outOffset); + outOffset += size[3]; + } } + } } + function genericSliceSlow(xVals, xInfo, outVals, begin, size) { - var outBuf = tfjsCore.buffer(size, xInfo.dtype, outVals); - var xBuf = tfjsCore.buffer(xInfo.shape, xInfo.dtype, xVals); - for (var i = 0; i < outBuf.size; ++i) { - var loc = outBuf.indexToLoc(i); - var xLoc = loc.map(function (idx, j) { return idx + begin[j]; }); - outVals[i] = xBuf.get.apply(xBuf, xLoc); - } + var outBuf = tfjsCore.buffer(size, xInfo.dtype, outVals); + var xBuf = tfjsCore.buffer(xInfo.shape, xInfo.dtype, xVals); + for (var i = 0; i < outBuf.size; ++i) { + var loc = outBuf.indexToLoc(i); + var xLoc = loc.map(function (idx, j) { + return idx + begin[j]; + }); + outVals[i] = xBuf.get.apply(xBuf, xLoc); + } } tfjsCore.registerKernel({ - kernelName: 'Slice', - backendName: 'wasm', - kernelFunc: slice, - }); - + kernelName: 'Slice', + backendName: 'wasm', + kernelFunc: slice, + }); + /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -2265,35 +2491,39 @@ * ============================================================================= */ var wasmFunc$5; + function setup$n(backend) { - wasmFunc$5 = backend.wasm.cwrap('Softmax', null /* void */, [ - 'number', - 'number', - 'number', - 'number' // batch - ]); + wasmFunc$5 = backend.wasm.cwrap('Softmax', null /* void */ , [ + 'number', + 'number', + 'number', + 'number' // batch + ]); } + function softmax(args) { - var backend = args.backend, logits = args.inputs.logits, dim = args.attrs.dim; - var xId = backend.dataIdMap.get(logits.dataId).id; - var out = backend.makeOutput(logits.shape, logits.dtype); - var outId = backend.dataIdMap.get(out.dataId).id; - var channels = logits.shape[dim]; - var batch = tfjsCore.util.sizeFromShape(logits.shape) / channels; - // Short-circuit zero-sized tensors. - if (tfjsCore.util.sizeFromShape(out.shape) === 0) { - return out; - } - wasmFunc$5(xId, outId, channels, batch); + var backend = args.backend, + logits = args.inputs.logits, + dim = args.attrs.dim; + var xId = backend.dataIdMap.get(logits.dataId).id; + var out = backend.makeOutput(logits.shape, logits.dtype); + var outId = backend.dataIdMap.get(out.dataId).id; + var channels = logits.shape[dim]; + var batch = tfjsCore.util.sizeFromShape(logits.shape) / channels; + // Short-circuit zero-sized tensors. + if (tfjsCore.util.sizeFromShape(out.shape) === 0) { return out; + } + wasmFunc$5(xId, outId, channels, batch); + return out; } tfjsCore.registerKernel({ - kernelName: 'Softmax', - backendName: 'wasm', - setupFunc: setup$n, - kernelFunc: softmax - }); - + kernelName: 'Softmax', + backendName: 'wasm', + setupFunc: setup$n, + kernelFunc: softmax + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2310,8 +2540,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Square'); - + registerUnaryKernel('Square'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2329,8 +2559,8 @@ * ============================================================================= */ var supportsFullBroadcast$d = true; - registerBinaryKernel('Sub', supportsFullBroadcast$d); - + registerBinaryKernel('Sub', supportsFullBroadcast$d); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2348,33 +2578,39 @@ * ============================================================================= */ var wasmSum; + function setup$o(backend) { - wasmSum = - backend.wasm.cwrap('Sum', null /*void*/, ['number, number, number']); + wasmSum = + backend.wasm.cwrap('Sum', null /*void*/ , ['number, number, number']); } + function sum(args) { - var backend = args.backend, inputs = args.inputs, attrs = args.attrs; - var axes = attrs.axes; - var x = inputs.x; - var xId = backend.dataIdMap.get(x.dataId).id; - tfjsCore.backend_util.assertAxesAreInnerMostDims('sum', axes, x.shape.length); - var _a = tfjsCore.backend_util.computeOutAndReduceShapes(x.shape, axes), outShape = _a[0], reduceShape = _a[1]; - var reduceSize = tfjsCore.util.sizeFromShape(reduceShape); - var out = backend.makeOutput(outShape, x.dtype); - if (tfjsCore.util.sizeFromShape(x.shape) === 0) { - return out; - } - var outId = backend.dataIdMap.get(out.dataId).id; - wasmSum(xId, reduceSize, outId); + var backend = args.backend, + inputs = args.inputs, + attrs = args.attrs; + var axes = attrs.axes; + var x = inputs.x; + var xId = backend.dataIdMap.get(x.dataId).id; + tfjsCore.backend_util.assertAxesAreInnerMostDims('sum', axes, x.shape.length); + var _a = tfjsCore.backend_util.computeOutAndReduceShapes(x.shape, axes), + outShape = _a[0], + reduceShape = _a[1]; + var reduceSize = tfjsCore.util.sizeFromShape(reduceShape); + var out = backend.makeOutput(outShape, x.dtype); + if (tfjsCore.util.sizeFromShape(x.shape) === 0) { return out; + } + var outId = backend.dataIdMap.get(out.dataId).id; + wasmSum(xId, reduceSize, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'Sum', - backendName: 'wasm', - setupFunc: setup$o, - kernelFunc: sum - }); - + kernelName: 'Sum', + backendName: 'wasm', + setupFunc: setup$o, + kernelFunc: sum + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2391,8 +2627,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Tanh'); - + registerUnaryKernel('Tanh'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2410,39 +2646,43 @@ * ============================================================================= */ var wasmTile; + function setup$p(backend) { - wasmTile = backend.wasm.cwrap('Tile', null /* void */, [ - 'number', - 'array', - 'number', - 'array', - 'number', - 'number' // out_id - ]); + wasmTile = backend.wasm.cwrap('Tile', null /* void */ , [ + 'number', + 'array', + 'number', + 'array', + 'number', + 'number' // out_id + ]); } + function tile(args) { - var inputs = args.inputs, backend = args.backend, attrs = args.attrs; - var x = inputs.x; - var xId = backend.dataIdMap.get(x.dataId).id; - var reps = attrs.reps; - var newShape = new Array(x.shape.length); - for (var i = 0; i < newShape.length; i++) { - newShape[i] = x.shape[i] * reps[i]; - } - var xShapeBytes = new Uint8Array(new Int32Array(x.shape).buffer); - var newShapeBytes = new Uint8Array(new Int32Array(newShape).buffer); - var out = backend.makeOutput(newShape, x.dtype); - var outId = backend.dataIdMap.get(out.dataId).id; - wasmTile(xId, xShapeBytes, x.shape.length, newShapeBytes, newShape.length, CppDType[out.dtype], outId); - return out; + var inputs = args.inputs, + backend = args.backend, + attrs = args.attrs; + var x = inputs.x; + var xId = backend.dataIdMap.get(x.dataId).id; + var reps = attrs.reps; + var newShape = new Array(x.shape.length); + for (var i = 0; i < newShape.length; i++) { + newShape[i] = x.shape[i] * reps[i]; + } + var xShapeBytes = new Uint8Array(new Int32Array(x.shape).buffer); + var newShapeBytes = new Uint8Array(new Int32Array(newShape).buffer); + var out = backend.makeOutput(newShape, x.dtype); + var outId = backend.dataIdMap.get(out.dataId).id; + wasmTile(xId, xShapeBytes, x.shape.length, newShapeBytes, newShape.length, CppDType[out.dtype], outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'Tile', - backendName: 'wasm', - setupFunc: setup$p, - kernelFunc: tile - }); - + kernelName: 'Tile', + backendName: 'wasm', + setupFunc: setup$p, + kernelFunc: tile + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2460,82 +2700,94 @@ * ============================================================================= */ var wasmTranspose; + function setup$q(backend) { - wasmTranspose = backend.wasm.cwrap('Transpose', null /* void */, [ - 'number', - 'array', - 'number', - 'number', - 'number', - 'array', - 'number', - ]); + wasmTranspose = backend.wasm.cwrap('Transpose', null /* void */ , [ + 'number', + 'array', + 'number', + 'number', + 'number', + 'array', + 'number', + ]); } + function transpose(args) { - var inputs = args.inputs, backend = args.backend, attrs = args.attrs; - // Reduce any dimensions with size one. Lower-rank transpose kernel performs - // better due to simpler memory access pattern. - var _a = removeOneSizeDims(inputs.x.shape, attrs.perm), reducedShape = _a[0], perm = _a[1]; - var x = { - dataId: inputs.x.dataId, - shape: reducedShape, - dtype: inputs.x.dtype - }; - var permIsNoOp = true; - for (var i = 0; i < perm.length; i++) { - if (perm[i] !== i) { - permIsNoOp = false; - } + var inputs = args.inputs, + backend = args.backend, + attrs = args.attrs; + // Reduce any dimensions with size one. Lower-rank transpose kernel performs + // better due to simpler memory access pattern. + var _a = removeOneSizeDims(inputs.x.shape, attrs.perm), + reducedShape = _a[0], + perm = _a[1]; + var x = { + dataId: inputs.x.dataId, + shape: reducedShape, + dtype: inputs.x.dtype + }; + var permIsNoOp = true; + for (var i = 0; i < perm.length; i++) { + if (perm[i] !== i) { + permIsNoOp = false; } - var outShape = computeOutShape(inputs.x.shape, attrs.perm); - if (permIsNoOp) { - return { dataId: x.dataId, shape: outShape, dtype: x.dtype }; - } - var out = backend.makeOutput(outShape, x.dtype); - var xId = backend.dataIdMap.get(x.dataId).id; - var outId = backend.dataIdMap.get(out.dataId).id; - var permBytes = new Uint8Array(new Int32Array(perm).buffer); - var xShapeBytes = new Uint8Array(new Int32Array(x.shape).buffer); - wasmTranspose(xId, xShapeBytes, x.shape.length, CppDType[x.dtype], outId, permBytes, perm.length); - return out; + } + var outShape = computeOutShape(inputs.x.shape, attrs.perm); + if (permIsNoOp) { + return { + dataId: x.dataId, + shape: outShape, + dtype: x.dtype + }; + } + var out = backend.makeOutput(outShape, x.dtype); + var xId = backend.dataIdMap.get(x.dataId).id; + var outId = backend.dataIdMap.get(out.dataId).id; + var permBytes = new Uint8Array(new Int32Array(perm).buffer); + var xShapeBytes = new Uint8Array(new Int32Array(x.shape).buffer); + wasmTranspose(xId, xShapeBytes, x.shape.length, CppDType[x.dtype], outId, permBytes, perm.length); + return out; } + function computeOutShape(inShape, perm) { - var outShape = new Array(inShape.length); - for (var i = 0; i < outShape.length; i++) { - outShape[i] = inShape[perm[i]]; - } - return outShape; + var outShape = new Array(inShape.length); + for (var i = 0; i < outShape.length; i++) { + outShape[i] = inShape[perm[i]]; + } + return outShape; } + function removeOneSizeDims(shape, perm) { - var newShape = []; - var newPerm = []; - for (var i = 0; i < shape.length; ++i) { - if (shape[i] !== 1) { - newShape.push(shape[i]); - } - if (shape[perm[i]] !== 1) { - newPerm.push(perm[i]); - } + var newShape = []; + var newPerm = []; + for (var i = 0; i < shape.length; ++i) { + if (shape[i] !== 1) { + newShape.push(shape[i]); } - for (var i = 0; i < newPerm.length; ++i) { - var minValIdx = -1; - for (var j = 0; j < newPerm.length; ++j) { - if (newPerm[j] >= i && - (minValIdx === -1 || newPerm[minValIdx] > newPerm[j])) { - minValIdx = j; - } - } - newPerm[minValIdx] = i; + if (shape[perm[i]] !== 1) { + newPerm.push(perm[i]); } - return [newShape, newPerm]; + } + for (var i = 0; i < newPerm.length; ++i) { + var minValIdx = -1; + for (var j = 0; j < newPerm.length; ++j) { + if (newPerm[j] >= i && + (minValIdx === -1 || newPerm[minValIdx] > newPerm[j])) { + minValIdx = j; + } + } + newPerm[minValIdx] = i; + } + return [newShape, newPerm]; } tfjsCore.registerKernel({ - kernelName: 'Transpose', - backendName: 'wasm', - kernelFunc: transpose, - setupFunc: setup$q, - }); - + kernelName: 'Transpose', + backendName: 'wasm', + kernelFunc: transpose, + setupFunc: setup$q, + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2553,35 +2805,51 @@ * ============================================================================= */ function unpack(args) { - var x = args.inputs.x, backend = args.backend, axis = args.attrs.axis; - var numOutputs = x.shape[axis]; - var rank = x.shape.length; - var outShape = new Array(rank - 1); - var outIndex = 0; - for (var i = 0; i < rank; i++) { - if (i !== axis) { - outShape[outIndex++] = x.shape[i]; - } + var x = args.inputs.x, + backend = args.backend, + axis = args.attrs.axis; + var numOutputs = x.shape[axis]; + var rank = x.shape.length; + var outShape = new Array(rank - 1); + var outIndex = 0; + for (var i = 0; i < rank; i++) { + if (i !== axis) { + outShape[outIndex++] = x.shape[i]; } - var outs = new Array(numOutputs); - var begin = new Array(rank).fill(0); - var size = x.shape.slice(); - size[axis] = 1; - for (var i = 0; i < outs.length; i++) { - begin[axis] = i; - outs[i] = slice({ inputs: { x: x }, attrs: { begin: begin, size: size }, backend: backend }); - } - return outs.map(function (_a) { - var dataId = _a.dataId, dtype = _a.dtype; - return ({ dataId: dataId, dtype: dtype, shape: outShape }); + } + var outs = new Array(numOutputs); + var begin = new Array(rank).fill(0); + var size = x.shape.slice(); + size[axis] = 1; + for (var i = 0; i < outs.length; i++) { + begin[axis] = i; + outs[i] = slice({ + inputs: { + x: x + }, + attrs: { + begin: begin, + size: size + }, + backend: backend + }); + } + return outs.map(function (_a) { + var dataId = _a.dataId, + dtype = _a.dtype; + return ({ + dataId: dataId, + dtype: dtype, + shape: outShape }); + }); } tfjsCore.registerKernel({ - kernelName: 'Unpack', - backendName: 'wasm', - kernelFunc: unpack, - }); - + kernelName: 'Unpack', + backendName: 'wasm', + kernelFunc: unpack, + }); + /** * @license * Copyright 2020 Google Inc. All Rights Reserved. @@ -2599,18 +2867,19 @@ * ============================================================================= */ function zerosLike(args) { - var x = args.inputs.x, backend = args.backend; - var out = backend.makeOutput(x.shape, x.dtype); - var outVals = backend.typedArrayFromHeap(out); - outVals.fill(0); - return out; + var x = args.inputs.x, + backend = args.backend; + var out = backend.makeOutput(x.shape, x.dtype); + var outVals = backend.typedArrayFromHeap(out); + outVals.fill(0); + return out; } tfjsCore.registerKernel({ - kernelName: 'ZerosLike', - backendName: 'wasm', - kernelFunc: zerosLike, - }); - + kernelName: 'ZerosLike', + backendName: 'wasm', + kernelFunc: zerosLike, + }); + /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use @@ -2627,78 +2896,3317 @@ ***************************************************************************** */ /* global Reflect, Promise */ - var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ + __proto__: [] + } + instanceof Array && function (d, b) { + d.__proto__ = b; + }) || + function (d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) d[p] = b[p]; + }; + return extendStatics(d, b); }; function __extends(d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + extendStatics(d, b); + + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } function __awaiter(thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + return new(P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + + function step(result) { + result.done ? resolve(result.value) : new P(function (resolve) { + resolve(result.value); + }).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); } function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + var _ = { + label: 0, + sent: function () { + if (t[0] & 1) throw t[1]; + return t[1]; + }, + trys: [], + ops: [] + }, + f, y, t, g; + return g = { + next: verb(0), + "throw": verb(1), + "return": verb(2) + }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { + return this; + }), g; + + function verb(n) { + return function (v) { + return step([n, v]); + }; + } + + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: + case 1: + t = op; + break; + case 4: + _.label++; + return { + value: op[1], done: false + }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; + } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { + _.label = op[1]; + break; + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; + } + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; } - } - - function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; - } - - var tfjsBackendWasm = createCommonjsModule(function (module, exports) { - var WasmBackendModule = (function() { - var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; - if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; - return ( - function(WasmBackendModule) { - WasmBackendModule = WasmBackendModule || {}; - - function GROWABLE_HEAP_I8(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer);}return HEAP8}function GROWABLE_HEAP_U8(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer);}return HEAPU8}function GROWABLE_HEAP_I32(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer);}return HEAP32}function GROWABLE_HEAP_U32(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer);}return HEAPU32}function GROWABLE_HEAP_F64(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer);}return HEAPF64}var Module=typeof WasmBackendModule!=="undefined"?WasmBackendModule:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key];}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(Module["ENVIRONMENT"]){throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)")}var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"];DYNAMIC_BASE=Module["DYNAMIC_BASE"];DYNAMICTOP_PTR=Module["DYNAMICTOP_PTR"];}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readBinary;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=path.dirname(scriptDirectory)+"/";}else{scriptDirectory=__dirname+"/";}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=fs;if(!nodePath)nodePath=path;filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret);}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/");}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status);};Module["inspect"]=function(){return "[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=worker_threads;}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}Worker=nodeWorkerThreads.Worker;}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)};}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs;}else if(typeof arguments!="undefined"){arguments_=arguments;}if(typeof quit==="function"){quit_=function(status){quit(status);};}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print;}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href;}else if(document.currentScript){scriptDirectory=document.currentScript.src;}if(_scriptDir){scriptDirectory=_scriptDir;}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1);}else{scriptDirectory="";}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=fs;if(!nodePath)nodePath=path;filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret);}assert(ret.buffer);return ret};}else{read_=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)};}}}else{throw new Error("environment detection error")}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){performance=perf_hooks.performance;}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key];}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(!Object.getOwnPropertyDescriptor(Module,"arguments"))Object.defineProperty(Module,"arguments",{configurable:true,get:function(){abort("Module.arguments has been replaced with plain arguments_");}});if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(!Object.getOwnPropertyDescriptor(Module,"thisProgram"))Object.defineProperty(Module,"thisProgram",{configurable:true,get:function(){abort("Module.thisProgram has been replaced with plain thisProgram");}});if(Module["quit"])quit_=Module["quit"];if(!Object.getOwnPropertyDescriptor(Module,"quit"))Object.defineProperty(Module,"quit",{configurable:true,get:function(){abort("Module.quit has been replaced with plain quit_");}});assert(typeof Module["memoryInitializerPrefixURL"]==="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["pthreadMainPrefixURL"]==="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["cdInitializerPrefixURL"]==="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["filePackagePrefixURL"]==="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["read"]==="undefined","Module.read option was removed (modify read_ in JS)");assert(typeof Module["readAsync"]==="undefined","Module.readAsync option was removed (modify readAsync in JS)");assert(typeof Module["readBinary"]==="undefined","Module.readBinary option was removed (modify readBinary in JS)");assert(typeof Module["setWindowTitle"]==="undefined","Module.setWindowTitle option was removed (modify setWindowTitle in JS)");assert(typeof Module["TOTAL_MEMORY"]==="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY");if(!Object.getOwnPropertyDescriptor(Module,"read"))Object.defineProperty(Module,"read",{configurable:true,get:function(){abort("Module.read has been replaced with plain read_");}});if(!Object.getOwnPropertyDescriptor(Module,"readAsync"))Object.defineProperty(Module,"readAsync",{configurable:true,get:function(){abort("Module.readAsync has been replaced with plain readAsync");}});if(!Object.getOwnPropertyDescriptor(Module,"readBinary"))Object.defineProperty(Module,"readBinary",{configurable:true,get:function(){abort("Module.readBinary has been replaced with plain readBinary");}});if(!Object.getOwnPropertyDescriptor(Module,"setWindowTitle"))Object.defineProperty(Module,"setWindowTitle",{configurable:true,get:function(){abort("Module.setWindowTitle has been replaced with plain setWindowTitle");}});assert(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER||ENVIRONMENT_IS_NODE,"Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)");var stackSave;var stackRestore;var stackAlloc;stackSave=stackRestore=stackAlloc=function(){abort("cannot use the stack before compiled code is ready to run, and has provided stack access");};function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text);}}var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(!Object.getOwnPropertyDescriptor(Module,"wasmBinary"))Object.defineProperty(Module,"wasmBinary",{configurable:true,get:function(){abort("Module.wasmBinary has been replaced with plain wasmBinary");}});var noExitRuntime;if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(!Object.getOwnPropertyDescriptor(Module,"noExitRuntime"))Object.defineProperty(Module,"noExitRuntime",{configurable:true,get:function(){abort("Module.noExitRuntime has been replaced with plain noExitRuntime");}});if(typeof WebAssembly!=="object"){abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.");}var wasmMemory;var wasmTable=new WebAssembly.Table({"initial":118,"maximum":118+0,"element":"anyfunc"});var wasmModule;var threadInfoStruct=0;var selfThreadId=0;var ABORT=false;function assert(condition,text){if(!condition){abort("Assertion failed: "+text);}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len);}return ret},"array":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string")return UTF8ToString(ret);if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2;}else{if((u0&248)!=240)warnOnce("Invalid UTF-8 leading byte 0x"+u0.toString(16)+" encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!");u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63;}if(u0<65536){str+=String.fromCharCode(u0);}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023);}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(GROWABLE_HEAP_U8(),ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023;}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u;}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63;}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63;}else{if(outIdx+3>=endIdx)break;if(u>=2097152)warnOnce("Invalid Unicode code point 0x"+u.toString(16)+" encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF).");heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63;}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,GROWABLE_HEAP_U8(),outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4;}return len}function writeArrayToMemory(array,buffer){assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");GROWABLE_HEAP_I8().set(array,buffer);}var WASM_PAGE_SIZE=65536;function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple;}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf);}var STACK_BASE=5255808,STACKTOP=STACK_BASE,STACK_MAX=12928,DYNAMIC_BASE=5255808,DYNAMICTOP_PTR=12e3;assert(STACK_BASE%16===0,"stack must start aligned");assert(DYNAMIC_BASE%16===0,"heap must start aligned");if(ENVIRONMENT_IS_PTHREAD){STACK_MAX=STACKTOP=STACK_MAX=2147483647;}var TOTAL_STACK=5242880;if(Module["TOTAL_STACK"])assert(TOTAL_STACK===Module["TOTAL_STACK"],"the stack size can no longer be determined at runtime");var INITIAL_INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(!Object.getOwnPropertyDescriptor(Module,"INITIAL_MEMORY"))Object.defineProperty(Module,"INITIAL_MEMORY",{configurable:true,get:function(){abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY");}});assert(INITIAL_INITIAL_MEMORY>=TOTAL_STACK,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+INITIAL_INITIAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");assert(typeof Int32Array!=="undefined"&&typeof Float64Array!=="undefined"&&Int32Array.prototype.subarray!==undefined&&Int32Array.prototype.set!==undefined,"JS engine does not provide full typed array support");if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"];}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"];}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,"maximum":1073741824/WASM_PAGE_SIZE,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)");}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer;}INITIAL_INITIAL_MEMORY=buffer.byteLength;assert(INITIAL_INITIAL_MEMORY%WASM_PAGE_SIZE===0);assert(65536%WASM_PAGE_SIZE===0);updateGlobalBufferAndViews(buffer);if(!ENVIRONMENT_IS_PTHREAD){GROWABLE_HEAP_I32()[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE;}function writeStackCookie(){assert((STACK_MAX&3)==0);GROWABLE_HEAP_U32()[(STACK_MAX>>2)+1]=34821223;GROWABLE_HEAP_U32()[(STACK_MAX>>2)+2]=2310721022;GROWABLE_HEAP_I32()[0]=1668509029;}function checkStackCookie(){var cookie1=GROWABLE_HEAP_U32()[(STACK_MAX>>2)+1];var cookie2=GROWABLE_HEAP_U32()[(STACK_MAX>>2)+2];if(cookie1!=34821223||cookie2!=2310721022){abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+cookie2.toString(16)+" "+cookie1.toString(16));}if(GROWABLE_HEAP_I32()[0]!==1668509029)abort("Runtime error: The application has corrupted its heap memory area (address zero)!");}function abortStackOverflow(allocSize){abort("Stack overflow! Attempted to allocate "+allocSize+" bytes on the stack, but stack has only "+(STACK_MAX-stackSave()+allocSize)+" bytes available!");}(function(){var h16=new Int16Array(1);var h8=new Int8Array(h16.buffer);h16[0]=25459;if(h8[0]!==115||h8[1]!==99)throw "Runtime error: expected the system to be little-endian!"})();function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func);}else{Module["dynCall_vi"](func,callback.arg);}}else{func(callback.arg===undefined?null:callback.arg);}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;if(ENVIRONMENT_IS_PTHREAD)runtimeInitialized=true;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift());}}callRuntimeCallbacks(__ATPRERUN__);}function initRuntime(){checkStackCookie();assert(!runtimeInitialized);runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__);}function preMain(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATMAIN__);}function postRun(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift());}}callRuntimeCallbacks(__ATPOSTRUN__);}function addOnPreRun(cb){__ATPRERUN__.unshift(cb);}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb);}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Math_ceil=Math.ceil;var Math_floor=Math.floor;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies);}if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!=="undefined"){runDependencyWatcher=setInterval(function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;err("still waiting on run dependencies:");}err("dependency: "+dep);}if(shown){err("(end of list)");}},1e4);}}else{err("warning: run dependency added without ID");}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies);}if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id];}else{err("warning: run dependency removed without ID");}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null;}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback();}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what);}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";out(what);err(what);ABORT=true;var output="abort("+what+") at "+stackTrace();what=output;throw new WebAssembly.RuntimeError(what)}var FS={error:function(){abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1");},init:function(){FS.error();},createDataFile:function(){FS.error();},createPreloadedFile:function(){FS.error();},createLazyFile:function(){FS.error();},open:function(){FS.error();},mkdev:function(){FS.error();},registerDevice:function(){FS.error();},analyzePath:function(){FS.error();},loadFilesFromDB:function(){FS.error();},ErrnoError:function ErrnoError(){FS.error();}};Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;function hasPrefix(str,prefix){return String.prototype.startsWith?str.startsWith(prefix):str.indexOf(prefix)===0}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return hasPrefix(filename,dataURIPrefix)}var fileURIPrefix="file://";function isFileURI(filename){return hasPrefix(filename,fileURIPrefix)}var wasmBinaryFile="tfjs-backend-wasm.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile);}function getBinary(){try{if(wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(wasmBinaryFile)}else{throw "both async and sync fetching of the wasm failed"}}catch(err){abort(err);}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw "failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary()})}return new Promise(function(resolve,reject){resolve(getBinary());})}function createWasm(){var info={"env":asmLibraryArg,"wasi_snapshot_preview1":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){var numWorkersToLoad=PThread.unusedWorkers.length;PThread.unusedWorkers.forEach(function(w){PThread.loadWasmModuleToWorker(w,function(){if(!--numWorkersToLoad)removeRunDependency("wasm-instantiate");});});}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate");}var trueModule=Module;function receiveInstantiatedSource(output){assert(Module===trueModule,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");trueModule=null;receiveInstance(output["instance"],output["module"]);}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason);})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource);})});}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return {}}var ASM_CONSTS={};function initPthreadsJS(){PThread.initRuntime();}if(!ENVIRONMENT_IS_PTHREAD)__ATINIT__.push({func:function(){___wasm_call_ctors();}});function demangle(func){warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return func}function demangleAll(text){var regex=/\b_Z[\w\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"})}var __pthread_ptr=0;var __pthread_is_main_runtime_thread=0;var __pthread_is_main_browser_thread=0;function __register_pthread_ptr(pthreadPtr,isMainBrowserThread,isMainRuntimeThread){pthreadPtr=pthreadPtr|0;isMainBrowserThread=isMainBrowserThread|0;isMainRuntimeThread=isMainRuntimeThread|0;__pthread_ptr=pthreadPtr;__pthread_is_main_browser_thread=isMainBrowserThread;__pthread_is_main_runtime_thread=isMainRuntimeThread;}Module["__register_pthread_ptr"]=__register_pthread_ptr;var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var __main_thread_futex_wait_address=12912;function _emscripten_futex_wake(addr,count){if(addr<=0||addr>GROWABLE_HEAP_I8().length||addr&3!=0||count<0)return -28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(GROWABLE_HEAP_I32(),addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw "Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function __kill_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw "Internal Error! _kill_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw "Internal Error! Null pthread_ptr in _kill_thread!";GROWABLE_HEAP_I32()[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined;}function __cancel_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw "Internal Error! _cancel_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw "Internal Error! Null pthread_ptr in _cancel_thread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"});}function __cleanup_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw "Internal Error! _cleanup_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw "Internal Error! Null pthread_ptr in _cleanup_thread!";GROWABLE_HEAP_I32()[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];if(pthread){var worker=pthread.worker;PThread.returnWorkerToPool(worker);}}var PThread={MAIN_THREAD_ID:1,mainThreadInfo:{schedPolicy:0,schedPrio:0},unusedWorkers:[],runningWorkers:[],initRuntime:function(){__register_pthread_ptr(PThread.mainThreadBlock,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(PThread.mainThreadBlock);},initMainThreadBlock:function(){assert(!ENVIRONMENT_IS_PTHREAD);var pthreadPoolSize=8;for(var i=0;i>2]=PThread.mainThreadBlock;var headPtr=PThread.mainThreadBlock+156;GROWABLE_HEAP_I32()[headPtr>>2]=headPtr;var tlsMemory=12400;for(var i=0;i<128;++i)GROWABLE_HEAP_U32()[tlsMemory/4+i]=0;Atomics.store(GROWABLE_HEAP_U32(),PThread.mainThreadBlock+104>>2,tlsMemory);Atomics.store(GROWABLE_HEAP_U32(),PThread.mainThreadBlock+40>>2,PThread.mainThreadBlock);Atomics.store(GROWABLE_HEAP_U32(),PThread.mainThreadBlock+44>>2,42);},initWorker:function(){},pthreads:{},exitHandlers:null,setThreadStatus:function(){},runExitHandlers:function(){if(PThread.exitHandlers!==null){while(PThread.exitHandlers.length>0){PThread.exitHandlers.pop()();}PThread.exitHandlers=null;}if(ENVIRONMENT_IS_PTHREAD&&threadInfoStruct)___pthread_tsd_run_dtors();},threadExit:function(exitCode){var tb=_pthread_self();if(tb){err("Pthread 0x"+tb.toString(16)+" exited.");Atomics.store(GROWABLE_HEAP_U32(),tb+4>>2,exitCode);Atomics.store(GROWABLE_HEAP_U32(),tb+0>>2,1);Atomics.store(GROWABLE_HEAP_U32(),tb+60>>2,1);Atomics.store(GROWABLE_HEAP_U32(),tb+64>>2,0);PThread.runExitHandlers();_emscripten_futex_wake(tb+0,2147483647);__register_pthread_ptr(0,0,0);threadInfoStruct=0;if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"});}}},threadCancel:function(){PThread.runExitHandlers();Atomics.store(GROWABLE_HEAP_U32(),threadInfoStruct+4>>2,-1);Atomics.store(GROWABLE_HEAP_U32(),threadInfoStruct+0>>2,1);_emscripten_futex_wake(threadInfoStruct+0,2147483647);threadInfoStruct=selfThreadId=0;__register_pthread_ptr(0,0,0);postMessage({"cmd":"cancelDone"});},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker);}}PThread.pthreads={};for(var i=0;i>2];GROWABLE_HEAP_I32()[pthread.threadInfoStruct+104>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct);}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null;},returnWorkerToPool:function(worker){delete PThread.pthreads[worker.pthread.thread];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined;},receiveObjectTransfer:function(data){},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"]);}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!");}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls();}else if(cmd==="spawnThread"){__spawn_thread(e.data);}else if(cmd==="cleanupThread"){__cleanup_thread(d["thread"]);}else if(cmd==="killThread"){__kill_thread(d["thread"]);}else if(cmd==="cancelThread"){__cancel_thread(d["thread"]);}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread;}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"]);}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"]);}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"]);}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(GROWABLE_HEAP_U32(),worker.pthread.thread+68>>2);if(detached){PThread.returnWorkerToPool(worker);}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker);}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data);}else if(e.data.target==="setimmediate"){worker.postMessage(e.data);}else{err("worker sent an unknown command "+cmd);}PThread.currentProxiedOperationCallerThread=undefined;};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message);};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data});});worker.on("error",function(data){worker.onerror(data);});worker.on("exit",function(data){console.log("worker exited - TODO: update the worker queue?");});}assert(wasmMemory instanceof WebAssembly.Memory,"WebAssembly memory should have been loaded by now!");assert(wasmModule instanceof WebAssembly.Module,"WebAssembly Module should have been loaded by now!");worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule,"DYNAMIC_BASE":DYNAMIC_BASE,"DYNAMICTOP_PTR":DYNAMICTOP_PTR});},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("tfjs-backend-wasm.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs));},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0]);}if(PThread.unusedWorkers.length>0)return PThread.unusedWorkers.pop();else return null},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()GROWABLE_HEAP_I8().length||addr&3!=0)return -28;if(ENVIRONMENT_IS_WORKER){var ret=Atomics.wait(GROWABLE_HEAP_I32(),addr>>2,val,timeout);if(ret==="timed-out")return -73;if(ret==="not-equal")return -6;if(ret==="ok")return 0;throw "Atomics.wait returned an unexpected value "+ret}else{var loadedVal=Atomics.load(GROWABLE_HEAP_I32(),addr>>2);if(val!=loadedVal)return -6;var tNow=performance.now();var tEnd=tNow+timeout;Atomics.store(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2,addr);var ourWaitAddress=addr;while(addr==ourWaitAddress){tNow=performance.now();if(tNow>tEnd){return -73}_emscripten_main_thread_process_queued_calls();addr=Atomics.load(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2);}return 0}}function _emscripten_is_main_browser_thread(){return __pthread_is_main_browser_thread|0}function _emscripten_is_main_runtime_thread(){return __pthread_is_main_runtime_thread|0}function _emscripten_memcpy_big(dest,src,num){GROWABLE_HEAP_U8().copyWithin(dest,src,src+num);}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;if(numCallArgs>20-1)throw "emscripten_proxy_to_main_thread_js: Too many arguments "+numCallArgs+" to proxied function idx="+index+", maximum supported is "+(20-1)+"!";var stack=stackSave();var args=stackAlloc(numCallArgs*8);var b=args>>3;for(var i=0;i>3]);buf+=8;}else if(ch===105){buf=buf+3&~3;args.push(GROWABLE_HEAP_I32()[buf>>2]);buf+=4;}else abort("unexpected char in asm const signature "+ch);}return args}function _emscripten_receive_on_main_thread_js(index,numCallArgs,args){_emscripten_receive_on_main_thread_js_callArgs.length=numCallArgs;var b=args>>3;for(var i=0;i>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){console.error("emscripten_realloc_buffer: Attempted to grow heap from "+buffer.byteLength+" bytes to "+size+" bytes, but got error: "+e);}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();if(requestedSize<=oldSize){return false}var PAGE_MULTIPLE=65536;var maxHeapSize=1073741824;if(requestedSize>maxHeapSize){err("Cannot enlarge memory, asked to go up to "+requestedSize+" bytes, but the limit is "+maxHeapSize+" bytes!");return false}var minHeapSize=16777216;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(minHeapSize,requestedSize,overGrownHeapSize),PAGE_MULTIPLE));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}err("Failed to grow the heap from "+oldSize+" bytes to "+newSize+" bytes, not enough memory!");return false}var JSEvents={keyEvent:0,mouseEvent:0,wheelEvent:0,uiEvent:0,focusEvent:0,deviceOrientationEvent:0,deviceMotionEvent:0,fullscreenChangeEvent:0,pointerlockChangeEvent:0,visibilityChangeEvent:0,touchEvent:0,previousFullscreenElement:null,previousScreenX:null,previousScreenY:null,removeEventListenersRegistered:false,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i);}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[];},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){JSEvents.removeEventListenersRegistered=true;}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;GROWABLE_HEAP_I32()[varargs+4>>2]=eventData;GROWABLE_HEAP_I32()[varargs+8>>2]=userData;_emscripten_async_queue_on_thread_(targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop);},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return "";if(target==window)return "#window";if(target==screen)return "#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas);}GROWABLE_HEAP_I32()[varargs>>2]=targetCanvasPtr;GROWABLE_HEAP_I32()[varargs+4>>2]=width;GROWABLE_HEAP_I32()[varargs+8>>2]=height;_emscripten_async_queue_on_thread_(targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop);}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height);}function __maybeCStringToJsString(cString){return cString===cString+0?UTF8ToString(cString):cString}var __specialEventTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function __findEventTarget(target){var domElement=__specialEventTargets[target]||(typeof document!=="undefined"?document.querySelector(__maybeCStringToJsString(target)):undefined);return domElement}function __findCanvasEventTarget(target){return __findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=__findCanvasEventTarget(target);if(!canvas)return -4;if(canvas.canvasSharedPtr){GROWABLE_HEAP_I32()[canvas.canvasSharedPtr>>2]=width;GROWABLE_HEAP_I32()[canvas.canvasSharedPtr+4>>2]=height;}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height;}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height);}}else if(canvas.canvasSharedPtr){var targetThread=GROWABLE_HEAP_I32()[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return -4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=__findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function __webgl_acquireInstancedArraysExtension(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor);};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount);};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount);};}}function __webgl_acquireVertexArrayObjectExtension(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao);};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao);};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};}}function __webgl_acquireDrawBuffersExtension(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs);};}}var GL={counter:1,lastError:0,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},currentContext:null,offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,init:function(){var miniTempFloatBuffer=new Float32Array(GL.MINI_TEMP_BUFFER_SIZE);for(var i=0;i>2]:-1;source+=UTF8ToString(GROWABLE_HEAP_I32()[string+i*4>>2],len<0?undefined:len);}return source},createContext:function(canvas,webGLContextAttributes){var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);GROWABLE_HEAP_I32()[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context);}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return !(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null;},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;if(context.version<2){__webgl_acquireInstancedArraysExtension(GLctx);__webgl_acquireVertexArrayObjectExtension(GLctx);__webgl_acquireDrawBuffersExtension(GLctx);}GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query");var automaticallyEnabledExtensions=["OES_texture_float","OES_texture_half_float","OES_standard_derivatives","OES_vertex_array_object","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","OES_element_index_uint","EXT_texture_filter_anisotropic","EXT_frag_depth","WEBGL_draw_buffers","ANGLE_instanced_arrays","OES_texture_float_linear","OES_texture_half_float_linear","EXT_blend_minmax","EXT_shader_texture_lod","EXT_texture_norm16","WEBGL_compressed_texture_pvrtc","EXT_color_buffer_half_float","WEBGL_color_buffer_float","EXT_sRGB","WEBGL_compressed_texture_etc1","EXT_disjoint_timer_query","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_astc","EXT_color_buffer_float","WEBGL_compressed_texture_s3tc_srgb","EXT_disjoint_timer_query_webgl2","WEBKIT_WEBGL_compressed_texture_pvrtc"];var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(automaticallyEnabledExtensions.indexOf(ext)!=-1){GLctx.getExtension(ext);}});},populateUniformTable:function(program){var p=GL.programs[program];var ptable=GL.programInfos[program]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1};var utable=ptable.uniforms;var numUniforms=GLctx.getProgramParameter(p,35718);for(var i=0;i>2;contextAttributes["alpha"]=!!GROWABLE_HEAP_I32()[a+(0>>2)];contextAttributes["depth"]=!!GROWABLE_HEAP_I32()[a+(4>>2)];contextAttributes["stencil"]=!!GROWABLE_HEAP_I32()[a+(8>>2)];contextAttributes["antialias"]=!!GROWABLE_HEAP_I32()[a+(12>>2)];contextAttributes["premultipliedAlpha"]=!!GROWABLE_HEAP_I32()[a+(16>>2)];contextAttributes["preserveDrawingBuffer"]=!!GROWABLE_HEAP_I32()[a+(20>>2)];var powerPreference=GROWABLE_HEAP_I32()[a+(24>>2)];contextAttributes["powerPreference"]=__emscripten_webgl_power_preferences[powerPreference];contextAttributes["failIfMajorPerformanceCaveat"]=!!GROWABLE_HEAP_I32()[a+(28>>2)];contextAttributes.majorVersion=GROWABLE_HEAP_I32()[a+(32>>2)];contextAttributes.minorVersion=GROWABLE_HEAP_I32()[a+(36>>2)];contextAttributes.enableExtensionsByDefault=GROWABLE_HEAP_I32()[a+(40>>2)];contextAttributes.explicitSwapControl=GROWABLE_HEAP_I32()[a+(44>>2)];contextAttributes.proxyContextToMainThread=GROWABLE_HEAP_I32()[a+(48>>2)];contextAttributes.renderViaOffscreenBackBuffer=GROWABLE_HEAP_I32()[a+(52>>2)];var canvas=__findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];assert(buffer);if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0;}else{buffer.push(curr);}},varargs:undefined,get:function(){assert(SYSCALLS.varargs!=undefined);SYSCALLS.varargs+=4;var ret=GROWABLE_HEAP_I32()[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){if(low>=0)assert(high===0);else assert(high===-1);return low}};function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,fd);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM");return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,fd,offset_low,offset_high,whence,newOffset);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM");}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd,iov,iovcnt,pnum);var num=0;for(var i=0;i>2];var len=GROWABLE_HEAP_I32()[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}function _pthread_cleanup_pop(execute){var routine=PThread.exitHandlers.pop();if(execute)routine();}function _pthread_cleanup_push(routine,arg){if(PThread.exitHandlers===null){PThread.exitHandlers=[];}PThread.exitHandlers.push(function(){dynCall_vi(routine,arg);});}function __spawn_thread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw "Internal Error! _spawn_thread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(worker.pthread!==undefined)throw "Internal error!";if(!threadParams.pthread_ptr)throw "Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){GROWABLE_HEAP_I32()[tlsMemory+i*4>>2]=0;}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,thread:threadParams.pthread_ptr,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(GROWABLE_HEAP_U32(),tis+(0>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(4>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(8>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(68>>2),threadParams.detached);Atomics.store(GROWABLE_HEAP_U32(),tis+(104>>2),tlsMemory);Atomics.store(GROWABLE_HEAP_U32(),tis+(48>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(40>>2),pthread.threadInfoStruct);Atomics.store(GROWABLE_HEAP_U32(),tis+(44>>2),42);Atomics.store(GROWABLE_HEAP_U32(),tis+(108>>2),threadParams.stackSize);Atomics.store(GROWABLE_HEAP_U32(),tis+(84>>2),threadParams.stackSize);Atomics.store(GROWABLE_HEAP_U32(),tis+(80>>2),stackHigh);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+8>>2),stackHigh);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+12>>2),threadParams.detached);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+20>>2),threadParams.schedPolicy);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+24>>2),threadParams.schedPrio);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(GROWABLE_HEAP_U32(),tis+(176>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"selfThreadId":threadParams.pthread_ptr,"parentThreadId":threadParams.parent_pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList);};if(worker.loaded){worker.runPthread();delete worker.runPthread;}}function _pthread_getschedparam(thread,policy,schedparam){if(!policy&&!schedparam)return ERRNO_CODES.EINVAL;if(!thread){err("pthread_getschedparam called with a null thread pointer!");return ERRNO_CODES.ESRCH}var self=GROWABLE_HEAP_I32()[thread+12>>2];if(self!==thread){err("pthread_getschedparam attempted on thread "+thread+", which does not point to a valid thread, or does not exist anymore!");return ERRNO_CODES.ESRCH}var schedPolicy=Atomics.load(GROWABLE_HEAP_U32(),thread+108+20>>2);var schedPrio=Atomics.load(GROWABLE_HEAP_U32(),thread+108+24>>2);if(policy)GROWABLE_HEAP_I32()[policy>>2]=schedPolicy;if(schedparam)GROWABLE_HEAP_I32()[schedparam>>2]=schedPrio;return 0}function _pthread_self(){return __pthread_ptr|0}Module["_pthread_self"]=_pthread_self;function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}var stackSize=0;var stackBase=0;var detached=0;var schedPolicy=0;var schedPrio=0;if(attr){stackSize=GROWABLE_HEAP_I32()[attr>>2];stackSize+=81920;stackBase=GROWABLE_HEAP_I32()[attr+8>>2];detached=GROWABLE_HEAP_I32()[attr+12>>2]!==0;var inheritSched=GROWABLE_HEAP_I32()[attr+16>>2]===0;if(inheritSched){var prevSchedPolicy=GROWABLE_HEAP_I32()[attr+20>>2];var prevSchedPrio=GROWABLE_HEAP_I32()[attr+24>>2];var parentThreadPtr=PThread.currentProxiedOperationCallerThread?PThread.currentProxiedOperationCallerThread:_pthread_self();_pthread_getschedparam(parentThreadPtr,attr+20,attr+24);schedPolicy=GROWABLE_HEAP_I32()[attr+20>>2];schedPrio=GROWABLE_HEAP_I32()[attr+24>>2];GROWABLE_HEAP_I32()[attr+20>>2]=prevSchedPolicy;GROWABLE_HEAP_I32()[attr+24>>2]=prevSchedPrio;}else{schedPolicy=GROWABLE_HEAP_I32()[attr+20>>2];schedPrio=GROWABLE_HEAP_I32()[attr+24>>2];}}else{stackSize=2097152;}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize);}else{stackBase-=stackSize;assert(stackBase>0);}var threadInfoStruct=_malloc(232);for(var i=0;i<232>>2;++i)GROWABLE_HEAP_U32()[(threadInfoStruct>>2)+i]=0;GROWABLE_HEAP_I32()[pthread_ptr>>2]=threadInfoStruct;GROWABLE_HEAP_I32()[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+156;GROWABLE_HEAP_I32()[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,schedPolicy:schedPolicy,schedPrio:schedPrio,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,parent_pthread_ptr:_pthread_self(),arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);}else{__spawn_thread(threadParams);}return 0}function _roundf(d){d=+d;return d>=+0?+Math_floor(d+ +.5):+Math_ceil(d-+.5)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();else PThread.initWorker();var GLctx;GL.init();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_fd_close,_fd_seek,_fd_write];var asmLibraryArg={"__assert_fail":___assert_fail,"__handle_stack_overflow":___handle_stack_overflow,"_emscripten_notify_thread_queue":__emscripten_notify_thread_queue,"abort":_abort,"emscripten_conditional_set_current_thread_status":_emscripten_conditional_set_current_thread_status,"emscripten_futex_wait":_emscripten_futex_wait,"emscripten_futex_wake":_emscripten_futex_wake,"emscripten_get_now":_emscripten_get_now,"emscripten_is_main_browser_thread":_emscripten_is_main_browser_thread,"emscripten_is_main_runtime_thread":_emscripten_is_main_runtime_thread,"emscripten_memcpy_big":_emscripten_memcpy_big,"emscripten_receive_on_main_thread_js":_emscripten_receive_on_main_thread_js,"emscripten_resize_heap":_emscripten_resize_heap,"emscripten_set_canvas_element_size":_emscripten_set_canvas_element_size,"emscripten_set_current_thread_status":_emscripten_set_current_thread_status,"emscripten_webgl_create_context":_emscripten_webgl_create_context,"fd_close":_fd_close,"fd_seek":_fd_seek,"fd_write":_fd_write,"initPthreadsJS":initPthreadsJS,"memory":wasmMemory||Module["wasmMemory"],"pthread_cleanup_pop":_pthread_cleanup_pop,"pthread_cleanup_push":_pthread_cleanup_push,"pthread_create":_pthread_create,"pthread_self":_pthread_self,"roundf":_roundf,"table":wasmTable};var asm=createWasm();Module["asm"]=asm;var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__wasm_call_ctors"].apply(null,arguments)};var _init=Module["_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["init"].apply(null,arguments)};var _register_tensor=Module["_register_tensor"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["register_tensor"].apply(null,arguments)};var _dispose_data=Module["_dispose_data"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose_data"].apply(null,arguments)};var _dispose=Module["_dispose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose"].apply(null,arguments)};var _Abs=Module["_Abs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Abs"].apply(null,arguments)};var _Add=Module["_Add"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Add"].apply(null,arguments)};var _AddN=Module["_AddN"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AddN"].apply(null,arguments)};var _ArgMax=Module["_ArgMax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ArgMax"].apply(null,arguments)};var _AvgPool=Module["_AvgPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AvgPool"].apply(null,arguments)};var _BatchMatMul=Module["_BatchMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["BatchMatMul"].apply(null,arguments)};var _ClipByValue=Module["_ClipByValue"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ClipByValue"].apply(null,arguments)};var _Conv2D=Module["_Conv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Conv2D"].apply(null,arguments)};var _Cos=Module["_Cos"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Cos"].apply(null,arguments)};var _CropAndResize=Module["_CropAndResize"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["CropAndResize"].apply(null,arguments)};var _DepthwiseConv2dNative=Module["_DepthwiseConv2dNative"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["DepthwiseConv2dNative"].apply(null,arguments)};var _Div=Module["_Div"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Div"].apply(null,arguments)};var _Exp=Module["_Exp"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Exp"].apply(null,arguments)};var _FloorDiv=Module["_FloorDiv"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FloorDiv"].apply(null,arguments)};var _FusedBatchNorm=Module["_FusedBatchNorm"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedBatchNorm"].apply(null,arguments)};var _FusedConv2D=Module["_FusedConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedConv2D"].apply(null,arguments)};var _FusedDepthwiseConv2D=Module["_FusedDepthwiseConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedDepthwiseConv2D"].apply(null,arguments)};var _Gather=Module["_Gather"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Gather"].apply(null,arguments)};var _GatherNd=Module["_GatherNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GatherNd"].apply(null,arguments)};var _Greater=Module["_Greater"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Greater"].apply(null,arguments)};var _GreaterEqual=Module["_GreaterEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GreaterEqual"].apply(null,arguments)};var _Less=Module["_Less"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Less"].apply(null,arguments)};var _LessEqual=Module["_LessEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LessEqual"].apply(null,arguments)};var _Log=Module["_Log"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Log"].apply(null,arguments)};var _LogicalAnd=Module["_LogicalAnd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LogicalAnd"].apply(null,arguments)};var _Max=Module["_Max"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Max"].apply(null,arguments)};var _MaxPool=Module["_MaxPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["MaxPool"].apply(null,arguments)};var _Maximum=Module["_Maximum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Maximum"].apply(null,arguments)};var _Min=Module["_Min"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Min"].apply(null,arguments)};var _Minimum=Module["_Minimum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Minimum"].apply(null,arguments)};var _Mul=Module["_Mul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Mul"].apply(null,arguments)};var _Neg=Module["_Neg"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Neg"].apply(null,arguments)};var _NonMaxSuppressionV3=Module["_NonMaxSuppressionV3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV3"].apply(null,arguments)};var _NonMaxSuppressionV5=Module["_NonMaxSuppressionV5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV5"].apply(null,arguments)};var _NotEqual=Module["_NotEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NotEqual"].apply(null,arguments)};var _PadV2=Module["_PadV2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["PadV2"].apply(null,arguments)};var _Pow=Module["_Pow"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Pow"].apply(null,arguments)};var _Prelu=Module["_Prelu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Prelu"].apply(null,arguments)};var _Relu=Module["_Relu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu"].apply(null,arguments)};var _Relu6=Module["_Relu6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu6"].apply(null,arguments)};var _ResizeBilinear=Module["_ResizeBilinear"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ResizeBilinear"].apply(null,arguments)};var _Rsqrt=Module["_Rsqrt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Rsqrt"].apply(null,arguments)};var _ScatterNd=Module["_ScatterNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ScatterNd"].apply(null,arguments)};var _Sigmoid=Module["_Sigmoid"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sigmoid"].apply(null,arguments)};var _Sin=Module["_Sin"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sin"].apply(null,arguments)};var _Softmax=Module["_Softmax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Softmax"].apply(null,arguments)};var _Square=Module["_Square"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Square"].apply(null,arguments)};var _Sub=Module["_Sub"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sub"].apply(null,arguments)};var _Sum=Module["_Sum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sum"].apply(null,arguments)};var _Tanh=Module["_Tanh"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tanh"].apply(null,arguments)};var _Tile=Module["_Tile"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tile"].apply(null,arguments)};var _Transpose=Module["_Transpose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Transpose"].apply(null,arguments)};var __FusedMatMul=Module["__FusedMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_FusedMatMul"].apply(null,arguments)};var _malloc=Module["_malloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["malloc"].apply(null,arguments)};var _free=Module["_free"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["free"].apply(null,arguments)};var ___em_js__initPthreadsJS=Module["___em_js__initPthreadsJS"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__em_js__initPthreadsJS"].apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_get_global_libc"].apply(null,arguments)};var _memalign=Module["_memalign"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["memalign"].apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__pthread_tsd_run_dtors"].apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null,arguments)};var _emscripten_main_browser_thread_id=Module["_emscripten_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_browser_thread_id"].apply(null,arguments)};var _emscripten_async_run_in_main_thread=Module["_emscripten_async_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread=Module["_emscripten_sync_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_0=Module["_emscripten_sync_run_in_main_thread_0"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_1=Module["_emscripten_sync_run_in_main_thread_1"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_2=Module["_emscripten_sync_run_in_main_thread_2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_xprintf_varargs=Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_3=Module["_emscripten_sync_run_in_main_thread_3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_5=Module["_emscripten_sync_run_in_main_thread_5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_6=Module["_emscripten_sync_run_in_main_thread_6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_7=Module["_emscripten_sync_run_in_main_thread_7"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null,arguments)};var _emscripten_async_queue_on_thread_=Module["_emscripten_async_queue_on_thread_"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_tls_init"].apply(null,arguments)};var ___set_stack_limit=Module["___set_stack_limit"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__set_stack_limit"].apply(null,arguments)};var stackSave=Module["stackSave"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackSave"].apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackAlloc"].apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackRestore"].apply(null,arguments)};var dynCall_vi=Module["dynCall_vi"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_vi"].apply(null,arguments)};var dynCall_v=Module["dynCall_v"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_v"].apply(null,arguments)};var dynCall_ii=Module["dynCall_ii"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_ii"].apply(null,arguments)};Module["asm"]=asm;if(!Object.getOwnPropertyDescriptor(Module,"intArrayFromString"))Module["intArrayFromString"]=function(){abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"intArrayToString"))Module["intArrayToString"]=function(){abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"ccall"))Module["ccall"]=function(){abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};Module["cwrap"]=cwrap;if(!Object.getOwnPropertyDescriptor(Module,"setValue"))Module["setValue"]=function(){abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getValue"))Module["getValue"]=function(){abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"allocate"))Module["allocate"]=function(){abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getMemory"))Module["getMemory"]=function(){abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ArrayToString"))Module["UTF8ArrayToString"]=function(){abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ToString"))Module["UTF8ToString"]=function(){abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8Array"))Module["stringToUTF8Array"]=function(){abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8"))Module["stringToUTF8"]=function(){abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF8"))Module["lengthBytesUTF8"]=function(){abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreRun"))Module["addOnPreRun"]=function(){abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"addOnInit"))Module["addOnInit"]=function(){abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreMain"))Module["addOnPreMain"]=function(){abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"addOnExit"))Module["addOnExit"]=function(){abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"addOnPostRun"))Module["addOnPostRun"]=function(){abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeStringToMemory"))Module["writeStringToMemory"]=function(){abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeArrayToMemory"))Module["writeArrayToMemory"]=function(){abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeAsciiToMemory"))Module["writeAsciiToMemory"]=function(){abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"addRunDependency"))Module["addRunDependency"]=function(){abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"removeRunDependency"))Module["removeRunDependency"]=function(){abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"FS_createFolder"))Module["FS_createFolder"]=function(){abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPath"))Module["FS_createPath"]=function(){abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDataFile"))Module["FS_createDataFile"]=function(){abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPreloadedFile"))Module["FS_createPreloadedFile"]=function(){abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLazyFile"))Module["FS_createLazyFile"]=function(){abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLink"))Module["FS_createLink"]=function(){abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDevice"))Module["FS_createDevice"]=function(){abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"FS_unlink"))Module["FS_unlink"]=function(){abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"dynamicAlloc"))Module["dynamicAlloc"]=function(){abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"loadDynamicLibrary"))Module["loadDynamicLibrary"]=function(){abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"loadWebAssemblyModule"))Module["loadWebAssemblyModule"]=function(){abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getLEB"))Module["getLEB"]=function(){abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getFunctionTables"))Module["getFunctionTables"]=function(){abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"alignFunctionTables"))Module["alignFunctionTables"]=function(){abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registerFunctions"))Module["registerFunctions"]=function(){abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"addFunction"))Module["addFunction"]=function(){abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"removeFunction"))Module["removeFunction"]=function(){abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getFuncWrapper"))Module["getFuncWrapper"]=function(){abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"prettyPrint"))Module["prettyPrint"]=function(){abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"makeBigInt"))Module["makeBigInt"]=function(){abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"dynCall"))Module["dynCall"]=function(){abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getCompilerSetting"))Module["getCompilerSetting"]=function(){abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"print"))Module["print"]=function(){abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"printErr"))Module["printErr"]=function(){abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getTempRet0"))Module["getTempRet0"]=function(){abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"setTempRet0"))Module["setTempRet0"]=function(){abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"callMain"))Module["callMain"]=function(){abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"abort"))Module["abort"]=function(){abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stringToNewUTF8"))Module["stringToNewUTF8"]=function(){abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"emscripten_realloc_buffer"))Module["emscripten_realloc_buffer"]=function(){abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"ENV"))Module["ENV"]=function(){abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"setjmpId"))Module["setjmpId"]=function(){abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_CODES"))Module["ERRNO_CODES"]=function(){abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_MESSAGES"))Module["ERRNO_MESSAGES"]=function(){abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"setErrNo"))Module["setErrNo"]=function(){abort("'setErrNo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"DNS"))Module["DNS"]=function(){abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"GAI_ERRNO_MESSAGES"))Module["GAI_ERRNO_MESSAGES"]=function(){abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"Protocols"))Module["Protocols"]=function(){abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"Sockets"))Module["Sockets"]=function(){abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"UNWIND_CACHE"))Module["UNWIND_CACHE"]=function(){abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"readAsmConstArgs"))Module["readAsmConstArgs"]=function(){abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_q"))Module["jstoi_q"]=function(){abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_s"))Module["jstoi_s"]=function(){abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"PATH"))Module["PATH"]=function(){abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"PATH_FS"))Module["PATH_FS"]=function(){abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"SYSCALLS"))Module["SYSCALLS"]=function(){abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"syscallMmap2"))Module["syscallMmap2"]=function(){abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"syscallMunmap"))Module["syscallMunmap"]=function(){abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"flush_NO_FILESYSTEM"))Module["flush_NO_FILESYSTEM"]=function(){abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"JSEvents"))Module["JSEvents"]=function(){abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"demangle"))Module["demangle"]=function(){abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"demangleAll"))Module["demangleAll"]=function(){abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"jsStackTrace"))Module["jsStackTrace"]=function(){abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getEnvStrings"))Module["getEnvStrings"]=function(){abort("'getEnvStrings' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64"))Module["writeI53ToI64"]=function(){abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Clamped"))Module["writeI53ToI64Clamped"]=function(){abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Signaling"))Module["writeI53ToI64Signaling"]=function(){abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Clamped"))Module["writeI53ToU64Clamped"]=function(){abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Signaling"))Module["writeI53ToU64Signaling"]=function(){abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromI64"))Module["readI53FromI64"]=function(){abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromU64"))Module["readI53FromU64"]=function(){abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"convertI32PairToI53"))Module["convertI32PairToI53"]=function(){abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"convertU32PairToI53"))Module["convertU32PairToI53"]=function(){abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"Browser"))Module["Browser"]=function(){abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"GL"))Module["GL"]=function(){abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGet"))Module["emscriptenWebGLGet"]=function(){abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetTexPixelData"))Module["emscriptenWebGLGetTexPixelData"]=function(){abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetUniform"))Module["emscriptenWebGLGetUniform"]=function(){abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetVertexAttrib"))Module["emscriptenWebGLGetVertexAttrib"]=function(){abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"AL"))Module["AL"]=function(){abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"SDL_unicode"))Module["SDL_unicode"]=function(){abort("'SDL_unicode' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"SDL_ttfContext"))Module["SDL_ttfContext"]=function(){abort("'SDL_ttfContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"SDL_audio"))Module["SDL_audio"]=function(){abort("'SDL_audio' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"SDL"))Module["SDL"]=function(){abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"SDL_gfx"))Module["SDL_gfx"]=function(){abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"GLUT"))Module["GLUT"]=function(){abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"EGL"))Module["EGL"]=function(){abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"GLFW_Window"))Module["GLFW_Window"]=function(){abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"GLFW"))Module["GLFW"]=function(){abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"GLEW"))Module["GLEW"]=function(){abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"IDBStore"))Module["IDBStore"]=function(){abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"runAndAbortIfError"))Module["runAndAbortIfError"]=function(){abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};Module["PThread"]=PThread;if(!Object.getOwnPropertyDescriptor(Module,"establishStackSpace"))Module["establishStackSpace"]=function(){abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getNoExitRuntime"))Module["getNoExitRuntime"]=function(){abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"resetPrototype"))Module["resetPrototype"]=function(){abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"warnOnce"))Module["warnOnce"]=function(){abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stackSave"))Module["stackSave"]=function(){abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stackRestore"))Module["stackRestore"]=function(){abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stackAlloc"))Module["stackAlloc"]=function(){abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"AsciiToString"))Module["AsciiToString"]=function(){abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stringToAscii"))Module["stringToAscii"]=function(){abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"UTF16ToString"))Module["UTF16ToString"]=function(){abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF16"))Module["stringToUTF16"]=function(){abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF16"))Module["lengthBytesUTF16"]=function(){abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"UTF32ToString"))Module["UTF32ToString"]=function(){abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF32"))Module["stringToUTF32"]=function(){abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF32"))Module["lengthBytesUTF32"]=function(){abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8"))Module["allocateUTF8"]=function(){abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8OnStack"))Module["allocateUTF8OnStack"]=function(){abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");};Module["writeStackCookie"]=writeStackCookie;Module["checkStackCookie"]=checkStackCookie;Module["abortStackOverflow"]=abortStackOverflow;Module["PThread"]=PThread;Module["_pthread_self"]=_pthread_self;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NORMAL"))Object.defineProperty(Module,"ALLOC_NORMAL",{configurable:true,get:function(){abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_STACK"))Object.defineProperty(Module,"ALLOC_STACK",{configurable:true,get:function(){abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_DYNAMIC"))Object.defineProperty(Module,"ALLOC_DYNAMIC",{configurable:true,get:function(){abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NONE"))Object.defineProperty(Module,"ALLOC_NONE",{configurable:true,get:function(){abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)");}});var calledRun;Module["then"]=function(func){if(calledRun){func(Module);}else{var old=Module["onRuntimeInitialized"];Module["onRuntimeInitialized"]=function(){if(old)old();func(Module);};}return Module};function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status;}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller;};function run(args){if(runDependencies>0){return}writeStackCookie();preRun();if(runDependencies>0)return;function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();assert(!Module["_main"],'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');postRun();}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("");},1);doRun();},1);}else{doRun();}checkStackCookie();}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()();}}if(!ENVIRONMENT_IS_PTHREAD)noExitRuntime=true;if(!ENVIRONMENT_IS_PTHREAD)run(); - - - return WasmBackendModule - } - ); - })(); - module.exports = WasmBackendModule; - }); - + if (op[0] & 5) throw op[1]; + return { + value: op[0] ? op[1] : void 0, + done: true + }; + } + } + + function createCommonjsModule(fn, module) { + return module = { + exports: {} + }, fn(module, module.exports), module.exports; + } + + var tfjsBackendWasm = createCommonjsModule(function (module, exports) { + var WasmBackendModule = (function () { + var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; + if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; + return ( + function (WasmBackendModule) { + WasmBackendModule = WasmBackendModule || {}; + + function GROWABLE_HEAP_I8() { + if (wasmMemory.buffer != buffer) { + updateGlobalBufferAndViews(wasmMemory.buffer); + } + return HEAP8 + } + + function GROWABLE_HEAP_U8() { + if (wasmMemory.buffer != buffer) { + updateGlobalBufferAndViews(wasmMemory.buffer); + } + return HEAPU8 + } + + function GROWABLE_HEAP_I32() { + if (wasmMemory.buffer != buffer) { + updateGlobalBufferAndViews(wasmMemory.buffer); + } + return HEAP32 + } + + function GROWABLE_HEAP_U32() { + if (wasmMemory.buffer != buffer) { + updateGlobalBufferAndViews(wasmMemory.buffer); + } + return HEAPU32 + } + + function GROWABLE_HEAP_F64() { + if (wasmMemory.buffer != buffer) { + updateGlobalBufferAndViews(wasmMemory.buffer); + } + return HEAPF64 + } + var Module = typeof WasmBackendModule !== "undefined" ? WasmBackendModule : {}; + var moduleOverrides = {}; + var key; + for (key in Module) { + if (Module.hasOwnProperty(key)) { + moduleOverrides[key] = Module[key]; + } + } + var arguments_ = []; + var thisProgram = "./this.program"; + var quit_ = function (status, toThrow) { + throw toThrow + }; + var ENVIRONMENT_IS_WEB = false; + var ENVIRONMENT_IS_WORKER = false; + var ENVIRONMENT_IS_NODE = false; + var ENVIRONMENT_IS_SHELL = false; + ENVIRONMENT_IS_WEB = typeof window === "object"; + ENVIRONMENT_IS_WORKER = typeof importScripts === "function"; + ENVIRONMENT_IS_NODE = typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string"; + ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER; + if (Module["ENVIRONMENT"]) { + throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)") + } + var ENVIRONMENT_IS_PTHREAD = Module["ENVIRONMENT_IS_PTHREAD"] || false; + if (ENVIRONMENT_IS_PTHREAD) { + buffer = Module["buffer"]; + DYNAMIC_BASE = Module["DYNAMIC_BASE"]; + DYNAMICTOP_PTR = Module["DYNAMICTOP_PTR"]; + } + var scriptDirectory = ""; + + function locateFile(path) { + if (Module["locateFile"]) { + return Module["locateFile"](path, scriptDirectory) + } + return scriptDirectory + path + } + var read_, readBinary; + var nodeFS; + var nodePath; + if (ENVIRONMENT_IS_NODE) { + if (ENVIRONMENT_IS_WORKER) { + scriptDirectory = path.dirname(scriptDirectory) + "/"; + } else { + scriptDirectory = __dirname + "/"; + } + read_ = function shell_read(filename, binary) { + if (!nodeFS) nodeFS = fs; + if (!nodePath) nodePath = path; + filename = nodePath["normalize"](filename); + return nodeFS["readFileSync"](filename, binary ? null : "utf8") + }; + readBinary = function readBinary(filename) { + var ret = read_(filename, true); + if (!ret.buffer) { + ret = new Uint8Array(ret); + } + assert(ret.buffer); + return ret + }; + if (process["argv"].length > 1) { + thisProgram = process["argv"][1].replace(/\\/g, "/"); + } + arguments_ = process["argv"].slice(2); + process["on"]("uncaughtException", function (ex) { + if (!(ex instanceof ExitStatus)) { + throw ex + } + }); + process["on"]("unhandledRejection", abort); + quit_ = function (status) { + process["exit"](status); + }; + Module["inspect"] = function () { + return "[Emscripten Module object]" + }; + var nodeWorkerThreads; + try { + nodeWorkerThreads = worker_threads; + } catch (e) { + console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'); + throw e + } + Worker = nodeWorkerThreads.Worker; + } else if (ENVIRONMENT_IS_SHELL) { + if (typeof read != "undefined") { + read_ = function shell_read(f) { + return read(f) + }; + } + readBinary = function readBinary(f) { + var data; + if (typeof readbuffer === "function") { + return new Uint8Array(readbuffer(f)) + } + data = read(f, "binary"); + assert(typeof data === "object"); + return data + }; + if (typeof scriptArgs != "undefined") { + arguments_ = scriptArgs; + } else if (typeof arguments != "undefined") { + arguments_ = arguments; + } + if (typeof quit === "function") { + quit_ = function (status) { + quit(status); + }; + } + if (typeof print !== "undefined") { + if (typeof console === "undefined") console = {}; + console.log = print; + console.warn = console.error = typeof printErr !== "undefined" ? printErr : print; + } + } else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { + if (ENVIRONMENT_IS_WORKER) { + scriptDirectory = self.location.href; + } else if (document.currentScript) { + scriptDirectory = document.currentScript.src; + } + if (_scriptDir) { + scriptDirectory = _scriptDir; + } + if (scriptDirectory.indexOf("blob:") !== 0) { + scriptDirectory = scriptDirectory.substr(0, scriptDirectory.lastIndexOf("/") + 1); + } else { + scriptDirectory = ""; + } + if (ENVIRONMENT_IS_NODE) { + read_ = function shell_read(filename, binary) { + if (!nodeFS) nodeFS = fs; + if (!nodePath) nodePath = path; + filename = nodePath["normalize"](filename); + return nodeFS["readFileSync"](filename, binary ? null : "utf8") + }; + readBinary = function readBinary(filename) { + var ret = read_(filename, true); + if (!ret.buffer) { + ret = new Uint8Array(ret); + } + assert(ret.buffer); + return ret + }; + } else { + read_ = function shell_read(url) { + var xhr = new XMLHttpRequest; + xhr.open("GET", url, false); + xhr.send(null); + return xhr.responseText + }; + if (ENVIRONMENT_IS_WORKER) { + readBinary = function readBinary(url) { + var xhr = new XMLHttpRequest; + xhr.open("GET", url, false); + xhr.responseType = "arraybuffer"; + xhr.send(null); + return new Uint8Array(xhr.response) + }; + } + } + } else { + throw new Error("environment detection error") + } + if (ENVIRONMENT_IS_NODE) { + if (typeof performance === "undefined") { + performance = perf_hooks.performance; + } + } + var out = Module["print"] || console.log.bind(console); + var err = Module["printErr"] || console.warn.bind(console); + for (key in moduleOverrides) { + if (moduleOverrides.hasOwnProperty(key)) { + Module[key] = moduleOverrides[key]; + } + } + moduleOverrides = null; + if (Module["arguments"]) arguments_ = Module["arguments"]; + if (!Object.getOwnPropertyDescriptor(Module, "arguments")) Object.defineProperty(Module, "arguments", { + configurable: true, + get: function () { + abort("Module.arguments has been replaced with plain arguments_"); + } + }); + if (Module["thisProgram"]) thisProgram = Module["thisProgram"]; + if (!Object.getOwnPropertyDescriptor(Module, "thisProgram")) Object.defineProperty(Module, "thisProgram", { + configurable: true, + get: function () { + abort("Module.thisProgram has been replaced with plain thisProgram"); + } + }); + if (Module["quit"]) quit_ = Module["quit"]; + if (!Object.getOwnPropertyDescriptor(Module, "quit")) Object.defineProperty(Module, "quit", { + configurable: true, + get: function () { + abort("Module.quit has been replaced with plain quit_"); + } + }); + assert(typeof Module["memoryInitializerPrefixURL"] === "undefined", "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["pthreadMainPrefixURL"] === "undefined", "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["cdInitializerPrefixURL"] === "undefined", "Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["filePackagePrefixURL"] === "undefined", "Module.filePackagePrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["read"] === "undefined", "Module.read option was removed (modify read_ in JS)"); + assert(typeof Module["readAsync"] === "undefined", "Module.readAsync option was removed (modify readAsync in JS)"); + assert(typeof Module["readBinary"] === "undefined", "Module.readBinary option was removed (modify readBinary in JS)"); + assert(typeof Module["setWindowTitle"] === "undefined", "Module.setWindowTitle option was removed (modify setWindowTitle in JS)"); + assert(typeof Module["TOTAL_MEMORY"] === "undefined", "Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"); + if (!Object.getOwnPropertyDescriptor(Module, "read")) Object.defineProperty(Module, "read", { + configurable: true, + get: function () { + abort("Module.read has been replaced with plain read_"); + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "readAsync")) Object.defineProperty(Module, "readAsync", { + configurable: true, + get: function () { + abort("Module.readAsync has been replaced with plain readAsync"); + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "readBinary")) Object.defineProperty(Module, "readBinary", { + configurable: true, + get: function () { + abort("Module.readBinary has been replaced with plain readBinary"); + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "setWindowTitle")) Object.defineProperty(Module, "setWindowTitle", { + configurable: true, + get: function () { + abort("Module.setWindowTitle has been replaced with plain setWindowTitle"); + } + }); + assert(ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER || ENVIRONMENT_IS_NODE, "Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)"); + var stackSave; + var stackRestore; + var stackAlloc; + stackSave = stackRestore = stackAlloc = function () { + abort("cannot use the stack before compiled code is ready to run, and has provided stack access"); + }; + + function warnOnce(text) { + if (!warnOnce.shown) warnOnce.shown = {}; + if (!warnOnce.shown[text]) { + warnOnce.shown[text] = 1; + err(text); + } + } + var wasmBinary; + if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"]; + if (!Object.getOwnPropertyDescriptor(Module, "wasmBinary")) Object.defineProperty(Module, "wasmBinary", { + configurable: true, + get: function () { + abort("Module.wasmBinary has been replaced with plain wasmBinary"); + } + }); + var noExitRuntime; + if (Module["noExitRuntime"]) noExitRuntime = Module["noExitRuntime"]; + if (!Object.getOwnPropertyDescriptor(Module, "noExitRuntime")) Object.defineProperty(Module, "noExitRuntime", { + configurable: true, + get: function () { + abort("Module.noExitRuntime has been replaced with plain noExitRuntime"); + } + }); + if (typeof WebAssembly !== "object") { + abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead."); + } + var wasmMemory; + var wasmTable = new WebAssembly.Table({ + "initial": 118, + "maximum": 118 + 0, + "element": "anyfunc" + }); + var wasmModule; + var threadInfoStruct = 0; + var selfThreadId = 0; + var ABORT = false; + + function assert(condition, text) { + if (!condition) { + abort("Assertion failed: " + text); + } + } + + function getCFunc(ident) { + var func = Module["_" + ident]; + assert(func, "Cannot call unknown function " + ident + ", make sure it is exported"); + return func + } + + function ccall(ident, returnType, argTypes, args, opts) { + var toC = { + "string": function (str) { + var ret = 0; + if (str !== null && str !== undefined && str !== 0) { + var len = (str.length << 2) + 1; + ret = stackAlloc(len); + stringToUTF8(str, ret, len); + } + return ret + }, + "array": function (arr) { + var ret = stackAlloc(arr.length); + writeArrayToMemory(arr, ret); + return ret + } + }; + + function convertReturnValue(ret) { + if (returnType === "string") return UTF8ToString(ret); + if (returnType === "boolean") return Boolean(ret); + return ret + } + var func = getCFunc(ident); + var cArgs = []; + var stack = 0; + assert(returnType !== "array", 'Return type should not be "array".'); + if (args) { + for (var i = 0; i < args.length; i++) { + var converter = toC[argTypes[i]]; + if (converter) { + if (stack === 0) stack = stackSave(); + cArgs[i] = converter(args[i]); + } else { + cArgs[i] = args[i]; + } + } + } + var ret = func.apply(null, cArgs); + ret = convertReturnValue(ret); + if (stack !== 0) stackRestore(stack); + return ret + } + + function cwrap(ident, returnType, argTypes, opts) { + return function () { + return ccall(ident, returnType, argTypes, arguments) + } + } + + function UTF8ArrayToString(heap, idx, maxBytesToRead) { + var endIdx = idx + maxBytesToRead; + var str = ""; + while (!(idx >= endIdx)) { + var u0 = heap[idx++]; + if (!u0) return str; + if (!(u0 & 128)) { + str += String.fromCharCode(u0); + continue + } + var u1 = heap[idx++] & 63; + if ((u0 & 224) == 192) { + str += String.fromCharCode((u0 & 31) << 6 | u1); + continue + } + var u2 = heap[idx++] & 63; + if ((u0 & 240) == 224) { + u0 = (u0 & 15) << 12 | u1 << 6 | u2; + } else { + if ((u0 & 248) != 240) warnOnce("Invalid UTF-8 leading byte 0x" + u0.toString(16) + " encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!"); + u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heap[idx++] & 63; + } + if (u0 < 65536) { + str += String.fromCharCode(u0); + } else { + var ch = u0 - 65536; + str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023); + } + } + return str + } + + function UTF8ToString(ptr, maxBytesToRead) { + return ptr ? UTF8ArrayToString(GROWABLE_HEAP_U8(), ptr, maxBytesToRead) : "" + } + + function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { + if (!(maxBytesToWrite > 0)) return 0; + var startIdx = outIdx; + var endIdx = outIdx + maxBytesToWrite - 1; + for (var i = 0; i < str.length; ++i) { + var u = str.charCodeAt(i); + if (u >= 55296 && u <= 57343) { + var u1 = str.charCodeAt(++i); + u = 65536 + ((u & 1023) << 10) | u1 & 1023; + } + if (u <= 127) { + if (outIdx >= endIdx) break; + heap[outIdx++] = u; + } else if (u <= 2047) { + if (outIdx + 1 >= endIdx) break; + heap[outIdx++] = 192 | u >> 6; + heap[outIdx++] = 128 | u & 63; + } else if (u <= 65535) { + if (outIdx + 2 >= endIdx) break; + heap[outIdx++] = 224 | u >> 12; + heap[outIdx++] = 128 | u >> 6 & 63; + heap[outIdx++] = 128 | u & 63; + } else { + if (outIdx + 3 >= endIdx) break; + if (u >= 2097152) warnOnce("Invalid Unicode code point 0x" + u.toString(16) + " encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF)."); + heap[outIdx++] = 240 | u >> 18; + heap[outIdx++] = 128 | u >> 12 & 63; + heap[outIdx++] = 128 | u >> 6 & 63; + heap[outIdx++] = 128 | u & 63; + } + } + heap[outIdx] = 0; + return outIdx - startIdx + } + + function stringToUTF8(str, outPtr, maxBytesToWrite) { + assert(typeof maxBytesToWrite == "number", "stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"); + return stringToUTF8Array(str, GROWABLE_HEAP_U8(), outPtr, maxBytesToWrite) + } + + function lengthBytesUTF8(str) { + var len = 0; + for (var i = 0; i < str.length; ++i) { + var u = str.charCodeAt(i); + if (u >= 55296 && u <= 57343) u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; + if (u <= 127) ++len; + else if (u <= 2047) len += 2; + else if (u <= 65535) len += 3; + else len += 4; + } + return len + } + + function writeArrayToMemory(array, buffer) { + assert(array.length >= 0, "writeArrayToMemory array must have a length (should be an array or typed array)"); + GROWABLE_HEAP_I8().set(array, buffer); + } + var WASM_PAGE_SIZE = 65536; + + function alignUp(x, multiple) { + if (x % multiple > 0) { + x += multiple - x % multiple; + } + return x + } + var buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; + + function updateGlobalBufferAndViews(buf) { + buffer = buf; + Module["HEAP8"] = HEAP8 = new Int8Array(buf); + Module["HEAP16"] = HEAP16 = new Int16Array(buf); + Module["HEAP32"] = HEAP32 = new Int32Array(buf); + Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); + Module["HEAPU16"] = HEAPU16 = new Uint16Array(buf); + Module["HEAPU32"] = HEAPU32 = new Uint32Array(buf); + Module["HEAPF32"] = HEAPF32 = new Float32Array(buf); + Module["HEAPF64"] = HEAPF64 = new Float64Array(buf); + } + var STACK_BASE = 5255808, + STACKTOP = STACK_BASE, + STACK_MAX = 12928, + DYNAMIC_BASE = 5255808, + DYNAMICTOP_PTR = 12e3; + assert(STACK_BASE % 16 === 0, "stack must start aligned"); + assert(DYNAMIC_BASE % 16 === 0, "heap must start aligned"); + if (ENVIRONMENT_IS_PTHREAD) { + STACK_MAX = STACKTOP = STACK_MAX = 2147483647; + } + var TOTAL_STACK = 5242880; + if (Module["TOTAL_STACK"]) assert(TOTAL_STACK === Module["TOTAL_STACK"], "the stack size can no longer be determined at runtime"); + var INITIAL_INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 16777216; + if (!Object.getOwnPropertyDescriptor(Module, "INITIAL_MEMORY")) Object.defineProperty(Module, "INITIAL_MEMORY", { + configurable: true, + get: function () { + abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY"); + } + }); + assert(INITIAL_INITIAL_MEMORY >= TOTAL_STACK, "INITIAL_MEMORY should be larger than TOTAL_STACK, was " + INITIAL_INITIAL_MEMORY + "! (TOTAL_STACK=" + TOTAL_STACK + ")"); + assert(typeof Int32Array !== "undefined" && typeof Float64Array !== "undefined" && Int32Array.prototype.subarray !== undefined && Int32Array.prototype.set !== undefined, "JS engine does not provide full typed array support"); + if (ENVIRONMENT_IS_PTHREAD) { + wasmMemory = Module["wasmMemory"]; + buffer = Module["buffer"]; + } else { + if (Module["wasmMemory"]) { + wasmMemory = Module["wasmMemory"]; + } else { + wasmMemory = new WebAssembly.Memory({ + "initial": INITIAL_INITIAL_MEMORY / WASM_PAGE_SIZE, + "maximum": 1073741824 / WASM_PAGE_SIZE, + "shared": true + }); + if (!(wasmMemory.buffer instanceof SharedArrayBuffer)) { + err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"); + if (ENVIRONMENT_IS_NODE) { + console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"); + } + throw Error("bad memory") + } + } + } + if (wasmMemory) { + buffer = wasmMemory.buffer; + } + INITIAL_INITIAL_MEMORY = buffer.byteLength; + assert(INITIAL_INITIAL_MEMORY % WASM_PAGE_SIZE === 0); + assert(65536 % WASM_PAGE_SIZE === 0); + updateGlobalBufferAndViews(buffer); + if (!ENVIRONMENT_IS_PTHREAD) { + GROWABLE_HEAP_I32()[DYNAMICTOP_PTR >> 2] = DYNAMIC_BASE; + } + + function writeStackCookie() { + assert((STACK_MAX & 3) == 0); + GROWABLE_HEAP_U32()[(STACK_MAX >> 2) + 1] = 34821223; + GROWABLE_HEAP_U32()[(STACK_MAX >> 2) + 2] = 2310721022; + GROWABLE_HEAP_I32()[0] = 1668509029; + } + + function checkStackCookie() { + var cookie1 = GROWABLE_HEAP_U32()[(STACK_MAX >> 2) + 1]; + var cookie2 = GROWABLE_HEAP_U32()[(STACK_MAX >> 2) + 2]; + if (cookie1 != 34821223 || cookie2 != 2310721022) { + abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x" + cookie2.toString(16) + " " + cookie1.toString(16)); + } + if (GROWABLE_HEAP_I32()[0] !== 1668509029) abort("Runtime error: The application has corrupted its heap memory area (address zero)!"); + } + + function abortStackOverflow(allocSize) { + abort("Stack overflow! Attempted to allocate " + allocSize + " bytes on the stack, but stack has only " + (STACK_MAX - stackSave() + allocSize) + " bytes available!"); + }(function () { + var h16 = new Int16Array(1); + var h8 = new Int8Array(h16.buffer); + h16[0] = 25459; + if (h8[0] !== 115 || h8[1] !== 99) throw "Runtime error: expected the system to be little-endian!" + })(); + + function callRuntimeCallbacks(callbacks) { + while (callbacks.length > 0) { + var callback = callbacks.shift(); + if (typeof callback == "function") { + callback(Module); + continue + } + var func = callback.func; + if (typeof func === "number") { + if (callback.arg === undefined) { + Module["dynCall_v"](func); + } else { + Module["dynCall_vi"](func, callback.arg); + } + } else { + func(callback.arg === undefined ? null : callback.arg); + } + } + } + var __ATPRERUN__ = []; + var __ATINIT__ = []; + var __ATMAIN__ = []; + var __ATPOSTRUN__ = []; + var runtimeInitialized = false; + var runtimeExited = false; + if (ENVIRONMENT_IS_PTHREAD) runtimeInitialized = true; + + function preRun() { + if (ENVIRONMENT_IS_PTHREAD) return; + if (Module["preRun"]) { + if (typeof Module["preRun"] == "function") Module["preRun"] = [Module["preRun"]]; + while (Module["preRun"].length) { + addOnPreRun(Module["preRun"].shift()); + } + } + callRuntimeCallbacks(__ATPRERUN__); + } + + function initRuntime() { + checkStackCookie(); + assert(!runtimeInitialized); + runtimeInitialized = true; + callRuntimeCallbacks(__ATINIT__); + } + + function preMain() { + checkStackCookie(); + if (ENVIRONMENT_IS_PTHREAD) return; + callRuntimeCallbacks(__ATMAIN__); + } + + function postRun() { + checkStackCookie(); + if (ENVIRONMENT_IS_PTHREAD) return; + if (Module["postRun"]) { + if (typeof Module["postRun"] == "function") Module["postRun"] = [Module["postRun"]]; + while (Module["postRun"].length) { + addOnPostRun(Module["postRun"].shift()); + } + } + callRuntimeCallbacks(__ATPOSTRUN__); + } + + function addOnPreRun(cb) { + __ATPRERUN__.unshift(cb); + } + + function addOnPostRun(cb) { + __ATPOSTRUN__.unshift(cb); + } + assert(Math.imul, "This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + assert(Math.fround, "This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + assert(Math.clz32, "This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + assert(Math.trunc, "This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + var Math_ceil = Math.ceil; + var Math_floor = Math.floor; + var runDependencies = 0; + var runDependencyWatcher = null; + var dependenciesFulfilled = null; + var runDependencyTracking = {}; + + function addRunDependency(id) { + assert(!ENVIRONMENT_IS_PTHREAD, "addRunDependency cannot be used in a pthread worker"); + runDependencies++; + if (Module["monitorRunDependencies"]) { + Module["monitorRunDependencies"](runDependencies); + } + if (id) { + assert(!runDependencyTracking[id]); + runDependencyTracking[id] = 1; + if (runDependencyWatcher === null && typeof setInterval !== "undefined") { + runDependencyWatcher = setInterval(function () { + if (ABORT) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null; + return + } + var shown = false; + for (var dep in runDependencyTracking) { + if (!shown) { + shown = true; + err("still waiting on run dependencies:"); + } + err("dependency: " + dep); + } + if (shown) { + err("(end of list)"); + } + }, 1e4); + } + } else { + err("warning: run dependency added without ID"); + } + } + + function removeRunDependency(id) { + runDependencies--; + if (Module["monitorRunDependencies"]) { + Module["monitorRunDependencies"](runDependencies); + } + if (id) { + assert(runDependencyTracking[id]); + delete runDependencyTracking[id]; + } else { + err("warning: run dependency removed without ID"); + } + if (runDependencies == 0) { + if (runDependencyWatcher !== null) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null; + } + if (dependenciesFulfilled) { + var callback = dependenciesFulfilled; + dependenciesFulfilled = null; + callback(); + } + } + } + Module["preloadedImages"] = {}; + Module["preloadedAudios"] = {}; + + function abort(what) { + if (Module["onAbort"]) { + Module["onAbort"](what); + } + if (ENVIRONMENT_IS_PTHREAD) console.error("Pthread aborting at " + (new Error).stack); + what += ""; + out(what); + err(what); + ABORT = true; + var output = "abort(" + what + ") at " + stackTrace(); + what = output; + throw new WebAssembly.RuntimeError(what) + } + var FS = { + error: function () { + abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1"); + }, + init: function () { + FS.error(); + }, + createDataFile: function () { + FS.error(); + }, + createPreloadedFile: function () { + FS.error(); + }, + createLazyFile: function () { + FS.error(); + }, + open: function () { + FS.error(); + }, + mkdev: function () { + FS.error(); + }, + registerDevice: function () { + FS.error(); + }, + analyzePath: function () { + FS.error(); + }, + loadFilesFromDB: function () { + FS.error(); + }, + ErrnoError: function ErrnoError() { + FS.error(); + } + }; + Module["FS_createDataFile"] = FS.createDataFile; + Module["FS_createPreloadedFile"] = FS.createPreloadedFile; + + function hasPrefix(str, prefix) { + return String.prototype.startsWith ? str.startsWith(prefix) : str.indexOf(prefix) === 0 + } + var dataURIPrefix = "data:application/octet-stream;base64,"; + + function isDataURI(filename) { + return hasPrefix(filename, dataURIPrefix) + } + var fileURIPrefix = "file://"; + + function isFileURI(filename) { + return hasPrefix(filename, fileURIPrefix) + } + var wasmBinaryFile = "tfjs-backend-wasm.wasm"; + if (!isDataURI(wasmBinaryFile)) { + wasmBinaryFile = locateFile(wasmBinaryFile); + } + + function getBinary() { + try { + if (wasmBinary) { + return new Uint8Array(wasmBinary) + } + if (readBinary) { + return readBinary(wasmBinaryFile) + } else { + throw "both async and sync fetching of the wasm failed" + } + } catch (err) { + abort(err); + } + } + + function getBinaryPromise() { + if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) && typeof fetch === "function" && !isFileURI(wasmBinaryFile)) { + return fetch(wasmBinaryFile, { + credentials: "same-origin" + }).then(function (response) { + if (!response["ok"]) { + throw "failed to load wasm binary file at '" + wasmBinaryFile + "'" + } + return response["arrayBuffer"]() + }).catch(function () { + return getBinary() + }) + } + return new Promise(function (resolve, reject) { + resolve(getBinary()); + }) + } + + function createWasm() { + var info = { + "env": asmLibraryArg, + "wasi_snapshot_preview1": asmLibraryArg + }; + + function receiveInstance(instance, module) { + var exports = instance.exports; + Module["asm"] = exports; + wasmModule = module; + if (!ENVIRONMENT_IS_PTHREAD) { + var numWorkersToLoad = PThread.unusedWorkers.length; + PThread.unusedWorkers.forEach(function (w) { + PThread.loadWasmModuleToWorker(w, function () { + if (!--numWorkersToLoad) removeRunDependency("wasm-instantiate"); + }); + }); + } + } + if (!ENVIRONMENT_IS_PTHREAD) { + addRunDependency("wasm-instantiate"); + } + var trueModule = Module; + + function receiveInstantiatedSource(output) { + assert(Module === trueModule, "the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"); + trueModule = null; + receiveInstance(output["instance"], output["module"]); + } + + function instantiateArrayBuffer(receiver) { + return getBinaryPromise().then(function (binary) { + return WebAssembly.instantiate(binary, info) + }).then(receiver, function (reason) { + err("failed to asynchronously prepare wasm: " + reason); + abort(reason); + }) + } + + function instantiateAsync() { + if (!wasmBinary && typeof WebAssembly.instantiateStreaming === "function" && !isDataURI(wasmBinaryFile) && !isFileURI(wasmBinaryFile) && typeof fetch === "function") { + fetch(wasmBinaryFile, { + credentials: "same-origin" + }).then(function (response) { + var result = WebAssembly.instantiateStreaming(response, info); + return result.then(receiveInstantiatedSource, function (reason) { + err("wasm streaming compile failed: " + reason); + err("falling back to ArrayBuffer instantiation"); + instantiateArrayBuffer(receiveInstantiatedSource); + }) + }); + } else { + return instantiateArrayBuffer(receiveInstantiatedSource) + } + } + if (Module["instantiateWasm"]) { + try { + var exports = Module["instantiateWasm"](info, receiveInstance); + return exports + } catch (e) { + err("Module.instantiateWasm callback failed with error: " + e); + return false + } + } + instantiateAsync(); + return {} + } + var ASM_CONSTS = {}; + + function initPthreadsJS() { + PThread.initRuntime(); + } + if (!ENVIRONMENT_IS_PTHREAD) __ATINIT__.push({ + func: function () { + ___wasm_call_ctors(); + } + }); + + function demangle(func) { + warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"); + return func + } + + function demangleAll(text) { + var regex = /\b_Z[\w\d_]+/g; + return text.replace(regex, function (x) { + var y = demangle(x); + return x === y ? x : y + " [" + x + "]" + }) + } + var __pthread_ptr = 0; + var __pthread_is_main_runtime_thread = 0; + var __pthread_is_main_browser_thread = 0; + + function __register_pthread_ptr(pthreadPtr, isMainBrowserThread, isMainRuntimeThread) { + pthreadPtr = pthreadPtr | 0; + isMainBrowserThread = isMainBrowserThread | 0; + isMainRuntimeThread = isMainRuntimeThread | 0; + __pthread_ptr = pthreadPtr; + __pthread_is_main_browser_thread = isMainBrowserThread; + __pthread_is_main_runtime_thread = isMainRuntimeThread; + } + Module["__register_pthread_ptr"] = __register_pthread_ptr; + var ERRNO_CODES = { + EPERM: 63, + ENOENT: 44, + ESRCH: 71, + EINTR: 27, + EIO: 29, + ENXIO: 60, + E2BIG: 1, + ENOEXEC: 45, + EBADF: 8, + ECHILD: 12, + EAGAIN: 6, + EWOULDBLOCK: 6, + ENOMEM: 48, + EACCES: 2, + EFAULT: 21, + ENOTBLK: 105, + EBUSY: 10, + EEXIST: 20, + EXDEV: 75, + ENODEV: 43, + ENOTDIR: 54, + EISDIR: 31, + EINVAL: 28, + ENFILE: 41, + EMFILE: 33, + ENOTTY: 59, + ETXTBSY: 74, + EFBIG: 22, + ENOSPC: 51, + ESPIPE: 70, + EROFS: 69, + EMLINK: 34, + EPIPE: 64, + EDOM: 18, + ERANGE: 68, + ENOMSG: 49, + EIDRM: 24, + ECHRNG: 106, + EL2NSYNC: 156, + EL3HLT: 107, + EL3RST: 108, + ELNRNG: 109, + EUNATCH: 110, + ENOCSI: 111, + EL2HLT: 112, + EDEADLK: 16, + ENOLCK: 46, + EBADE: 113, + EBADR: 114, + EXFULL: 115, + ENOANO: 104, + EBADRQC: 103, + EBADSLT: 102, + EDEADLOCK: 16, + EBFONT: 101, + ENOSTR: 100, + ENODATA: 116, + ETIME: 117, + ENOSR: 118, + ENONET: 119, + ENOPKG: 120, + EREMOTE: 121, + ENOLINK: 47, + EADV: 122, + ESRMNT: 123, + ECOMM: 124, + EPROTO: 65, + EMULTIHOP: 36, + EDOTDOT: 125, + EBADMSG: 9, + ENOTUNIQ: 126, + EBADFD: 127, + EREMCHG: 128, + ELIBACC: 129, + ELIBBAD: 130, + ELIBSCN: 131, + ELIBMAX: 132, + ELIBEXEC: 133, + ENOSYS: 52, + ENOTEMPTY: 55, + ENAMETOOLONG: 37, + ELOOP: 32, + EOPNOTSUPP: 138, + EPFNOSUPPORT: 139, + ECONNRESET: 15, + ENOBUFS: 42, + EAFNOSUPPORT: 5, + EPROTOTYPE: 67, + ENOTSOCK: 57, + ENOPROTOOPT: 50, + ESHUTDOWN: 140, + ECONNREFUSED: 14, + EADDRINUSE: 3, + ECONNABORTED: 13, + ENETUNREACH: 40, + ENETDOWN: 38, + ETIMEDOUT: 73, + EHOSTDOWN: 142, + EHOSTUNREACH: 23, + EINPROGRESS: 26, + EALREADY: 7, + EDESTADDRREQ: 17, + EMSGSIZE: 35, + EPROTONOSUPPORT: 66, + ESOCKTNOSUPPORT: 137, + EADDRNOTAVAIL: 4, + ENETRESET: 39, + EISCONN: 30, + ENOTCONN: 53, + ETOOMANYREFS: 141, + EUSERS: 136, + EDQUOT: 19, + ESTALE: 72, + ENOTSUP: 138, + ENOMEDIUM: 148, + EILSEQ: 25, + EOVERFLOW: 61, + ECANCELED: 11, + ENOTRECOVERABLE: 56, + EOWNERDEAD: 62, + ESTRPIPE: 135 + }; + var __main_thread_futex_wait_address = 12912; + + function _emscripten_futex_wake(addr, count) { + if (addr <= 0 || addr > GROWABLE_HEAP_I8().length || addr & 3 != 0 || count < 0) return -28; + if (count == 0) return 0; + if (count >= 2147483647) count = Infinity; + var mainThreadWaitAddress = Atomics.load(GROWABLE_HEAP_I32(), __main_thread_futex_wait_address >> 2); + var mainThreadWoken = 0; + if (mainThreadWaitAddress == addr) { + var loadedAddr = Atomics.compareExchange(GROWABLE_HEAP_I32(), __main_thread_futex_wait_address >> 2, mainThreadWaitAddress, 0); + if (loadedAddr == mainThreadWaitAddress) { + --count; + mainThreadWoken = 1; + if (count <= 0) return 1 + } + } + var ret = Atomics.notify(GROWABLE_HEAP_I32(), addr >> 2, count); + if (ret >= 0) return ret + mainThreadWoken; + throw "Atomics.notify returned an unexpected value " + ret + } + Module["_emscripten_futex_wake"] = _emscripten_futex_wake; + + function __kill_thread(pthread_ptr) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _kill_thread() can only ever be called from main application thread!"; + if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _kill_thread!"; + GROWABLE_HEAP_I32()[pthread_ptr + 12 >> 2] = 0; + var pthread = PThread.pthreads[pthread_ptr]; + pthread.worker.terminate(); + PThread.freeThreadData(pthread); + PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker), 1); + pthread.worker.pthread = undefined; + } + + function __cancel_thread(pthread_ptr) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _cancel_thread() can only ever be called from main application thread!"; + if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _cancel_thread!"; + var pthread = PThread.pthreads[pthread_ptr]; + pthread.worker.postMessage({ + "cmd": "cancel" + }); + } + + function __cleanup_thread(pthread_ptr) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _cleanup_thread() can only ever be called from main application thread!"; + if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _cleanup_thread!"; + GROWABLE_HEAP_I32()[pthread_ptr + 12 >> 2] = 0; + var pthread = PThread.pthreads[pthread_ptr]; + if (pthread) { + var worker = pthread.worker; + PThread.returnWorkerToPool(worker); + } + } + var PThread = { + MAIN_THREAD_ID: 1, + mainThreadInfo: { + schedPolicy: 0, + schedPrio: 0 + }, + unusedWorkers: [], + runningWorkers: [], + initRuntime: function () { + __register_pthread_ptr(PThread.mainThreadBlock, !ENVIRONMENT_IS_WORKER, 1); + _emscripten_register_main_browser_thread_id(PThread.mainThreadBlock); + }, + initMainThreadBlock: function () { + assert(!ENVIRONMENT_IS_PTHREAD); + var pthreadPoolSize = 8; + for (var i = 0; i < pthreadPoolSize; ++i) { + PThread.allocateUnusedWorker(); + } + PThread.mainThreadBlock = 12160; + for (var i = 0; i < 232 / 4; ++i) GROWABLE_HEAP_U32()[PThread.mainThreadBlock / 4 + i] = 0; + GROWABLE_HEAP_I32()[PThread.mainThreadBlock + 12 >> 2] = PThread.mainThreadBlock; + var headPtr = PThread.mainThreadBlock + 156; + GROWABLE_HEAP_I32()[headPtr >> 2] = headPtr; + var tlsMemory = 12400; + for (var i = 0; i < 128; ++i) GROWABLE_HEAP_U32()[tlsMemory / 4 + i] = 0; + Atomics.store(GROWABLE_HEAP_U32(), PThread.mainThreadBlock + 104 >> 2, tlsMemory); + Atomics.store(GROWABLE_HEAP_U32(), PThread.mainThreadBlock + 40 >> 2, PThread.mainThreadBlock); + Atomics.store(GROWABLE_HEAP_U32(), PThread.mainThreadBlock + 44 >> 2, 42); + }, + initWorker: function () {}, + pthreads: {}, + exitHandlers: null, + setThreadStatus: function () {}, + runExitHandlers: function () { + if (PThread.exitHandlers !== null) { + while (PThread.exitHandlers.length > 0) { + PThread.exitHandlers.pop()(); + } + PThread.exitHandlers = null; + } + if (ENVIRONMENT_IS_PTHREAD && threadInfoStruct) ___pthread_tsd_run_dtors(); + }, + threadExit: function (exitCode) { + var tb = _pthread_self(); + if (tb) { + err("Pthread 0x" + tb.toString(16) + " exited."); + Atomics.store(GROWABLE_HEAP_U32(), tb + 4 >> 2, exitCode); + Atomics.store(GROWABLE_HEAP_U32(), tb + 0 >> 2, 1); + Atomics.store(GROWABLE_HEAP_U32(), tb + 60 >> 2, 1); + Atomics.store(GROWABLE_HEAP_U32(), tb + 64 >> 2, 0); + PThread.runExitHandlers(); + _emscripten_futex_wake(tb + 0, 2147483647); + __register_pthread_ptr(0, 0, 0); + threadInfoStruct = 0; + if (ENVIRONMENT_IS_PTHREAD) { + postMessage({ + "cmd": "exit" + }); + } + } + }, + threadCancel: function () { + PThread.runExitHandlers(); + Atomics.store(GROWABLE_HEAP_U32(), threadInfoStruct + 4 >> 2, -1); + Atomics.store(GROWABLE_HEAP_U32(), threadInfoStruct + 0 >> 2, 1); + _emscripten_futex_wake(threadInfoStruct + 0, 2147483647); + threadInfoStruct = selfThreadId = 0; + __register_pthread_ptr(0, 0, 0); + postMessage({ + "cmd": "cancelDone" + }); + }, + terminateAllThreads: function () { + for (var t in PThread.pthreads) { + var pthread = PThread.pthreads[t]; + if (pthread && pthread.worker) { + PThread.returnWorkerToPool(pthread.worker); + } + } + PThread.pthreads = {}; + for (var i = 0; i < PThread.unusedWorkers.length; ++i) { + var worker = PThread.unusedWorkers[i]; + assert(!worker.pthread); + worker.terminate(); + } + PThread.unusedWorkers = []; + for (var i = 0; i < PThread.runningWorkers.length; ++i) { + var worker = PThread.runningWorkers[i]; + var pthread = worker.pthread; + assert(pthread, "This Worker should have a pthread it is executing"); + PThread.freeThreadData(pthread); + worker.terminate(); + } + PThread.runningWorkers = []; + }, + freeThreadData: function (pthread) { + if (!pthread) return; + if (pthread.threadInfoStruct) { + var tlsMemory = GROWABLE_HEAP_I32()[pthread.threadInfoStruct + 104 >> 2]; + GROWABLE_HEAP_I32()[pthread.threadInfoStruct + 104 >> 2] = 0; + _free(tlsMemory); + _free(pthread.threadInfoStruct); + } + pthread.threadInfoStruct = 0; + if (pthread.allocatedOwnStack && pthread.stackBase) _free(pthread.stackBase); + pthread.stackBase = 0; + if (pthread.worker) pthread.worker.pthread = null; + }, + returnWorkerToPool: function (worker) { + delete PThread.pthreads[worker.pthread.thread]; + PThread.unusedWorkers.push(worker); + PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker), 1); + PThread.freeThreadData(worker.pthread); + worker.pthread = undefined; + }, + receiveObjectTransfer: function (data) {}, + loadWasmModuleToWorker: function (worker, onFinishedLoading) { + worker.onmessage = function (e) { + var d = e["data"]; + var cmd = d["cmd"]; + if (worker.pthread) PThread.currentProxiedOperationCallerThread = worker.pthread.threadInfoStruct; + if (d["targetThread"] && d["targetThread"] != _pthread_self()) { + var thread = PThread.pthreads[d.targetThread]; + if (thread) { + thread.worker.postMessage(e.data, d["transferList"]); + } else { + console.error('Internal error! Worker sent a message "' + cmd + '" to target pthread ' + d["targetThread"] + ", but that thread no longer exists!"); + } + PThread.currentProxiedOperationCallerThread = undefined; + return + } + if (cmd === "processQueuedMainThreadWork") { + _emscripten_main_thread_process_queued_calls(); + } else if (cmd === "spawnThread") { + __spawn_thread(e.data); + } else if (cmd === "cleanupThread") { + __cleanup_thread(d["thread"]); + } else if (cmd === "killThread") { + __kill_thread(d["thread"]); + } else if (cmd === "cancelThread") { + __cancel_thread(d["thread"]); + } else if (cmd === "loaded") { + worker.loaded = true; + if (onFinishedLoading) onFinishedLoading(worker); + if (worker.runPthread) { + worker.runPthread(); + delete worker.runPthread; + } + } else if (cmd === "print") { + out("Thread " + d["threadId"] + ": " + d["text"]); + } else if (cmd === "printErr") { + err("Thread " + d["threadId"] + ": " + d["text"]); + } else if (cmd === "alert") { + alert("Thread " + d["threadId"] + ": " + d["text"]); + } else if (cmd === "exit") { + var detached = worker.pthread && Atomics.load(GROWABLE_HEAP_U32(), worker.pthread.thread + 68 >> 2); + if (detached) { + PThread.returnWorkerToPool(worker); + } + } else if (cmd === "cancelDone") { + PThread.returnWorkerToPool(worker); + } else if (cmd === "objectTransfer") { + PThread.receiveObjectTransfer(e.data); + } else if (e.data.target === "setimmediate") { + worker.postMessage(e.data); + } else { + err("worker sent an unknown command " + cmd); + } + PThread.currentProxiedOperationCallerThread = undefined; + }; + worker.onerror = function (e) { + err("pthread sent an error! " + e.filename + ":" + e.lineno + ": " + e.message); + }; + if (ENVIRONMENT_IS_NODE) { + worker.on("message", function (data) { + worker.onmessage({ + data: data + }); + }); + worker.on("error", function (data) { + worker.onerror(data); + }); + worker.on("exit", function (data) { + console.log("worker exited - TODO: update the worker queue?"); + }); + } + assert(wasmMemory instanceof WebAssembly.Memory, "WebAssembly memory should have been loaded by now!"); + assert(wasmModule instanceof WebAssembly.Module, "WebAssembly Module should have been loaded by now!"); + worker.postMessage({ + "cmd": "load", + "urlOrBlob": Module["mainScriptUrlOrBlob"] || _scriptDir, + "wasmMemory": wasmMemory, + "wasmModule": wasmModule, + "DYNAMIC_BASE": DYNAMIC_BASE, + "DYNAMICTOP_PTR": DYNAMICTOP_PTR + }); + }, + allocateUnusedWorker: function () { + var pthreadMainJs = locateFile("tfjs-backend-wasm.worker.js"); + PThread.unusedWorkers.push(new Worker(pthreadMainJs)); + }, + getNewWorker: function () { + if (PThread.unusedWorkers.length == 0) { + PThread.allocateUnusedWorker(); + PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0]); + } + if (PThread.unusedWorkers.length > 0) return PThread.unusedWorkers.pop(); + else return null + }, + busySpinWait: function (msecs) { + var t = performance.now() + msecs; + while (performance.now() < t) {} + } + }; + + function establishStackSpace(stackTop, stackMax) { + STACK_BASE = STACKTOP = stackTop; + STACK_MAX = stackMax; + ___set_stack_limit(STACK_MAX); + writeStackCookie(); + stackRestore(stackTop); + } + Module["establishStackSpace"] = establishStackSpace; + + function getNoExitRuntime() { + return noExitRuntime + } + Module["getNoExitRuntime"] = getNoExitRuntime; + + function jsStackTrace() { + var err = new Error; + if (!err.stack) { + try { + throw new Error + } catch (e) { + err = e; + } + if (!err.stack) { + return "(no stack trace available)" + } + } + return err.stack.toString() + } + + function stackTrace() { + var js = jsStackTrace(); + if (Module["extraStackTrace"]) js += "\n" + Module["extraStackTrace"](); + return demangleAll(js) + } + + function ___assert_fail(condition, filename, line, func) { + abort("Assertion failed: " + UTF8ToString(condition) + ", at: " + [filename ? UTF8ToString(filename) : "unknown filename", line, func ? UTF8ToString(func) : "unknown function"]); + } + var _emscripten_get_now; + if (ENVIRONMENT_IS_NODE) { + _emscripten_get_now = function () { + var t = process["hrtime"](); + return t[0] * 1e3 + t[1] / 1e6 + }; + } else if (ENVIRONMENT_IS_PTHREAD) { + _emscripten_get_now = function () { + return performance.now() - Module["__performance_now_clock_drift"] + }; + } else if (typeof dateNow !== "undefined") { + _emscripten_get_now = dateNow; + } else _emscripten_get_now = function () { + return performance.now() + }; + + function _atexit(func, arg) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(1, 1, func, arg); + warnOnce("atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)"); + } + + function ___handle_stack_overflow() { + abort("stack overflow"); + } + + function __emscripten_notify_thread_queue(targetThreadId, mainThreadId) { + if (targetThreadId == mainThreadId) { + postMessage({ + "cmd": "processQueuedMainThreadWork" + }); + } else if (ENVIRONMENT_IS_PTHREAD) { + postMessage({ + "targetThread": targetThreadId, + "cmd": "processThreadQueue" + }); + } else { + var pthread = PThread.pthreads[targetThreadId]; + var worker = pthread && pthread.worker; + if (!worker) { + err("Cannot send message to thread with ID " + targetThreadId + ", unknown thread ID!"); + return + } + worker.postMessage({ + "cmd": "processThreadQueue" + }); + } + return 1 + } + + function _abort() { + abort(); + } + + function _emscripten_conditional_set_current_thread_status(expectedStatus, newStatus) {} + + function _emscripten_futex_wait(addr, val, timeout) { + if (addr <= 0 || addr > GROWABLE_HEAP_I8().length || addr & 3 != 0) return -28; + if (ENVIRONMENT_IS_WORKER) { + var ret = Atomics.wait(GROWABLE_HEAP_I32(), addr >> 2, val, timeout); + if (ret === "timed-out") return -73; + if (ret === "not-equal") return -6; + if (ret === "ok") return 0; + throw "Atomics.wait returned an unexpected value " + ret + } else { + var loadedVal = Atomics.load(GROWABLE_HEAP_I32(), addr >> 2); + if (val != loadedVal) return -6; + var tNow = performance.now(); + var tEnd = tNow + timeout; + Atomics.store(GROWABLE_HEAP_I32(), __main_thread_futex_wait_address >> 2, addr); + var ourWaitAddress = addr; + while (addr == ourWaitAddress) { + tNow = performance.now(); + if (tNow > tEnd) { + return -73 + } + _emscripten_main_thread_process_queued_calls(); + addr = Atomics.load(GROWABLE_HEAP_I32(), __main_thread_futex_wait_address >> 2); + } + return 0 + } + } + + function _emscripten_is_main_browser_thread() { + return __pthread_is_main_browser_thread | 0 + } + + function _emscripten_is_main_runtime_thread() { + return __pthread_is_main_runtime_thread | 0 + } + + function _emscripten_memcpy_big(dest, src, num) { + GROWABLE_HEAP_U8().copyWithin(dest, src, src + num); + } + + function _emscripten_proxy_to_main_thread_js(index, sync) { + var numCallArgs = arguments.length - 2; + if (numCallArgs > 20 - 1) throw "emscripten_proxy_to_main_thread_js: Too many arguments " + numCallArgs + " to proxied function idx=" + index + ", maximum supported is " + (20 - 1) + "!"; + var stack = stackSave(); + var args = stackAlloc(numCallArgs * 8); + var b = args >> 3; + for (var i = 0; i < numCallArgs; i++) { + GROWABLE_HEAP_F64()[b + i] = arguments[2 + i]; + } + var ret = _emscripten_run_in_main_runtime_thread_js(index, numCallArgs, args, sync); + stackRestore(stack); + return ret + } + var _emscripten_receive_on_main_thread_js_callArgs = []; + + function readAsmConstArgs(sigPtr, buf) { + if (!readAsmConstArgs.array) { + readAsmConstArgs.array = []; + } + var args = readAsmConstArgs.array; + args.length = 0; + var ch; + while (ch = GROWABLE_HEAP_U8()[sigPtr++]) { + if (ch === 100 || ch === 102) { + buf = buf + 7 & ~7; + args.push(GROWABLE_HEAP_F64()[buf >> 3]); + buf += 8; + } else if (ch === 105) { + buf = buf + 3 & ~3; + args.push(GROWABLE_HEAP_I32()[buf >> 2]); + buf += 4; + } else abort("unexpected char in asm const signature " + ch); + } + return args + } + + function _emscripten_receive_on_main_thread_js(index, numCallArgs, args) { + _emscripten_receive_on_main_thread_js_callArgs.length = numCallArgs; + var b = args >> 3; + for (var i = 0; i < numCallArgs; i++) { + _emscripten_receive_on_main_thread_js_callArgs[i] = GROWABLE_HEAP_F64()[b + i]; + } + var isEmAsmConst = index < 0; + var func = !isEmAsmConst ? proxiedFunctionTable[index] : ASM_CONSTS[-index - 1]; + if (isEmAsmConst) { + var sigPtr = _emscripten_receive_on_main_thread_js_callArgs[1]; + var varargPtr = _emscripten_receive_on_main_thread_js_callArgs[2]; + var constArgs = readAsmConstArgs(sigPtr, varargPtr); + return func.apply(null, constArgs) + } + assert(func.length == numCallArgs, "Call args mismatch in emscripten_receive_on_main_thread_js"); + return func.apply(null, _emscripten_receive_on_main_thread_js_callArgs) + } + + function _emscripten_get_heap_size() { + return GROWABLE_HEAP_U8().length + } + + function emscripten_realloc_buffer(size) { + try { + wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16); + updateGlobalBufferAndViews(wasmMemory.buffer); + return 1 + } catch (e) { + console.error("emscripten_realloc_buffer: Attempted to grow heap from " + buffer.byteLength + " bytes to " + size + " bytes, but got error: " + e); + } + } + + function _emscripten_resize_heap(requestedSize) { + var oldSize = _emscripten_get_heap_size(); + if (requestedSize <= oldSize) { + return false + } + var PAGE_MULTIPLE = 65536; + var maxHeapSize = 1073741824; + if (requestedSize > maxHeapSize) { + err("Cannot enlarge memory, asked to go up to " + requestedSize + " bytes, but the limit is " + maxHeapSize + " bytes!"); + return false + } + var minHeapSize = 16777216; + for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { + var overGrownHeapSize = oldSize * (1 + .2 / cutDown); + overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296); + var newSize = Math.min(maxHeapSize, alignUp(Math.max(minHeapSize, requestedSize, overGrownHeapSize), PAGE_MULTIPLE)); + var replacement = emscripten_realloc_buffer(newSize); + if (replacement) { + return true + } + } + err("Failed to grow the heap from " + oldSize + " bytes to " + newSize + " bytes, not enough memory!"); + return false + } + var JSEvents = { + keyEvent: 0, + mouseEvent: 0, + wheelEvent: 0, + uiEvent: 0, + focusEvent: 0, + deviceOrientationEvent: 0, + deviceMotionEvent: 0, + fullscreenChangeEvent: 0, + pointerlockChangeEvent: 0, + visibilityChangeEvent: 0, + touchEvent: 0, + previousFullscreenElement: null, + previousScreenX: null, + previousScreenY: null, + removeEventListenersRegistered: false, + removeAllEventListeners: function () { + for (var i = JSEvents.eventHandlers.length - 1; i >= 0; --i) { + JSEvents._removeHandler(i); + } + JSEvents.eventHandlers = []; + JSEvents.deferredCalls = []; + }, + registerRemoveEventListeners: function () { + if (!JSEvents.removeEventListenersRegistered) { + JSEvents.removeEventListenersRegistered = true; + } + }, + deferredCalls: [], + deferCall: function (targetFunction, precedence, argsList) { + function arraysHaveEqualContent(arrA, arrB) { + if (arrA.length != arrB.length) return false; + for (var i in arrA) { + if (arrA[i] != arrB[i]) return false + } + return true + } + for (var i in JSEvents.deferredCalls) { + var call = JSEvents.deferredCalls[i]; + if (call.targetFunction == targetFunction && arraysHaveEqualContent(call.argsList, argsList)) { + return + } + } + JSEvents.deferredCalls.push({ + targetFunction: targetFunction, + precedence: precedence, + argsList: argsList + }); + JSEvents.deferredCalls.sort(function (x, y) { + return x.precedence < y.precedence + }); + }, + removeDeferredCalls: function (targetFunction) { + for (var i = 0; i < JSEvents.deferredCalls.length; ++i) { + if (JSEvents.deferredCalls[i].targetFunction == targetFunction) { + JSEvents.deferredCalls.splice(i, 1); + --i; + } + } + }, + canPerformEventHandlerRequests: function () { + return JSEvents.inEventHandler && JSEvents.currentEventHandler.allowsDeferredCalls + }, + runDeferredCalls: function () { + if (!JSEvents.canPerformEventHandlerRequests()) { + return + } + for (var i = 0; i < JSEvents.deferredCalls.length; ++i) { + var call = JSEvents.deferredCalls[i]; + JSEvents.deferredCalls.splice(i, 1); + --i; + call.targetFunction.apply(null, call.argsList); + } + }, + inEventHandler: 0, + currentEventHandler: null, + eventHandlers: [], + removeAllHandlersOnTarget: function (target, eventTypeString) { + for (var i = 0; i < JSEvents.eventHandlers.length; ++i) { + if (JSEvents.eventHandlers[i].target == target && (!eventTypeString || eventTypeString == JSEvents.eventHandlers[i].eventTypeString)) { + JSEvents._removeHandler(i--); + } + } + }, + _removeHandler: function (i) { + var h = JSEvents.eventHandlers[i]; + h.target.removeEventListener(h.eventTypeString, h.eventListenerFunc, h.useCapture); + JSEvents.eventHandlers.splice(i, 1); + }, + registerOrRemoveHandler: function (eventHandler) { + var jsEventHandler = function jsEventHandler(event) { + ++JSEvents.inEventHandler; + JSEvents.currentEventHandler = eventHandler; + JSEvents.runDeferredCalls(); + eventHandler.handlerFunc(event); + JSEvents.runDeferredCalls(); + --JSEvents.inEventHandler; + }; + if (eventHandler.callbackfunc) { + eventHandler.eventListenerFunc = jsEventHandler; + eventHandler.target.addEventListener(eventHandler.eventTypeString, jsEventHandler, eventHandler.useCapture); + JSEvents.eventHandlers.push(eventHandler); + JSEvents.registerRemoveEventListeners(); + } else { + for (var i = 0; i < JSEvents.eventHandlers.length; ++i) { + if (JSEvents.eventHandlers[i].target == eventHandler.target && JSEvents.eventHandlers[i].eventTypeString == eventHandler.eventTypeString) { + JSEvents._removeHandler(i--); + } + } + } + }, + queueEventHandlerOnThread_iiii: function (targetThread, eventHandlerFunc, eventTypeId, eventData, userData) { + var stackTop = stackSave(); + var varargs = stackAlloc(12); + GROWABLE_HEAP_I32()[varargs >> 2] = eventTypeId; + GROWABLE_HEAP_I32()[varargs + 4 >> 2] = eventData; + GROWABLE_HEAP_I32()[varargs + 8 >> 2] = userData; + _emscripten_async_queue_on_thread_(targetThread, 637534208, eventHandlerFunc, eventData, varargs); + stackRestore(stackTop); + }, + getTargetThreadForEventCallback: function (targetThread) { + switch (targetThread) { + case 1: + return 0; + case 2: + return PThread.currentProxiedOperationCallerThread; + default: + return targetThread + } + }, + getNodeNameForTarget: function (target) { + if (!target) return ""; + if (target == window) return "#window"; + if (target == screen) return "#screen"; + return target && target.nodeName ? target.nodeName : "" + }, + fullscreenEnabled: function () { + return document.fullscreenEnabled || document.webkitFullscreenEnabled + } + }; + + function stringToNewUTF8(jsString) { + var length = lengthBytesUTF8(jsString) + 1; + var cString = _malloc(length); + stringToUTF8(jsString, cString, length); + return cString + } + + function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread, targetCanvas, width, height) { + var stackTop = stackSave(); + var varargs = stackAlloc(12); + var targetCanvasPtr = 0; + if (targetCanvas) { + targetCanvasPtr = stringToNewUTF8(targetCanvas); + } + GROWABLE_HEAP_I32()[varargs >> 2] = targetCanvasPtr; + GROWABLE_HEAP_I32()[varargs + 4 >> 2] = width; + GROWABLE_HEAP_I32()[varargs + 8 >> 2] = height; + _emscripten_async_queue_on_thread_(targetThread, 657457152, 0, targetCanvasPtr, varargs); + stackRestore(stackTop); + } + + function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread, targetCanvas, width, height) { + targetCanvas = targetCanvas ? UTF8ToString(targetCanvas) : ""; + _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread, targetCanvas, width, height); + } + + function __maybeCStringToJsString(cString) { + return cString === cString + 0 ? UTF8ToString(cString) : cString + } + var __specialEventTargets = [0, typeof document !== "undefined" ? document : 0, typeof window !== "undefined" ? window : 0]; + + function __findEventTarget(target) { + var domElement = __specialEventTargets[target] || (typeof document !== "undefined" ? document.querySelector(__maybeCStringToJsString(target)) : undefined); + return domElement + } + + function __findCanvasEventTarget(target) { + return __findEventTarget(target) + } + + function _emscripten_set_canvas_element_size_calling_thread(target, width, height) { + var canvas = __findCanvasEventTarget(target); + if (!canvas) return -4; + if (canvas.canvasSharedPtr) { + GROWABLE_HEAP_I32()[canvas.canvasSharedPtr >> 2] = width; + GROWABLE_HEAP_I32()[canvas.canvasSharedPtr + 4 >> 2] = height; + } + if (canvas.offscreenCanvas || !canvas.controlTransferredOffscreen) { + if (canvas.offscreenCanvas) canvas = canvas.offscreenCanvas; + var autoResizeViewport = false; + if (canvas.GLctxObject && canvas.GLctxObject.GLctx) { + var prevViewport = canvas.GLctxObject.GLctx.getParameter(2978); + autoResizeViewport = prevViewport[0] === 0 && prevViewport[1] === 0 && prevViewport[2] === canvas.width && prevViewport[3] === canvas.height; + } + canvas.width = width; + canvas.height = height; + if (autoResizeViewport) { + canvas.GLctxObject.GLctx.viewport(0, 0, width, height); + } + } else if (canvas.canvasSharedPtr) { + var targetThread = GROWABLE_HEAP_I32()[canvas.canvasSharedPtr + 8 >> 2]; + _emscripten_set_offscreencanvas_size_on_target_thread(targetThread, target, width, height); + return 1 + } else { + return -4 + } + return 0 + } + + function _emscripten_set_canvas_element_size_main_thread(target, width, height) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(2, 1, target, width, height); + return _emscripten_set_canvas_element_size_calling_thread(target, width, height) + } + + function _emscripten_set_canvas_element_size(target, width, height) { + var canvas = __findCanvasEventTarget(target); + if (canvas) { + return _emscripten_set_canvas_element_size_calling_thread(target, width, height) + } else { + return _emscripten_set_canvas_element_size_main_thread(target, width, height) + } + } + + function _emscripten_set_current_thread_status(newStatus) {} + + function __webgl_acquireInstancedArraysExtension(ctx) { + var ext = ctx.getExtension("ANGLE_instanced_arrays"); + if (ext) { + ctx["vertexAttribDivisor"] = function (index, divisor) { + ext["vertexAttribDivisorANGLE"](index, divisor); + }; + ctx["drawArraysInstanced"] = function (mode, first, count, primcount) { + ext["drawArraysInstancedANGLE"](mode, first, count, primcount); + }; + ctx["drawElementsInstanced"] = function (mode, count, type, indices, primcount) { + ext["drawElementsInstancedANGLE"](mode, count, type, indices, primcount); + }; + } + } + + function __webgl_acquireVertexArrayObjectExtension(ctx) { + var ext = ctx.getExtension("OES_vertex_array_object"); + if (ext) { + ctx["createVertexArray"] = function () { + return ext["createVertexArrayOES"]() + }; + ctx["deleteVertexArray"] = function (vao) { + ext["deleteVertexArrayOES"](vao); + }; + ctx["bindVertexArray"] = function (vao) { + ext["bindVertexArrayOES"](vao); + }; + ctx["isVertexArray"] = function (vao) { + return ext["isVertexArrayOES"](vao) + }; + } + } + + function __webgl_acquireDrawBuffersExtension(ctx) { + var ext = ctx.getExtension("WEBGL_draw_buffers"); + if (ext) { + ctx["drawBuffers"] = function (n, bufs) { + ext["drawBuffersWEBGL"](n, bufs); + }; + } + } + var GL = { + counter: 1, + lastError: 0, + buffers: [], + mappedBuffers: {}, + programs: [], + framebuffers: [], + renderbuffers: [], + textures: [], + uniforms: [], + shaders: [], + vaos: [], + contexts: {}, + currentContext: null, + offscreenCanvases: {}, + timerQueriesEXT: [], + programInfos: {}, + stringCache: {}, + unpackAlignment: 4, + init: function () { + var miniTempFloatBuffer = new Float32Array(GL.MINI_TEMP_BUFFER_SIZE); + for (var i = 0; i < GL.MINI_TEMP_BUFFER_SIZE; i++) { + GL.miniTempBufferFloatViews[i] = miniTempFloatBuffer.subarray(0, i + 1); + } + var miniTempIntBuffer = new Int32Array(GL.MINI_TEMP_BUFFER_SIZE); + for (var i = 0; i < GL.MINI_TEMP_BUFFER_SIZE; i++) { + GL.miniTempBufferIntViews[i] = miniTempIntBuffer.subarray(0, i + 1); + } + }, + recordError: function recordError(errorCode) { + if (!GL.lastError) { + GL.lastError = errorCode; + } + }, + getNewId: function (table) { + var ret = GL.counter++; + for (var i = table.length; i < ret; i++) { + table[i] = null; + } + return ret + }, + MINI_TEMP_BUFFER_SIZE: 256, + miniTempBufferFloatViews: [0], + miniTempBufferIntViews: [0], + getSource: function (shader, count, string, length) { + var source = ""; + for (var i = 0; i < count; ++i) { + var len = length ? GROWABLE_HEAP_I32()[length + i * 4 >> 2] : -1; + source += UTF8ToString(GROWABLE_HEAP_I32()[string + i * 4 >> 2], len < 0 ? undefined : len); + } + return source + }, + createContext: function (canvas, webGLContextAttributes) { + var ctx = canvas.getContext("webgl", webGLContextAttributes); + if (!ctx) return 0; + var handle = GL.registerContext(ctx, webGLContextAttributes); + return handle + }, + registerContext: function (ctx, webGLContextAttributes) { + var handle = _malloc(8); + GROWABLE_HEAP_I32()[handle + 4 >> 2] = _pthread_self(); + var context = { + handle: handle, + attributes: webGLContextAttributes, + version: webGLContextAttributes.majorVersion, + GLctx: ctx + }; + if (ctx.canvas) ctx.canvas.GLctxObject = context; + GL.contexts[handle] = context; + if (typeof webGLContextAttributes.enableExtensionsByDefault === "undefined" || webGLContextAttributes.enableExtensionsByDefault) { + GL.initExtensions(context); + } + return handle + }, + makeContextCurrent: function (contextHandle) { + GL.currentContext = GL.contexts[contextHandle]; + Module.ctx = GLctx = GL.currentContext && GL.currentContext.GLctx; + return !(contextHandle && !GLctx) + }, + getContext: function (contextHandle) { + return GL.contexts[contextHandle] + }, + deleteContext: function (contextHandle) { + if (GL.currentContext === GL.contexts[contextHandle]) GL.currentContext = null; + if (typeof JSEvents === "object") JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas); + if (GL.contexts[contextHandle] && GL.contexts[contextHandle].GLctx.canvas) GL.contexts[contextHandle].GLctx.canvas.GLctxObject = undefined; + _free(GL.contexts[contextHandle].handle); + GL.contexts[contextHandle] = null; + }, + initExtensions: function (context) { + if (!context) context = GL.currentContext; + if (context.initExtensionsDone) return; + context.initExtensionsDone = true; + var GLctx = context.GLctx; + if (context.version < 2) { + __webgl_acquireInstancedArraysExtension(GLctx); + __webgl_acquireVertexArrayObjectExtension(GLctx); + __webgl_acquireDrawBuffersExtension(GLctx); + } + GLctx.disjointTimerQueryExt = GLctx.getExtension("EXT_disjoint_timer_query"); + var automaticallyEnabledExtensions = ["OES_texture_float", "OES_texture_half_float", "OES_standard_derivatives", "OES_vertex_array_object", "WEBGL_compressed_texture_s3tc", "WEBGL_depth_texture", "OES_element_index_uint", "EXT_texture_filter_anisotropic", "EXT_frag_depth", "WEBGL_draw_buffers", "ANGLE_instanced_arrays", "OES_texture_float_linear", "OES_texture_half_float_linear", "EXT_blend_minmax", "EXT_shader_texture_lod", "EXT_texture_norm16", "WEBGL_compressed_texture_pvrtc", "EXT_color_buffer_half_float", "WEBGL_color_buffer_float", "EXT_sRGB", "WEBGL_compressed_texture_etc1", "EXT_disjoint_timer_query", "WEBGL_compressed_texture_etc", "WEBGL_compressed_texture_astc", "EXT_color_buffer_float", "WEBGL_compressed_texture_s3tc_srgb", "EXT_disjoint_timer_query_webgl2", "WEBKIT_WEBGL_compressed_texture_pvrtc"]; + var exts = GLctx.getSupportedExtensions() || []; + exts.forEach(function (ext) { + if (automaticallyEnabledExtensions.indexOf(ext) != -1) { + GLctx.getExtension(ext); + } + }); + }, + populateUniformTable: function (program) { + var p = GL.programs[program]; + var ptable = GL.programInfos[program] = { + uniforms: {}, + maxUniformLength: 0, + maxAttributeLength: -1, + maxUniformBlockNameLength: -1 + }; + var utable = ptable.uniforms; + var numUniforms = GLctx.getProgramParameter(p, 35718); + for (var i = 0; i < numUniforms; ++i) { + var u = GLctx.getActiveUniform(p, i); + var name = u.name; + ptable.maxUniformLength = Math.max(ptable.maxUniformLength, name.length + 1); + if (name.slice(-1) == "]") { + name = name.slice(0, name.lastIndexOf("[")); + } + var loc = GLctx.getUniformLocation(p, name); + if (loc) { + var id = GL.getNewId(GL.uniforms); + utable[name] = [u.size, id]; + GL.uniforms[id] = loc; + for (var j = 1; j < u.size; ++j) { + var n = name + "[" + j + "]"; + loc = GLctx.getUniformLocation(p, n); + id = GL.getNewId(GL.uniforms); + GL.uniforms[id] = loc; + } + } + } + } + }; + var __emscripten_webgl_power_preferences = ["default", "low-power", "high-performance"]; + + function _emscripten_webgl_do_create_context(target, attributes) { + assert(attributes); + var contextAttributes = {}; + var a = attributes >> 2; + contextAttributes["alpha"] = !!GROWABLE_HEAP_I32()[a + (0 >> 2)]; + contextAttributes["depth"] = !!GROWABLE_HEAP_I32()[a + (4 >> 2)]; + contextAttributes["stencil"] = !!GROWABLE_HEAP_I32()[a + (8 >> 2)]; + contextAttributes["antialias"] = !!GROWABLE_HEAP_I32()[a + (12 >> 2)]; + contextAttributes["premultipliedAlpha"] = !!GROWABLE_HEAP_I32()[a + (16 >> 2)]; + contextAttributes["preserveDrawingBuffer"] = !!GROWABLE_HEAP_I32()[a + (20 >> 2)]; + var powerPreference = GROWABLE_HEAP_I32()[a + (24 >> 2)]; + contextAttributes["powerPreference"] = __emscripten_webgl_power_preferences[powerPreference]; + contextAttributes["failIfMajorPerformanceCaveat"] = !!GROWABLE_HEAP_I32()[a + (28 >> 2)]; + contextAttributes.majorVersion = GROWABLE_HEAP_I32()[a + (32 >> 2)]; + contextAttributes.minorVersion = GROWABLE_HEAP_I32()[a + (36 >> 2)]; + contextAttributes.enableExtensionsByDefault = GROWABLE_HEAP_I32()[a + (40 >> 2)]; + contextAttributes.explicitSwapControl = GROWABLE_HEAP_I32()[a + (44 >> 2)]; + contextAttributes.proxyContextToMainThread = GROWABLE_HEAP_I32()[a + (48 >> 2)]; + contextAttributes.renderViaOffscreenBackBuffer = GROWABLE_HEAP_I32()[a + (52 >> 2)]; + var canvas = __findCanvasEventTarget(target); + if (!canvas) { + return 0 + } + if (contextAttributes.explicitSwapControl) { + return 0 + } + var contextHandle = GL.createContext(canvas, contextAttributes); + return contextHandle + } + + function _emscripten_webgl_create_context(a0, a1) { + return _emscripten_webgl_do_create_context(a0, a1) + } + var SYSCALLS = { + mappings: {}, + buffers: [null, [], + [] + ], + printChar: function (stream, curr) { + var buffer = SYSCALLS.buffers[stream]; + assert(buffer); + if (curr === 0 || curr === 10) { + (stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0)); + buffer.length = 0; + } else { + buffer.push(curr); + } + }, + varargs: undefined, + get: function () { + assert(SYSCALLS.varargs != undefined); + SYSCALLS.varargs += 4; + var ret = GROWABLE_HEAP_I32()[SYSCALLS.varargs - 4 >> 2]; + return ret + }, + getStr: function (ptr) { + var ret = UTF8ToString(ptr); + return ret + }, + get64: function (low, high) { + if (low >= 0) assert(high === 0); + else assert(high === -1); + return low + } + }; + + function _fd_close(fd) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(3, 1, fd); + abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM"); + return 0 + } + + function _fd_seek(fd, offset_low, offset_high, whence, newOffset) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(4, 1, fd, offset_low, offset_high, whence, newOffset); + abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM"); + } + + function _fd_write(fd, iov, iovcnt, pnum) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(5, 1, fd, iov, iovcnt, pnum); + var num = 0; + for (var i = 0; i < iovcnt; i++) { + var ptr = GROWABLE_HEAP_I32()[iov + i * 8 >> 2]; + var len = GROWABLE_HEAP_I32()[iov + (i * 8 + 4) >> 2]; + for (var j = 0; j < len; j++) { + SYSCALLS.printChar(fd, GROWABLE_HEAP_U8()[ptr + j]); + } + num += len; + } + GROWABLE_HEAP_I32()[pnum >> 2] = num; + return 0 + } + + function _pthread_cleanup_pop(execute) { + var routine = PThread.exitHandlers.pop(); + if (execute) routine(); + } + + function _pthread_cleanup_push(routine, arg) { + if (PThread.exitHandlers === null) { + PThread.exitHandlers = []; + } + PThread.exitHandlers.push(function () { + dynCall_vi(routine, arg); + }); + } + + function __spawn_thread(threadParams) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _spawn_thread() can only ever be called from main application thread!"; + var worker = PThread.getNewWorker(); + if (worker.pthread !== undefined) throw "Internal error!"; + if (!threadParams.pthread_ptr) throw "Internal error, no pthread ptr!"; + PThread.runningWorkers.push(worker); + var tlsMemory = _malloc(128 * 4); + for (var i = 0; i < 128; ++i) { + GROWABLE_HEAP_I32()[tlsMemory + i * 4 >> 2] = 0; + } + var stackHigh = threadParams.stackBase + threadParams.stackSize; + var pthread = PThread.pthreads[threadParams.pthread_ptr] = { + worker: worker, + stackBase: threadParams.stackBase, + stackSize: threadParams.stackSize, + allocatedOwnStack: threadParams.allocatedOwnStack, + thread: threadParams.pthread_ptr, + threadInfoStruct: threadParams.pthread_ptr + }; + var tis = pthread.threadInfoStruct >> 2; + Atomics.store(GROWABLE_HEAP_U32(), tis + (0 >> 2), 0); + Atomics.store(GROWABLE_HEAP_U32(), tis + (4 >> 2), 0); + Atomics.store(GROWABLE_HEAP_U32(), tis + (8 >> 2), 0); + Atomics.store(GROWABLE_HEAP_U32(), tis + (68 >> 2), threadParams.detached); + Atomics.store(GROWABLE_HEAP_U32(), tis + (104 >> 2), tlsMemory); + Atomics.store(GROWABLE_HEAP_U32(), tis + (48 >> 2), 0); + Atomics.store(GROWABLE_HEAP_U32(), tis + (40 >> 2), pthread.threadInfoStruct); + Atomics.store(GROWABLE_HEAP_U32(), tis + (44 >> 2), 42); + Atomics.store(GROWABLE_HEAP_U32(), tis + (108 >> 2), threadParams.stackSize); + Atomics.store(GROWABLE_HEAP_U32(), tis + (84 >> 2), threadParams.stackSize); + Atomics.store(GROWABLE_HEAP_U32(), tis + (80 >> 2), stackHigh); + Atomics.store(GROWABLE_HEAP_U32(), tis + (108 + 8 >> 2), stackHigh); + Atomics.store(GROWABLE_HEAP_U32(), tis + (108 + 12 >> 2), threadParams.detached); + Atomics.store(GROWABLE_HEAP_U32(), tis + (108 + 20 >> 2), threadParams.schedPolicy); + Atomics.store(GROWABLE_HEAP_U32(), tis + (108 + 24 >> 2), threadParams.schedPrio); + var global_libc = _emscripten_get_global_libc(); + var global_locale = global_libc + 40; + Atomics.store(GROWABLE_HEAP_U32(), tis + (176 >> 2), global_locale); + worker.pthread = pthread; + var msg = { + "cmd": "run", + "start_routine": threadParams.startRoutine, + "arg": threadParams.arg, + "threadInfoStruct": threadParams.pthread_ptr, + "selfThreadId": threadParams.pthread_ptr, + "parentThreadId": threadParams.parent_pthread_ptr, + "stackBase": threadParams.stackBase, + "stackSize": threadParams.stackSize + }; + worker.runPthread = function () { + msg.time = performance.now(); + worker.postMessage(msg, threadParams.transferList); + }; + if (worker.loaded) { + worker.runPthread(); + delete worker.runPthread; + } + } + + function _pthread_getschedparam(thread, policy, schedparam) { + if (!policy && !schedparam) return ERRNO_CODES.EINVAL; + if (!thread) { + err("pthread_getschedparam called with a null thread pointer!"); + return ERRNO_CODES.ESRCH + } + var self = GROWABLE_HEAP_I32()[thread + 12 >> 2]; + if (self !== thread) { + err("pthread_getschedparam attempted on thread " + thread + ", which does not point to a valid thread, or does not exist anymore!"); + return ERRNO_CODES.ESRCH + } + var schedPolicy = Atomics.load(GROWABLE_HEAP_U32(), thread + 108 + 20 >> 2); + var schedPrio = Atomics.load(GROWABLE_HEAP_U32(), thread + 108 + 24 >> 2); + if (policy) GROWABLE_HEAP_I32()[policy >> 2] = schedPolicy; + if (schedparam) GROWABLE_HEAP_I32()[schedparam >> 2] = schedPrio; + return 0 + } + + function _pthread_self() { + return __pthread_ptr | 0 + } + Module["_pthread_self"] = _pthread_self; + + function _pthread_create(pthread_ptr, attr, start_routine, arg) { + if (typeof SharedArrayBuffer === "undefined") { + err("Current environment does not support SharedArrayBuffer, pthreads are not available!"); + return 6 + } + if (!pthread_ptr) { + err("pthread_create called with a null thread pointer!"); + return 28 + } + var transferList = []; + var error = 0; + if (ENVIRONMENT_IS_PTHREAD && (transferList.length === 0 || error)) { + return _emscripten_sync_run_in_main_thread_4(687865856, pthread_ptr, attr, start_routine, arg) + } + var stackSize = 0; + var stackBase = 0; + var detached = 0; + var schedPolicy = 0; + var schedPrio = 0; + if (attr) { + stackSize = GROWABLE_HEAP_I32()[attr >> 2]; + stackSize += 81920; + stackBase = GROWABLE_HEAP_I32()[attr + 8 >> 2]; + detached = GROWABLE_HEAP_I32()[attr + 12 >> 2] !== 0; + var inheritSched = GROWABLE_HEAP_I32()[attr + 16 >> 2] === 0; + if (inheritSched) { + var prevSchedPolicy = GROWABLE_HEAP_I32()[attr + 20 >> 2]; + var prevSchedPrio = GROWABLE_HEAP_I32()[attr + 24 >> 2]; + var parentThreadPtr = PThread.currentProxiedOperationCallerThread ? PThread.currentProxiedOperationCallerThread : _pthread_self(); + _pthread_getschedparam(parentThreadPtr, attr + 20, attr + 24); + schedPolicy = GROWABLE_HEAP_I32()[attr + 20 >> 2]; + schedPrio = GROWABLE_HEAP_I32()[attr + 24 >> 2]; + GROWABLE_HEAP_I32()[attr + 20 >> 2] = prevSchedPolicy; + GROWABLE_HEAP_I32()[attr + 24 >> 2] = prevSchedPrio; + } else { + schedPolicy = GROWABLE_HEAP_I32()[attr + 20 >> 2]; + schedPrio = GROWABLE_HEAP_I32()[attr + 24 >> 2]; + } + } else { + stackSize = 2097152; + } + var allocatedOwnStack = stackBase == 0; + if (allocatedOwnStack) { + stackBase = _memalign(16, stackSize); + } else { + stackBase -= stackSize; + assert(stackBase > 0); + } + var threadInfoStruct = _malloc(232); + for (var i = 0; i < 232 >> 2; ++i) GROWABLE_HEAP_U32()[(threadInfoStruct >> 2) + i] = 0; + GROWABLE_HEAP_I32()[pthread_ptr >> 2] = threadInfoStruct; + GROWABLE_HEAP_I32()[threadInfoStruct + 12 >> 2] = threadInfoStruct; + var headPtr = threadInfoStruct + 156; + GROWABLE_HEAP_I32()[headPtr >> 2] = headPtr; + var threadParams = { + stackBase: stackBase, + stackSize: stackSize, + allocatedOwnStack: allocatedOwnStack, + schedPolicy: schedPolicy, + schedPrio: schedPrio, + detached: detached, + startRoutine: start_routine, + pthread_ptr: threadInfoStruct, + parent_pthread_ptr: _pthread_self(), + arg: arg, + transferList: transferList + }; + if (ENVIRONMENT_IS_PTHREAD) { + threadParams.cmd = "spawnThread"; + postMessage(threadParams, transferList); + } else { + __spawn_thread(threadParams); + } + return 0 + } + + function _roundf(d) { + d = +d; + return d >= +0 ? +Math_floor(d + +.5) : +Math_ceil(d - +.5) + } + if (!ENVIRONMENT_IS_PTHREAD) PThread.initMainThreadBlock(); + else PThread.initWorker(); + var GLctx; + GL.init(); + var proxiedFunctionTable = [null, _atexit, _emscripten_set_canvas_element_size_main_thread, _fd_close, _fd_seek, _fd_write]; + var asmLibraryArg = { + "__assert_fail": ___assert_fail, + "__handle_stack_overflow": ___handle_stack_overflow, + "_emscripten_notify_thread_queue": __emscripten_notify_thread_queue, + "abort": _abort, + "emscripten_conditional_set_current_thread_status": _emscripten_conditional_set_current_thread_status, + "emscripten_futex_wait": _emscripten_futex_wait, + "emscripten_futex_wake": _emscripten_futex_wake, + "emscripten_get_now": _emscripten_get_now, + "emscripten_is_main_browser_thread": _emscripten_is_main_browser_thread, + "emscripten_is_main_runtime_thread": _emscripten_is_main_runtime_thread, + "emscripten_memcpy_big": _emscripten_memcpy_big, + "emscripten_receive_on_main_thread_js": _emscripten_receive_on_main_thread_js, + "emscripten_resize_heap": _emscripten_resize_heap, + "emscripten_set_canvas_element_size": _emscripten_set_canvas_element_size, + "emscripten_set_current_thread_status": _emscripten_set_current_thread_status, + "emscripten_webgl_create_context": _emscripten_webgl_create_context, + "fd_close": _fd_close, + "fd_seek": _fd_seek, + "fd_write": _fd_write, + "initPthreadsJS": initPthreadsJS, + "memory": wasmMemory || Module["wasmMemory"], + "pthread_cleanup_pop": _pthread_cleanup_pop, + "pthread_cleanup_push": _pthread_cleanup_push, + "pthread_create": _pthread_create, + "pthread_self": _pthread_self, + "roundf": _roundf, + "table": wasmTable + }; + var asm = createWasm(); + Module["asm"] = asm; + var ___wasm_call_ctors = Module["___wasm_call_ctors"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__wasm_call_ctors"].apply(null, arguments) + }; + var _init = Module["_init"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["init"].apply(null, arguments) + }; + var _register_tensor = Module["_register_tensor"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["register_tensor"].apply(null, arguments) + }; + var _dispose_data = Module["_dispose_data"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dispose_data"].apply(null, arguments) + }; + var _dispose = Module["_dispose"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dispose"].apply(null, arguments) + }; + var _Abs = Module["_Abs"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Abs"].apply(null, arguments) + }; + var _Add = Module["_Add"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Add"].apply(null, arguments) + }; + var _AddN = Module["_AddN"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["AddN"].apply(null, arguments) + }; + var _ArgMax = Module["_ArgMax"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ArgMax"].apply(null, arguments) + }; + var _AvgPool = Module["_AvgPool"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["AvgPool"].apply(null, arguments) + }; + var _BatchMatMul = Module["_BatchMatMul"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["BatchMatMul"].apply(null, arguments) + }; + var _ClipByValue = Module["_ClipByValue"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ClipByValue"].apply(null, arguments) + }; + var _Conv2D = Module["_Conv2D"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Conv2D"].apply(null, arguments) + }; + var _Cos = Module["_Cos"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Cos"].apply(null, arguments) + }; + var _CropAndResize = Module["_CropAndResize"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["CropAndResize"].apply(null, arguments) + }; + var _DepthwiseConv2dNative = Module["_DepthwiseConv2dNative"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["DepthwiseConv2dNative"].apply(null, arguments) + }; + var _Div = Module["_Div"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Div"].apply(null, arguments) + }; + var _Exp = Module["_Exp"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Exp"].apply(null, arguments) + }; + var _FloorDiv = Module["_FloorDiv"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FloorDiv"].apply(null, arguments) + }; + var _FusedBatchNorm = Module["_FusedBatchNorm"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FusedBatchNorm"].apply(null, arguments) + }; + var _FusedConv2D = Module["_FusedConv2D"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FusedConv2D"].apply(null, arguments) + }; + var _FusedDepthwiseConv2D = Module["_FusedDepthwiseConv2D"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FusedDepthwiseConv2D"].apply(null, arguments) + }; + var _Gather = Module["_Gather"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Gather"].apply(null, arguments) + }; + var _GatherNd = Module["_GatherNd"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["GatherNd"].apply(null, arguments) + }; + var _Greater = Module["_Greater"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Greater"].apply(null, arguments) + }; + var _GreaterEqual = Module["_GreaterEqual"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["GreaterEqual"].apply(null, arguments) + }; + var _Less = Module["_Less"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Less"].apply(null, arguments) + }; + var _LessEqual = Module["_LessEqual"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["LessEqual"].apply(null, arguments) + }; + var _Log = Module["_Log"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Log"].apply(null, arguments) + }; + var _LogicalAnd = Module["_LogicalAnd"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["LogicalAnd"].apply(null, arguments) + }; + var _Max = Module["_Max"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Max"].apply(null, arguments) + }; + var _MaxPool = Module["_MaxPool"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["MaxPool"].apply(null, arguments) + }; + var _Maximum = Module["_Maximum"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Maximum"].apply(null, arguments) + }; + var _Min = Module["_Min"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Min"].apply(null, arguments) + }; + var _Minimum = Module["_Minimum"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Minimum"].apply(null, arguments) + }; + var _Mul = Module["_Mul"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Mul"].apply(null, arguments) + }; + var _Neg = Module["_Neg"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Neg"].apply(null, arguments) + }; + var _NonMaxSuppressionV3 = Module["_NonMaxSuppressionV3"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["NonMaxSuppressionV3"].apply(null, arguments) + }; + var _NonMaxSuppressionV5 = Module["_NonMaxSuppressionV5"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["NonMaxSuppressionV5"].apply(null, arguments) + }; + var _NotEqual = Module["_NotEqual"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["NotEqual"].apply(null, arguments) + }; + var _PadV2 = Module["_PadV2"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["PadV2"].apply(null, arguments) + }; + var _Pow = Module["_Pow"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Pow"].apply(null, arguments) + }; + var _Prelu = Module["_Prelu"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Prelu"].apply(null, arguments) + }; + var _Relu = Module["_Relu"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Relu"].apply(null, arguments) + }; + var _Relu6 = Module["_Relu6"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Relu6"].apply(null, arguments) + }; + var _ResizeBilinear = Module["_ResizeBilinear"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ResizeBilinear"].apply(null, arguments) + }; + var _Rsqrt = Module["_Rsqrt"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Rsqrt"].apply(null, arguments) + }; + var _ScatterNd = Module["_ScatterNd"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ScatterNd"].apply(null, arguments) + }; + var _Sigmoid = Module["_Sigmoid"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sigmoid"].apply(null, arguments) + }; + var _Sin = Module["_Sin"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sin"].apply(null, arguments) + }; + var _Softmax = Module["_Softmax"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Softmax"].apply(null, arguments) + }; + var _Square = Module["_Square"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Square"].apply(null, arguments) + }; + var _Sub = Module["_Sub"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sub"].apply(null, arguments) + }; + var _Sum = Module["_Sum"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sum"].apply(null, arguments) + }; + var _Tanh = Module["_Tanh"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Tanh"].apply(null, arguments) + }; + var _Tile = Module["_Tile"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Tile"].apply(null, arguments) + }; + var _Transpose = Module["_Transpose"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Transpose"].apply(null, arguments) + }; + var __FusedMatMul = Module["__FusedMatMul"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["_FusedMatMul"].apply(null, arguments) + }; + var _malloc = Module["_malloc"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["malloc"].apply(null, arguments) + }; + var _free = Module["_free"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["free"].apply(null, arguments) + }; + var ___em_js__initPthreadsJS = Module["___em_js__initPthreadsJS"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__em_js__initPthreadsJS"].apply(null, arguments) + }; + var _emscripten_get_global_libc = Module["_emscripten_get_global_libc"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_get_global_libc"].apply(null, arguments) + }; + var _memalign = Module["_memalign"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["memalign"].apply(null, arguments) + }; + var ___pthread_tsd_run_dtors = Module["___pthread_tsd_run_dtors"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__pthread_tsd_run_dtors"].apply(null, arguments) + }; + var _emscripten_main_thread_process_queued_calls = Module["_emscripten_main_thread_process_queued_calls"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null, arguments) + }; + var _emscripten_current_thread_process_queued_calls = Module["_emscripten_current_thread_process_queued_calls"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null, arguments) + }; + var _emscripten_register_main_browser_thread_id = Module["_emscripten_register_main_browser_thread_id"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null, arguments) + }; + var _emscripten_main_browser_thread_id = Module["_emscripten_main_browser_thread_id"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_main_browser_thread_id"].apply(null, arguments) + }; + var _emscripten_async_run_in_main_thread = Module["_emscripten_async_run_in_main_thread"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread = Module["_emscripten_sync_run_in_main_thread"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_0 = Module["_emscripten_sync_run_in_main_thread_0"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_1 = Module["_emscripten_sync_run_in_main_thread_1"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_2 = Module["_emscripten_sync_run_in_main_thread_2"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_xprintf_varargs = Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_3 = Module["_emscripten_sync_run_in_main_thread_3"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_4 = Module["_emscripten_sync_run_in_main_thread_4"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_5 = Module["_emscripten_sync_run_in_main_thread_5"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_6 = Module["_emscripten_sync_run_in_main_thread_6"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_7 = Module["_emscripten_sync_run_in_main_thread_7"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null, arguments) + }; + var _emscripten_run_in_main_runtime_thread_js = Module["_emscripten_run_in_main_runtime_thread_js"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null, arguments) + }; + var _emscripten_async_queue_on_thread_ = Module["_emscripten_async_queue_on_thread_"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null, arguments) + }; + var _emscripten_tls_init = Module["_emscripten_tls_init"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_tls_init"].apply(null, arguments) + }; + var ___set_stack_limit = Module["___set_stack_limit"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__set_stack_limit"].apply(null, arguments) + }; + var stackSave = Module["stackSave"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["stackSave"].apply(null, arguments) + }; + var stackAlloc = Module["stackAlloc"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["stackAlloc"].apply(null, arguments) + }; + var stackRestore = Module["stackRestore"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["stackRestore"].apply(null, arguments) + }; + var dynCall_vi = Module["dynCall_vi"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dynCall_vi"].apply(null, arguments) + }; + var dynCall_v = Module["dynCall_v"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dynCall_v"].apply(null, arguments) + }; + var dynCall_ii = Module["dynCall_ii"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dynCall_ii"].apply(null, arguments) + }; + Module["asm"] = asm; + if (!Object.getOwnPropertyDescriptor(Module, "intArrayFromString")) Module["intArrayFromString"] = function () { + abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "intArrayToString")) Module["intArrayToString"] = function () { + abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "ccall")) Module["ccall"] = function () { + abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + Module["cwrap"] = cwrap; + if (!Object.getOwnPropertyDescriptor(Module, "setValue")) Module["setValue"] = function () { + abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "getValue")) Module["getValue"] = function () { + abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "allocate")) Module["allocate"] = function () { + abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "getMemory")) Module["getMemory"] = function () { + abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF8ArrayToString")) Module["UTF8ArrayToString"] = function () { + abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF8ToString")) Module["UTF8ToString"] = function () { + abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8Array")) Module["stringToUTF8Array"] = function () { + abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8")) Module["stringToUTF8"] = function () { + abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF8")) Module["lengthBytesUTF8"] = function () { + abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function () { + abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnPreRun")) Module["addOnPreRun"] = function () { + abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnInit")) Module["addOnInit"] = function () { + abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnPreMain")) Module["addOnPreMain"] = function () { + abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnExit")) Module["addOnExit"] = function () { + abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnPostRun")) Module["addOnPostRun"] = function () { + abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeStringToMemory")) Module["writeStringToMemory"] = function () { + abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeArrayToMemory")) Module["writeArrayToMemory"] = function () { + abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeAsciiToMemory")) Module["writeAsciiToMemory"] = function () { + abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "addRunDependency")) Module["addRunDependency"] = function () { + abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "removeRunDependency")) Module["removeRunDependency"] = function () { + abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createFolder")) Module["FS_createFolder"] = function () { + abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createPath")) Module["FS_createPath"] = function () { + abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createDataFile")) Module["FS_createDataFile"] = function () { + abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createPreloadedFile")) Module["FS_createPreloadedFile"] = function () { + abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createLazyFile")) Module["FS_createLazyFile"] = function () { + abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createLink")) Module["FS_createLink"] = function () { + abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createDevice")) Module["FS_createDevice"] = function () { + abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_unlink")) Module["FS_unlink"] = function () { + abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "dynamicAlloc")) Module["dynamicAlloc"] = function () { + abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "loadDynamicLibrary")) Module["loadDynamicLibrary"] = function () { + abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "loadWebAssemblyModule")) Module["loadWebAssemblyModule"] = function () { + abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "getLEB")) Module["getLEB"] = function () { + abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "getFunctionTables")) Module["getFunctionTables"] = function () { + abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "alignFunctionTables")) Module["alignFunctionTables"] = function () { + abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "registerFunctions")) Module["registerFunctions"] = function () { + abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "addFunction")) Module["addFunction"] = function () { + abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "removeFunction")) Module["removeFunction"] = function () { + abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "getFuncWrapper")) Module["getFuncWrapper"] = function () { + abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "prettyPrint")) Module["prettyPrint"] = function () { + abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "makeBigInt")) Module["makeBigInt"] = function () { + abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "dynCall")) Module["dynCall"] = function () { + abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "getCompilerSetting")) Module["getCompilerSetting"] = function () { + abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "print")) Module["print"] = function () { + abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "printErr")) Module["printErr"] = function () { + abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "getTempRet0")) Module["getTempRet0"] = function () { + abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "setTempRet0")) Module["setTempRet0"] = function () { + abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "callMain")) Module["callMain"] = function () { + abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "abort")) Module["abort"] = function () { + abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToNewUTF8")) Module["stringToNewUTF8"] = function () { + abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscripten_realloc_buffer")) Module["emscripten_realloc_buffer"] = function () { + abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "ENV")) Module["ENV"] = function () { + abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "setjmpId")) Module["setjmpId"] = function () { + abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_CODES")) Module["ERRNO_CODES"] = function () { + abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_MESSAGES")) Module["ERRNO_MESSAGES"] = function () { + abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "setErrNo")) Module["setErrNo"] = function () { + abort("'setErrNo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "DNS")) Module["DNS"] = function () { + abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "GAI_ERRNO_MESSAGES")) Module["GAI_ERRNO_MESSAGES"] = function () { + abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "Protocols")) Module["Protocols"] = function () { + abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "Sockets")) Module["Sockets"] = function () { + abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "UNWIND_CACHE")) Module["UNWIND_CACHE"] = function () { + abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "readAsmConstArgs")) Module["readAsmConstArgs"] = function () { + abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "jstoi_q")) Module["jstoi_q"] = function () { + abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "jstoi_s")) Module["jstoi_s"] = function () { + abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "PATH")) Module["PATH"] = function () { + abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "PATH_FS")) Module["PATH_FS"] = function () { + abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "SYSCALLS")) Module["SYSCALLS"] = function () { + abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "syscallMmap2")) Module["syscallMmap2"] = function () { + abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "syscallMunmap")) Module["syscallMunmap"] = function () { + abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "flush_NO_FILESYSTEM")) Module["flush_NO_FILESYSTEM"] = function () { + abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "JSEvents")) Module["JSEvents"] = function () { + abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "demangle")) Module["demangle"] = function () { + abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "demangleAll")) Module["demangleAll"] = function () { + abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "jsStackTrace")) Module["jsStackTrace"] = function () { + abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function () { + abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "getEnvStrings")) Module["getEnvStrings"] = function () { + abort("'getEnvStrings' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64")) Module["writeI53ToI64"] = function () { + abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Clamped")) Module["writeI53ToI64Clamped"] = function () { + abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Signaling")) Module["writeI53ToI64Signaling"] = function () { + abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Clamped")) Module["writeI53ToU64Clamped"] = function () { + abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Signaling")) Module["writeI53ToU64Signaling"] = function () { + abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "readI53FromI64")) Module["readI53FromI64"] = function () { + abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "readI53FromU64")) Module["readI53FromU64"] = function () { + abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "convertI32PairToI53")) Module["convertI32PairToI53"] = function () { + abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "convertU32PairToI53")) Module["convertU32PairToI53"] = function () { + abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "Browser")) Module["Browser"] = function () { + abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "GL")) Module["GL"] = function () { + abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGet")) Module["emscriptenWebGLGet"] = function () { + abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetTexPixelData")) Module["emscriptenWebGLGetTexPixelData"] = function () { + abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetUniform")) Module["emscriptenWebGLGetUniform"] = function () { + abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetVertexAttrib")) Module["emscriptenWebGLGetVertexAttrib"] = function () { + abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "AL")) Module["AL"] = function () { + abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL_unicode")) Module["SDL_unicode"] = function () { + abort("'SDL_unicode' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL_ttfContext")) Module["SDL_ttfContext"] = function () { + abort("'SDL_ttfContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL_audio")) Module["SDL_audio"] = function () { + abort("'SDL_audio' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL")) Module["SDL"] = function () { + abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL_gfx")) Module["SDL_gfx"] = function () { + abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLUT")) Module["GLUT"] = function () { + abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "EGL")) Module["EGL"] = function () { + abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLFW_Window")) Module["GLFW_Window"] = function () { + abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLFW")) Module["GLFW"] = function () { + abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLEW")) Module["GLEW"] = function () { + abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "IDBStore")) Module["IDBStore"] = function () { + abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "runAndAbortIfError")) Module["runAndAbortIfError"] = function () { + abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + Module["PThread"] = PThread; + if (!Object.getOwnPropertyDescriptor(Module, "establishStackSpace")) Module["establishStackSpace"] = function () { + abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "getNoExitRuntime")) Module["getNoExitRuntime"] = function () { + abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "resetPrototype")) Module["resetPrototype"] = function () { + abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "warnOnce")) Module["warnOnce"] = function () { + abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackSave")) Module["stackSave"] = function () { + abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackRestore")) Module["stackRestore"] = function () { + abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackAlloc")) Module["stackAlloc"] = function () { + abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "AsciiToString")) Module["AsciiToString"] = function () { + abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToAscii")) Module["stringToAscii"] = function () { + abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF16ToString")) Module["UTF16ToString"] = function () { + abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF16")) Module["stringToUTF16"] = function () { + abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF16")) Module["lengthBytesUTF16"] = function () { + abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF32ToString")) Module["UTF32ToString"] = function () { + abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF32")) Module["stringToUTF32"] = function () { + abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF32")) Module["lengthBytesUTF32"] = function () { + abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8")) Module["allocateUTF8"] = function () { + abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8OnStack")) Module["allocateUTF8OnStack"] = function () { + abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + }; + Module["writeStackCookie"] = writeStackCookie; + Module["checkStackCookie"] = checkStackCookie; + Module["abortStackOverflow"] = abortStackOverflow; + Module["PThread"] = PThread; + Module["_pthread_self"] = _pthread_self; + Module["wasmMemory"] = wasmMemory; + Module["ExitStatus"] = ExitStatus; + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NORMAL")) Object.defineProperty(Module, "ALLOC_NORMAL", { + configurable: true, + get: function () { + abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_STACK")) Object.defineProperty(Module, "ALLOC_STACK", { + configurable: true, + get: function () { + abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_DYNAMIC")) Object.defineProperty(Module, "ALLOC_DYNAMIC", { + configurable: true, + get: function () { + abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NONE")) Object.defineProperty(Module, "ALLOC_NONE", { + configurable: true, + get: function () { + abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); + } + }); + var calledRun; + Module["then"] = function (func) { + if (calledRun) { + func(Module); + } else { + var old = Module["onRuntimeInitialized"]; + Module["onRuntimeInitialized"] = function () { + if (old) old(); + func(Module); + }; + } + return Module + }; + + function ExitStatus(status) { + this.name = "ExitStatus"; + this.message = "Program terminated with exit(" + status + ")"; + this.status = status; + } + dependenciesFulfilled = function runCaller() { + if (!calledRun) run(); + if (!calledRun) dependenciesFulfilled = runCaller; + }; + + function run(args) { + if (runDependencies > 0) { + return + } + writeStackCookie(); + preRun(); + if (runDependencies > 0) return; + + function doRun() { + if (calledRun) return; + calledRun = true; + Module["calledRun"] = true; + if (ABORT) return; + initRuntime(); + preMain(); + if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"](); + assert(!Module["_main"], 'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'); + postRun(); + } + if (Module["setStatus"]) { + Module["setStatus"]("Running..."); + setTimeout(function () { + setTimeout(function () { + Module["setStatus"](""); + }, 1); + doRun(); + }, 1); + } else { + doRun(); + } + checkStackCookie(); + } + Module["run"] = run; + if (Module["preInit"]) { + if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]]; + while (Module["preInit"].length > 0) { + Module["preInit"].pop()(); + } + } + if (!ENVIRONMENT_IS_PTHREAD) noExitRuntime = true; + if (!ENVIRONMENT_IS_PTHREAD) run(); + + + return WasmBackendModule + } + ); + })(); + module.exports = WasmBackendModule; + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2718,151 +6226,187 @@ var _this = undefined; var WASM_PRIORITY = 2; var BackendWasm = /** @class */ (function (_super) { - __extends(BackendWasm, _super); - function BackendWasm(wasm) { - var _this = _super.call(this) || this; - _this.wasm = wasm; - // 0 is reserved for null data ids. - _this.dataIdNextNumber = 1; - _this.wasm.tfjs.init(); - _this.dataIdMap = new tfjsCore.DataStorage(_this, tfjsCore.engine()); - return _this; + __extends(BackendWasm, _super); + + function BackendWasm(wasm) { + var _this = _super.call(this) || this; + _this.wasm = wasm; + // 0 is reserved for null data ids. + _this.dataIdNextNumber = 1; + _this.wasm.tfjs.init(); + _this.dataIdMap = new tfjsCore.DataStorage(_this, tfjsCore.engine()); + return _this; + } + BackendWasm.prototype.write = function (values, shape, dtype) { + var dataId = {}; + this.move(dataId, values, shape, dtype); + return dataId; + }; + BackendWasm.prototype.numDataIds = function () { + return this.dataIdMap.numDataIds(); + }; + BackendWasm.prototype.time = function (f) { + return __awaiter(this, void 0, void 0, function () { + var start, kernelMs; + return __generator(this, function (_a) { + start = tfjsCore.util.now(); + f(); + kernelMs = tfjsCore.util.now() - start; + return [2 /*return*/ , { + kernelMs: kernelMs + }]; + }); + }); + }; + BackendWasm.prototype.move = function (dataId, values, shape, dtype) { + var id = this.dataIdNextNumber++; + if (dtype === 'string') { + var stringBytes = values; + this.dataIdMap.set(dataId, { + id: id, + stringBytes: stringBytes, + shape: shape, + dtype: dtype, + memoryOffset: null + }); + return; } - BackendWasm.prototype.write = function (values, shape, dtype) { - var dataId = {}; - this.move(dataId, values, shape, dtype); - return dataId; - }; - BackendWasm.prototype.numDataIds = function () { - return this.dataIdMap.numDataIds(); - }; - BackendWasm.prototype.time = function (f) { - return __awaiter(this, void 0, void 0, function () { - var start, kernelMs; - return __generator(this, function (_a) { - start = tfjsCore.util.now(); - f(); - kernelMs = tfjsCore.util.now() - start; - return [2 /*return*/, { kernelMs: kernelMs }]; - }); - }); - }; - BackendWasm.prototype.move = function (dataId, values, shape, dtype) { - var id = this.dataIdNextNumber++; - if (dtype === 'string') { - var stringBytes = values; - this.dataIdMap.set(dataId, { id: id, stringBytes: stringBytes, shape: shape, dtype: dtype, memoryOffset: null }); - return; - } - var size = tfjsCore.util.sizeFromShape(shape); - var numBytes = size * tfjsCore.util.bytesPerElement(dtype); - var memoryOffset = this.wasm._malloc(numBytes); - this.dataIdMap.set(dataId, { id: id, memoryOffset: memoryOffset, shape: shape, dtype: dtype }); - this.wasm.tfjs.registerTensor(id, size, memoryOffset); - if (values != null) { - this.wasm.HEAPU8.set(new Uint8Array(values.buffer, 0, numBytes), memoryOffset); - } - }; - BackendWasm.prototype.read = function (dataId) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.readSync(dataId)]; - }); - }); - }; - BackendWasm.prototype.readSync = function (dataId) { - var _a = this.dataIdMap.get(dataId), memoryOffset = _a.memoryOffset, dtype = _a.dtype, shape = _a.shape, stringBytes = _a.stringBytes; - if (dtype === 'string') { - return stringBytes; - } - var bytes = this.wasm.HEAPU8.slice(memoryOffset, memoryOffset + tfjsCore.util.sizeFromShape(shape) * tfjsCore.util.bytesPerElement(dtype)); - return typedArrayFromBuffer(bytes.buffer, dtype); - }; - BackendWasm.prototype.disposeData = function (dataId) { - var data = this.dataIdMap.get(dataId); - this.wasm._free(data.memoryOffset); - this.wasm.tfjs.disposeData(data.id); - this.dataIdMap.delete(dataId); - }; - BackendWasm.prototype.floatPrecision = function () { - return 32; - }; - // Returns the memory offset of a tensor. Useful for debugging and unit - // testing. - BackendWasm.prototype.getMemoryOffset = function (dataId) { - return this.dataIdMap.get(dataId).memoryOffset; - }; - BackendWasm.prototype.dispose = function () { - this.wasm.tfjs.dispose(); - this.wasm = null; - }; - BackendWasm.prototype.memory = function () { - return { unreliable: false }; - }; - /** - * Make a tensor info for the output of an op. If `memoryOffset` is not - * present, this method allocates memory on the WASM heap. If `memoryOffset` - * is present, the memory was allocated elsewhere (in c++) and we just record - * the pointer where that memory lives. - */ - BackendWasm.prototype.makeOutput = function (shape, dtype, memoryOffset) { - var dataId; - if (memoryOffset == null) { - dataId = this.write(null /* values */, shape, dtype); - } - else { - dataId = {}; - var id = this.dataIdNextNumber++; - this.dataIdMap.set(dataId, { id: id, memoryOffset: memoryOffset, shape: shape, dtype: dtype }); - var size = tfjsCore.util.sizeFromShape(shape); - this.wasm.tfjs.registerTensor(id, size, memoryOffset); - } - return { dataId: dataId, shape: shape, dtype: dtype }; + var size = tfjsCore.util.sizeFromShape(shape); + var numBytes = size * tfjsCore.util.bytesPerElement(dtype); + var memoryOffset = this.wasm._malloc(numBytes); + this.dataIdMap.set(dataId, { + id: id, + memoryOffset: memoryOffset, + shape: shape, + dtype: dtype + }); + this.wasm.tfjs.registerTensor(id, size, memoryOffset); + if (values != null) { + this.wasm.HEAPU8.set(new Uint8Array(values.buffer, 0, numBytes), memoryOffset); + } + }; + BackendWasm.prototype.read = function (dataId) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/ , this.readSync(dataId)]; + }); + }); + }; + BackendWasm.prototype.readSync = function (dataId) { + var _a = this.dataIdMap.get(dataId), + memoryOffset = _a.memoryOffset, + dtype = _a.dtype, + shape = _a.shape, + stringBytes = _a.stringBytes; + if (dtype === 'string') { + return stringBytes; + } + var bytes = this.wasm.HEAPU8.slice(memoryOffset, memoryOffset + tfjsCore.util.sizeFromShape(shape) * tfjsCore.util.bytesPerElement(dtype)); + return typedArrayFromBuffer(bytes.buffer, dtype); + }; + BackendWasm.prototype.disposeData = function (dataId) { + var data = this.dataIdMap.get(dataId); + this.wasm._free(data.memoryOffset); + this.wasm.tfjs.disposeData(data.id); + this.dataIdMap.delete(dataId); + }; + BackendWasm.prototype.floatPrecision = function () { + return 32; + }; + // Returns the memory offset of a tensor. Useful for debugging and unit + // testing. + BackendWasm.prototype.getMemoryOffset = function (dataId) { + return this.dataIdMap.get(dataId).memoryOffset; + }; + BackendWasm.prototype.dispose = function () { + this.wasm.tfjs.dispose(); + this.wasm = null; + }; + BackendWasm.prototype.memory = function () { + return { + unreliable: false }; - BackendWasm.prototype.typedArrayFromHeap = function (_a) { - var shape = _a.shape, dtype = _a.dtype, dataId = _a.dataId; - var buffer = this.wasm.HEAPU8.buffer; - var memoryOffset = this.dataIdMap.get(dataId).memoryOffset; - var size = tfjsCore.util.sizeFromShape(shape); - switch (dtype) { - case 'float32': - return new Float32Array(buffer, memoryOffset, size); - case 'int32': - return new Int32Array(buffer, memoryOffset, size); - case 'bool': - return new Uint8Array(buffer, memoryOffset, size); - default: - throw new Error("Uknown dtype " + dtype); - } + }; + /** + * Make a tensor info for the output of an op. If `memoryOffset` is not + * present, this method allocates memory on the WASM heap. If `memoryOffset` + * is present, the memory was allocated elsewhere (in c++) and we just record + * the pointer where that memory lives. + */ + BackendWasm.prototype.makeOutput = function (shape, dtype, memoryOffset) { + var dataId; + if (memoryOffset == null) { + dataId = this.write(null /* values */ , shape, dtype); + } else { + dataId = {}; + var id = this.dataIdNextNumber++; + this.dataIdMap.set(dataId, { + id: id, + memoryOffset: memoryOffset, + shape: shape, + dtype: dtype + }); + var size = tfjsCore.util.sizeFromShape(shape); + this.wasm.tfjs.registerTensor(id, size, memoryOffset); + } + return { + dataId: dataId, + shape: shape, + dtype: dtype }; - return BackendWasm; + }; + BackendWasm.prototype.typedArrayFromHeap = function (_a) { + var shape = _a.shape, + dtype = _a.dtype, + dataId = _a.dataId; + var buffer = this.wasm.HEAPU8.buffer; + var memoryOffset = this.dataIdMap.get(dataId).memoryOffset; + var size = tfjsCore.util.sizeFromShape(shape); + switch (dtype) { + case 'float32': + return new Float32Array(buffer, memoryOffset, size); + case 'int32': + return new Int32Array(buffer, memoryOffset, size); + case 'bool': + return new Uint8Array(buffer, memoryOffset, size); + default: + throw new Error("Uknown dtype " + dtype); + } + }; + return BackendWasm; }(tfjsCore.KernelBackend)); - tfjsCore.registerBackend('wasm', function () { return __awaiter(_this, void 0, void 0, function () { + tfjsCore.registerBackend('wasm', function () { + return __awaiter(_this, void 0, void 0, function () { var wasm; return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, init()]; - case 1: - wasm = (_a.sent()).wasm; - return [2 /*return*/, new BackendWasm(wasm)]; - } + switch (_a.label) { + case 0: + return [4 /*yield*/ , init()]; + case 1: + wasm = (_a.sent()).wasm; + return [2 /*return*/ , new BackendWasm(wasm)]; + } }); - }); }, WASM_PRIORITY); + }); + }, WASM_PRIORITY); + function createInstantiateWasmFunc(path) { - // tslint:disable-next-line:no-any - return function (imports, callback) { - tfjsCore.util.fetch(path, { credentials: 'same-origin' }).then(function (response) { - if (!response['ok']) { - imports.env.a("failed to load wasm binary file at '" + path + "'"); - } - response.arrayBuffer().then(function (binary) { - WebAssembly.instantiate(binary, imports).then(function (output) { - callback(output.instance); - }); - }); + // tslint:disable-next-line:no-any + return function (imports, callback) { + tfjsCore.util.fetch(path, { + credentials: 'same-origin' + }).then(function (response) { + if (!response['ok']) { + imports.env.a("failed to load wasm binary file at '" + path + "'"); + } + response.arrayBuffer().then(function (binary) { + WebAssembly.instantiate(binary, imports).then(function (output) { + callback(output.instance); }); - return {}; - }; + }); + }); + return {}; + }; } /** * Initializes the wasm module and creates the js <--> wasm bridge. @@ -2872,73 +6416,78 @@ * in Chrome 76). */ function init() { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, new Promise(function (resolve, reject) { - var factoryConfig = {}; - if (wasmPath != null) { - factoryConfig.locateFile = function (path, prefix) { - if (path.endsWith('.wasm')) { - return wasmPath; - } - return prefix + path; - }; - // use wasm instantiateWasm override when system fetch is not available. - // For detail references - // https://github.com/emscripten-core/emscripten/blob/2bca083cbbd5a4133db61fbd74d04f7feecfa907/tests/manual_wasm_instantiate.html#L170 - if (customFetch) { - factoryConfig.instantiateWasm = createInstantiateWasmFunc(wasmPath); - } - } - var wasm = tfjsBackendWasm(factoryConfig); - var voidReturnType = null; - // Using the tfjs namespace to avoid conflict with emscripten's API. - wasm.tfjs = { - init: wasm.cwrap('init', null, []), - registerTensor: wasm.cwrap('register_tensor', null, [ - 'number', - 'number', - 'number', - ]), - disposeData: wasm.cwrap('dispose_data', voidReturnType, ['number']), - dispose: wasm.cwrap('dispose', voidReturnType, []), - }; - var initialized = false; - wasm.onRuntimeInitialized = function () { - initialized = true; - initAborted = false; - resolve({ wasm: wasm }); - }; - wasm.onAbort = function () { - if (initialized) { - // Emscripten already called console.warn so no need to double log. - return; - } - if (initAborted) { - // Emscripten calls `onAbort` twice, resulting in double error - // messages. - return; - } - initAborted = true; - var rejectMsg = 'Make sure the server can serve the `.wasm` file relative to the ' + - 'bundled js file. For more details see https://github.com/tensorflow/tfjs/blob/master/tfjs-backend-wasm/README.md#using-bundlers'; - reject({ message: rejectMsg }); - }; - })]; - }); + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/ , new Promise(function (resolve, reject) { + var factoryConfig = {}; + if (wasmPath != null) { + factoryConfig.locateFile = function (path, prefix) { + if (path.endsWith('.wasm')) { + return wasmPath; + } + return prefix + path; + }; + // use wasm instantiateWasm override when system fetch is not available. + // For detail references + // https://github.com/emscripten-core/emscripten/blob/2bca083cbbd5a4133db61fbd74d04f7feecfa907/tests/manual_wasm_instantiate.html#L170 + if (customFetch) { + factoryConfig.instantiateWasm = createInstantiateWasmFunc(wasmPath); + } + } + var wasm = tfjsBackendWasm(factoryConfig); + var voidReturnType = null; + // Using the tfjs namespace to avoid conflict with emscripten's API. + wasm.tfjs = { + init: wasm.cwrap('init', null, []), + registerTensor: wasm.cwrap('register_tensor', null, [ + 'number', + 'number', + 'number', + ]), + disposeData: wasm.cwrap('dispose_data', voidReturnType, ['number']), + dispose: wasm.cwrap('dispose', voidReturnType, []), + }; + var initialized = false; + wasm.onRuntimeInitialized = function () { + initialized = true; + initAborted = false; + resolve({ + wasm: wasm + }); + }; + wasm.onAbort = function () { + if (initialized) { + // Emscripten already called console.warn so no need to double log. + return; + } + if (initAborted) { + // Emscripten calls `onAbort` twice, resulting in double error + // messages. + return; + } + initAborted = true; + var rejectMsg = 'Make sure the server can serve the `.wasm` file relative to the ' + + 'bundled js file. For more details see https://github.com/tensorflow/tfjs/blob/master/tfjs-backend-wasm/README.md#using-bundlers'; + reject({ + message: rejectMsg + }); + }; + })]; }); + }); } + function typedArrayFromBuffer(buffer, dtype) { - switch (dtype) { - case 'float32': - return new Float32Array(buffer); - case 'int32': - return new Int32Array(buffer); - case 'bool': - return new Uint8Array(buffer); - default: - throw new Error("Unknown dtype " + dtype); - } + switch (dtype) { + case 'float32': + return new Float32Array(buffer); + case 'int32': + return new Int32Array(buffer); + case 'bool': + return new Uint8Array(buffer); + default: + throw new Error("Unknown dtype " + dtype); + } } var wasmPath = null; var initAborted = false; @@ -2954,24 +6503,28 @@ */ /** @doc {heading: 'Environment', namespace: 'wasm'} */ function setWasmPath(path, usePlatformFetch) { - if (usePlatformFetch === void 0) { usePlatformFetch = false; } - if (initAborted) { - throw new Error('The WASM backend was already initialized. Make sure you call ' + - '`setWasmPath()` before you call `tf.setBackend()` or `tf.ready()`'); - } - wasmPath = path; - customFetch = usePlatformFetch; - } - + if (usePlatformFetch === void 0) { + usePlatformFetch = false; + } + if (initAborted) { + throw new Error('The WASM backend was already initialized. Make sure you call ' + + '`setWasmPath()` before you call `tf.setBackend()` or `tf.ready()`'); + } + wasmPath = path; + customFetch = usePlatformFetch; + } + /** @license See the LICENSE file. */ // This code is auto-generated, do not modify this file! - var version = '0.0.0'; - - exports.BackendWasm = BackendWasm; - exports.setWasmPath = setWasmPath; - exports.version_wasm = version; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}))); -//# sourceMappingURL=tf-backend-wasm.js.map + var version = '0.0.0'; + + exports.BackendWasm = BackendWasm; + exports.setWasmPath = setWasmPath; + exports.version_wasm = version; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + +}))); +//# sourceMappingURL=tf-backend-wasm.js.map diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js b/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js index 255cb67140c..427a38493f0 100644 --- a/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js +++ b/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js @@ -1 +1,151 @@ -var threadInfoStruct=0;var selfThreadId=0;var parentThreadId=0;var Module={};function assert(condition,text){if(!condition)abort("Assertion failed: "+text)}function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:selfThreadId})}var out=function(){throw"out() is not defined in worker.js."};var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);Module["wasmModule"]=null;receiveInstance(instance);return instance.exports};this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["DYNAMIC_BASE"]=e.data.DYNAMIC_BASE;Module["DYNAMICTOP_PTR"]=e.data.DYNAMICTOP_PTR;Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}Module=WasmBackendModule(Module);postMessage({"cmd":"loaded"})}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;threadInfoStruct=e.data.threadInfoStruct;Module["__register_pthread_ptr"](threadInfoStruct,0,0);selfThreadId=e.data.selfThreadId;parentThreadId=e.data.parentThreadId;var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;assert(threadInfoStruct);assert(selfThreadId);assert(parentThreadId);assert(top!=0);assert(max!=0);assert(top>max);Module["establishStackSpace"](top,max);Module["_emscripten_tls_init"]();Module["writeStackCookie"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].setThreadStatus(Module["_pthread_self"](),1);try{var result=Module["dynCall_ii"](e.data.start_routine,e.data.arg);Module["checkStackCookie"]();if(!Module["getNoExitRuntime"]())Module["PThread"].threadExit(result)}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){Atomics.store(Module["HEAPU32"],threadInfoStruct+4>>2,ex instanceof Module["ExitStatus"]?ex.status:-2);Atomics.store(Module["HEAPU32"],threadInfoStruct+0>>2,1);if(typeof Module["_emscripten_futex_wake"]!=="function"){err("Thread Initialisation failed.");throw ex}Module["_emscripten_futex_wake"](threadInfoStruct+0,2147483647);if(!(ex instanceof Module["ExitStatus"]))throw ex}else{err("Pthread 0x"+threadInfoStruct.toString(16)+" completed its pthread main entry point with an unwind, keeping the pthread worker alive for asynchronous operation.")}}}else if(e.data.cmd==="cancel"){if(threadInfoStruct){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(threadInfoStruct){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} +var threadInfoStruct = 0; +var selfThreadId = 0; +var parentThreadId = 0; +var Module = {}; + +function assert(condition, text) { + if (!condition) abort("Assertion failed: " + text) +} + +function threadPrintErr() { + var text = Array.prototype.slice.call(arguments).join(" "); + console.error(text) +} + +function threadAlert() { + var text = Array.prototype.slice.call(arguments).join(" "); + postMessage({ + cmd: "alert", + text: text, + threadId: selfThreadId + }) +} +var out = function () { + throw "out() is not defined in worker.js." +}; +var err = threadPrintErr; +this.alert = threadAlert; +Module["instantiateWasm"] = function (info, receiveInstance) { + var instance = new WebAssembly.Instance(Module["wasmModule"], info); + Module["wasmModule"] = null; + receiveInstance(instance); + return instance.exports +}; +this.onmessage = function (e) { + try { + if (e.data.cmd === "load") { + Module["DYNAMIC_BASE"] = e.data.DYNAMIC_BASE; + Module["DYNAMICTOP_PTR"] = e.data.DYNAMICTOP_PTR; + Module["wasmModule"] = e.data.wasmModule; + Module["wasmMemory"] = e.data.wasmMemory; + Module["buffer"] = Module["wasmMemory"].buffer; + Module["ENVIRONMENT_IS_PTHREAD"] = true; + if (typeof e.data.urlOrBlob === "string") { + importScripts(e.data.urlOrBlob) + } else { + var objectUrl = URL.createObjectURL(e.data.urlOrBlob); + importScripts(objectUrl); + URL.revokeObjectURL(objectUrl) + } + Module = WasmBackendModule(Module); + postMessage({ + "cmd": "loaded" + }) + } else if (e.data.cmd === "objectTransfer") { + Module["PThread"].receiveObjectTransfer(e.data) + } else if (e.data.cmd === "run") { + Module["__performance_now_clock_drift"] = performance.now() - e.data.time; + threadInfoStruct = e.data.threadInfoStruct; + Module["__register_pthread_ptr"](threadInfoStruct, 0, 0); + selfThreadId = e.data.selfThreadId; + parentThreadId = e.data.parentThreadId; + var max = e.data.stackBase; + var top = e.data.stackBase + e.data.stackSize; + assert(threadInfoStruct); + assert(selfThreadId); + assert(parentThreadId); + assert(top != 0); + assert(max != 0); + assert(top > max); + Module["establishStackSpace"](top, max); + Module["_emscripten_tls_init"](); + Module["writeStackCookie"](); + Module["PThread"].receiveObjectTransfer(e.data); + Module["PThread"].setThreadStatus(Module["_pthread_self"](), 1); + try { + var result = Module["dynCall_ii"](e.data.start_routine, e.data.arg); + Module["checkStackCookie"](); + if (!Module["getNoExitRuntime"]()) Module["PThread"].threadExit(result) + } catch (ex) { + if (ex === "Canceled!") { + Module["PThread"].threadCancel() + } else if (ex != "unwind") { + Atomics.store(Module["HEAPU32"], threadInfoStruct + 4 >> 2, ex instanceof Module["ExitStatus"] ? ex.status : -2); + Atomics.store(Module["HEAPU32"], threadInfoStruct + 0 >> 2, 1); + if (typeof Module["_emscripten_futex_wake"] !== "function") { + err("Thread Initialisation failed."); + throw ex + } + Module["_emscripten_futex_wake"](threadInfoStruct + 0, 2147483647); + if (!(ex instanceof Module["ExitStatus"])) throw ex + } else { + err("Pthread 0x" + threadInfoStruct.toString(16) + " completed its pthread main entry point with an unwind, keeping the pthread worker alive for asynchronous operation.") + } + } + } else if (e.data.cmd === "cancel") { + if (threadInfoStruct) { + Module["PThread"].threadCancel() + } + } else if (e.data.target === "setimmediate") {} else if (e.data.cmd === "processThreadQueue") { + if (threadInfoStruct) { + Module["_emscripten_current_thread_process_queued_calls"]() + } + } else { + err("worker.js received unknown command " + e.data.cmd); + err(e.data) + } + } catch (ex) { + err("worker.js onmessage() captured an uncaught exception: " + ex); + if (ex.stack) err(ex.stack); + throw ex + } +}; +if (typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string") { + self = { + location: { + href: __filename + } + }; + var onmessage = this.onmessage; + var nodeWorkerThreads = require("worker_threads"); + Worker = nodeWorkerThreads.Worker; + var parentPort = nodeWorkerThreads.parentPort; + parentPort.on("message", function (data) { + onmessage({ + data: data + }) + }); + var nodeFS = require("fs"); + var nodeRead = function (filename) { + return nodeFS.readFileSync(filename, "utf8") + }; + + function globalEval(x) { + global.require = require; + global.Module = Module; + eval.call(null, x) + } + importScripts = function (f) { + globalEval(nodeRead(f)) + }; + postMessage = function (msg) { + parentPort.postMessage(msg) + }; + if (typeof performance === "undefined") { + performance = { + now: function () { + return Date.now() + } + } + } +} From 80d6e5aaa2eb40303648060a18db19eb01e5d51e Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Sat, 25 Apr 2020 08:20:16 -0400 Subject: [PATCH 53/85] update --- tfjs-backend-wasm/karma.conf.js | 4 ++-- tfjs-backend-wasm/rollup.config.js | 4 ++-- tfjs-backend-wasm/src/backend_wasm.ts | 6 +++--- tfjs-core/benchmarks/tf-backend-wasm.js | 19 +++++++++++++------ .../benchmarks/tfjs-backend-wasm.worker.js | 9 +++++++++ 5 files changed, 29 insertions(+), 13 deletions(-) diff --git a/tfjs-backend-wasm/karma.conf.js b/tfjs-backend-wasm/karma.conf.js index ad075e5886e..51e256a0706 100644 --- a/tfjs-backend-wasm/karma.conf.js +++ b/tfjs-backend-wasm/karma.conf.js @@ -30,7 +30,7 @@ const karmaTypescriptConfig = { // Disable coverage reports and instrumentation by default for tests coverageOptions: {instrumentation: false}, reports: {}, - include: ['src/', 'wasm-out/'] + include: ['src/'] }; module.exports = function(config) { @@ -56,7 +56,7 @@ module.exports = function(config) { ], exclude: ['src/test_node.ts'], preprocessors: { - 'wasm-out/tfjs-backend-wasm.js': ['karma-typescript'], + // 'wasm-out/tfjs-backend-wasm.js': ['karma-typescript'], '**/*.ts': ['karma-typescript'] }, karmaTypescriptConfig, diff --git a/tfjs-backend-wasm/rollup.config.js b/tfjs-backend-wasm/rollup.config.js index d953167cc15..0e651f144da 100644 --- a/tfjs-backend-wasm/rollup.config.js +++ b/tfjs-backend-wasm/rollup.config.js @@ -55,10 +55,10 @@ function config({plugins = [], output = {}}) { output: { banner: PREAMBLE, sourcemap: true, - globals: {'@tensorflow/tfjs-core': 'tf', 'fs': 'fs', 'path': 'path'}, + globals: {'@tensorflow/tfjs-core': 'tf', 'fs': 'fs', 'path': 'path', '../wasm-out/tfjs-backend-wasm.js': 'WasmBackendModule'}, ...output, }, - external: ['crypto', '@tensorflow/tfjs-core', 'fs', 'path'], + external: ['crypto', '@tensorflow/tfjs-core', 'fs', 'path', '../wasm-out/tfjs-backend-wasm.js'], onwarn: warning => { let {code} = warning; if (code === 'CIRCULAR_DEPENDENCY' || code === 'CIRCULAR' || diff --git a/tfjs-backend-wasm/src/backend_wasm.ts b/tfjs-backend-wasm/src/backend_wasm.ts index fe062cd7492..ef2b88f16df 100644 --- a/tfjs-backend-wasm/src/backend_wasm.ts +++ b/tfjs-backend-wasm/src/backend_wasm.ts @@ -17,8 +17,8 @@ import {backend_util, BackendTimingInfo, DataStorage, DataType, engine, KernelBackend, registerBackend, TensorInfo, util} from '@tensorflow/tfjs-core'; -import {BackendWasmModule, WasmFactoryConfig} from '../wasm-out/tfjs-backend-wasm'; -import wasmFactory from '../wasm-out/tfjs-backend-wasm.js'; +import {BackendWasmModule, WasmFactoryConfig} from '../wasm-out/tfjs-backend-wasm.js'; +import WasmBackendModule from '../wasm-out/tfjs-backend-wasm.js'; const WASM_PRIORITY = 2; @@ -216,7 +216,7 @@ export async function init(): Promise<{wasm: BackendWasmModule}> { factoryConfig.instantiateWasm = createInstantiateWasmFunc(wasmPath); } } - const wasm = wasmFactory(factoryConfig); + const wasm = WasmBackendModule(factoryConfig); const voidReturnType: string = null; // Using the tfjs namespace to avoid conflict with emscripten's API. wasm.tfjs = { diff --git a/tfjs-core/benchmarks/tf-backend-wasm.js b/tfjs-core/benchmarks/tf-backend-wasm.js index 37128de6fe3..9ba60bc3bf7 100644 --- a/tfjs-core/benchmarks/tf-backend-wasm.js +++ b/tfjs-core/benchmarks/tf-backend-wasm.js @@ -3818,6 +3818,7 @@ return hasPrefix(filename, fileURIPrefix) } var wasmBinaryFile = "tfjs-backend-wasm.wasm"; + console.log("INITIALIZE WASM BINARY FILE"); if (!isDataURI(wasmBinaryFile)) { wasmBinaryFile = locateFile(wasmBinaryFile); } @@ -3896,15 +3897,19 @@ function instantiateAsync() { if (!wasmBinary && typeof WebAssembly.instantiateStreaming === "function" && !isDataURI(wasmBinaryFile) && !isFileURI(wasmBinaryFile) && typeof fetch === "function") { + console.log("INSTANTIATE ASYNC"); + console.log(wasmBinaryFile); fetch(wasmBinaryFile, { credentials: "same-origin" }).then(function (response) { - var result = WebAssembly.instantiateStreaming(response, info); - return result.then(receiveInstantiatedSource, function (reason) { - err("wasm streaming compile failed: " + reason); - err("falling back to ArrayBuffer instantiation"); - instantiateArrayBuffer(receiveInstantiatedSource); - }) + response.arrayBuffer().then(resp => { + var result = WebAssembly.instantiate(resp, info); + return result.then(receiveInstantiatedSource, function (reason) { + err("wasm streaming compile failed: " + reason); + err("falling back to ArrayBuffer instantiation"); + instantiateArrayBuffer(receiveInstantiatedSource); + }) + }); }); } else { return instantiateArrayBuffer(receiveInstantiatedSource) @@ -6423,6 +6428,8 @@ if (wasmPath != null) { factoryConfig.locateFile = function (path, prefix) { if (path.endsWith('.wasm')) { + console.log("ASKIGN FOR THE WASM BINARY"); + console.log(wasmPath); return wasmPath; } return prefix + path; diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js b/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js index 427a38493f0..7a5a7f0133d 100644 --- a/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js +++ b/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js @@ -34,19 +34,26 @@ Module["instantiateWasm"] = function (info, receiveInstance) { this.onmessage = function (e) { try { if (e.data.cmd === "load") { + console.log("LOADING YAY"); + console.log(e.data.urlOrBlob); Module["DYNAMIC_BASE"] = e.data.DYNAMIC_BASE; Module["DYNAMICTOP_PTR"] = e.data.DYNAMICTOP_PTR; Module["wasmModule"] = e.data.wasmModule; Module["wasmMemory"] = e.data.wasmMemory; Module["buffer"] = Module["wasmMemory"].buffer; Module["ENVIRONMENT_IS_PTHREAD"] = true; + console.log("ABOUT TO LOAD"); if (typeof e.data.urlOrBlob === "string") { + console.log("IMPORT SCRIPTS?"); importScripts(e.data.urlOrBlob) + console.log("done importing"); } else { var objectUrl = URL.createObjectURL(e.data.urlOrBlob); importScripts(objectUrl); URL.revokeObjectURL(objectUrl) } + console.log("WORKER HAS INSTANTIATED"); + console.log(WasmBackendModule); Module = WasmBackendModule(Module); postMessage({ "cmd": "loaded" @@ -136,6 +143,8 @@ if (typeof process === "object" && typeof process.versions === "object" && typeo eval.call(null, x) } importScripts = function (f) { + console.log('WORKER IMPORT SCRIPTS'); + console.log(f); globalEval(nodeRead(f)) }; postMessage = function (msg) { From 74948f5e12a1e5c12b6d652b242526b27902d57b Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Wed, 29 Apr 2020 15:24:49 -0400 Subject: [PATCH 54/85] works --- tfjs-core/benchmarks/index.html | 1 + tfjs-core/benchmarks/runserver | 22 + tfjs-core/benchmarks/tf-backend-wasm.js | 6846 ++++------------- tfjs-core/benchmarks/tfjs-backend-wasm.js | 3275 ++++++++ .../benchmarks/tfjs-backend-wasm.worker.js | 161 +- 5 files changed, 4882 insertions(+), 5423 deletions(-) create mode 100755 tfjs-core/benchmarks/runserver create mode 100755 tfjs-core/benchmarks/tfjs-backend-wasm.js diff --git a/tfjs-core/benchmarks/index.html b/tfjs-core/benchmarks/index.html index cf3730465ce..5884f385adc 100644 --- a/tfjs-core/benchmarks/index.html +++ b/tfjs-core/benchmarks/index.html @@ -61,6 +61,7 @@

TensorFlow.js Model Benchmark

+ diff --git a/tfjs-core/benchmarks/runserver b/tfjs-core/benchmarks/runserver new file mode 100755 index 00000000000..a4eab8f6297 --- /dev/null +++ b/tfjs-core/benchmarks/runserver @@ -0,0 +1,22 @@ +import http.server +from http.server import HTTPServer, BaseHTTPRequestHandler +import socketserver + +PORT = 8080 + +Handler = http.server.SimpleHTTPRequestHandler + +Handler.extensions_map={ + '.manifest': 'text/cache-manifest', + '.html': 'text/html', + '.png': 'image/png', + '.jpg': 'image/jpg', + '.svg': 'image/svg+xml', + '.css': 'text/css', + '.js': 'application/x-javascript', + '.wasm': 'application/wasm', + '': 'application/octet-stream', # Default + } + +httpd = socketserver.TCPServer(("", PORT), Handler) +httpd.serve_forever() diff --git a/tfjs-core/benchmarks/tf-backend-wasm.js b/tfjs-core/benchmarks/tf-backend-wasm.js index 9ba60bc3bf7..67c1bd92345 100644 --- a/tfjs-core/benchmarks/tf-backend-wasm.js +++ b/tfjs-core/benchmarks/tf-backend-wasm.js @@ -1,31 +1,27 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tensorflow/tfjs-core'), require('path'), require('fs'), require('worker_threads'), require('perf_hooks')) : - typeof define === 'function' && define.amd ? define(['exports', '@tensorflow/tfjs-core', 'path', 'fs', 'worker_threads', 'perf_hooks'], factory) : - (global = global || self, factory((global.tf = global.tf || {}, global.tf.wasm = global.tf.wasm || {}), global.tf, global.path, global.fs, global.worker_threads, global.perf_hooks)); -}(this, (function (exports, tfjsCore, path, fs, worker_threads, perf_hooks) { - 'use strict'; - - path = path && path.hasOwnProperty('default') ? path['default'] : path; - fs = fs && fs.hasOwnProperty('default') ? fs['default'] : fs; - worker_threads = worker_threads && worker_threads.hasOwnProperty('default') ? worker_threads['default'] : worker_threads; - perf_hooks = perf_hooks && perf_hooks.hasOwnProperty('default') ? perf_hooks['default'] : perf_hooks; - +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tensorflow/tfjs-core'), require('../wasm-out/tfjs-backend-wasm.js')) : + typeof define === 'function' && define.amd ? define(['exports', '@tensorflow/tfjs-core', '../wasm-out/tfjs-backend-wasm.js'], factory) : + (global = global || self, factory((global.tf = global.tf || {}, global.tf.wasm = global.tf.wasm || {}), global.tf, global.WasmBackendModule)); +}(this, (function (exports, tfjsCore, WasmBackendModule) { 'use strict'; + + WasmBackendModule = WasmBackendModule && WasmBackendModule.hasOwnProperty('default') ? WasmBackendModule['default'] : WasmBackendModule; + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -45,21 +41,21 @@ // This enum must align with the enum defined in cc/backend.h. var CppDType; (function (CppDType) { - CppDType[CppDType["float32"] = 0] = "float32"; - CppDType[CppDType["int32"] = 1] = "int32"; - CppDType[CppDType["bool"] = 2] = "bool"; - CppDType[CppDType["string"] = 3] = "string"; - CppDType[CppDType["complex64"] = 4] = "complex64"; + CppDType[CppDType["float32"] = 0] = "float32"; + CppDType[CppDType["int32"] = 1] = "int32"; + CppDType[CppDType["bool"] = 2] = "bool"; + CppDType[CppDType["string"] = 3] = "string"; + CppDType[CppDType["complex64"] = 4] = "complex64"; })(CppDType || (CppDType = {})); // Must match enum in cc/fusable_activations.h. var FusableActivation; (function (FusableActivation) { - FusableActivation[FusableActivation["linear"] = 0] = "linear"; - FusableActivation[FusableActivation["relu"] = 1] = "relu"; - FusableActivation[FusableActivation["relu6"] = 2] = "relu6"; - FusableActivation[FusableActivation["prelu"] = 3] = "prelu"; - })(FusableActivation || (FusableActivation = {})); - + FusableActivation[FusableActivation["linear"] = 0] = "linear"; + FusableActivation[FusableActivation["relu"] = 1] = "relu"; + FusableActivation[FusableActivation["relu6"] = 2] = "relu6"; + FusableActivation[FusableActivation["prelu"] = 3] = "prelu"; + })(FusableActivation || (FusableActivation = {})); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -76,75 +72,66 @@ * limitations under the License. * ============================================================================= */ - var wasmFusedMatMul; - + let wasmFusedMatMul; function setup(backend) { - wasmFusedMatMul = backend.wasm.cwrap('_FusedMatMul', null /* void */ , [ - 'number', - 'array', - 'number', - 'number', - 'array', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number' // out_id - ]); + wasmFusedMatMul = backend.wasm.cwrap('_FusedMatMul', null /* void */, [ + 'number', + 'array', + 'number', + 'number', + 'array', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number' // out_id + ]); } - function fusedBatchMatMul(args) { - var inputs = args.inputs, - backend = args.backend, - attrs = args.attrs; - var a = inputs.a, - b = inputs.b, - bias = inputs.bias, - preluActivationWeights = inputs.preluActivationWeights; - if (a.dtype !== 'float32' || b.dtype !== 'float32') { - throw new Error("_FusedMatMul for non non-float32 tensors not yet supported."); - } - var transposeA = attrs.transposeA, - transposeB = attrs.transposeB, - activation = attrs.activation; - var aId = backend.dataIdMap.get(a.dataId).id; - var bId = backend.dataIdMap.get(b.dataId).id; - var biasId = 0; - if (bias != null) { - var biasData = backend.dataIdMap.get(bias.dataId); - if (biasData.shape.length !== 1) { - throw new Error("_FusedMatMul only supports rank-1 bias but got " + - ("rank " + biasData.shape.length + ".")); + const { inputs, backend, attrs } = args; + const { a, b, bias, preluActivationWeights } = inputs; + if (a.dtype !== 'float32' || b.dtype !== 'float32') { + throw new Error(`_FusedMatMul for non non-float32 tensors not yet supported.`); + } + const { transposeA, transposeB, activation } = attrs; + const aId = backend.dataIdMap.get(a.dataId).id; + const bId = backend.dataIdMap.get(b.dataId).id; + let biasId = 0; + if (bias != null) { + const biasData = backend.dataIdMap.get(bias.dataId); + if (biasData.shape.length !== 1) { + throw new Error(`_FusedMatMul only supports rank-1 bias but got ` + + `rank ${biasData.shape.length}.`); + } + biasId = biasData.id; } - biasId = biasData.id; - } - var preluActivationWeightsId = preluActivationWeights == null ? - 0 : - backend.dataIdMap.get(preluActivationWeights.dataId).id; - var fusedActivation = FusableActivation[activation]; - if (fusedActivation == null) { - throw new Error(activation + " activation not yet supported for FusedConv2D " + - "in the wasm backend."); - } - var leftDim = transposeA ? a.shape[2] : a.shape[1]; - var rightDim = transposeB ? b.shape[1] : b.shape[2]; - var batchDim = a.shape[0]; - var out = backend.makeOutput([batchDim, leftDim, rightDim], a.dtype); - var outId = backend.dataIdMap.get(out.dataId).id; - var aShapeBytes = new Uint8Array(new Int32Array(a.shape).buffer); - var bShapeBytes = new Uint8Array(new Int32Array(b.shape).buffer); - wasmFusedMatMul(aId, aShapeBytes, a.shape.length, bId, bShapeBytes, b.shape.length, transposeA, transposeB, fusedActivation, biasId, preluActivationWeightsId, outId); - return out; + const preluActivationWeightsId = preluActivationWeights == null ? + 0 : + backend.dataIdMap.get(preluActivationWeights.dataId).id; + const fusedActivation = FusableActivation[activation]; + if (fusedActivation == null) { + throw new Error(`${activation} activation not yet supported for FusedConv2D ` + + `in the wasm backend.`); + } + const leftDim = transposeA ? a.shape[2] : a.shape[1]; + const rightDim = transposeB ? b.shape[1] : b.shape[2]; + const batchDim = a.shape[0]; + const out = backend.makeOutput([batchDim, leftDim, rightDim], a.dtype); + const outId = backend.dataIdMap.get(out.dataId).id; + const aShapeBytes = new Uint8Array(new Int32Array(a.shape).buffer); + const bShapeBytes = new Uint8Array(new Int32Array(b.shape).buffer); + wasmFusedMatMul(aId, aShapeBytes, a.shape.length, bId, bShapeBytes, b.shape.length, transposeA, transposeB, fusedActivation, biasId, preluActivationWeightsId, outId); + return out; } tfjsCore.registerKernel({ - kernelName: '_FusedMatMul', - backendName: 'wasm', - setupFunc: setup, - kernelFunc: fusedBatchMatMul - }); - + kernelName: '_FusedMatMul', + backendName: 'wasm', + setupFunc: setup, + kernelFunc: fusedBatchMatMul + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -162,34 +149,26 @@ * ============================================================================= */ function registerUnaryKernel(kernelName) { - var wasmFunc; - - function setupFunc(backend) { - wasmFunc = - backend.wasm.cwrap(kernelName, null /* void */ , ['number', 'number']); - } - - function kernelFunc(args) { - var backend = args.backend, - x = args.inputs.x; - var xId = backend.dataIdMap.get(x.dataId).id; - var out = backend.makeOutput(x.shape, x.dtype); - var outId = backend.dataIdMap.get(out.dataId).id; - // Short-circuit zero-sized tensors. - if (tfjsCore.util.sizeFromShape(out.shape) === 0) { - return out; + let wasmFunc; + function setupFunc(backend) { + wasmFunc = + backend.wasm.cwrap(kernelName, null /* void */, ['number', 'number']); } - wasmFunc(xId, outId); - return out; - } - tfjsCore.registerKernel({ - kernelName: kernelName, - backendName: 'wasm', - setupFunc: setupFunc, - kernelFunc: kernelFunc - }); - } - + function kernelFunc(args) { + const { backend, inputs: { x } } = args; + const xId = backend.dataIdMap.get(x.dataId).id; + const out = backend.makeOutput(x.shape, x.dtype); + const outId = backend.dataIdMap.get(out.dataId).id; + // Short-circuit zero-sized tensors. + if (tfjsCore.util.sizeFromShape(out.shape) === 0) { + return out; + } + wasmFunc(xId, outId); + return out; + } + tfjsCore.registerKernel({ kernelName, backendName: 'wasm', setupFunc, kernelFunc }); + } + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -206,8 +185,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Abs'); - + registerUnaryKernel('Abs'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -225,69 +204,55 @@ * ============================================================================= */ function registerBinaryKernel(kernelName, supportsFullBroadcast, dtype) { - var wasmFunc; - - function setupFunc(backend) { - wasmFunc = backend.wasm.cwrap(kernelName, null /* void */ , [ - 'number', - 'array', - 'number', - 'number', - 'array', - 'number', - 'number', - 'number' // out_id - ]); - } - - function kernelFunc(args) { - var backend = args.backend, - inputs = args.inputs; - var a = inputs.a, - b = inputs.b; - var aId = backend.dataIdMap.get(a.dataId).id; - var bId = backend.dataIdMap.get(b.dataId).id; - var outputType = dtype != null ? dtype : a.dtype; - var newShape = tfjsCore.backend_util.assertAndGetBroadcastShape(a.shape, b.shape); - var out = backend.makeOutput(newShape, outputType); - // Short-circuit zero-sized tensors. - if (tfjsCore.util.sizeFromShape(newShape) === 0) { - return out; - } - var aShapeBytes = new Uint8Array(new Int32Array(a.shape).buffer); - var bShapeBytes = new Uint8Array(new Int32Array(b.shape).buffer); - var outId = backend.dataIdMap.get(out.dataId).id; - var kernelFunc = function () { - return wasmFunc(aId, aShapeBytes, a.shape.length, bId, bShapeBytes, b.shape.length, CppDType[a.dtype], outId); - }; - if (supportsFullBroadcast) { - kernelFunc(); - return out; + let wasmFunc; + function setupFunc(backend) { + wasmFunc = backend.wasm.cwrap(kernelName, null /* void */, [ + 'number', + 'array', + 'number', + 'number', + 'array', + 'number', + 'number', + 'number' // out_id + ]); } - var aBroadcastDims = tfjsCore.backend_util.getBroadcastDims(a.shape, newShape); - var bBroadcastDims = tfjsCore.backend_util.getBroadcastDims(b.shape, newShape); - var loopsOverAllOfA = aBroadcastDims.every(function (v, i) { - return v === i; - }); - var loopsOverAllOfB = bBroadcastDims.every(function (v, i) { - return v === i; - }); - if (loopsOverAllOfA && loopsOverAllOfB) { - kernelFunc(); - return out; - } else { - throw new Error("Broadcasting along outer dims is not yet " + - ("supported for " + kernelName + ".")); + function kernelFunc(args) { + const { backend, inputs } = args; + const { a, b } = inputs; + const aId = backend.dataIdMap.get(a.dataId).id; + const bId = backend.dataIdMap.get(b.dataId).id; + const outputType = dtype != null ? dtype : a.dtype; + const newShape = tfjsCore.backend_util.assertAndGetBroadcastShape(a.shape, b.shape); + const out = backend.makeOutput(newShape, outputType); + // Short-circuit zero-sized tensors. + if (tfjsCore.util.sizeFromShape(newShape) === 0) { + return out; + } + const aShapeBytes = new Uint8Array(new Int32Array(a.shape).buffer); + const bShapeBytes = new Uint8Array(new Int32Array(b.shape).buffer); + const outId = backend.dataIdMap.get(out.dataId).id; + const kernelFunc = () => wasmFunc(aId, aShapeBytes, a.shape.length, bId, bShapeBytes, b.shape.length, CppDType[a.dtype], outId); + if (supportsFullBroadcast) { + kernelFunc(); + return out; + } + const aBroadcastDims = tfjsCore.backend_util.getBroadcastDims(a.shape, newShape); + const bBroadcastDims = tfjsCore.backend_util.getBroadcastDims(b.shape, newShape); + const loopsOverAllOfA = aBroadcastDims.every((v, i) => v === i); + const loopsOverAllOfB = bBroadcastDims.every((v, i) => v === i); + if (loopsOverAllOfA && loopsOverAllOfB) { + kernelFunc(); + return out; + } + else { + throw new Error(`Broadcasting along outer dims is not yet ` + + `supported for ${kernelName}.`); + } } - } - tfjsCore.registerKernel({ - kernelName: kernelName, - backendName: 'wasm', - setupFunc: setupFunc, - kernelFunc: kernelFunc - }); - } - + tfjsCore.registerKernel({ kernelName, backendName: 'wasm', setupFunc, kernelFunc }); + } + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -304,9 +269,9 @@ * limitations under the License. * ============================================================================= */ - var supportsFullBroadcast = true; - registerBinaryKernel('Add', supportsFullBroadcast); - + const supportsFullBroadcast = true; + registerBinaryKernel('Add', supportsFullBroadcast); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -323,40 +288,35 @@ * limitations under the License. * ============================================================================= */ - var wasmFunc; - + let wasmFunc; function setupFunc(backend) { - wasmFunc = backend.wasm.cwrap('AddN', null /* void */ , [ - 'array', - 'number', - 'number', - 'number', - ]); + wasmFunc = backend.wasm.cwrap('AddN', null /* void */, [ + 'array', + 'number', + 'number', + 'number', + ]); } - function addn(args) { - var inputs = args.inputs, - backend = args.backend; - var out = backend.makeOutput(inputs[0].shape, inputs[0].dtype); - // Short-circuit zero-sized tensors. - if (tfjsCore.util.sizeFromShape(out.shape) === 0) { + const { inputs, backend } = args; + const out = backend.makeOutput(inputs[0].shape, inputs[0].dtype); + // Short-circuit zero-sized tensors. + if (tfjsCore.util.sizeFromShape(out.shape) === 0) { + return out; + } + const inputIds = inputs.map(x => backend.dataIdMap.get(x.dataId).id); + const inputIdsBytes = new Uint8Array(new Int32Array(inputIds).buffer); + const outId = backend.dataIdMap.get(out.dataId).id; + wasmFunc(inputIdsBytes, inputIds.length, CppDType[out.dtype], outId); return out; - } - var inputIds = inputs.map(function (x) { - return backend.dataIdMap.get(x.dataId).id; - }); - var inputIdsBytes = new Uint8Array(new Int32Array(inputIds).buffer); - var outId = backend.dataIdMap.get(out.dataId).id; - wasmFunc(inputIdsBytes, inputIds.length, CppDType[out.dtype], outId); - return out; } tfjsCore.registerKernel({ - kernelName: 'AddN', - backendName: 'wasm', - setupFunc: setupFunc, - kernelFunc: addn, - }); - + kernelName: 'AddN', + backendName: 'wasm', + setupFunc, + kernelFunc: addn, + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -373,38 +333,34 @@ * limitations under the License. * ============================================================================= */ - var wasmFunc$1; - + let wasmFunc$1; function setup$1(backend) { - wasmFunc$1 = backend.wasm.cwrap('ArgMax', null /* void */ , [ - 'number', - 'number', - 'number', - 'number', - 'number' // out_id - ]); + wasmFunc$1 = backend.wasm.cwrap('ArgMax', null /* void */, [ + 'number', + 'number', + 'number', + 'number', + 'number' // out_id + ]); } - function argmax(args) { - var x = args.inputs.x, - backend = args.backend, - axis = args.attrs.axis; - var outShape = x.shape.slice(0, -1); - var out = backend.makeOutput(outShape, 'int32'); - var xId = backend.dataIdMap.get(x.dataId).id; - var outId = backend.dataIdMap.get(out.dataId).id; - var outerSize = tfjsCore.util.sizeFromShape(out.shape); - var innerSize = x.shape[axis]; - wasmFunc$1(xId, CppDType[x.dtype], outerSize, innerSize, outId); - return out; + const { inputs: { x }, backend, attrs: { axis } } = args; + const outShape = x.shape.slice(0, -1); + const out = backend.makeOutput(outShape, 'int32'); + const xId = backend.dataIdMap.get(x.dataId).id; + const outId = backend.dataIdMap.get(out.dataId).id; + const outerSize = tfjsCore.util.sizeFromShape(out.shape); + const innerSize = x.shape[axis]; + wasmFunc$1(xId, CppDType[x.dtype], outerSize, innerSize, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'ArgMax', - backendName: 'wasm', - kernelFunc: argmax, - setupFunc: setup$1 - }); - + kernelName: 'ArgMax', + backendName: 'wasm', + kernelFunc: argmax, + setupFunc: setup$1 + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -421,63 +377,59 @@ * limitations under the License. * ============================================================================= */ - var wasmAvgPool; - + let wasmAvgPool; function setup$2(backend) { - wasmAvgPool = backend.wasm.cwrap('AvgPool', null /* void */ , [ - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - ]); + wasmAvgPool = backend.wasm.cwrap('AvgPool', null /* void */, [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + ]); } - function avgPool(args) { - var inputs = args.inputs, - attrs = args.attrs, - backend = args.backend; - var convInfo = attrs; - var x = inputs.x; - var xId = backend.dataIdMap.get(x.dataId).id; - var filterHeight = convInfo.filterHeight; - var filterWidth = convInfo.filterWidth; - var padTop = convInfo.padInfo.top; - var padRight = convInfo.padInfo.right; - var padBottom = convInfo.padInfo.bottom; - var padLeft = convInfo.padInfo.left; - var strideHeight = convInfo.strideHeight; - var strideWidth = convInfo.strideWidth; - var channels = convInfo.inChannels; - if (convInfo.dataFormat !== 'channelsLast') { - throw new Error("wasm backend does not support dataFormat:'" + - (convInfo.dataFormat + "'. Please use 'channelsLast'.")); - } - if (convInfo.dilationWidth !== 1 || convInfo.dilationHeight !== 1) { - throw new Error("was backend only supports average pooling with dilation = [1, 1], " + - ("got [" + convInfo.dilationHeight + ", " + convInfo.dilationWidth + "].")); - } - var out = backend.makeOutput(convInfo.outShape, 'float32'); - var outId = backend.dataIdMap.get(out.dataId).id; - wasmAvgPool(xId, x.shape[0], x.shape[1], x.shape[2], filterHeight, filterWidth, padTop, padRight, padBottom, padLeft, strideHeight, strideWidth, channels, outId); - return out; + const { inputs, attrs, backend } = args; + const convInfo = attrs; + const { x } = inputs; + const xId = backend.dataIdMap.get(x.dataId).id; + const filterHeight = convInfo.filterHeight; + const filterWidth = convInfo.filterWidth; + const padTop = convInfo.padInfo.top; + const padRight = convInfo.padInfo.right; + const padBottom = convInfo.padInfo.bottom; + const padLeft = convInfo.padInfo.left; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const channels = convInfo.inChannels; + if (convInfo.dataFormat !== 'channelsLast') { + throw new Error(`wasm backend does not support dataFormat:'` + + `${convInfo.dataFormat}'. Please use 'channelsLast'.`); + } + if (convInfo.dilationWidth !== 1 || convInfo.dilationHeight !== 1) { + throw new Error(`was backend only supports average pooling with dilation = [1, 1], ` + + `got [${convInfo.dilationHeight}, ${convInfo.dilationWidth}].`); + } + const out = backend.makeOutput(convInfo.outShape, 'float32'); + const outId = backend.dataIdMap.get(out.dataId).id; + wasmAvgPool(xId, x.shape[0], x.shape[1], x.shape[2], filterHeight, filterWidth, padTop, padRight, padBottom, padLeft, strideHeight, strideWidth, channels, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'AvgPool', - backendName: 'wasm', - setupFunc: setup$2, - kernelFunc: avgPool - }); - + kernelName: 'AvgPool', + backendName: 'wasm', + setupFunc: setup$2, + kernelFunc: avgPool + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -494,52 +446,46 @@ * limitations under the License. * ============================================================================= */ - var wasmBatchMatMul; - + let wasmBatchMatMul; function setup$3(backend) { - wasmBatchMatMul = backend.wasm.cwrap('BatchMatMul', null /* void */ , [ - 'number', - 'array', - 'number', - 'number', - 'array', - 'number', - 'number', - 'number', - 'number' // out_id - ]); + wasmBatchMatMul = backend.wasm.cwrap('BatchMatMul', null /* void */, [ + 'number', + 'array', + 'number', + 'number', + 'array', + 'number', + 'number', + 'number', + 'number' // out_id + ]); } - function batchMatMul(args) { - var inputs = args.inputs, - backend = args.backend, - attrs = args.attrs; - var a = inputs.a, - b = inputs.b; - if (a.dtype !== 'float32' || b.dtype !== 'float32') { - throw new Error("BatchMatMul for non non-float32 tensors not yet supported."); - } - var transposeA = attrs.transposeA, - transposeB = attrs.transposeB; - var aId = backend.dataIdMap.get(a.dataId).id; - var bId = backend.dataIdMap.get(b.dataId).id; - var leftDim = transposeA ? a.shape[2] : a.shape[1]; - var rightDim = transposeB ? b.shape[1] : b.shape[2]; - var batchDim = a.shape[0]; - var out = backend.makeOutput([batchDim, leftDim, rightDim], a.dtype); - var outId = backend.dataIdMap.get(out.dataId).id; - var aShapeBytes = new Uint8Array(new Int32Array(a.shape).buffer); - var bShapeBytes = new Uint8Array(new Int32Array(b.shape).buffer); - wasmBatchMatMul(aId, aShapeBytes, a.shape.length, bId, bShapeBytes, b.shape.length, transposeA, transposeB, outId); - return out; + const { inputs, backend, attrs } = args; + const { a, b } = inputs; + if (a.dtype !== 'float32' || b.dtype !== 'float32') { + throw new Error(`BatchMatMul for non non-float32 tensors not yet supported.`); + } + const { transposeA, transposeB } = attrs; + const aId = backend.dataIdMap.get(a.dataId).id; + const bId = backend.dataIdMap.get(b.dataId).id; + const leftDim = transposeA ? a.shape[2] : a.shape[1]; + const rightDim = transposeB ? b.shape[1] : b.shape[2]; + const batchDim = a.shape[0]; + const out = backend.makeOutput([batchDim, leftDim, rightDim], a.dtype); + const outId = backend.dataIdMap.get(out.dataId).id; + const aShapeBytes = new Uint8Array(new Int32Array(a.shape).buffer); + const bShapeBytes = new Uint8Array(new Int32Array(b.shape).buffer); + wasmBatchMatMul(aId, aShapeBytes, a.shape.length, bId, bShapeBytes, b.shape.length, transposeA, transposeB, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'BatchMatMul', - backendName: 'wasm', - setupFunc: setup$3, - kernelFunc: batchMatMul - }); - + kernelName: 'BatchMatMul', + backendName: 'wasm', + setupFunc: setup$3, + kernelFunc: batchMatMul + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -557,21 +503,19 @@ * ============================================================================= */ function cast(args) { - var x = args.inputs.x, - dtype = args.attrs.dtype, - backend = args.backend; - var out = backend.makeOutput(x.shape, dtype); - var inVals = backend.typedArrayFromHeap(x); - var outVals = backend.typedArrayFromHeap(out); - outVals.set(inVals); - return out; + const { inputs: { x }, attrs: { dtype }, backend } = args; + const out = backend.makeOutput(x.shape, dtype); + const inVals = backend.typedArrayFromHeap(x); + const outVals = backend.typedArrayFromHeap(out); + outVals.set(inVals); + return out; } tfjsCore.registerKernel({ - kernelName: 'Cast', - backendName: 'wasm', - kernelFunc: cast, - }); - + kernelName: 'Cast', + backendName: 'wasm', + kernelFunc: cast, + }); + /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -588,37 +532,32 @@ * limitations under the License. * ============================================================================= */ - var wasmClip; - + let wasmClip; function setup$4(backend) { - wasmClip = backend.wasm.cwrap('ClipByValue', null /* void */ , [ - 'number', - 'number', - 'number', - 'number' // out_id - ]); + wasmClip = backend.wasm.cwrap('ClipByValue', null /* void */, [ + 'number', + 'number', + 'number', + 'number' // out_id + ]); } - function clip(args) { - var inputs = args.inputs, - backend = args.backend, - attrs = args.attrs; - var x = inputs.x; - var min = attrs.min, - max = attrs.max; - var xId = backend.dataIdMap.get(x.dataId).id; - var out = backend.makeOutput(x.shape, 'float32'); - var outId = backend.dataIdMap.get(out.dataId).id; - wasmClip(xId, min, max, outId); - return out; + const { inputs, backend, attrs } = args; + const { x } = inputs; + const { min, max } = attrs; + const xId = backend.dataIdMap.get(x.dataId).id; + const out = backend.makeOutput(x.shape, 'float32'); + const outId = backend.dataIdMap.get(out.dataId).id; + wasmClip(xId, min, max, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'ClipByValue', - backendName: 'wasm', - setupFunc: setup$4, - kernelFunc: clip - }); - + kernelName: 'ClipByValue', + backendName: 'wasm', + setupFunc: setup$4, + kernelFunc: clip + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -636,42 +575,36 @@ * ============================================================================= */ function concat(args) { - var inputs = args.inputs, - backend = args.backend, - axis = args.attrs.axis; - var outShape = tfjsCore.backend_util.computeOutShape(inputs.map(function (t) { - return t.shape; - }), axis); - var out = backend.makeOutput(outShape, inputs[0].dtype); - var batchDim = tfjsCore.util.sizeFromShape(inputs[0].shape.slice(0, axis)); - var sumInnerDims = 0; - var innerDims = inputs.map(function (input) { - var innerDim = tfjsCore.util.sizeFromShape(input.shape.slice(axis)); - sumInnerDims += innerDim; - return innerDim; - }); - var inVals = inputs.map(function (input) { - return backend.typedArrayFromHeap(input); - }); - var outVals = backend.typedArrayFromHeap(out); - for (var b = 0; b < batchDim; b++) { - var outOffset = b * sumInnerDims; - for (var i = 0; i < inVals.length; i++) { - var innerDim = innerDims[i]; - var inOffset = b * innerDim; - var vals = inVals[i].subarray(inOffset, inOffset + innerDim); - outVals.set(vals, outOffset); - outOffset += innerDim; + const { inputs, backend, attrs: { axis } } = args; + const outShape = tfjsCore.backend_util.computeOutShape(inputs.map(t => t.shape), axis); + const out = backend.makeOutput(outShape, inputs[0].dtype); + const batchDim = tfjsCore.util.sizeFromShape(inputs[0].shape.slice(0, axis)); + let sumInnerDims = 0; + const innerDims = inputs.map(input => { + const innerDim = tfjsCore.util.sizeFromShape(input.shape.slice(axis)); + sumInnerDims += innerDim; + return innerDim; + }); + const inVals = inputs.map(input => backend.typedArrayFromHeap(input)); + const outVals = backend.typedArrayFromHeap(out); + for (let b = 0; b < batchDim; b++) { + let outOffset = b * sumInnerDims; + for (let i = 0; i < inVals.length; i++) { + const innerDim = innerDims[i]; + const inOffset = b * innerDim; + const vals = inVals[i].subarray(inOffset, inOffset + innerDim); + outVals.set(vals, outOffset); + outOffset += innerDim; + } } - } - return out; + return out; } tfjsCore.registerKernel({ - kernelName: 'Concat', - backendName: 'wasm', - kernelFunc: concat, - }); - + kernelName: 'Concat', + backendName: 'wasm', + kernelFunc: concat, + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -688,70 +621,65 @@ * limitations under the License. * ============================================================================= */ - var wasmConv2d; - + let wasmConv2d; function setup$5(backend) { - wasmConv2d = backend.wasm.cwrap('Conv2D', null /* void */ , [ - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - ]); + wasmConv2d = backend.wasm.cwrap('Conv2D', null /* void */, [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + ]); } - function conv2d(args) { - var inputs = args.inputs, - attrs = args.attrs, - backend = args.backend; - var convInfo = attrs; - var x = inputs.x, - filter = inputs.filter; - var xId = backend.dataIdMap.get(x.dataId).id; - var filterId = backend.dataIdMap.get(filter.dataId).id; - var filterHeight = convInfo.filterHeight; - var filterWidth = convInfo.filterWidth; - var padTop = convInfo.padInfo.top; - var padRight = convInfo.padInfo.right; - var padBottom = convInfo.padInfo.bottom; - var padLeft = convInfo.padInfo.left; - var dilationHeight = convInfo.dilationHeight; - var dilationWidth = convInfo.dilationWidth; - var strideHeight = convInfo.strideHeight; - var strideWidth = convInfo.strideWidth; - var inputChannels = convInfo.inChannels; - var outputChannels = convInfo.outChannels; - var isSamePad = convInfo.padInfo.type === 'SAME' ? 1 : 0; - if (convInfo.dataFormat !== 'channelsLast') { - throw new Error("wasm backend Conv2D does not support dataFormat:'" + - (convInfo.dataFormat + "'. Please use 'channelsLast'.")); - } - var out = backend.makeOutput(convInfo.outShape, 'float32'); - var outId = backend.dataIdMap.get(out.dataId).id; - wasmConv2d(xId, x.shape[0], x.shape[1], x.shape[2], filterId, filterHeight, filterWidth, padTop, padRight, padBottom, padLeft, isSamePad, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, outId); - return out; + const { inputs, attrs, backend } = args; + const convInfo = attrs; + const { x, filter } = inputs; + const xId = backend.dataIdMap.get(x.dataId).id; + const filterId = backend.dataIdMap.get(filter.dataId).id; + const filterHeight = convInfo.filterHeight; + const filterWidth = convInfo.filterWidth; + const padTop = convInfo.padInfo.top; + const padRight = convInfo.padInfo.right; + const padBottom = convInfo.padInfo.bottom; + const padLeft = convInfo.padInfo.left; + const dilationHeight = convInfo.dilationHeight; + const dilationWidth = convInfo.dilationWidth; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const inputChannels = convInfo.inChannels; + const outputChannels = convInfo.outChannels; + const isSamePad = convInfo.padInfo.type === 'SAME' ? 1 : 0; + if (convInfo.dataFormat !== 'channelsLast') { + throw new Error(`wasm backend Conv2D does not support dataFormat:'` + + `${convInfo.dataFormat}'. Please use 'channelsLast'.`); + } + const out = backend.makeOutput(convInfo.outShape, 'float32'); + const outId = backend.dataIdMap.get(out.dataId).id; + wasmConv2d(xId, x.shape[0], x.shape[1], x.shape[2], filterId, filterHeight, filterWidth, padTop, padRight, padBottom, padLeft, isSamePad, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'Conv2D', - backendName: 'wasm', - setupFunc: setup$5, - kernelFunc: conv2d - }); - + kernelName: 'Conv2D', + backendName: 'wasm', + setupFunc: setup$5, + kernelFunc: conv2d + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -768,8 +696,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Cos'); - + registerUnaryKernel('Cos'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -789,75 +717,57 @@ // Must match enum in CropAndResize.cc var InterpolationMethod; (function (InterpolationMethod) { - InterpolationMethod[InterpolationMethod["bilinear"] = 0] = "bilinear"; - InterpolationMethod[InterpolationMethod["nearest"] = 1] = "nearest"; + InterpolationMethod[InterpolationMethod["bilinear"] = 0] = "bilinear"; + InterpolationMethod[InterpolationMethod["nearest"] = 1] = "nearest"; })(InterpolationMethod || (InterpolationMethod = {})); - var wasmCropAndResize; - + let wasmCropAndResize; function setup$6(backend) { - wasmCropAndResize = backend.wasm.cwrap('CropAndResize', null /*void*/ , [ - 'number', - 'number', - 'number', - 'number', - 'array', - 'number', - 'number', - 'number', - 'number', - 'number' // out id - ]); + wasmCropAndResize = backend.wasm.cwrap('CropAndResize', null /*void*/, [ + 'number', + 'number', + 'number', + 'number', + 'array', + 'number', + 'number', + 'number', + 'number', + 'number' // out id + ]); } - function cropAndResize(args) { - var backend = args.backend, - inputs = args.inputs, - attrs = args.attrs; - var method = attrs.method, - extrapolationValue = attrs.extrapolationValue, - cropSize = attrs.cropSize; - var images = inputs.images, - boxes = inputs.boxes, - boxInd = inputs.boxInd; - var numBoxes = boxes.shape[0]; - var _a = cropSize, - cropHeight = _a[0], - cropWidth = _a[1]; - var outShape = [numBoxes, cropHeight, cropWidth, images.shape[3]]; - var imagesData = backend.dataIdMap.get(images.dataId); - var castedData; - if (images.dtype !== 'float32') { - castedData = - cast({ - backend: backend, - inputs: { - x: images - }, - attrs: { - dtype: 'float32' - } - }); - imagesData = backend.dataIdMap.get(castedData.dataId); - } - var imagesId = imagesData.id; - var boxesId = backend.dataIdMap.get(boxes.dataId).id; - var boxIndId = backend.dataIdMap.get(boxInd.dataId).id; - var out = backend.makeOutput(outShape, 'float32'); - var outId = backend.dataIdMap.get(out.dataId).id; - var imagesShapeBytes = new Uint8Array(new Int32Array(images.shape).buffer); - wasmCropAndResize(imagesId, boxesId, boxIndId, numBoxes, imagesShapeBytes, cropHeight, cropWidth, InterpolationMethod[method], extrapolationValue, outId); - if (castedData != null) { - backend.disposeData(castedData.dataId); - } - return out; + const { backend, inputs, attrs } = args; + const { method, extrapolationValue, cropSize } = attrs; + const { images, boxes, boxInd } = inputs; + const numBoxes = boxes.shape[0]; + const [cropHeight, cropWidth] = cropSize; + const outShape = [numBoxes, cropHeight, cropWidth, images.shape[3]]; + let imagesData = backend.dataIdMap.get(images.dataId); + let castedData; + if (images.dtype !== 'float32') { + castedData = + cast({ backend, inputs: { x: images }, attrs: { dtype: 'float32' } }); + imagesData = backend.dataIdMap.get(castedData.dataId); + } + const imagesId = imagesData.id; + const boxesId = backend.dataIdMap.get(boxes.dataId).id; + const boxIndId = backend.dataIdMap.get(boxInd.dataId).id; + const out = backend.makeOutput(outShape, 'float32'); + const outId = backend.dataIdMap.get(out.dataId).id; + const imagesShapeBytes = new Uint8Array(new Int32Array(images.shape).buffer); + wasmCropAndResize(imagesId, boxesId, boxIndId, numBoxes, imagesShapeBytes, cropHeight, cropWidth, InterpolationMethod[method], extrapolationValue, outId); + if (castedData != null) { + backend.disposeData(castedData.dataId); + } + return out; } tfjsCore.registerKernel({ - kernelName: 'CropAndResize', - backendName: 'wasm', - setupFunc: setup$6, - kernelFunc: cropAndResize - }); - + kernelName: 'CropAndResize', + backendName: 'wasm', + setupFunc: setup$6, + kernelFunc: cropAndResize + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -874,71 +784,66 @@ * limitations under the License. * ============================================================================= */ - var wasmDepthwiseConv2d; - + let wasmDepthwiseConv2d; function setup$7(backend) { - wasmDepthwiseConv2d = - backend.wasm.cwrap('DepthwiseConv2dNative', null /* void */ , [ - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - ]); + wasmDepthwiseConv2d = + backend.wasm.cwrap('DepthwiseConv2dNative', null /* void */, [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + ]); } - function depthwiseConv2d(args) { - var inputs = args.inputs, - attrs = args.attrs, - backend = args.backend; - var convInfo = attrs; - var x = inputs.x, - filter = inputs.filter; - var xId = backend.dataIdMap.get(x.dataId).id; - var filterId = backend.dataIdMap.get(filter.dataId).id; - var filterHeight = convInfo.filterHeight; - var filterWidth = convInfo.filterWidth; - var padTop = convInfo.padInfo.top; - var padRight = convInfo.padInfo.right; - var padBottom = convInfo.padInfo.bottom; - var padLeft = convInfo.padInfo.left; - var dilationHeight = convInfo.dilationHeight; - var dilationWidth = convInfo.dilationWidth; - var strideHeight = convInfo.strideHeight; - var strideWidth = convInfo.strideWidth; - var inputChannels = convInfo.inChannels; - var outputChannels = convInfo.outChannels; - var isSamePad = convInfo.padInfo.type === 'SAME' ? 1 : 0; - if (convInfo.dataFormat !== 'channelsLast') { - throw new Error("wasm backend DepthwiseConv2dNative does not support dataFormat:'" + - (convInfo.dataFormat + "'. Please use 'channelsLast'.")); - } - var out = backend.makeOutput(convInfo.outShape, 'float32'); - var outId = backend.dataIdMap.get(out.dataId).id; - wasmDepthwiseConv2d(xId, x.shape[0], x.shape[1], x.shape[2], filterId, filterHeight, filterWidth, padTop, padRight, padBottom, padLeft, isSamePad, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, outId); - return out; + const { inputs, attrs, backend } = args; + const convInfo = attrs; + const { x, filter } = inputs; + const xId = backend.dataIdMap.get(x.dataId).id; + const filterId = backend.dataIdMap.get(filter.dataId).id; + const filterHeight = convInfo.filterHeight; + const filterWidth = convInfo.filterWidth; + const padTop = convInfo.padInfo.top; + const padRight = convInfo.padInfo.right; + const padBottom = convInfo.padInfo.bottom; + const padLeft = convInfo.padInfo.left; + const dilationHeight = convInfo.dilationHeight; + const dilationWidth = convInfo.dilationWidth; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const inputChannels = convInfo.inChannels; + const outputChannels = convInfo.outChannels; + const isSamePad = convInfo.padInfo.type === 'SAME' ? 1 : 0; + if (convInfo.dataFormat !== 'channelsLast') { + throw new Error(`wasm backend DepthwiseConv2dNative does not support dataFormat:'` + + `${convInfo.dataFormat}'. Please use 'channelsLast'.`); + } + const out = backend.makeOutput(convInfo.outShape, 'float32'); + const outId = backend.dataIdMap.get(out.dataId).id; + wasmDepthwiseConv2d(xId, x.shape[0], x.shape[1], x.shape[2], filterId, filterHeight, filterWidth, padTop, padRight, padBottom, padLeft, isSamePad, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'DepthwiseConv2dNative', - backendName: 'wasm', - setupFunc: setup$7, - kernelFunc: depthwiseConv2d - }); - + kernelName: 'DepthwiseConv2dNative', + backendName: 'wasm', + setupFunc: setup$7, + kernelFunc: depthwiseConv2d + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -955,9 +860,9 @@ * limitations under the License. * ============================================================================= */ - var supportsFullBroadcast$1 = false; - registerBinaryKernel('Div', supportsFullBroadcast$1); - + const supportsFullBroadcast$1 = false; + registerBinaryKernel('Div', supportsFullBroadcast$1); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -974,8 +879,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Exp'); - + registerUnaryKernel('Exp'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -992,9 +897,9 @@ * limitations under the License. * ============================================================================= */ - var supportsFullBroadcast$2 = false; - registerBinaryKernel('FloorDiv', supportsFullBroadcast$2); - + const supportsFullBroadcast$2 = false; + registerBinaryKernel('FloorDiv', supportsFullBroadcast$2); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1011,43 +916,35 @@ * limitations under the License. * ============================================================================= */ - var wasmBatchNorm; - + let wasmBatchNorm; function setup$8(backend) { - wasmBatchNorm = backend.wasm.cwrap('FusedBatchNorm', null /* void */ , ['number', 'number', 'number', 'number', 'number', 'number', 'number']); + wasmBatchNorm = backend.wasm.cwrap('FusedBatchNorm', null /* void */, ['number', 'number', 'number', 'number', 'number', 'number', 'number']); } - function fusedBatchNorm(args) { - var backend = args.backend, - inputs = args.inputs, - attrs = args.attrs; - var varianceEpsilon = attrs.varianceEpsilon; - var x = inputs.x, - mean = inputs.mean, - variance = inputs.variance, - offset = inputs.offset, - scale = inputs.scale; - var xId = backend.dataIdMap.get(x.dataId).id; - var meanId = backend.dataIdMap.get(mean.dataId).id; - var varianceId = backend.dataIdMap.get(variance.dataId).id; - var offsetId = offset != null ? backend.dataIdMap.get(offset.dataId).id : 0; - var scaleId = scale != null ? backend.dataIdMap.get(scale.dataId).id : 0; - var out = backend.makeOutput(x.shape, x.dtype); - // Short-circuit zero-sized tensors. - if (tfjsCore.util.sizeFromShape(x.shape) === 0) { + const { backend, inputs, attrs } = args; + const { varianceEpsilon } = attrs; + const { x, mean, variance, offset, scale } = inputs; + const xId = backend.dataIdMap.get(x.dataId).id; + const meanId = backend.dataIdMap.get(mean.dataId).id; + const varianceId = backend.dataIdMap.get(variance.dataId).id; + const offsetId = offset != null ? backend.dataIdMap.get(offset.dataId).id : 0; + const scaleId = scale != null ? backend.dataIdMap.get(scale.dataId).id : 0; + const out = backend.makeOutput(x.shape, x.dtype); + // Short-circuit zero-sized tensors. + if (tfjsCore.util.sizeFromShape(x.shape) === 0) { + return out; + } + const outId = backend.dataIdMap.get(out.dataId).id; + wasmBatchNorm(xId, meanId, varianceId, offsetId, scaleId, varianceEpsilon, outId); return out; - } - var outId = backend.dataIdMap.get(out.dataId).id; - wasmBatchNorm(xId, meanId, varianceId, offsetId, scaleId, varianceEpsilon, outId); - return out; } tfjsCore.registerKernel({ - kernelName: 'FusedBatchNorm', - backendName: 'wasm', - setupFunc: setup$8, - kernelFunc: fusedBatchNorm - }); - + kernelName: 'FusedBatchNorm', + backendName: 'wasm', + setupFunc: setup$8, + kernelFunc: fusedBatchNorm + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1064,100 +961,92 @@ * limitations under the License. * ============================================================================= */ - var wasmFusedConv2d; - + let wasmFusedConv2d; function setup$9(backend) { - wasmFusedConv2d = backend.wasm.cwrap('FusedConv2D', null /* void */ , [ - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - ]); + wasmFusedConv2d = backend.wasm.cwrap('FusedConv2D', null /* void */, [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + ]); } - function fusedConv2d(args) { - var inputs = args.inputs, - attrs = args.attrs, - backend = args.backend; - var convInfo = attrs.convInfo, - activation = attrs.activation; - var fusedActivation = FusableActivation[activation]; - if (fusedActivation == null) { - throw new Error(activation + " activation not yet supported for FusedConv2D " + - "in the wasm backend."); - } - var x = inputs.x, - filter = inputs.filter, - bias = inputs.bias, - preluActivationWeights = inputs.preluActivationWeights; - var xId = backend.dataIdMap.get(x.dataId).id; - var filterId = backend.dataIdMap.get(filter.dataId).id; - var outputChannels = convInfo.outChannels; - var biasId = 0; - if (bias != null) { - var biasData = backend.dataIdMap.get(bias.dataId); - if (biasData.shape.length !== 1) { - throw new Error("FusedConv2D only supports rank-1 bias but got " + - ("rank " + biasData.shape.length + ".")); + const { inputs, attrs, backend } = args; + const { convInfo, activation } = attrs; + const fusedActivation = FusableActivation[activation]; + if (fusedActivation == null) { + throw new Error(`${activation} activation not yet supported for FusedConv2D ` + + `in the wasm backend.`); } - if (biasData.shape[0] !== outputChannels) { - throw new Error("FusedConv2D bias shape (" + biasData.shape + ") does not " + - ("match the number of output channels (" + outputChannels + ")")); + const { x, filter, bias, preluActivationWeights } = inputs; + const xId = backend.dataIdMap.get(x.dataId).id; + const filterId = backend.dataIdMap.get(filter.dataId).id; + const outputChannels = convInfo.outChannels; + let biasId = 0; + if (bias != null) { + const biasData = backend.dataIdMap.get(bias.dataId); + if (biasData.shape.length !== 1) { + throw new Error(`FusedConv2D only supports rank-1 bias but got ` + + `rank ${biasData.shape.length}.`); + } + if (biasData.shape[0] !== outputChannels) { + throw new Error(`FusedConv2D bias shape (${biasData.shape}) does not ` + + `match the number of output channels (${outputChannels})`); + } + biasId = biasData.id; } - biasId = biasData.id; - } - var filterHeight = convInfo.filterHeight; - var filterWidth = convInfo.filterWidth; - var padTop = convInfo.padInfo.top; - var padRight = convInfo.padInfo.right; - var padBottom = convInfo.padInfo.bottom; - var padLeft = convInfo.padInfo.left; - var dilationHeight = convInfo.dilationHeight; - var dilationWidth = convInfo.dilationWidth; - var strideHeight = convInfo.strideHeight; - var strideWidth = convInfo.strideWidth; - var inputChannels = convInfo.inChannels; - var isSamePad = convInfo.padInfo.type === 'SAME' ? 1 : 0; - var batchSize = convInfo.batchSize; - var inHeight = convInfo.inHeight; - var inWidth = convInfo.inWidth; - if (convInfo.dataFormat !== 'channelsLast') { - throw new Error("wasm backend FusedConv2D does not support dataFormat:'" + - (convInfo.dataFormat + "'. Please use 'channelsLast'.")); - } - var out = backend.makeOutput(convInfo.outShape, 'float32'); - var outId = backend.dataIdMap.get(out.dataId).id; - var preluActivationWeightsId = preluActivationWeights == null ? - 0 : - backend.dataIdMap.get(preluActivationWeights.dataId).id; - wasmFusedConv2d(xId, batchSize, inHeight, inWidth, filterId, filterHeight, filterWidth, biasId, padTop, padRight, padBottom, padLeft, isSamePad, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, fusedActivation, preluActivationWeightsId, outId); - return out; + const filterHeight = convInfo.filterHeight; + const filterWidth = convInfo.filterWidth; + const padTop = convInfo.padInfo.top; + const padRight = convInfo.padInfo.right; + const padBottom = convInfo.padInfo.bottom; + const padLeft = convInfo.padInfo.left; + const dilationHeight = convInfo.dilationHeight; + const dilationWidth = convInfo.dilationWidth; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const inputChannels = convInfo.inChannels; + const isSamePad = convInfo.padInfo.type === 'SAME' ? 1 : 0; + const batchSize = convInfo.batchSize; + const inHeight = convInfo.inHeight; + const inWidth = convInfo.inWidth; + if (convInfo.dataFormat !== 'channelsLast') { + throw new Error(`wasm backend FusedConv2D does not support dataFormat:'` + + `${convInfo.dataFormat}'. Please use 'channelsLast'.`); + } + const out = backend.makeOutput(convInfo.outShape, 'float32'); + const outId = backend.dataIdMap.get(out.dataId).id; + const preluActivationWeightsId = preluActivationWeights == null ? + 0 : + backend.dataIdMap.get(preluActivationWeights.dataId).id; + wasmFusedConv2d(xId, batchSize, inHeight, inWidth, filterId, filterHeight, filterWidth, biasId, padTop, padRight, padBottom, padLeft, isSamePad, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, fusedActivation, preluActivationWeightsId, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'FusedConv2D', - backendName: 'wasm', - setupFunc: setup$9, - kernelFunc: fusedConv2d - }); - + kernelName: 'FusedConv2D', + backendName: 'wasm', + setupFunc: setup$9, + kernelFunc: fusedConv2d + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1174,101 +1063,93 @@ * limitations under the License. * ============================================================================= */ - var wasmFusedDepthwiseConv2d; - + let wasmFusedDepthwiseConv2d; function setup$a(backend) { - wasmFusedDepthwiseConv2d = - backend.wasm.cwrap('FusedDepthwiseConv2D', null /* void */ , [ - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - ]); + wasmFusedDepthwiseConv2d = + backend.wasm.cwrap('FusedDepthwiseConv2D', null /* void */, [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + ]); } - function fusedDepthwiseConv2d(args) { - var inputs = args.inputs, - attrs = args.attrs, - backend = args.backend; - var convInfo = attrs.convInfo, - activation = attrs.activation; - var fusedActivation = FusableActivation[activation]; - if (fusedActivation == null) { - throw new Error(activation + " activation not yet supported for FusedDepthwiseConv2D " + - "in the wasm backend."); - } - var x = inputs.x, - filter = inputs.filter, - bias = inputs.bias, - preluActivationWeights = inputs.preluActivationWeights; - var xId = backend.dataIdMap.get(x.dataId).id; - var filterId = backend.dataIdMap.get(filter.dataId).id; - var outputChannels = convInfo.outChannels; - var biasId = 0; - if (bias != null) { - var biasData = backend.dataIdMap.get(bias.dataId); - if (biasData.shape.length !== 1) { - throw new Error("FusedDepthwiseConv2D only supports rank-1 bias but got " + - ("rank " + biasData.shape.length + ".")); + const { inputs, attrs, backend } = args; + const { convInfo, activation } = attrs; + const fusedActivation = FusableActivation[activation]; + if (fusedActivation == null) { + throw new Error(`${activation} activation not yet supported for FusedDepthwiseConv2D ` + + `in the wasm backend.`); } - if (biasData.shape[0] !== outputChannels) { - throw new Error("FusedDepthwiseConv2D bias shape (" + biasData.shape + ") does not " + - ("match the number of output channels (" + outputChannels + ")")); + const { x, filter, bias, preluActivationWeights } = inputs; + const xId = backend.dataIdMap.get(x.dataId).id; + const filterId = backend.dataIdMap.get(filter.dataId).id; + const outputChannels = convInfo.outChannels; + let biasId = 0; + if (bias != null) { + const biasData = backend.dataIdMap.get(bias.dataId); + if (biasData.shape.length !== 1) { + throw new Error(`FusedDepthwiseConv2D only supports rank-1 bias but got ` + + `rank ${biasData.shape.length}.`); + } + if (biasData.shape[0] !== outputChannels) { + throw new Error(`FusedDepthwiseConv2D bias shape (${biasData.shape}) does not ` + + `match the number of output channels (${outputChannels})`); + } + biasId = biasData.id; } - biasId = biasData.id; - } - var filterHeight = convInfo.filterHeight; - var filterWidth = convInfo.filterWidth; - var padTop = convInfo.padInfo.top; - var padRight = convInfo.padInfo.right; - var padBottom = convInfo.padInfo.bottom; - var padLeft = convInfo.padInfo.left; - var dilationHeight = convInfo.dilationHeight; - var dilationWidth = convInfo.dilationWidth; - var strideHeight = convInfo.strideHeight; - var strideWidth = convInfo.strideWidth; - var inputChannels = convInfo.inChannels; - var isSamePad = convInfo.padInfo.type === 'SAME' ? 1 : 0; - var batchSize = convInfo.batchSize; - var inHeight = convInfo.inHeight; - var inWidth = convInfo.inWidth; - if (convInfo.dataFormat !== 'channelsLast') { - throw new Error("wasm backend FusedDepthwiseConv2D does not support dataFormat:'" + - (convInfo.dataFormat + "'. Please use 'channelsLast'.")); - } - var out = backend.makeOutput(convInfo.outShape, 'float32'); - var outId = backend.dataIdMap.get(out.dataId).id; - var preluActivationWeightsId = preluActivationWeights == null ? - 0 : - backend.dataIdMap.get(preluActivationWeights.dataId).id; - wasmFusedDepthwiseConv2d(xId, batchSize, inHeight, inWidth, filterId, filterHeight, filterWidth, biasId, padTop, padRight, padBottom, padLeft, isSamePad, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, fusedActivation, preluActivationWeightsId, outId); - return out; + const filterHeight = convInfo.filterHeight; + const filterWidth = convInfo.filterWidth; + const padTop = convInfo.padInfo.top; + const padRight = convInfo.padInfo.right; + const padBottom = convInfo.padInfo.bottom; + const padLeft = convInfo.padInfo.left; + const dilationHeight = convInfo.dilationHeight; + const dilationWidth = convInfo.dilationWidth; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const inputChannels = convInfo.inChannels; + const isSamePad = convInfo.padInfo.type === 'SAME' ? 1 : 0; + const batchSize = convInfo.batchSize; + const inHeight = convInfo.inHeight; + const inWidth = convInfo.inWidth; + if (convInfo.dataFormat !== 'channelsLast') { + throw new Error(`wasm backend FusedDepthwiseConv2D does not support dataFormat:'` + + `${convInfo.dataFormat}'. Please use 'channelsLast'.`); + } + const out = backend.makeOutput(convInfo.outShape, 'float32'); + const outId = backend.dataIdMap.get(out.dataId).id; + const preluActivationWeightsId = preluActivationWeights == null ? + 0 : + backend.dataIdMap.get(preluActivationWeights.dataId).id; + wasmFusedDepthwiseConv2d(xId, batchSize, inHeight, inWidth, filterId, filterHeight, filterWidth, biasId, padTop, padRight, padBottom, padLeft, isSamePad, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, fusedActivation, preluActivationWeightsId, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'FusedDepthwiseConv2D', - backendName: 'wasm', - setupFunc: setup$a, - kernelFunc: fusedDepthwiseConv2d - }); - + kernelName: 'FusedDepthwiseConv2D', + backendName: 'wasm', + setupFunc: setup$a, + kernelFunc: fusedDepthwiseConv2d + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1285,52 +1166,47 @@ * limitations under the License. * ============================================================================= */ - var wasmGather; - + let wasmGather; function setup$b(backend) { - wasmGather = backend.wasm.cwrap('Gather', null /*void*/ , [ - 'number', - 'number', - 'array', - 'number', - 'number', - 'number', - 'array', - 'number' // outId - ]); + wasmGather = backend.wasm.cwrap('Gather', null /*void*/, [ + 'number', + 'number', + 'array', + 'number', + 'number', + 'number', + 'array', + 'number' // outId + ]); } - function gather(args) { - var backend = args.backend, - inputs = args.inputs, - attrs = args.attrs; - var x = inputs.x, - indices = inputs.indices; - var axis = attrs.axis; - var newShape = x.shape.slice(); - newShape[axis] = tfjsCore.util.sizeFromShape(indices.shape); - var stridesSize = x.shape.length - 1; - var out = backend.makeOutput(newShape, x.dtype); - if (tfjsCore.util.sizeFromShape(x.shape) === 0) { + const { backend, inputs, attrs } = args; + const { x, indices } = inputs; + const { axis } = attrs; + const newShape = x.shape.slice(); + newShape[axis] = tfjsCore.util.sizeFromShape(indices.shape); + const stridesSize = x.shape.length - 1; + const out = backend.makeOutput(newShape, x.dtype); + if (tfjsCore.util.sizeFromShape(x.shape) === 0) { + return out; + } + const xData = backend.dataIdMap.get(x.dataId); + const xId = xData.id; + const indicesData = backend.dataIdMap.get(indices.dataId); + const indicesId = indicesData.id; + const outId = backend.dataIdMap.get(out.dataId).id; + const xStridesBytes = new Uint8Array(new Int32Array(tfjsCore.util.computeStrides(x.shape)).buffer); + const outStridesBytes = new Uint8Array(new Int32Array(tfjsCore.util.computeStrides(newShape)).buffer); + wasmGather(xId, CppDType[x.dtype], xStridesBytes, stridesSize, indicesId, axis, outStridesBytes, outId); return out; - } - var xData = backend.dataIdMap.get(x.dataId); - var xId = xData.id; - var indicesData = backend.dataIdMap.get(indices.dataId); - var indicesId = indicesData.id; - var outId = backend.dataIdMap.get(out.dataId).id; - var xStridesBytes = new Uint8Array(new Int32Array(tfjsCore.util.computeStrides(x.shape)).buffer); - var outStridesBytes = new Uint8Array(new Int32Array(tfjsCore.util.computeStrides(newShape)).buffer); - wasmGather(xId, CppDType[x.dtype], xStridesBytes, stridesSize, indicesId, axis, outStridesBytes, outId); - return out; } tfjsCore.registerKernel({ - kernelName: 'Gather', - backendName: 'wasm', - setupFunc: setup$b, - kernelFunc: gather - }); - + kernelName: 'Gather', + backendName: 'wasm', + setupFunc: setup$b, + kernelFunc: gather + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1347,53 +1223,45 @@ * limitations under the License. * ============================================================================= */ - var wasmGatherNd; - + let wasmGatherNd; function setup$c(backend) { - wasmGatherNd = backend.wasm.cwrap('GatherNd', null /*void*/ , [ - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'array', - 'number' // outId - ]); + wasmGatherNd = backend.wasm.cwrap('GatherNd', null /*void*/, [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'array', + 'number' // outId + ]); } - function gatherNd(args) { - var backend = args.backend, - inputs = args.inputs; - var x = inputs.x, - indices = inputs.indices; - var _a = tfjsCore.gather_util.prepareAndValidate(x, indices), - resultShape = _a[0], - numSlices = _a[1], - sliceSize = _a[2], - strides = _a[3]; - var out = backend.makeOutput(resultShape, x.dtype); - if (numSlices === 0) { + const { backend, inputs } = args; + const { x, indices } = inputs; + const [resultShape, numSlices, sliceSize, strides] = tfjsCore.gather_util.prepareAndValidate(x, indices); + const out = backend.makeOutput(resultShape, x.dtype); + if (numSlices === 0) { + return out; + } + const indicesShape = indices.shape; + const sliceRank = indicesShape[indicesShape.length - 1]; + const xData = backend.dataIdMap.get(x.dataId); + const xId = xData.id; + const indicesData = backend.dataIdMap.get(indices.dataId); + const indicesId = indicesData.id; + const stridesBytes = new Uint8Array(new Int32Array(strides).buffer); + const outId = backend.dataIdMap.get(out.dataId).id; + wasmGatherNd(xId, CppDType[x.dtype], indicesId, numSlices, sliceRank, sliceSize, stridesBytes, outId); return out; - } - var indicesShape = indices.shape; - var sliceRank = indicesShape[indicesShape.length - 1]; - var xData = backend.dataIdMap.get(x.dataId); - var xId = xData.id; - var indicesData = backend.dataIdMap.get(indices.dataId); - var indicesId = indicesData.id; - var stridesBytes = new Uint8Array(new Int32Array(strides).buffer); - var outId = backend.dataIdMap.get(out.dataId).id; - wasmGatherNd(xId, CppDType[x.dtype], indicesId, numSlices, sliceRank, sliceSize, stridesBytes, outId); - return out; } tfjsCore.registerKernel({ - kernelName: 'GatherNd', - backendName: 'wasm', - setupFunc: setup$c, - kernelFunc: gatherNd - }); - + kernelName: 'GatherNd', + backendName: 'wasm', + setupFunc: setup$c, + kernelFunc: gatherNd + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1410,9 +1278,9 @@ * limitations under the License. * ============================================================================= */ - var supportsFullBroadcast$3 = false; - registerBinaryKernel('Greater', supportsFullBroadcast$3, 'bool'); - + const supportsFullBroadcast$3 = false; + registerBinaryKernel('Greater', supportsFullBroadcast$3, 'bool'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1429,9 +1297,9 @@ * limitations under the License. * ============================================================================= */ - var supportsFullBroadcast$4 = false; - registerBinaryKernel('GreaterEqual', supportsFullBroadcast$4, 'bool'); - + const supportsFullBroadcast$4 = false; + registerBinaryKernel('GreaterEqual', supportsFullBroadcast$4, 'bool'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1448,9 +1316,9 @@ * limitations under the License. * ============================================================================= */ - var supportsFullBroadcast$5 = false; - registerBinaryKernel('Less', supportsFullBroadcast$5, 'bool'); - + const supportsFullBroadcast$5 = false; + registerBinaryKernel('Less', supportsFullBroadcast$5, 'bool'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1467,9 +1335,9 @@ * limitations under the License. * ============================================================================= */ - var supportsFullBroadcast$6 = false; - registerBinaryKernel('LessEqual', supportsFullBroadcast$6, 'bool'); - + const supportsFullBroadcast$6 = false; + registerBinaryKernel('LessEqual', supportsFullBroadcast$6, 'bool'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1486,8 +1354,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Log'); - + registerUnaryKernel('Log'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1504,9 +1372,9 @@ * limitations under the License. * ============================================================================= */ - var supportsFullBroadcast$7 = false; - registerBinaryKernel('LogicalAnd', supportsFullBroadcast$7, 'bool'); - + const supportsFullBroadcast$7 = false; + registerBinaryKernel('LogicalAnd', supportsFullBroadcast$7, 'bool'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1523,40 +1391,34 @@ * limitations under the License. * ============================================================================= */ - var wasmMax; - + let wasmMax; function setup$d(backend) { - wasmMax = - backend.wasm.cwrap('Max', null /*void*/ , ['number, number, number']); + wasmMax = + backend.wasm.cwrap('Max', null /*void*/, ['number, number, number']); } - function max(args) { - var backend = args.backend, - inputs = args.inputs, - attrs = args.attrs; - var axes = attrs.axes; - var x = inputs.x; - var xId = backend.dataIdMap.get(x.dataId).id; - tfjsCore.backend_util.assertAxesAreInnerMostDims('max', axes, x.shape.length); - var _a = tfjsCore.backend_util.computeOutAndReduceShapes(x.shape, axes), - outShape = _a[0], - reduceShape = _a[1]; - var reduceSize = tfjsCore.util.sizeFromShape(reduceShape); - var out = backend.makeOutput(outShape, x.dtype); - if (tfjsCore.util.sizeFromShape(x.shape) === 0) { + const { backend, inputs, attrs } = args; + const { axes } = attrs; + const { x } = inputs; + const xId = backend.dataIdMap.get(x.dataId).id; + tfjsCore.backend_util.assertAxesAreInnerMostDims('max', axes, x.shape.length); + const [outShape, reduceShape] = tfjsCore.backend_util.computeOutAndReduceShapes(x.shape, axes); + const reduceSize = tfjsCore.util.sizeFromShape(reduceShape); + const out = backend.makeOutput(outShape, x.dtype); + if (tfjsCore.util.sizeFromShape(x.shape) === 0) { + return out; + } + const outId = backend.dataIdMap.get(out.dataId).id; + wasmMax(xId, reduceSize, outId); return out; - } - var outId = backend.dataIdMap.get(out.dataId).id; - wasmMax(xId, reduceSize, outId); - return out; } tfjsCore.registerKernel({ - kernelName: 'Max', - backendName: 'wasm', - setupFunc: setup$d, - kernelFunc: max - }); - + kernelName: 'Max', + backendName: 'wasm', + setupFunc: setup$d, + kernelFunc: max + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1573,9 +1435,9 @@ * limitations under the License. * ============================================================================= */ - var supportsFullBroadcast$8 = false; - registerBinaryKernel('Maximum', supportsFullBroadcast$8); - + const supportsFullBroadcast$8 = false; + registerBinaryKernel('Maximum', supportsFullBroadcast$8); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1592,65 +1454,61 @@ * limitations under the License. * ============================================================================= */ - var wasmMaxPool; - + let wasmMaxPool; function setup$e(backend) { - wasmMaxPool = backend.wasm.cwrap('MaxPool', null /* void */ , [ - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - ]); + wasmMaxPool = backend.wasm.cwrap('MaxPool', null /* void */, [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + ]); } - function maxPool(args) { - var inputs = args.inputs, - attrs = args.attrs, - backend = args.backend; - var convInfo = attrs; - var x = inputs.x; - var xId = backend.dataIdMap.get(x.dataId).id; - var filterHeight = convInfo.filterHeight; - var filterWidth = convInfo.filterWidth; - var padTop = convInfo.padInfo.top; - var padRight = convInfo.padInfo.right; - var padBottom = convInfo.padInfo.bottom; - var padLeft = convInfo.padInfo.left; - var dilationHeight = convInfo.dilationHeight; - var dilationWidth = convInfo.dilationWidth; - var strideHeight = convInfo.strideHeight; - var strideWidth = convInfo.strideWidth; - var inputChannels = convInfo.inChannels; - var outputChannels = convInfo.outChannels; - if (convInfo.dataFormat !== 'channelsLast') { - throw new Error("wasm backend does not support dataFormat:'" + - (convInfo.dataFormat + "'. Please use 'channelsLast'.")); - } - var out = backend.makeOutput(convInfo.outShape, 'float32'); - var outId = backend.dataIdMap.get(out.dataId).id; - wasmMaxPool(xId, x.shape[0], x.shape[1], x.shape[2], filterHeight, filterWidth, padTop, padRight, padBottom, padLeft, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, outId); - return out; + const { inputs, attrs, backend } = args; + const convInfo = attrs; + const { x } = inputs; + const xId = backend.dataIdMap.get(x.dataId).id; + const filterHeight = convInfo.filterHeight; + const filterWidth = convInfo.filterWidth; + const padTop = convInfo.padInfo.top; + const padRight = convInfo.padInfo.right; + const padBottom = convInfo.padInfo.bottom; + const padLeft = convInfo.padInfo.left; + const dilationHeight = convInfo.dilationHeight; + const dilationWidth = convInfo.dilationWidth; + const strideHeight = convInfo.strideHeight; + const strideWidth = convInfo.strideWidth; + const inputChannels = convInfo.inChannels; + const outputChannels = convInfo.outChannels; + if (convInfo.dataFormat !== 'channelsLast') { + throw new Error(`wasm backend does not support dataFormat:'` + + `${convInfo.dataFormat}'. Please use 'channelsLast'.`); + } + const out = backend.makeOutput(convInfo.outShape, 'float32'); + const outId = backend.dataIdMap.get(out.dataId).id; + wasmMaxPool(xId, x.shape[0], x.shape[1], x.shape[2], filterHeight, filterWidth, padTop, padRight, padBottom, padLeft, dilationHeight, dilationWidth, strideHeight, strideWidth, inputChannels, outputChannels, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'MaxPool', - backendName: 'wasm', - setupFunc: setup$e, - kernelFunc: maxPool - }); - + kernelName: 'MaxPool', + backendName: 'wasm', + setupFunc: setup$e, + kernelFunc: maxPool + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1667,40 +1525,34 @@ * limitations under the License. * ============================================================================= */ - var wasmMin; - + let wasmMin; function setup$f(backend) { - wasmMin = - backend.wasm.cwrap('Min', null /*void*/ , ['number, number, number']); + wasmMin = + backend.wasm.cwrap('Min', null /*void*/, ['number, number, number']); } - function min(args) { - var backend = args.backend, - inputs = args.inputs, - attrs = args.attrs; - var axes = attrs.axes; - var x = inputs.x; - var xId = backend.dataIdMap.get(x.dataId).id; - tfjsCore.backend_util.assertAxesAreInnerMostDims('min', axes, x.shape.length); - var _a = tfjsCore.backend_util.computeOutAndReduceShapes(x.shape, axes), - outShape = _a[0], - reduceShape = _a[1]; - var reduceSize = tfjsCore.util.sizeFromShape(reduceShape); - var out = backend.makeOutput(outShape, x.dtype); - if (tfjsCore.util.sizeFromShape(x.shape) === 0) { + const { backend, inputs, attrs } = args; + const { axes } = attrs; + const { x } = inputs; + const xId = backend.dataIdMap.get(x.dataId).id; + tfjsCore.backend_util.assertAxesAreInnerMostDims('min', axes, x.shape.length); + const [outShape, reduceShape] = tfjsCore.backend_util.computeOutAndReduceShapes(x.shape, axes); + const reduceSize = tfjsCore.util.sizeFromShape(reduceShape); + const out = backend.makeOutput(outShape, x.dtype); + if (tfjsCore.util.sizeFromShape(x.shape) === 0) { + return out; + } + const outId = backend.dataIdMap.get(out.dataId).id; + wasmMin(xId, reduceSize, outId); return out; - } - var outId = backend.dataIdMap.get(out.dataId).id; - wasmMin(xId, reduceSize, outId); - return out; } tfjsCore.registerKernel({ - kernelName: 'Min', - backendName: 'wasm', - setupFunc: setup$f, - kernelFunc: min - }); - + kernelName: 'Min', + backendName: 'wasm', + setupFunc: setup$f, + kernelFunc: min + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1717,9 +1569,9 @@ * limitations under the License. * ============================================================================= */ - var supportsFullBroadcast$9 = false; - registerBinaryKernel('Minimum', supportsFullBroadcast$9); - + const supportsFullBroadcast$9 = false; + registerBinaryKernel('Minimum', supportsFullBroadcast$9); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1736,9 +1588,9 @@ * limitations under the License. * ============================================================================= */ - var supportsFullBroadcast$a = true; - registerBinaryKernel('Mul', supportsFullBroadcast$a); - + const supportsFullBroadcast$a = true; + registerBinaryKernel('Mul', supportsFullBroadcast$a); + /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -1755,8 +1607,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Neg'); - + registerUnaryKernel('Neg'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1778,19 +1630,15 @@ * `Result`. */ function parseResultStruct(backend, resOffset) { - var result = new Int32Array(backend.wasm.HEAPU8.buffer, resOffset, 3); - var pSelectedIndices = result[0]; - var selectedSize = result[1]; - var pSelectedScores = result[2]; - // Since the result was allocated on the heap, we have to delete it. - backend.wasm._free(resOffset); - return { - pSelectedIndices: pSelectedIndices, - selectedSize: selectedSize, - pSelectedScores: pSelectedScores - }; - } - + const result = new Int32Array(backend.wasm.HEAPU8.buffer, resOffset, 3); + const pSelectedIndices = result[0]; + const selectedSize = result[1]; + const pSelectedScores = result[2]; + // Since the result was allocated on the heap, we have to delete it. + backend.wasm._free(resOffset); + return { pSelectedIndices, selectedSize, pSelectedScores }; + } + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1807,47 +1655,37 @@ * limitations under the License. * ============================================================================= */ - var wasmFunc$2; - + let wasmFunc$2; function setup$g(backend) { - wasmFunc$2 = backend.wasm.cwrap('NonMaxSuppressionV3', 'number', // Result* + wasmFunc$2 = backend.wasm.cwrap('NonMaxSuppressionV3', 'number', // Result* [ - 'number', - 'number', - 'number', - 'number', - 'number', + 'number', + 'number', + 'number', + 'number', + 'number', ]); } - function kernelFunc(args) { - var backend = args.backend, - inputs = args.inputs, - attrs = args.attrs; - var iouThreshold = attrs.iouThreshold, - maxOutputSize = attrs.maxOutputSize, - scoreThreshold = attrs.scoreThreshold; - var boxes = inputs.boxes, - scores = inputs.scores; - var boxesId = backend.dataIdMap.get(boxes.dataId).id; - var scoresId = backend.dataIdMap.get(scores.dataId).id; - var resOffset = wasmFunc$2(boxesId, scoresId, maxOutputSize, iouThreshold, scoreThreshold); - var _a = parseResultStruct(backend, resOffset), - pSelectedIndices = _a.pSelectedIndices, - selectedSize = _a.selectedSize, - pSelectedScores = _a.pSelectedScores; - // Since we are not using scores for V3, we have to delete it from the heap. - backend.wasm._free(pSelectedScores); - var selectedIndicesTensor = backend.makeOutput([selectedSize], 'int32', pSelectedIndices); - return selectedIndicesTensor; + const { backend, inputs, attrs } = args; + const { iouThreshold, maxOutputSize, scoreThreshold } = attrs; + const { boxes, scores } = inputs; + const boxesId = backend.dataIdMap.get(boxes.dataId).id; + const scoresId = backend.dataIdMap.get(scores.dataId).id; + const resOffset = wasmFunc$2(boxesId, scoresId, maxOutputSize, iouThreshold, scoreThreshold); + const { pSelectedIndices, selectedSize, pSelectedScores } = parseResultStruct(backend, resOffset); + // Since we are not using scores for V3, we have to delete it from the heap. + backend.wasm._free(pSelectedScores); + const selectedIndicesTensor = backend.makeOutput([selectedSize], 'int32', pSelectedIndices); + return selectedIndicesTensor; } tfjsCore.registerKernel({ - kernelName: 'NonMaxSuppressionV3', - backendName: 'wasm', - setupFunc: setup$g, - kernelFunc: kernelFunc, - }); - + kernelName: 'NonMaxSuppressionV3', + backendName: 'wasm', + setupFunc: setup$g, + kernelFunc, + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1864,48 +1702,37 @@ * limitations under the License. * ============================================================================= */ - var wasmFunc$3; - + let wasmFunc$3; function setup$h(backend) { - wasmFunc$3 = backend.wasm.cwrap('NonMaxSuppressionV5', 'number', // Result* + wasmFunc$3 = backend.wasm.cwrap('NonMaxSuppressionV5', 'number', // Result* [ - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', ]); } - function kernelFunc$1(args) { - var backend = args.backend, - inputs = args.inputs, - attrs = args.attrs; - var iouThreshold = attrs.iouThreshold, - maxOutputSize = attrs.maxOutputSize, - scoreThreshold = attrs.scoreThreshold, - softNmsSigma = attrs.softNmsSigma; - var boxes = inputs.boxes, - scores = inputs.scores; - var boxesId = backend.dataIdMap.get(boxes.dataId).id; - var scoresId = backend.dataIdMap.get(scores.dataId).id; - var resOffset = wasmFunc$3(boxesId, scoresId, maxOutputSize, iouThreshold, scoreThreshold, softNmsSigma); - var _a = parseResultStruct(backend, resOffset), - pSelectedIndices = _a.pSelectedIndices, - selectedSize = _a.selectedSize, - pSelectedScores = _a.pSelectedScores; - var selectedIndicesTensor = backend.makeOutput([selectedSize], 'int32', pSelectedIndices); - var selectedScoresTensor = backend.makeOutput([selectedSize], 'float32', pSelectedScores); - return [selectedIndicesTensor, selectedScoresTensor]; + const { backend, inputs, attrs } = args; + const { iouThreshold, maxOutputSize, scoreThreshold, softNmsSigma } = attrs; + const { boxes, scores } = inputs; + const boxesId = backend.dataIdMap.get(boxes.dataId).id; + const scoresId = backend.dataIdMap.get(scores.dataId).id; + const resOffset = wasmFunc$3(boxesId, scoresId, maxOutputSize, iouThreshold, scoreThreshold, softNmsSigma); + const { pSelectedIndices, selectedSize, pSelectedScores, } = parseResultStruct(backend, resOffset); + const selectedIndicesTensor = backend.makeOutput([selectedSize], 'int32', pSelectedIndices); + const selectedScoresTensor = backend.makeOutput([selectedSize], 'float32', pSelectedScores); + return [selectedIndicesTensor, selectedScoresTensor]; } tfjsCore.registerKernel({ - kernelName: 'NonMaxSuppressionV5', - backendName: 'wasm', - setupFunc: setup$h, - kernelFunc: kernelFunc$1, - }); - + kernelName: 'NonMaxSuppressionV5', + backendName: 'wasm', + setupFunc: setup$h, + kernelFunc: kernelFunc$1, + }); + /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -1922,9 +1749,9 @@ * limitations under the License. * ============================================================================= */ - var supportsFullBroadcast$b = false; - registerBinaryKernel('NotEqual', supportsFullBroadcast$b, 'bool'); - + const supportsFullBroadcast$b = false; + registerBinaryKernel('NotEqual', supportsFullBroadcast$b, 'bool'); + /** * @license * Copyright 2020 Google Inc. All Rights Reserved. @@ -1942,19 +1769,18 @@ * ============================================================================= */ function onesLike(args) { - var x = args.inputs.x, - backend = args.backend; - var out = backend.makeOutput(x.shape, x.dtype); - var outVals = backend.typedArrayFromHeap(out); - outVals.fill(1); - return out; + const { inputs: { x }, backend } = args; + const out = backend.makeOutput(x.shape, x.dtype); + const outVals = backend.typedArrayFromHeap(out); + outVals.fill(1); + return out; } tfjsCore.registerKernel({ - kernelName: 'OnesLike', - backendName: 'wasm', - kernelFunc: onesLike, - }); - + kernelName: 'OnesLike', + backendName: 'wasm', + kernelFunc: onesLike, + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1971,45 +1797,37 @@ * limitations under the License. * ============================================================================= */ - var wasmPadV2; - + let wasmPadV2; function setup$i(backend) { - wasmPadV2 = backend.wasm.cwrap('PadV2', null /* void */ , [ - 'number', - 'array', - 'number', - 'number', - 'array', - 'number', - 'number', - ]); + wasmPadV2 = backend.wasm.cwrap('PadV2', null /* void */, [ + 'number', + 'array', + 'number', + 'number', + 'array', + 'number', + 'number', + ]); } - function pad(args) { - var x = args.inputs.x, - backend = args.backend, - _a = args.attrs, - paddings = _a.paddings, - constantValue = _a.constantValue; - var outShape = paddings.map(function (p, i) { - return p[0] /* beforePad */ + x.shape[i] + p[1]; - } /* afterPad */ ); - var xId = backend.dataIdMap.get(x.dataId).id; - var out = backend.makeOutput(outShape, x.dtype); - var outId = backend.dataIdMap.get(out.dataId).id; - var xShapeBytes = new Uint8Array(new Int32Array(x.shape).buffer); - var paddingsFlat = [].concat.apply([], paddings); - var paddingsBytes = new Uint8Array(new Int32Array(paddingsFlat).buffer); - wasmPadV2(xId, xShapeBytes, x.shape.length, CppDType[x.dtype], paddingsBytes, constantValue, outId); - return out; + const { inputs: { x }, backend, attrs: { paddings, constantValue } } = args; + const outShape = paddings.map((p, i) => p[0] /* beforePad */ + x.shape[i] + p[1] /* afterPad */); + const xId = backend.dataIdMap.get(x.dataId).id; + const out = backend.makeOutput(outShape, x.dtype); + const outId = backend.dataIdMap.get(out.dataId).id; + const xShapeBytes = new Uint8Array(new Int32Array(x.shape).buffer); + const paddingsFlat = [].concat(...paddings); + const paddingsBytes = new Uint8Array(new Int32Array(paddingsFlat).buffer); + wasmPadV2(xId, xShapeBytes, x.shape.length, CppDType[x.dtype], paddingsBytes, constantValue, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'PadV2', - backendName: 'wasm', - kernelFunc: pad, - setupFunc: setup$i - }); - + kernelName: 'PadV2', + backendName: 'wasm', + kernelFunc: pad, + setupFunc: setup$i + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2026,9 +1844,9 @@ * limitations under the License. * ============================================================================= */ - var supportsFullBroadcast$c = false; - registerBinaryKernel('Pow', supportsFullBroadcast$c); - + const supportsFullBroadcast$c = false; + registerBinaryKernel('Pow', supportsFullBroadcast$c); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2045,35 +1863,31 @@ * limitations under the License. * ============================================================================= */ - var wasmPrelu; - + let wasmPrelu; function setup$j(backend) { - wasmPrelu = backend.wasm.cwrap('Prelu', null /* void */ , [ - 'number', - 'number', - 'number' // out_id - ]); + wasmPrelu = backend.wasm.cwrap('Prelu', null /* void */, [ + 'number', + 'number', + 'number' // out_id + ]); } - function prelu(args) { - var inputs = args.inputs, - backend = args.backend; - var x = inputs.x, - alpha = inputs.alpha; - var xId = backend.dataIdMap.get(x.dataId).id; - var weightsId = backend.dataIdMap.get(alpha.dataId).id; - var out = backend.makeOutput(x.shape, 'float32'); - var outId = backend.dataIdMap.get(out.dataId).id; - wasmPrelu(xId, weightsId, outId); - return out; + const { inputs, backend } = args; + const { x, alpha } = inputs; + const xId = backend.dataIdMap.get(x.dataId).id; + const weightsId = backend.dataIdMap.get(alpha.dataId).id; + const out = backend.makeOutput(x.shape, 'float32'); + const outId = backend.dataIdMap.get(out.dataId).id; + wasmPrelu(xId, weightsId, outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'Prelu', - backendName: 'wasm', - setupFunc: setup$j, - kernelFunc: prelu - }); - + kernelName: 'Prelu', + backendName: 'wasm', + setupFunc: setup$j, + kernelFunc: prelu + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2090,8 +1904,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Relu'); - + registerUnaryKernel('Relu'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2108,8 +1922,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Relu6'); - + registerUnaryKernel('Relu6'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2127,20 +1941,15 @@ * ============================================================================= */ function reshape(args) { - var x = args.inputs.x, - shape = args.attrs.shape; - return { - dataId: x.dataId, - shape: shape, - dtype: x.dtype - }; + const { inputs: { x }, attrs: { shape } } = args; + return { dataId: x.dataId, shape, dtype: x.dtype }; } tfjsCore.registerKernel({ - kernelName: 'Reshape', - backendName: 'wasm', - kernelFunc: reshape, - }); - + kernelName: 'Reshape', + backendName: 'wasm', + kernelFunc: reshape, + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2157,69 +1966,51 @@ * limitations under the License. * ============================================================================= */ - var wasmResizeBilinear; - + let wasmResizeBilinear; function setup$k(backend) { - wasmResizeBilinear = backend.wasm.cwrap('ResizeBilinear', null /*void*/ , [ - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'number' // outId - ]); + wasmResizeBilinear = backend.wasm.cwrap('ResizeBilinear', null /*void*/, [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'number' // outId + ]); } - function resizeBilinear(args) { - var backend = args.backend, - inputs = args.inputs, - attrs = args.attrs; - var x = inputs.x; - var alignCorners = attrs.alignCorners, - newHeight = attrs.newHeight, - newWidth = attrs.newWidth; - var _a = x.shape, - batch = _a[0], - oldHeight = _a[1], - oldWidth = _a[2], - numChannels = _a[3]; - var outShape = [batch, newHeight, newWidth, numChannels]; - var xData = backend.dataIdMap.get(x.dataId); - var castedData; - if (xData.dtype !== 'float32') { - castedData = cast({ - backend: backend, - inputs: { - x: x - }, - attrs: { - dtype: 'float32' - } - }); - xData = backend.dataIdMap.get(castedData.dataId); - } - var xId = xData.id; - var out = backend.makeOutput(outShape, 'float32'); - if (tfjsCore.util.sizeFromShape(x.shape) === 0) { + const { backend, inputs, attrs } = args; + const { x } = inputs; + const { alignCorners, newHeight, newWidth } = attrs; + const [batch, oldHeight, oldWidth, numChannels] = x.shape; + const outShape = [batch, newHeight, newWidth, numChannels]; + let xData = backend.dataIdMap.get(x.dataId); + let castedData; + if (xData.dtype !== 'float32') { + castedData = cast({ backend, inputs: { x }, attrs: { dtype: 'float32' } }); + xData = backend.dataIdMap.get(castedData.dataId); + } + const xId = xData.id; + const out = backend.makeOutput(outShape, 'float32'); + if (tfjsCore.util.sizeFromShape(x.shape) === 0) { + return out; + } + const outId = backend.dataIdMap.get(out.dataId).id; + wasmResizeBilinear(xId, batch, oldHeight, oldWidth, numChannels, newHeight, newWidth, alignCorners ? 1 : 0, outId); + if (castedData != null) { + backend.disposeData(castedData.dataId); + } return out; - } - var outId = backend.dataIdMap.get(out.dataId).id; - wasmResizeBilinear(xId, batch, oldHeight, oldWidth, numChannels, newHeight, newWidth, alignCorners ? 1 : 0, outId); - if (castedData != null) { - backend.disposeData(castedData.dataId); - } - return out; } tfjsCore.registerKernel({ - kernelName: 'ResizeBilinear', - backendName: 'wasm', - setupFunc: setup$k, - kernelFunc: resizeBilinear - }); - + kernelName: 'ResizeBilinear', + backendName: 'wasm', + setupFunc: setup$k, + kernelFunc: resizeBilinear + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2236,8 +2027,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Rsqrt'); - + registerUnaryKernel('Rsqrt'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2254,55 +2045,45 @@ * limitations under the License. * ============================================================================= */ - var wasmScatterNd; - + let wasmScatterNd; function setup$l(backend) { - wasmScatterNd = backend.wasm.cwrap('ScatterNd', null /*void*/ , [ - 'number', - 'number', - 'number', - 'number', - 'number', - 'number', - 'array', - 'number', - 'number' // outId - ]); + wasmScatterNd = backend.wasm.cwrap('ScatterNd', null /*void*/, [ + 'number', + 'number', + 'number', + 'number', + 'number', + 'number', + 'array', + 'number', + 'number' // outId + ]); } - function scatterNd(args) { - var backend = args.backend, - inputs = args.inputs, - attrs = args.attrs; - var indices = inputs.indices, - updates = inputs.updates; - var shape = attrs.shape; - var out = backend.makeOutput(shape, updates.dtype); - if (tfjsCore.util.sizeFromShape(shape) === 0) { + const { backend, inputs, attrs } = args; + const { indices, updates } = inputs; + const { shape } = attrs; + const out = backend.makeOutput(shape, updates.dtype); + if (tfjsCore.util.sizeFromShape(shape) === 0) { + return out; + } + const { sliceRank, numUpdates, sliceSize, strides, outputSize } = tfjsCore.scatter_util.calculateShapes(updates, indices, shape); + const indicesData = backend.dataIdMap.get(indices.dataId); + const indicesId = indicesData.id; + const updatesData = backend.dataIdMap.get(updates.dataId); + const updatesId = updatesData.id; + const stridesBytes = new Uint8Array(new Int32Array(strides).buffer); + const outId = backend.dataIdMap.get(out.dataId).id; + wasmScatterNd(indicesId, updatesId, CppDType[updates.dtype], sliceRank, numUpdates, sliceSize, stridesBytes, outputSize, outId); return out; - } - var _a = tfjsCore.scatter_util.calculateShapes(updates, indices, shape), - sliceRank = _a.sliceRank, - numUpdates = _a.numUpdates, - sliceSize = _a.sliceSize, - strides = _a.strides, - outputSize = _a.outputSize; - var indicesData = backend.dataIdMap.get(indices.dataId); - var indicesId = indicesData.id; - var updatesData = backend.dataIdMap.get(updates.dataId); - var updatesId = updatesData.id; - var stridesBytes = new Uint8Array(new Int32Array(strides).buffer); - var outId = backend.dataIdMap.get(out.dataId).id; - wasmScatterNd(indicesId, updatesId, CppDType[updates.dtype], sliceRank, numUpdates, sliceSize, stridesBytes, outputSize, outId); - return out; } tfjsCore.registerKernel({ - kernelName: 'ScatterNd', - backendName: 'wasm', - setupFunc: setup$l, - kernelFunc: scatterNd - }); - + kernelName: 'ScatterNd', + backendName: 'wasm', + setupFunc: setup$l, + kernelFunc: scatterNd + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2319,33 +2100,30 @@ * limitations under the License. * ============================================================================= */ - var wasmFunc$4; - + let wasmFunc$4; function setup$m(backend) { - wasmFunc$4 = - backend.wasm.cwrap('Sigmoid', null /* void */ , ['number', 'number']); + wasmFunc$4 = + backend.wasm.cwrap('Sigmoid', null /* void */, ['number', 'number']); } - function sigmoid(args) { - var backend = args.backend, - x = args.inputs.x; - var xId = backend.dataIdMap.get(x.dataId).id; - var out = backend.makeOutput(x.shape, x.dtype); - var outId = backend.dataIdMap.get(out.dataId).id; - // Short-circuit zero-sized tensors. - if (tfjsCore.util.sizeFromShape(out.shape) === 0) { + const { backend, inputs: { x } } = args; + const xId = backend.dataIdMap.get(x.dataId).id; + const out = backend.makeOutput(x.shape, x.dtype); + const outId = backend.dataIdMap.get(out.dataId).id; + // Short-circuit zero-sized tensors. + if (tfjsCore.util.sizeFromShape(out.shape) === 0) { + return out; + } + wasmFunc$4(xId, outId); return out; - } - wasmFunc$4(xId, outId); - return out; } tfjsCore.registerKernel({ - kernelName: 'Sigmoid', - backendName: 'wasm', - setupFunc: setup$m, - kernelFunc: sigmoid - }); - + kernelName: 'Sigmoid', + backendName: 'wasm', + setupFunc: setup$m, + kernelFunc: sigmoid + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2362,8 +2140,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Sin'); - + registerUnaryKernel('Sin'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2381,99 +2159,92 @@ * ============================================================================= */ function slice(args) { - var x = args.inputs.x, - _a = args.attrs, - begin = _a.begin, - size = _a.size, - backend = args.backend; - var isContinous = tfjsCore.slice_util.isSliceContinous(x.shape, begin, size); - var xVals = backend.typedArrayFromHeap(x); - var out = backend.makeOutput(size, x.dtype); - var outVals = backend.typedArrayFromHeap(out); - var xStrides = tfjsCore.util.computeStrides(x.shape); - if (isContinous) { - var flatOffset = tfjsCore.slice_util.computeFlatOffset(begin, xStrides); - outVals.set(xVals.subarray(flatOffset, flatOffset + tfjsCore.util.sizeFromShape(size))); + const { inputs: { x }, attrs: { begin, size }, backend } = args; + const isContinous = tfjsCore.slice_util.isSliceContinous(x.shape, begin, size); + const xVals = backend.typedArrayFromHeap(x); + const out = backend.makeOutput(size, x.dtype); + const outVals = backend.typedArrayFromHeap(out); + const xStrides = tfjsCore.util.computeStrides(x.shape); + if (isContinous) { + const flatOffset = tfjsCore.slice_util.computeFlatOffset(begin, xStrides); + outVals.set(xVals.subarray(flatOffset, flatOffset + tfjsCore.util.sizeFromShape(size))); + return out; + } + const rank = x.shape.length; + if (rank === 2) { + slice2d(xVals, xStrides[0], outVals, begin, size); + } + else if (rank === 3) { + slice3d(xVals, xStrides[0], xStrides[1], outVals, begin, size); + } + else if (rank === 4) { + slice4d(xVals, xStrides[0], xStrides[1], xStrides[2], outVals, begin, size); + } + else { + genericSliceSlow(xVals, x, outVals, begin, size); + } return out; - } - var rank = x.shape.length; - if (rank === 2) { - slice2d(xVals, xStrides[0], outVals, begin, size); - } else if (rank === 3) { - slice3d(xVals, xStrides[0], xStrides[1], outVals, begin, size); - } else if (rank === 4) { - slice4d(xVals, xStrides[0], xStrides[1], xStrides[2], outVals, begin, size); - } else { - genericSliceSlow(xVals, x, outVals, begin, size); - } - return out; } - function slice2d(xVals, xStride, outVals, begin, size) { - var outOffset = 0; - var beginI = begin[0]; - var beginJ = begin[1]; - var endI = beginI + size[0]; - for (var i = beginI; i < endI; i++) { - var xOffset = i * xStride + beginJ; - outVals.set(xVals.subarray(xOffset, xOffset + size[1]), outOffset); - outOffset += size[1]; - } + let outOffset = 0; + const beginI = begin[0]; + const beginJ = begin[1]; + const endI = beginI + size[0]; + for (let i = beginI; i < endI; i++) { + const xOffset = i * xStride + beginJ; + outVals.set(xVals.subarray(xOffset, xOffset + size[1]), outOffset); + outOffset += size[1]; + } } - function slice3d(xVals, xStride1, xStride2, outVals, begin, size) { - var outOffset = 0; - var beginI = begin[0]; - var beginJ = begin[1]; - var beginK = begin[2]; - var endI = beginI + size[0]; - var endJ = beginJ + size[1]; - for (var i = beginI; i < endI; i++) { - for (var j = beginJ; j < endJ; j++) { - var xOffset = i * xStride1 + j * xStride2 + beginK; - outVals.set(xVals.subarray(xOffset, xOffset + size[2]), outOffset); - outOffset += size[2]; + let outOffset = 0; + const beginI = begin[0]; + const beginJ = begin[1]; + const beginK = begin[2]; + const endI = beginI + size[0]; + const endJ = beginJ + size[1]; + for (let i = beginI; i < endI; i++) { + for (let j = beginJ; j < endJ; j++) { + const xOffset = i * xStride1 + j * xStride2 + beginK; + outVals.set(xVals.subarray(xOffset, xOffset + size[2]), outOffset); + outOffset += size[2]; + } } - } } - function slice4d(xVals, xStride1, xStride2, xStride3, outVals, begin, size) { - var outOffset = 0; - var beginI = begin[0]; - var beginJ = begin[1]; - var beginK = begin[2]; - var endI = beginI + size[0]; - var endJ = beginJ + size[1]; - var endK = beginK + size[2]; - var beginL = begin[3]; - for (var i = beginI; i < endI; i++) { - for (var j = beginJ; j < endJ; j++) { - for (var k = beginK; k < endK; k++) { - var xOffset = i * xStride1 + j * xStride2 + k * xStride3 + beginL; - outVals.set(xVals.subarray(xOffset, xOffset + size[3]), outOffset); - outOffset += size[3]; - } + let outOffset = 0; + const beginI = begin[0]; + const beginJ = begin[1]; + const beginK = begin[2]; + const endI = beginI + size[0]; + const endJ = beginJ + size[1]; + const endK = beginK + size[2]; + const beginL = begin[3]; + for (let i = beginI; i < endI; i++) { + for (let j = beginJ; j < endJ; j++) { + for (let k = beginK; k < endK; k++) { + const xOffset = i * xStride1 + j * xStride2 + k * xStride3 + beginL; + outVals.set(xVals.subarray(xOffset, xOffset + size[3]), outOffset); + outOffset += size[3]; + } + } } - } } - function genericSliceSlow(xVals, xInfo, outVals, begin, size) { - var outBuf = tfjsCore.buffer(size, xInfo.dtype, outVals); - var xBuf = tfjsCore.buffer(xInfo.shape, xInfo.dtype, xVals); - for (var i = 0; i < outBuf.size; ++i) { - var loc = outBuf.indexToLoc(i); - var xLoc = loc.map(function (idx, j) { - return idx + begin[j]; - }); - outVals[i] = xBuf.get.apply(xBuf, xLoc); - } + const outBuf = tfjsCore.buffer(size, xInfo.dtype, outVals); + const xBuf = tfjsCore.buffer(xInfo.shape, xInfo.dtype, xVals); + for (let i = 0; i < outBuf.size; ++i) { + const loc = outBuf.indexToLoc(i); + const xLoc = loc.map((idx, j) => idx + begin[j]); + outVals[i] = xBuf.get(...xLoc); + } } tfjsCore.registerKernel({ - kernelName: 'Slice', - backendName: 'wasm', - kernelFunc: slice, - }); - + kernelName: 'Slice', + backendName: 'wasm', + kernelFunc: slice, + }); + /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -2490,40 +2261,36 @@ * limitations under the License. * ============================================================================= */ - var wasmFunc$5; - + let wasmFunc$5; function setup$n(backend) { - wasmFunc$5 = backend.wasm.cwrap('Softmax', null /* void */ , [ - 'number', - 'number', - 'number', - 'number' // batch - ]); + wasmFunc$5 = backend.wasm.cwrap('Softmax', null /* void */, [ + 'number', + 'number', + 'number', + 'number' // batch + ]); } - function softmax(args) { - var backend = args.backend, - logits = args.inputs.logits, - dim = args.attrs.dim; - var xId = backend.dataIdMap.get(logits.dataId).id; - var out = backend.makeOutput(logits.shape, logits.dtype); - var outId = backend.dataIdMap.get(out.dataId).id; - var channels = logits.shape[dim]; - var batch = tfjsCore.util.sizeFromShape(logits.shape) / channels; - // Short-circuit zero-sized tensors. - if (tfjsCore.util.sizeFromShape(out.shape) === 0) { + const { backend, inputs: { logits }, attrs: { dim } } = args; + const xId = backend.dataIdMap.get(logits.dataId).id; + const out = backend.makeOutput(logits.shape, logits.dtype); + const outId = backend.dataIdMap.get(out.dataId).id; + const channels = logits.shape[dim]; + const batch = tfjsCore.util.sizeFromShape(logits.shape) / channels; + // Short-circuit zero-sized tensors. + if (tfjsCore.util.sizeFromShape(out.shape) === 0) { + return out; + } + wasmFunc$5(xId, outId, channels, batch); return out; - } - wasmFunc$5(xId, outId, channels, batch); - return out; } tfjsCore.registerKernel({ - kernelName: 'Softmax', - backendName: 'wasm', - setupFunc: setup$n, - kernelFunc: softmax - }); - + kernelName: 'Softmax', + backendName: 'wasm', + setupFunc: setup$n, + kernelFunc: softmax + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2540,8 +2307,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Square'); - + registerUnaryKernel('Square'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2558,9 +2325,9 @@ * limitations under the License. * ============================================================================= */ - var supportsFullBroadcast$d = true; - registerBinaryKernel('Sub', supportsFullBroadcast$d); - + const supportsFullBroadcast$d = true; + registerBinaryKernel('Sub', supportsFullBroadcast$d); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2577,40 +2344,34 @@ * limitations under the License. * ============================================================================= */ - var wasmSum; - + let wasmSum; function setup$o(backend) { - wasmSum = - backend.wasm.cwrap('Sum', null /*void*/ , ['number, number, number']); + wasmSum = + backend.wasm.cwrap('Sum', null /*void*/, ['number, number, number']); } - function sum(args) { - var backend = args.backend, - inputs = args.inputs, - attrs = args.attrs; - var axes = attrs.axes; - var x = inputs.x; - var xId = backend.dataIdMap.get(x.dataId).id; - tfjsCore.backend_util.assertAxesAreInnerMostDims('sum', axes, x.shape.length); - var _a = tfjsCore.backend_util.computeOutAndReduceShapes(x.shape, axes), - outShape = _a[0], - reduceShape = _a[1]; - var reduceSize = tfjsCore.util.sizeFromShape(reduceShape); - var out = backend.makeOutput(outShape, x.dtype); - if (tfjsCore.util.sizeFromShape(x.shape) === 0) { + const { backend, inputs, attrs } = args; + const { axes } = attrs; + const { x } = inputs; + const xId = backend.dataIdMap.get(x.dataId).id; + tfjsCore.backend_util.assertAxesAreInnerMostDims('sum', axes, x.shape.length); + const [outShape, reduceShape] = tfjsCore.backend_util.computeOutAndReduceShapes(x.shape, axes); + const reduceSize = tfjsCore.util.sizeFromShape(reduceShape); + const out = backend.makeOutput(outShape, x.dtype); + if (tfjsCore.util.sizeFromShape(x.shape) === 0) { + return out; + } + const outId = backend.dataIdMap.get(out.dataId).id; + wasmSum(xId, reduceSize, outId); return out; - } - var outId = backend.dataIdMap.get(out.dataId).id; - wasmSum(xId, reduceSize, outId); - return out; } tfjsCore.registerKernel({ - kernelName: 'Sum', - backendName: 'wasm', - setupFunc: setup$o, - kernelFunc: sum - }); - + kernelName: 'Sum', + backendName: 'wasm', + setupFunc: setup$o, + kernelFunc: sum + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2627,8 +2388,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Tanh'); - + registerUnaryKernel('Tanh'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2645,44 +2406,40 @@ * limitations under the License. * ============================================================================= */ - var wasmTile; - + let wasmTile; function setup$p(backend) { - wasmTile = backend.wasm.cwrap('Tile', null /* void */ , [ - 'number', - 'array', - 'number', - 'array', - 'number', - 'number' // out_id - ]); + wasmTile = backend.wasm.cwrap('Tile', null /* void */, [ + 'number', + 'array', + 'number', + 'array', + 'number', + 'number' // out_id + ]); } - function tile(args) { - var inputs = args.inputs, - backend = args.backend, - attrs = args.attrs; - var x = inputs.x; - var xId = backend.dataIdMap.get(x.dataId).id; - var reps = attrs.reps; - var newShape = new Array(x.shape.length); - for (var i = 0; i < newShape.length; i++) { - newShape[i] = x.shape[i] * reps[i]; - } - var xShapeBytes = new Uint8Array(new Int32Array(x.shape).buffer); - var newShapeBytes = new Uint8Array(new Int32Array(newShape).buffer); - var out = backend.makeOutput(newShape, x.dtype); - var outId = backend.dataIdMap.get(out.dataId).id; - wasmTile(xId, xShapeBytes, x.shape.length, newShapeBytes, newShape.length, CppDType[out.dtype], outId); - return out; + const { inputs, backend, attrs } = args; + const { x } = inputs; + const xId = backend.dataIdMap.get(x.dataId).id; + const { reps } = attrs; + const newShape = new Array(x.shape.length); + for (let i = 0; i < newShape.length; i++) { + newShape[i] = x.shape[i] * reps[i]; + } + const xShapeBytes = new Uint8Array(new Int32Array(x.shape).buffer); + const newShapeBytes = new Uint8Array(new Int32Array(newShape).buffer); + const out = backend.makeOutput(newShape, x.dtype); + const outId = backend.dataIdMap.get(out.dataId).id; + wasmTile(xId, xShapeBytes, x.shape.length, newShapeBytes, newShape.length, CppDType[out.dtype], outId); + return out; } tfjsCore.registerKernel({ - kernelName: 'Tile', - backendName: 'wasm', - setupFunc: setup$p, - kernelFunc: tile - }); - + kernelName: 'Tile', + backendName: 'wasm', + setupFunc: setup$p, + kernelFunc: tile + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2699,95 +2456,83 @@ * limitations under the License. * ============================================================================= */ - var wasmTranspose; - + let wasmTranspose; function setup$q(backend) { - wasmTranspose = backend.wasm.cwrap('Transpose', null /* void */ , [ - 'number', - 'array', - 'number', - 'number', - 'number', - 'array', - 'number', - ]); + wasmTranspose = backend.wasm.cwrap('Transpose', null /* void */, [ + 'number', + 'array', + 'number', + 'number', + 'number', + 'array', + 'number', + ]); } - function transpose(args) { - var inputs = args.inputs, - backend = args.backend, - attrs = args.attrs; - // Reduce any dimensions with size one. Lower-rank transpose kernel performs - // better due to simpler memory access pattern. - var _a = removeOneSizeDims(inputs.x.shape, attrs.perm), - reducedShape = _a[0], - perm = _a[1]; - var x = { - dataId: inputs.x.dataId, - shape: reducedShape, - dtype: inputs.x.dtype - }; - var permIsNoOp = true; - for (var i = 0; i < perm.length; i++) { - if (perm[i] !== i) { - permIsNoOp = false; - } - } - var outShape = computeOutShape(inputs.x.shape, attrs.perm); - if (permIsNoOp) { - return { - dataId: x.dataId, - shape: outShape, - dtype: x.dtype + const { inputs, backend, attrs } = args; + // Reduce any dimensions with size one. Lower-rank transpose kernel performs + // better due to simpler memory access pattern. + const [reducedShape, perm] = removeOneSizeDims(inputs.x.shape, attrs.perm); + const x = { + dataId: inputs.x.dataId, + shape: reducedShape, + dtype: inputs.x.dtype }; - } - var out = backend.makeOutput(outShape, x.dtype); - var xId = backend.dataIdMap.get(x.dataId).id; - var outId = backend.dataIdMap.get(out.dataId).id; - var permBytes = new Uint8Array(new Int32Array(perm).buffer); - var xShapeBytes = new Uint8Array(new Int32Array(x.shape).buffer); - wasmTranspose(xId, xShapeBytes, x.shape.length, CppDType[x.dtype], outId, permBytes, perm.length); - return out; + let permIsNoOp = true; + for (let i = 0; i < perm.length; i++) { + if (perm[i] !== i) { + permIsNoOp = false; + } + } + const outShape = computeOutShape(inputs.x.shape, attrs.perm); + if (permIsNoOp) { + return { dataId: x.dataId, shape: outShape, dtype: x.dtype }; + } + const out = backend.makeOutput(outShape, x.dtype); + const xId = backend.dataIdMap.get(x.dataId).id; + const outId = backend.dataIdMap.get(out.dataId).id; + const permBytes = new Uint8Array(new Int32Array(perm).buffer); + const xShapeBytes = new Uint8Array(new Int32Array(x.shape).buffer); + wasmTranspose(xId, xShapeBytes, x.shape.length, CppDType[x.dtype], outId, permBytes, perm.length); + return out; } - function computeOutShape(inShape, perm) { - var outShape = new Array(inShape.length); - for (var i = 0; i < outShape.length; i++) { - outShape[i] = inShape[perm[i]]; - } - return outShape; + const outShape = new Array(inShape.length); + for (let i = 0; i < outShape.length; i++) { + outShape[i] = inShape[perm[i]]; + } + return outShape; } - function removeOneSizeDims(shape, perm) { - var newShape = []; - var newPerm = []; - for (var i = 0; i < shape.length; ++i) { - if (shape[i] !== 1) { - newShape.push(shape[i]); - } - if (shape[perm[i]] !== 1) { - newPerm.push(perm[i]); + const newShape = []; + const newPerm = []; + for (let i = 0; i < shape.length; ++i) { + if (shape[i] !== 1) { + newShape.push(shape[i]); + } + if (shape[perm[i]] !== 1) { + newPerm.push(perm[i]); + } } - } - for (var i = 0; i < newPerm.length; ++i) { - var minValIdx = -1; - for (var j = 0; j < newPerm.length; ++j) { - if (newPerm[j] >= i && - (minValIdx === -1 || newPerm[minValIdx] > newPerm[j])) { - minValIdx = j; - } + for (let i = 0; i < newPerm.length; ++i) { + let minValIdx = -1; + for (let j = 0; j < newPerm.length; ++j) { + if (newPerm[j] >= i && + (minValIdx === -1 || newPerm[minValIdx] > newPerm[j])) { + minValIdx = j; + } + } + newPerm[minValIdx] = i; } - newPerm[minValIdx] = i; - } - return [newShape, newPerm]; + return [newShape, newPerm]; } tfjsCore.registerKernel({ - kernelName: 'Transpose', - backendName: 'wasm', - kernelFunc: transpose, - setupFunc: setup$q, - }); - + kernelName: 'Transpose', + backendName: 'wasm', + kernelFunc: transpose, + setupFunc: setup$q, + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2805,51 +2550,32 @@ * ============================================================================= */ function unpack(args) { - var x = args.inputs.x, - backend = args.backend, - axis = args.attrs.axis; - var numOutputs = x.shape[axis]; - var rank = x.shape.length; - var outShape = new Array(rank - 1); - var outIndex = 0; - for (var i = 0; i < rank; i++) { - if (i !== axis) { - outShape[outIndex++] = x.shape[i]; + const { inputs: { x }, backend, attrs: { axis } } = args; + const numOutputs = x.shape[axis]; + const rank = x.shape.length; + const outShape = new Array(rank - 1); + let outIndex = 0; + for (let i = 0; i < rank; i++) { + if (i !== axis) { + outShape[outIndex++] = x.shape[i]; + } } - } - var outs = new Array(numOutputs); - var begin = new Array(rank).fill(0); - var size = x.shape.slice(); - size[axis] = 1; - for (var i = 0; i < outs.length; i++) { - begin[axis] = i; - outs[i] = slice({ - inputs: { - x: x - }, - attrs: { - begin: begin, - size: size - }, - backend: backend - }); - } - return outs.map(function (_a) { - var dataId = _a.dataId, - dtype = _a.dtype; - return ({ - dataId: dataId, - dtype: dtype, - shape: outShape - }); - }); + const outs = new Array(numOutputs); + const begin = new Array(rank).fill(0); + const size = x.shape.slice(); + size[axis] = 1; + for (let i = 0; i < outs.length; i++) { + begin[axis] = i; + outs[i] = slice({ inputs: { x }, attrs: { begin, size }, backend }); + } + return outs.map(({ dataId, dtype }) => ({ dataId, dtype, shape: outShape })); } tfjsCore.registerKernel({ - kernelName: 'Unpack', - backendName: 'wasm', - kernelFunc: unpack, - }); - + kernelName: 'Unpack', + backendName: 'wasm', + kernelFunc: unpack, + }); + /** * @license * Copyright 2020 Google Inc. All Rights Reserved. @@ -2867,3638 +2593,237 @@ * ============================================================================= */ function zerosLike(args) { - var x = args.inputs.x, - backend = args.backend; - var out = backend.makeOutput(x.shape, x.dtype); - var outVals = backend.typedArrayFromHeap(out); - outVals.fill(0); - return out; + const { inputs: { x }, backend } = args; + const out = backend.makeOutput(x.shape, x.dtype); + const outVals = backend.typedArrayFromHeap(out); + outVals.fill(0); + return out; } tfjsCore.registerKernel({ - kernelName: 'ZerosLike', - backendName: 'wasm', - kernelFunc: zerosLike, - }); - - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 - - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. - - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. - ***************************************************************************** */ - /* global Reflect, Promise */ - - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ - __proto__: [] - } - instanceof Array && function (d, b) { - d.__proto__ = b; - }) || - function (d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) d[p] = b[p]; - }; - return extendStatics(d, b); - }; - - function __extends(d, b) { - extendStatics(d, b); - - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - } - - function __awaiter(thisArg, _arguments, P, generator) { - return new(P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + kernelName: 'ZerosLike', + backendName: 'wasm', + kernelFunc: zerosLike, + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const WASM_PRIORITY = 2; + class BackendWasm extends tfjsCore.KernelBackend { + constructor(wasm) { + super(); + this.wasm = wasm; + // 0 is reserved for null data ids. + this.dataIdNextNumber = 1; + this.wasm.tfjs.init(); + this.dataIdMap = new tfjsCore.DataStorage(this, tfjsCore.engine()); } - - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } + write(values, shape, dtype) { + const dataId = {}; + this.move(dataId, values, shape, dtype); + return dataId; } - - function step(result) { - result.done ? resolve(result.value) : new P(function (resolve) { - resolve(result.value); - }).then(fulfilled, rejected); + numDataIds() { + return this.dataIdMap.numDataIds(); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - } - - function __generator(thisArg, body) { - var _ = { - label: 0, - sent: function () { - if (t[0] & 1) throw t[1]; - return t[1]; - }, - trys: [], - ops: [] - }, - f, y, t, g; - return g = { - next: verb(0), - "throw": verb(1), - "return": verb(2) - }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { - return this; - }), g; - - function verb(n) { - return function (v) { - return step([n, v]); - }; - } - - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: - case 1: - t = op; - break; - case 4: - _.label++; - return { - value: op[1], done: false - }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } catch (e) { - op = [6, e]; - y = 0; - } finally { - f = t = 0; + async time(f) { + const start = tfjsCore.util.now(); + f(); + const kernelMs = tfjsCore.util.now() - start; + return { kernelMs }; } - if (op[0] & 5) throw op[1]; - return { - value: op[0] ? op[1] : void 0, - done: true - }; - } - } - - function createCommonjsModule(fn, module) { - return module = { - exports: {} - }, fn(module, module.exports), module.exports; - } - - var tfjsBackendWasm = createCommonjsModule(function (module, exports) { - var WasmBackendModule = (function () { - var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; - if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; - return ( - function (WasmBackendModule) { - WasmBackendModule = WasmBackendModule || {}; - - function GROWABLE_HEAP_I8() { - if (wasmMemory.buffer != buffer) { - updateGlobalBufferAndViews(wasmMemory.buffer); - } - return HEAP8 - } - - function GROWABLE_HEAP_U8() { - if (wasmMemory.buffer != buffer) { - updateGlobalBufferAndViews(wasmMemory.buffer); - } - return HEAPU8 + move(dataId, values, shape, dtype) { + const id = this.dataIdNextNumber++; + if (dtype === 'string') { + const stringBytes = values; + this.dataIdMap.set(dataId, { id, stringBytes, shape, dtype, memoryOffset: null }); + return; } - - function GROWABLE_HEAP_I32() { - if (wasmMemory.buffer != buffer) { - updateGlobalBufferAndViews(wasmMemory.buffer); - } - return HEAP32 + const size = tfjsCore.util.sizeFromShape(shape); + const numBytes = size * tfjsCore.util.bytesPerElement(dtype); + const memoryOffset = this.wasm._malloc(numBytes); + this.dataIdMap.set(dataId, { id, memoryOffset, shape, dtype }); + this.wasm.tfjs.registerTensor(id, size, memoryOffset); + if (values != null) { + this.wasm.HEAPU8.set(new Uint8Array(values.buffer, 0, numBytes), memoryOffset); } - - function GROWABLE_HEAP_U32() { - if (wasmMemory.buffer != buffer) { - updateGlobalBufferAndViews(wasmMemory.buffer); - } - return HEAPU32 + } + async read(dataId) { + return this.readSync(dataId); + } + readSync(dataId) { + const { memoryOffset, dtype, shape, stringBytes } = this.dataIdMap.get(dataId); + if (dtype === 'string') { + return stringBytes; } - - function GROWABLE_HEAP_F64() { - if (wasmMemory.buffer != buffer) { - updateGlobalBufferAndViews(wasmMemory.buffer); - } - return HEAPF64 + const bytes = this.wasm.HEAPU8.slice(memoryOffset, memoryOffset + tfjsCore.util.sizeFromShape(shape) * tfjsCore.util.bytesPerElement(dtype)); + return typedArrayFromBuffer(bytes.buffer, dtype); + } + disposeData(dataId) { + const data = this.dataIdMap.get(dataId); + this.wasm._free(data.memoryOffset); + this.wasm.tfjs.disposeData(data.id); + this.dataIdMap.delete(dataId); + } + floatPrecision() { + return 32; + } + // Returns the memory offset of a tensor. Useful for debugging and unit + // testing. + getMemoryOffset(dataId) { + return this.dataIdMap.get(dataId).memoryOffset; + } + dispose() { + this.wasm.tfjs.dispose(); + this.wasm = null; + } + memory() { + return { unreliable: false }; + } + /** + * Make a tensor info for the output of an op. If `memoryOffset` is not + * present, this method allocates memory on the WASM heap. If `memoryOffset` + * is present, the memory was allocated elsewhere (in c++) and we just record + * the pointer where that memory lives. + */ + makeOutput(shape, dtype, memoryOffset) { + let dataId; + if (memoryOffset == null) { + dataId = this.write(null /* values */, shape, dtype); + } + else { + dataId = {}; + const id = this.dataIdNextNumber++; + this.dataIdMap.set(dataId, { id, memoryOffset, shape, dtype }); + const size = tfjsCore.util.sizeFromShape(shape); + this.wasm.tfjs.registerTensor(id, size, memoryOffset); + } + return { dataId, shape, dtype }; + } + typedArrayFromHeap({ shape, dtype, dataId }) { + const buffer = this.wasm.HEAPU8.buffer; + const { memoryOffset } = this.dataIdMap.get(dataId); + const size = tfjsCore.util.sizeFromShape(shape); + switch (dtype) { + case 'float32': + return new Float32Array(buffer, memoryOffset, size); + case 'int32': + return new Int32Array(buffer, memoryOffset, size); + case 'bool': + return new Uint8Array(buffer, memoryOffset, size); + default: + throw new Error(`Uknown dtype ${dtype}`); } - var Module = typeof WasmBackendModule !== "undefined" ? WasmBackendModule : {}; - var moduleOverrides = {}; - var key; - for (key in Module) { - if (Module.hasOwnProperty(key)) { - moduleOverrides[key] = Module[key]; - } + } + } + tfjsCore.registerBackend('wasm', async () => { + const { wasm } = await init(); + return new BackendWasm(wasm); + }, WASM_PRIORITY); + function createInstantiateWasmFunc(path) { + // tslint:disable-next-line:no-any + return (imports, callback) => { + tfjsCore.util.fetch(path, { credentials: 'same-origin' }).then((response) => { + if (!response['ok']) { + imports.env.a(`failed to load wasm binary file at '${path}'`); + } + response.arrayBuffer().then(binary => { + WebAssembly.instantiate(binary, imports).then(output => { + callback(output.instance); + }); + }); + }); + return {}; + }; + } + /** + * Initializes the wasm module and creates the js <--> wasm bridge. + * + * NOTE: We wrap the wasm module in a object with property 'wasm' instead of + * returning Promise to avoid freezing Chrome (last tested + * in Chrome 76). + */ + async function init() { + return new Promise((resolve, reject) => { + const factoryConfig = {}; + if (wasmPath != null) { + factoryConfig.locateFile = (path, prefix) => { + if (path.endsWith('.wasm')) { + return wasmPath; + } + return prefix + path; + }; + // use wasm instantiateWasm override when system fetch is not available. + // For detail references + // https://github.com/emscripten-core/emscripten/blob/2bca083cbbd5a4133db61fbd74d04f7feecfa907/tests/manual_wasm_instantiate.html#L170 + if (customFetch) { + factoryConfig.instantiateWasm = createInstantiateWasmFunc(wasmPath); + } } - var arguments_ = []; - var thisProgram = "./this.program"; - var quit_ = function (status, toThrow) { - throw toThrow - }; - var ENVIRONMENT_IS_WEB = false; - var ENVIRONMENT_IS_WORKER = false; - var ENVIRONMENT_IS_NODE = false; - var ENVIRONMENT_IS_SHELL = false; - ENVIRONMENT_IS_WEB = typeof window === "object"; - ENVIRONMENT_IS_WORKER = typeof importScripts === "function"; - ENVIRONMENT_IS_NODE = typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string"; - ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER; - if (Module["ENVIRONMENT"]) { - throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)") - } - var ENVIRONMENT_IS_PTHREAD = Module["ENVIRONMENT_IS_PTHREAD"] || false; - if (ENVIRONMENT_IS_PTHREAD) { - buffer = Module["buffer"]; - DYNAMIC_BASE = Module["DYNAMIC_BASE"]; - DYNAMICTOP_PTR = Module["DYNAMICTOP_PTR"]; - } - var scriptDirectory = ""; - - function locateFile(path) { - if (Module["locateFile"]) { - return Module["locateFile"](path, scriptDirectory) - } - return scriptDirectory + path - } - var read_, readBinary; - var nodeFS; - var nodePath; - if (ENVIRONMENT_IS_NODE) { - if (ENVIRONMENT_IS_WORKER) { - scriptDirectory = path.dirname(scriptDirectory) + "/"; - } else { - scriptDirectory = __dirname + "/"; - } - read_ = function shell_read(filename, binary) { - if (!nodeFS) nodeFS = fs; - if (!nodePath) nodePath = path; - filename = nodePath["normalize"](filename); - return nodeFS["readFileSync"](filename, binary ? null : "utf8") - }; - readBinary = function readBinary(filename) { - var ret = read_(filename, true); - if (!ret.buffer) { - ret = new Uint8Array(ret); - } - assert(ret.buffer); - return ret - }; - if (process["argv"].length > 1) { - thisProgram = process["argv"][1].replace(/\\/g, "/"); - } - arguments_ = process["argv"].slice(2); - process["on"]("uncaughtException", function (ex) { - if (!(ex instanceof ExitStatus)) { - throw ex - } - }); - process["on"]("unhandledRejection", abort); - quit_ = function (status) { - process["exit"](status); - }; - Module["inspect"] = function () { - return "[Emscripten Module object]" - }; - var nodeWorkerThreads; - try { - nodeWorkerThreads = worker_threads; - } catch (e) { - console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'); - throw e - } - Worker = nodeWorkerThreads.Worker; - } else if (ENVIRONMENT_IS_SHELL) { - if (typeof read != "undefined") { - read_ = function shell_read(f) { - return read(f) - }; - } - readBinary = function readBinary(f) { - var data; - if (typeof readbuffer === "function") { - return new Uint8Array(readbuffer(f)) - } - data = read(f, "binary"); - assert(typeof data === "object"); - return data - }; - if (typeof scriptArgs != "undefined") { - arguments_ = scriptArgs; - } else if (typeof arguments != "undefined") { - arguments_ = arguments; - } - if (typeof quit === "function") { - quit_ = function (status) { - quit(status); - }; - } - if (typeof print !== "undefined") { - if (typeof console === "undefined") console = {}; - console.log = print; - console.warn = console.error = typeof printErr !== "undefined" ? printErr : print; - } - } else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { - if (ENVIRONMENT_IS_WORKER) { - scriptDirectory = self.location.href; - } else if (document.currentScript) { - scriptDirectory = document.currentScript.src; - } - if (_scriptDir) { - scriptDirectory = _scriptDir; - } - if (scriptDirectory.indexOf("blob:") !== 0) { - scriptDirectory = scriptDirectory.substr(0, scriptDirectory.lastIndexOf("/") + 1); - } else { - scriptDirectory = ""; - } - if (ENVIRONMENT_IS_NODE) { - read_ = function shell_read(filename, binary) { - if (!nodeFS) nodeFS = fs; - if (!nodePath) nodePath = path; - filename = nodePath["normalize"](filename); - return nodeFS["readFileSync"](filename, binary ? null : "utf8") - }; - readBinary = function readBinary(filename) { - var ret = read_(filename, true); - if (!ret.buffer) { - ret = new Uint8Array(ret); - } - assert(ret.buffer); - return ret - }; - } else { - read_ = function shell_read(url) { - var xhr = new XMLHttpRequest; - xhr.open("GET", url, false); - xhr.send(null); - return xhr.responseText - }; - if (ENVIRONMENT_IS_WORKER) { - readBinary = function readBinary(url) { - var xhr = new XMLHttpRequest; - xhr.open("GET", url, false); - xhr.responseType = "arraybuffer"; - xhr.send(null); - return new Uint8Array(xhr.response) - }; - } - } - } else { - throw new Error("environment detection error") - } - if (ENVIRONMENT_IS_NODE) { - if (typeof performance === "undefined") { - performance = perf_hooks.performance; - } - } - var out = Module["print"] || console.log.bind(console); - var err = Module["printErr"] || console.warn.bind(console); - for (key in moduleOverrides) { - if (moduleOverrides.hasOwnProperty(key)) { - Module[key] = moduleOverrides[key]; - } - } - moduleOverrides = null; - if (Module["arguments"]) arguments_ = Module["arguments"]; - if (!Object.getOwnPropertyDescriptor(Module, "arguments")) Object.defineProperty(Module, "arguments", { - configurable: true, - get: function () { - abort("Module.arguments has been replaced with plain arguments_"); - } - }); - if (Module["thisProgram"]) thisProgram = Module["thisProgram"]; - if (!Object.getOwnPropertyDescriptor(Module, "thisProgram")) Object.defineProperty(Module, "thisProgram", { - configurable: true, - get: function () { - abort("Module.thisProgram has been replaced with plain thisProgram"); - } - }); - if (Module["quit"]) quit_ = Module["quit"]; - if (!Object.getOwnPropertyDescriptor(Module, "quit")) Object.defineProperty(Module, "quit", { - configurable: true, - get: function () { - abort("Module.quit has been replaced with plain quit_"); - } - }); - assert(typeof Module["memoryInitializerPrefixURL"] === "undefined", "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"); - assert(typeof Module["pthreadMainPrefixURL"] === "undefined", "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"); - assert(typeof Module["cdInitializerPrefixURL"] === "undefined", "Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"); - assert(typeof Module["filePackagePrefixURL"] === "undefined", "Module.filePackagePrefixURL option was removed, use Module.locateFile instead"); - assert(typeof Module["read"] === "undefined", "Module.read option was removed (modify read_ in JS)"); - assert(typeof Module["readAsync"] === "undefined", "Module.readAsync option was removed (modify readAsync in JS)"); - assert(typeof Module["readBinary"] === "undefined", "Module.readBinary option was removed (modify readBinary in JS)"); - assert(typeof Module["setWindowTitle"] === "undefined", "Module.setWindowTitle option was removed (modify setWindowTitle in JS)"); - assert(typeof Module["TOTAL_MEMORY"] === "undefined", "Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"); - if (!Object.getOwnPropertyDescriptor(Module, "read")) Object.defineProperty(Module, "read", { - configurable: true, - get: function () { - abort("Module.read has been replaced with plain read_"); - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "readAsync")) Object.defineProperty(Module, "readAsync", { - configurable: true, - get: function () { - abort("Module.readAsync has been replaced with plain readAsync"); - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "readBinary")) Object.defineProperty(Module, "readBinary", { - configurable: true, - get: function () { - abort("Module.readBinary has been replaced with plain readBinary"); - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "setWindowTitle")) Object.defineProperty(Module, "setWindowTitle", { - configurable: true, - get: function () { - abort("Module.setWindowTitle has been replaced with plain setWindowTitle"); - } - }); - assert(ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER || ENVIRONMENT_IS_NODE, "Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)"); - var stackSave; - var stackRestore; - var stackAlloc; - stackSave = stackRestore = stackAlloc = function () { - abort("cannot use the stack before compiled code is ready to run, and has provided stack access"); - }; - - function warnOnce(text) { - if (!warnOnce.shown) warnOnce.shown = {}; - if (!warnOnce.shown[text]) { - warnOnce.shown[text] = 1; - err(text); - } - } - var wasmBinary; - if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"]; - if (!Object.getOwnPropertyDescriptor(Module, "wasmBinary")) Object.defineProperty(Module, "wasmBinary", { - configurable: true, - get: function () { - abort("Module.wasmBinary has been replaced with plain wasmBinary"); - } - }); - var noExitRuntime; - if (Module["noExitRuntime"]) noExitRuntime = Module["noExitRuntime"]; - if (!Object.getOwnPropertyDescriptor(Module, "noExitRuntime")) Object.defineProperty(Module, "noExitRuntime", { - configurable: true, - get: function () { - abort("Module.noExitRuntime has been replaced with plain noExitRuntime"); - } - }); - if (typeof WebAssembly !== "object") { - abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead."); - } - var wasmMemory; - var wasmTable = new WebAssembly.Table({ - "initial": 118, - "maximum": 118 + 0, - "element": "anyfunc" - }); - var wasmModule; - var threadInfoStruct = 0; - var selfThreadId = 0; - var ABORT = false; - - function assert(condition, text) { - if (!condition) { - abort("Assertion failed: " + text); - } - } - - function getCFunc(ident) { - var func = Module["_" + ident]; - assert(func, "Cannot call unknown function " + ident + ", make sure it is exported"); - return func - } - - function ccall(ident, returnType, argTypes, args, opts) { - var toC = { - "string": function (str) { - var ret = 0; - if (str !== null && str !== undefined && str !== 0) { - var len = (str.length << 2) + 1; - ret = stackAlloc(len); - stringToUTF8(str, ret, len); - } - return ret - }, - "array": function (arr) { - var ret = stackAlloc(arr.length); - writeArrayToMemory(arr, ret); - return ret - } - }; - - function convertReturnValue(ret) { - if (returnType === "string") return UTF8ToString(ret); - if (returnType === "boolean") return Boolean(ret); - return ret - } - var func = getCFunc(ident); - var cArgs = []; - var stack = 0; - assert(returnType !== "array", 'Return type should not be "array".'); - if (args) { - for (var i = 0; i < args.length; i++) { - var converter = toC[argTypes[i]]; - if (converter) { - if (stack === 0) stack = stackSave(); - cArgs[i] = converter(args[i]); - } else { - cArgs[i] = args[i]; - } - } - } - var ret = func.apply(null, cArgs); - ret = convertReturnValue(ret); - if (stack !== 0) stackRestore(stack); - return ret - } - - function cwrap(ident, returnType, argTypes, opts) { - return function () { - return ccall(ident, returnType, argTypes, arguments) - } - } - - function UTF8ArrayToString(heap, idx, maxBytesToRead) { - var endIdx = idx + maxBytesToRead; - var str = ""; - while (!(idx >= endIdx)) { - var u0 = heap[idx++]; - if (!u0) return str; - if (!(u0 & 128)) { - str += String.fromCharCode(u0); - continue - } - var u1 = heap[idx++] & 63; - if ((u0 & 224) == 192) { - str += String.fromCharCode((u0 & 31) << 6 | u1); - continue - } - var u2 = heap[idx++] & 63; - if ((u0 & 240) == 224) { - u0 = (u0 & 15) << 12 | u1 << 6 | u2; - } else { - if ((u0 & 248) != 240) warnOnce("Invalid UTF-8 leading byte 0x" + u0.toString(16) + " encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!"); - u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heap[idx++] & 63; - } - if (u0 < 65536) { - str += String.fromCharCode(u0); - } else { - var ch = u0 - 65536; - str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023); - } - } - return str - } - - function UTF8ToString(ptr, maxBytesToRead) { - return ptr ? UTF8ArrayToString(GROWABLE_HEAP_U8(), ptr, maxBytesToRead) : "" - } - - function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { - if (!(maxBytesToWrite > 0)) return 0; - var startIdx = outIdx; - var endIdx = outIdx + maxBytesToWrite - 1; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) { - var u1 = str.charCodeAt(++i); - u = 65536 + ((u & 1023) << 10) | u1 & 1023; - } - if (u <= 127) { - if (outIdx >= endIdx) break; - heap[outIdx++] = u; - } else if (u <= 2047) { - if (outIdx + 1 >= endIdx) break; - heap[outIdx++] = 192 | u >> 6; - heap[outIdx++] = 128 | u & 63; - } else if (u <= 65535) { - if (outIdx + 2 >= endIdx) break; - heap[outIdx++] = 224 | u >> 12; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } else { - if (outIdx + 3 >= endIdx) break; - if (u >= 2097152) warnOnce("Invalid Unicode code point 0x" + u.toString(16) + " encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF)."); - heap[outIdx++] = 240 | u >> 18; - heap[outIdx++] = 128 | u >> 12 & 63; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } - } - heap[outIdx] = 0; - return outIdx - startIdx - } - - function stringToUTF8(str, outPtr, maxBytesToWrite) { - assert(typeof maxBytesToWrite == "number", "stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"); - return stringToUTF8Array(str, GROWABLE_HEAP_U8(), outPtr, maxBytesToWrite) - } - - function lengthBytesUTF8(str) { - var len = 0; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; - if (u <= 127) ++len; - else if (u <= 2047) len += 2; - else if (u <= 65535) len += 3; - else len += 4; - } - return len - } - - function writeArrayToMemory(array, buffer) { - assert(array.length >= 0, "writeArrayToMemory array must have a length (should be an array or typed array)"); - GROWABLE_HEAP_I8().set(array, buffer); - } - var WASM_PAGE_SIZE = 65536; - - function alignUp(x, multiple) { - if (x % multiple > 0) { - x += multiple - x % multiple; - } - return x - } - var buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; - - function updateGlobalBufferAndViews(buf) { - buffer = buf; - Module["HEAP8"] = HEAP8 = new Int8Array(buf); - Module["HEAP16"] = HEAP16 = new Int16Array(buf); - Module["HEAP32"] = HEAP32 = new Int32Array(buf); - Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); - Module["HEAPU16"] = HEAPU16 = new Uint16Array(buf); - Module["HEAPU32"] = HEAPU32 = new Uint32Array(buf); - Module["HEAPF32"] = HEAPF32 = new Float32Array(buf); - Module["HEAPF64"] = HEAPF64 = new Float64Array(buf); - } - var STACK_BASE = 5255808, - STACKTOP = STACK_BASE, - STACK_MAX = 12928, - DYNAMIC_BASE = 5255808, - DYNAMICTOP_PTR = 12e3; - assert(STACK_BASE % 16 === 0, "stack must start aligned"); - assert(DYNAMIC_BASE % 16 === 0, "heap must start aligned"); - if (ENVIRONMENT_IS_PTHREAD) { - STACK_MAX = STACKTOP = STACK_MAX = 2147483647; - } - var TOTAL_STACK = 5242880; - if (Module["TOTAL_STACK"]) assert(TOTAL_STACK === Module["TOTAL_STACK"], "the stack size can no longer be determined at runtime"); - var INITIAL_INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 16777216; - if (!Object.getOwnPropertyDescriptor(Module, "INITIAL_MEMORY")) Object.defineProperty(Module, "INITIAL_MEMORY", { - configurable: true, - get: function () { - abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY"); - } - }); - assert(INITIAL_INITIAL_MEMORY >= TOTAL_STACK, "INITIAL_MEMORY should be larger than TOTAL_STACK, was " + INITIAL_INITIAL_MEMORY + "! (TOTAL_STACK=" + TOTAL_STACK + ")"); - assert(typeof Int32Array !== "undefined" && typeof Float64Array !== "undefined" && Int32Array.prototype.subarray !== undefined && Int32Array.prototype.set !== undefined, "JS engine does not provide full typed array support"); - if (ENVIRONMENT_IS_PTHREAD) { - wasmMemory = Module["wasmMemory"]; - buffer = Module["buffer"]; - } else { - if (Module["wasmMemory"]) { - wasmMemory = Module["wasmMemory"]; - } else { - wasmMemory = new WebAssembly.Memory({ - "initial": INITIAL_INITIAL_MEMORY / WASM_PAGE_SIZE, - "maximum": 1073741824 / WASM_PAGE_SIZE, - "shared": true - }); - if (!(wasmMemory.buffer instanceof SharedArrayBuffer)) { - err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"); - if (ENVIRONMENT_IS_NODE) { - console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"); - } - throw Error("bad memory") - } - } - } - if (wasmMemory) { - buffer = wasmMemory.buffer; - } - INITIAL_INITIAL_MEMORY = buffer.byteLength; - assert(INITIAL_INITIAL_MEMORY % WASM_PAGE_SIZE === 0); - assert(65536 % WASM_PAGE_SIZE === 0); - updateGlobalBufferAndViews(buffer); - if (!ENVIRONMENT_IS_PTHREAD) { - GROWABLE_HEAP_I32()[DYNAMICTOP_PTR >> 2] = DYNAMIC_BASE; - } - - function writeStackCookie() { - assert((STACK_MAX & 3) == 0); - GROWABLE_HEAP_U32()[(STACK_MAX >> 2) + 1] = 34821223; - GROWABLE_HEAP_U32()[(STACK_MAX >> 2) + 2] = 2310721022; - GROWABLE_HEAP_I32()[0] = 1668509029; - } - - function checkStackCookie() { - var cookie1 = GROWABLE_HEAP_U32()[(STACK_MAX >> 2) + 1]; - var cookie2 = GROWABLE_HEAP_U32()[(STACK_MAX >> 2) + 2]; - if (cookie1 != 34821223 || cookie2 != 2310721022) { - abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x" + cookie2.toString(16) + " " + cookie1.toString(16)); - } - if (GROWABLE_HEAP_I32()[0] !== 1668509029) abort("Runtime error: The application has corrupted its heap memory area (address zero)!"); - } - - function abortStackOverflow(allocSize) { - abort("Stack overflow! Attempted to allocate " + allocSize + " bytes on the stack, but stack has only " + (STACK_MAX - stackSave() + allocSize) + " bytes available!"); - }(function () { - var h16 = new Int16Array(1); - var h8 = new Int8Array(h16.buffer); - h16[0] = 25459; - if (h8[0] !== 115 || h8[1] !== 99) throw "Runtime error: expected the system to be little-endian!" - })(); - - function callRuntimeCallbacks(callbacks) { - while (callbacks.length > 0) { - var callback = callbacks.shift(); - if (typeof callback == "function") { - callback(Module); - continue - } - var func = callback.func; - if (typeof func === "number") { - if (callback.arg === undefined) { - Module["dynCall_v"](func); - } else { - Module["dynCall_vi"](func, callback.arg); - } - } else { - func(callback.arg === undefined ? null : callback.arg); - } - } - } - var __ATPRERUN__ = []; - var __ATINIT__ = []; - var __ATMAIN__ = []; - var __ATPOSTRUN__ = []; - var runtimeInitialized = false; - var runtimeExited = false; - if (ENVIRONMENT_IS_PTHREAD) runtimeInitialized = true; - - function preRun() { - if (ENVIRONMENT_IS_PTHREAD) return; - if (Module["preRun"]) { - if (typeof Module["preRun"] == "function") Module["preRun"] = [Module["preRun"]]; - while (Module["preRun"].length) { - addOnPreRun(Module["preRun"].shift()); - } - } - callRuntimeCallbacks(__ATPRERUN__); - } - - function initRuntime() { - checkStackCookie(); - assert(!runtimeInitialized); - runtimeInitialized = true; - callRuntimeCallbacks(__ATINIT__); - } - - function preMain() { - checkStackCookie(); - if (ENVIRONMENT_IS_PTHREAD) return; - callRuntimeCallbacks(__ATMAIN__); - } - - function postRun() { - checkStackCookie(); - if (ENVIRONMENT_IS_PTHREAD) return; - if (Module["postRun"]) { - if (typeof Module["postRun"] == "function") Module["postRun"] = [Module["postRun"]]; - while (Module["postRun"].length) { - addOnPostRun(Module["postRun"].shift()); - } - } - callRuntimeCallbacks(__ATPOSTRUN__); - } - - function addOnPreRun(cb) { - __ATPRERUN__.unshift(cb); - } - - function addOnPostRun(cb) { - __ATPOSTRUN__.unshift(cb); - } - assert(Math.imul, "This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); - assert(Math.fround, "This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); - assert(Math.clz32, "This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); - assert(Math.trunc, "This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); - var Math_ceil = Math.ceil; - var Math_floor = Math.floor; - var runDependencies = 0; - var runDependencyWatcher = null; - var dependenciesFulfilled = null; - var runDependencyTracking = {}; - - function addRunDependency(id) { - assert(!ENVIRONMENT_IS_PTHREAD, "addRunDependency cannot be used in a pthread worker"); - runDependencies++; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - if (id) { - assert(!runDependencyTracking[id]); - runDependencyTracking[id] = 1; - if (runDependencyWatcher === null && typeof setInterval !== "undefined") { - runDependencyWatcher = setInterval(function () { - if (ABORT) { - clearInterval(runDependencyWatcher); - runDependencyWatcher = null; - return - } - var shown = false; - for (var dep in runDependencyTracking) { - if (!shown) { - shown = true; - err("still waiting on run dependencies:"); - } - err("dependency: " + dep); - } - if (shown) { - err("(end of list)"); - } - }, 1e4); - } - } else { - err("warning: run dependency added without ID"); - } - } - - function removeRunDependency(id) { - runDependencies--; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - if (id) { - assert(runDependencyTracking[id]); - delete runDependencyTracking[id]; - } else { - err("warning: run dependency removed without ID"); - } - if (runDependencies == 0) { - if (runDependencyWatcher !== null) { - clearInterval(runDependencyWatcher); - runDependencyWatcher = null; - } - if (dependenciesFulfilled) { - var callback = dependenciesFulfilled; - dependenciesFulfilled = null; - callback(); - } - } - } - Module["preloadedImages"] = {}; - Module["preloadedAudios"] = {}; - - function abort(what) { - if (Module["onAbort"]) { - Module["onAbort"](what); - } - if (ENVIRONMENT_IS_PTHREAD) console.error("Pthread aborting at " + (new Error).stack); - what += ""; - out(what); - err(what); - ABORT = true; - var output = "abort(" + what + ") at " + stackTrace(); - what = output; - throw new WebAssembly.RuntimeError(what) - } - var FS = { - error: function () { - abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1"); - }, - init: function () { - FS.error(); - }, - createDataFile: function () { - FS.error(); - }, - createPreloadedFile: function () { - FS.error(); - }, - createLazyFile: function () { - FS.error(); - }, - open: function () { - FS.error(); - }, - mkdev: function () { - FS.error(); - }, - registerDevice: function () { - FS.error(); - }, - analyzePath: function () { - FS.error(); - }, - loadFilesFromDB: function () { - FS.error(); - }, - ErrnoError: function ErrnoError() { - FS.error(); - } - }; - Module["FS_createDataFile"] = FS.createDataFile; - Module["FS_createPreloadedFile"] = FS.createPreloadedFile; - - function hasPrefix(str, prefix) { - return String.prototype.startsWith ? str.startsWith(prefix) : str.indexOf(prefix) === 0 - } - var dataURIPrefix = "data:application/octet-stream;base64,"; - - function isDataURI(filename) { - return hasPrefix(filename, dataURIPrefix) - } - var fileURIPrefix = "file://"; - - function isFileURI(filename) { - return hasPrefix(filename, fileURIPrefix) - } - var wasmBinaryFile = "tfjs-backend-wasm.wasm"; - console.log("INITIALIZE WASM BINARY FILE"); - if (!isDataURI(wasmBinaryFile)) { - wasmBinaryFile = locateFile(wasmBinaryFile); - } - - function getBinary() { - try { - if (wasmBinary) { - return new Uint8Array(wasmBinary) - } - if (readBinary) { - return readBinary(wasmBinaryFile) - } else { - throw "both async and sync fetching of the wasm failed" - } - } catch (err) { - abort(err); - } - } - - function getBinaryPromise() { - if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) && typeof fetch === "function" && !isFileURI(wasmBinaryFile)) { - return fetch(wasmBinaryFile, { - credentials: "same-origin" - }).then(function (response) { - if (!response["ok"]) { - throw "failed to load wasm binary file at '" + wasmBinaryFile + "'" - } - return response["arrayBuffer"]() - }).catch(function () { - return getBinary() - }) - } - return new Promise(function (resolve, reject) { - resolve(getBinary()); - }) - } - - function createWasm() { - var info = { - "env": asmLibraryArg, - "wasi_snapshot_preview1": asmLibraryArg - }; - - function receiveInstance(instance, module) { - var exports = instance.exports; - Module["asm"] = exports; - wasmModule = module; - if (!ENVIRONMENT_IS_PTHREAD) { - var numWorkersToLoad = PThread.unusedWorkers.length; - PThread.unusedWorkers.forEach(function (w) { - PThread.loadWasmModuleToWorker(w, function () { - if (!--numWorkersToLoad) removeRunDependency("wasm-instantiate"); - }); - }); - } - } - if (!ENVIRONMENT_IS_PTHREAD) { - addRunDependency("wasm-instantiate"); - } - var trueModule = Module; - - function receiveInstantiatedSource(output) { - assert(Module === trueModule, "the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"); - trueModule = null; - receiveInstance(output["instance"], output["module"]); - } - - function instantiateArrayBuffer(receiver) { - return getBinaryPromise().then(function (binary) { - return WebAssembly.instantiate(binary, info) - }).then(receiver, function (reason) { - err("failed to asynchronously prepare wasm: " + reason); - abort(reason); - }) - } - - function instantiateAsync() { - if (!wasmBinary && typeof WebAssembly.instantiateStreaming === "function" && !isDataURI(wasmBinaryFile) && !isFileURI(wasmBinaryFile) && typeof fetch === "function") { - console.log("INSTANTIATE ASYNC"); - console.log(wasmBinaryFile); - fetch(wasmBinaryFile, { - credentials: "same-origin" - }).then(function (response) { - response.arrayBuffer().then(resp => { - var result = WebAssembly.instantiate(resp, info); - return result.then(receiveInstantiatedSource, function (reason) { - err("wasm streaming compile failed: " + reason); - err("falling back to ArrayBuffer instantiation"); - instantiateArrayBuffer(receiveInstantiatedSource); - }) - }); - }); - } else { - return instantiateArrayBuffer(receiveInstantiatedSource) - } - } - if (Module["instantiateWasm"]) { - try { - var exports = Module["instantiateWasm"](info, receiveInstance); - return exports - } catch (e) { - err("Module.instantiateWasm callback failed with error: " + e); - return false - } - } - instantiateAsync(); - return {} - } - var ASM_CONSTS = {}; - - function initPthreadsJS() { - PThread.initRuntime(); - } - if (!ENVIRONMENT_IS_PTHREAD) __ATINIT__.push({ - func: function () { - ___wasm_call_ctors(); - } - }); - - function demangle(func) { - warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"); - return func - } - - function demangleAll(text) { - var regex = /\b_Z[\w\d_]+/g; - return text.replace(regex, function (x) { - var y = demangle(x); - return x === y ? x : y + " [" + x + "]" - }) - } - var __pthread_ptr = 0; - var __pthread_is_main_runtime_thread = 0; - var __pthread_is_main_browser_thread = 0; - - function __register_pthread_ptr(pthreadPtr, isMainBrowserThread, isMainRuntimeThread) { - pthreadPtr = pthreadPtr | 0; - isMainBrowserThread = isMainBrowserThread | 0; - isMainRuntimeThread = isMainRuntimeThread | 0; - __pthread_ptr = pthreadPtr; - __pthread_is_main_browser_thread = isMainBrowserThread; - __pthread_is_main_runtime_thread = isMainRuntimeThread; - } - Module["__register_pthread_ptr"] = __register_pthread_ptr; - var ERRNO_CODES = { - EPERM: 63, - ENOENT: 44, - ESRCH: 71, - EINTR: 27, - EIO: 29, - ENXIO: 60, - E2BIG: 1, - ENOEXEC: 45, - EBADF: 8, - ECHILD: 12, - EAGAIN: 6, - EWOULDBLOCK: 6, - ENOMEM: 48, - EACCES: 2, - EFAULT: 21, - ENOTBLK: 105, - EBUSY: 10, - EEXIST: 20, - EXDEV: 75, - ENODEV: 43, - ENOTDIR: 54, - EISDIR: 31, - EINVAL: 28, - ENFILE: 41, - EMFILE: 33, - ENOTTY: 59, - ETXTBSY: 74, - EFBIG: 22, - ENOSPC: 51, - ESPIPE: 70, - EROFS: 69, - EMLINK: 34, - EPIPE: 64, - EDOM: 18, - ERANGE: 68, - ENOMSG: 49, - EIDRM: 24, - ECHRNG: 106, - EL2NSYNC: 156, - EL3HLT: 107, - EL3RST: 108, - ELNRNG: 109, - EUNATCH: 110, - ENOCSI: 111, - EL2HLT: 112, - EDEADLK: 16, - ENOLCK: 46, - EBADE: 113, - EBADR: 114, - EXFULL: 115, - ENOANO: 104, - EBADRQC: 103, - EBADSLT: 102, - EDEADLOCK: 16, - EBFONT: 101, - ENOSTR: 100, - ENODATA: 116, - ETIME: 117, - ENOSR: 118, - ENONET: 119, - ENOPKG: 120, - EREMOTE: 121, - ENOLINK: 47, - EADV: 122, - ESRMNT: 123, - ECOMM: 124, - EPROTO: 65, - EMULTIHOP: 36, - EDOTDOT: 125, - EBADMSG: 9, - ENOTUNIQ: 126, - EBADFD: 127, - EREMCHG: 128, - ELIBACC: 129, - ELIBBAD: 130, - ELIBSCN: 131, - ELIBMAX: 132, - ELIBEXEC: 133, - ENOSYS: 52, - ENOTEMPTY: 55, - ENAMETOOLONG: 37, - ELOOP: 32, - EOPNOTSUPP: 138, - EPFNOSUPPORT: 139, - ECONNRESET: 15, - ENOBUFS: 42, - EAFNOSUPPORT: 5, - EPROTOTYPE: 67, - ENOTSOCK: 57, - ENOPROTOOPT: 50, - ESHUTDOWN: 140, - ECONNREFUSED: 14, - EADDRINUSE: 3, - ECONNABORTED: 13, - ENETUNREACH: 40, - ENETDOWN: 38, - ETIMEDOUT: 73, - EHOSTDOWN: 142, - EHOSTUNREACH: 23, - EINPROGRESS: 26, - EALREADY: 7, - EDESTADDRREQ: 17, - EMSGSIZE: 35, - EPROTONOSUPPORT: 66, - ESOCKTNOSUPPORT: 137, - EADDRNOTAVAIL: 4, - ENETRESET: 39, - EISCONN: 30, - ENOTCONN: 53, - ETOOMANYREFS: 141, - EUSERS: 136, - EDQUOT: 19, - ESTALE: 72, - ENOTSUP: 138, - ENOMEDIUM: 148, - EILSEQ: 25, - EOVERFLOW: 61, - ECANCELED: 11, - ENOTRECOVERABLE: 56, - EOWNERDEAD: 62, - ESTRPIPE: 135 - }; - var __main_thread_futex_wait_address = 12912; - - function _emscripten_futex_wake(addr, count) { - if (addr <= 0 || addr > GROWABLE_HEAP_I8().length || addr & 3 != 0 || count < 0) return -28; - if (count == 0) return 0; - if (count >= 2147483647) count = Infinity; - var mainThreadWaitAddress = Atomics.load(GROWABLE_HEAP_I32(), __main_thread_futex_wait_address >> 2); - var mainThreadWoken = 0; - if (mainThreadWaitAddress == addr) { - var loadedAddr = Atomics.compareExchange(GROWABLE_HEAP_I32(), __main_thread_futex_wait_address >> 2, mainThreadWaitAddress, 0); - if (loadedAddr == mainThreadWaitAddress) { - --count; - mainThreadWoken = 1; - if (count <= 0) return 1 - } - } - var ret = Atomics.notify(GROWABLE_HEAP_I32(), addr >> 2, count); - if (ret >= 0) return ret + mainThreadWoken; - throw "Atomics.notify returned an unexpected value " + ret - } - Module["_emscripten_futex_wake"] = _emscripten_futex_wake; - - function __kill_thread(pthread_ptr) { - if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _kill_thread() can only ever be called from main application thread!"; - if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _kill_thread!"; - GROWABLE_HEAP_I32()[pthread_ptr + 12 >> 2] = 0; - var pthread = PThread.pthreads[pthread_ptr]; - pthread.worker.terminate(); - PThread.freeThreadData(pthread); - PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker), 1); - pthread.worker.pthread = undefined; - } - - function __cancel_thread(pthread_ptr) { - if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _cancel_thread() can only ever be called from main application thread!"; - if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _cancel_thread!"; - var pthread = PThread.pthreads[pthread_ptr]; - pthread.worker.postMessage({ - "cmd": "cancel" - }); - } - - function __cleanup_thread(pthread_ptr) { - if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _cleanup_thread() can only ever be called from main application thread!"; - if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _cleanup_thread!"; - GROWABLE_HEAP_I32()[pthread_ptr + 12 >> 2] = 0; - var pthread = PThread.pthreads[pthread_ptr]; - if (pthread) { - var worker = pthread.worker; - PThread.returnWorkerToPool(worker); - } - } - var PThread = { - MAIN_THREAD_ID: 1, - mainThreadInfo: { - schedPolicy: 0, - schedPrio: 0 - }, - unusedWorkers: [], - runningWorkers: [], - initRuntime: function () { - __register_pthread_ptr(PThread.mainThreadBlock, !ENVIRONMENT_IS_WORKER, 1); - _emscripten_register_main_browser_thread_id(PThread.mainThreadBlock); - }, - initMainThreadBlock: function () { - assert(!ENVIRONMENT_IS_PTHREAD); - var pthreadPoolSize = 8; - for (var i = 0; i < pthreadPoolSize; ++i) { - PThread.allocateUnusedWorker(); - } - PThread.mainThreadBlock = 12160; - for (var i = 0; i < 232 / 4; ++i) GROWABLE_HEAP_U32()[PThread.mainThreadBlock / 4 + i] = 0; - GROWABLE_HEAP_I32()[PThread.mainThreadBlock + 12 >> 2] = PThread.mainThreadBlock; - var headPtr = PThread.mainThreadBlock + 156; - GROWABLE_HEAP_I32()[headPtr >> 2] = headPtr; - var tlsMemory = 12400; - for (var i = 0; i < 128; ++i) GROWABLE_HEAP_U32()[tlsMemory / 4 + i] = 0; - Atomics.store(GROWABLE_HEAP_U32(), PThread.mainThreadBlock + 104 >> 2, tlsMemory); - Atomics.store(GROWABLE_HEAP_U32(), PThread.mainThreadBlock + 40 >> 2, PThread.mainThreadBlock); - Atomics.store(GROWABLE_HEAP_U32(), PThread.mainThreadBlock + 44 >> 2, 42); - }, - initWorker: function () {}, - pthreads: {}, - exitHandlers: null, - setThreadStatus: function () {}, - runExitHandlers: function () { - if (PThread.exitHandlers !== null) { - while (PThread.exitHandlers.length > 0) { - PThread.exitHandlers.pop()(); - } - PThread.exitHandlers = null; - } - if (ENVIRONMENT_IS_PTHREAD && threadInfoStruct) ___pthread_tsd_run_dtors(); - }, - threadExit: function (exitCode) { - var tb = _pthread_self(); - if (tb) { - err("Pthread 0x" + tb.toString(16) + " exited."); - Atomics.store(GROWABLE_HEAP_U32(), tb + 4 >> 2, exitCode); - Atomics.store(GROWABLE_HEAP_U32(), tb + 0 >> 2, 1); - Atomics.store(GROWABLE_HEAP_U32(), tb + 60 >> 2, 1); - Atomics.store(GROWABLE_HEAP_U32(), tb + 64 >> 2, 0); - PThread.runExitHandlers(); - _emscripten_futex_wake(tb + 0, 2147483647); - __register_pthread_ptr(0, 0, 0); - threadInfoStruct = 0; - if (ENVIRONMENT_IS_PTHREAD) { - postMessage({ - "cmd": "exit" - }); - } - } - }, - threadCancel: function () { - PThread.runExitHandlers(); - Atomics.store(GROWABLE_HEAP_U32(), threadInfoStruct + 4 >> 2, -1); - Atomics.store(GROWABLE_HEAP_U32(), threadInfoStruct + 0 >> 2, 1); - _emscripten_futex_wake(threadInfoStruct + 0, 2147483647); - threadInfoStruct = selfThreadId = 0; - __register_pthread_ptr(0, 0, 0); - postMessage({ - "cmd": "cancelDone" - }); - }, - terminateAllThreads: function () { - for (var t in PThread.pthreads) { - var pthread = PThread.pthreads[t]; - if (pthread && pthread.worker) { - PThread.returnWorkerToPool(pthread.worker); - } - } - PThread.pthreads = {}; - for (var i = 0; i < PThread.unusedWorkers.length; ++i) { - var worker = PThread.unusedWorkers[i]; - assert(!worker.pthread); - worker.terminate(); - } - PThread.unusedWorkers = []; - for (var i = 0; i < PThread.runningWorkers.length; ++i) { - var worker = PThread.runningWorkers[i]; - var pthread = worker.pthread; - assert(pthread, "This Worker should have a pthread it is executing"); - PThread.freeThreadData(pthread); - worker.terminate(); - } - PThread.runningWorkers = []; - }, - freeThreadData: function (pthread) { - if (!pthread) return; - if (pthread.threadInfoStruct) { - var tlsMemory = GROWABLE_HEAP_I32()[pthread.threadInfoStruct + 104 >> 2]; - GROWABLE_HEAP_I32()[pthread.threadInfoStruct + 104 >> 2] = 0; - _free(tlsMemory); - _free(pthread.threadInfoStruct); - } - pthread.threadInfoStruct = 0; - if (pthread.allocatedOwnStack && pthread.stackBase) _free(pthread.stackBase); - pthread.stackBase = 0; - if (pthread.worker) pthread.worker.pthread = null; - }, - returnWorkerToPool: function (worker) { - delete PThread.pthreads[worker.pthread.thread]; - PThread.unusedWorkers.push(worker); - PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker), 1); - PThread.freeThreadData(worker.pthread); - worker.pthread = undefined; - }, - receiveObjectTransfer: function (data) {}, - loadWasmModuleToWorker: function (worker, onFinishedLoading) { - worker.onmessage = function (e) { - var d = e["data"]; - var cmd = d["cmd"]; - if (worker.pthread) PThread.currentProxiedOperationCallerThread = worker.pthread.threadInfoStruct; - if (d["targetThread"] && d["targetThread"] != _pthread_self()) { - var thread = PThread.pthreads[d.targetThread]; - if (thread) { - thread.worker.postMessage(e.data, d["transferList"]); - } else { - console.error('Internal error! Worker sent a message "' + cmd + '" to target pthread ' + d["targetThread"] + ", but that thread no longer exists!"); - } - PThread.currentProxiedOperationCallerThread = undefined; - return - } - if (cmd === "processQueuedMainThreadWork") { - _emscripten_main_thread_process_queued_calls(); - } else if (cmd === "spawnThread") { - __spawn_thread(e.data); - } else if (cmd === "cleanupThread") { - __cleanup_thread(d["thread"]); - } else if (cmd === "killThread") { - __kill_thread(d["thread"]); - } else if (cmd === "cancelThread") { - __cancel_thread(d["thread"]); - } else if (cmd === "loaded") { - worker.loaded = true; - if (onFinishedLoading) onFinishedLoading(worker); - if (worker.runPthread) { - worker.runPthread(); - delete worker.runPthread; - } - } else if (cmd === "print") { - out("Thread " + d["threadId"] + ": " + d["text"]); - } else if (cmd === "printErr") { - err("Thread " + d["threadId"] + ": " + d["text"]); - } else if (cmd === "alert") { - alert("Thread " + d["threadId"] + ": " + d["text"]); - } else if (cmd === "exit") { - var detached = worker.pthread && Atomics.load(GROWABLE_HEAP_U32(), worker.pthread.thread + 68 >> 2); - if (detached) { - PThread.returnWorkerToPool(worker); - } - } else if (cmd === "cancelDone") { - PThread.returnWorkerToPool(worker); - } else if (cmd === "objectTransfer") { - PThread.receiveObjectTransfer(e.data); - } else if (e.data.target === "setimmediate") { - worker.postMessage(e.data); - } else { - err("worker sent an unknown command " + cmd); - } - PThread.currentProxiedOperationCallerThread = undefined; - }; - worker.onerror = function (e) { - err("pthread sent an error! " + e.filename + ":" + e.lineno + ": " + e.message); - }; - if (ENVIRONMENT_IS_NODE) { - worker.on("message", function (data) { - worker.onmessage({ - data: data - }); - }); - worker.on("error", function (data) { - worker.onerror(data); - }); - worker.on("exit", function (data) { - console.log("worker exited - TODO: update the worker queue?"); - }); - } - assert(wasmMemory instanceof WebAssembly.Memory, "WebAssembly memory should have been loaded by now!"); - assert(wasmModule instanceof WebAssembly.Module, "WebAssembly Module should have been loaded by now!"); - worker.postMessage({ - "cmd": "load", - "urlOrBlob": Module["mainScriptUrlOrBlob"] || _scriptDir, - "wasmMemory": wasmMemory, - "wasmModule": wasmModule, - "DYNAMIC_BASE": DYNAMIC_BASE, - "DYNAMICTOP_PTR": DYNAMICTOP_PTR - }); - }, - allocateUnusedWorker: function () { - var pthreadMainJs = locateFile("tfjs-backend-wasm.worker.js"); - PThread.unusedWorkers.push(new Worker(pthreadMainJs)); - }, - getNewWorker: function () { - if (PThread.unusedWorkers.length == 0) { - PThread.allocateUnusedWorker(); - PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0]); - } - if (PThread.unusedWorkers.length > 0) return PThread.unusedWorkers.pop(); - else return null - }, - busySpinWait: function (msecs) { - var t = performance.now() + msecs; - while (performance.now() < t) {} - } - }; - - function establishStackSpace(stackTop, stackMax) { - STACK_BASE = STACKTOP = stackTop; - STACK_MAX = stackMax; - ___set_stack_limit(STACK_MAX); - writeStackCookie(); - stackRestore(stackTop); - } - Module["establishStackSpace"] = establishStackSpace; - - function getNoExitRuntime() { - return noExitRuntime - } - Module["getNoExitRuntime"] = getNoExitRuntime; - - function jsStackTrace() { - var err = new Error; - if (!err.stack) { - try { - throw new Error - } catch (e) { - err = e; - } - if (!err.stack) { - return "(no stack trace available)" - } - } - return err.stack.toString() - } - - function stackTrace() { - var js = jsStackTrace(); - if (Module["extraStackTrace"]) js += "\n" + Module["extraStackTrace"](); - return demangleAll(js) - } - - function ___assert_fail(condition, filename, line, func) { - abort("Assertion failed: " + UTF8ToString(condition) + ", at: " + [filename ? UTF8ToString(filename) : "unknown filename", line, func ? UTF8ToString(func) : "unknown function"]); - } - var _emscripten_get_now; - if (ENVIRONMENT_IS_NODE) { - _emscripten_get_now = function () { - var t = process["hrtime"](); - return t[0] * 1e3 + t[1] / 1e6 - }; - } else if (ENVIRONMENT_IS_PTHREAD) { - _emscripten_get_now = function () { - return performance.now() - Module["__performance_now_clock_drift"] - }; - } else if (typeof dateNow !== "undefined") { - _emscripten_get_now = dateNow; - } else _emscripten_get_now = function () { - return performance.now() - }; - - function _atexit(func, arg) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(1, 1, func, arg); - warnOnce("atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)"); - } - - function ___handle_stack_overflow() { - abort("stack overflow"); - } - - function __emscripten_notify_thread_queue(targetThreadId, mainThreadId) { - if (targetThreadId == mainThreadId) { - postMessage({ - "cmd": "processQueuedMainThreadWork" - }); - } else if (ENVIRONMENT_IS_PTHREAD) { - postMessage({ - "targetThread": targetThreadId, - "cmd": "processThreadQueue" - }); - } else { - var pthread = PThread.pthreads[targetThreadId]; - var worker = pthread && pthread.worker; - if (!worker) { - err("Cannot send message to thread with ID " + targetThreadId + ", unknown thread ID!"); - return - } - worker.postMessage({ - "cmd": "processThreadQueue" - }); - } - return 1 - } - - function _abort() { - abort(); - } - - function _emscripten_conditional_set_current_thread_status(expectedStatus, newStatus) {} - - function _emscripten_futex_wait(addr, val, timeout) { - if (addr <= 0 || addr > GROWABLE_HEAP_I8().length || addr & 3 != 0) return -28; - if (ENVIRONMENT_IS_WORKER) { - var ret = Atomics.wait(GROWABLE_HEAP_I32(), addr >> 2, val, timeout); - if (ret === "timed-out") return -73; - if (ret === "not-equal") return -6; - if (ret === "ok") return 0; - throw "Atomics.wait returned an unexpected value " + ret - } else { - var loadedVal = Atomics.load(GROWABLE_HEAP_I32(), addr >> 2); - if (val != loadedVal) return -6; - var tNow = performance.now(); - var tEnd = tNow + timeout; - Atomics.store(GROWABLE_HEAP_I32(), __main_thread_futex_wait_address >> 2, addr); - var ourWaitAddress = addr; - while (addr == ourWaitAddress) { - tNow = performance.now(); - if (tNow > tEnd) { - return -73 - } - _emscripten_main_thread_process_queued_calls(); - addr = Atomics.load(GROWABLE_HEAP_I32(), __main_thread_futex_wait_address >> 2); - } - return 0 - } - } - - function _emscripten_is_main_browser_thread() { - return __pthread_is_main_browser_thread | 0 - } - - function _emscripten_is_main_runtime_thread() { - return __pthread_is_main_runtime_thread | 0 - } - - function _emscripten_memcpy_big(dest, src, num) { - GROWABLE_HEAP_U8().copyWithin(dest, src, src + num); - } - - function _emscripten_proxy_to_main_thread_js(index, sync) { - var numCallArgs = arguments.length - 2; - if (numCallArgs > 20 - 1) throw "emscripten_proxy_to_main_thread_js: Too many arguments " + numCallArgs + " to proxied function idx=" + index + ", maximum supported is " + (20 - 1) + "!"; - var stack = stackSave(); - var args = stackAlloc(numCallArgs * 8); - var b = args >> 3; - for (var i = 0; i < numCallArgs; i++) { - GROWABLE_HEAP_F64()[b + i] = arguments[2 + i]; - } - var ret = _emscripten_run_in_main_runtime_thread_js(index, numCallArgs, args, sync); - stackRestore(stack); - return ret - } - var _emscripten_receive_on_main_thread_js_callArgs = []; - - function readAsmConstArgs(sigPtr, buf) { - if (!readAsmConstArgs.array) { - readAsmConstArgs.array = []; - } - var args = readAsmConstArgs.array; - args.length = 0; - var ch; - while (ch = GROWABLE_HEAP_U8()[sigPtr++]) { - if (ch === 100 || ch === 102) { - buf = buf + 7 & ~7; - args.push(GROWABLE_HEAP_F64()[buf >> 3]); - buf += 8; - } else if (ch === 105) { - buf = buf + 3 & ~3; - args.push(GROWABLE_HEAP_I32()[buf >> 2]); - buf += 4; - } else abort("unexpected char in asm const signature " + ch); - } - return args - } - - function _emscripten_receive_on_main_thread_js(index, numCallArgs, args) { - _emscripten_receive_on_main_thread_js_callArgs.length = numCallArgs; - var b = args >> 3; - for (var i = 0; i < numCallArgs; i++) { - _emscripten_receive_on_main_thread_js_callArgs[i] = GROWABLE_HEAP_F64()[b + i]; - } - var isEmAsmConst = index < 0; - var func = !isEmAsmConst ? proxiedFunctionTable[index] : ASM_CONSTS[-index - 1]; - if (isEmAsmConst) { - var sigPtr = _emscripten_receive_on_main_thread_js_callArgs[1]; - var varargPtr = _emscripten_receive_on_main_thread_js_callArgs[2]; - var constArgs = readAsmConstArgs(sigPtr, varargPtr); - return func.apply(null, constArgs) - } - assert(func.length == numCallArgs, "Call args mismatch in emscripten_receive_on_main_thread_js"); - return func.apply(null, _emscripten_receive_on_main_thread_js_callArgs) - } - - function _emscripten_get_heap_size() { - return GROWABLE_HEAP_U8().length - } - - function emscripten_realloc_buffer(size) { - try { - wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16); - updateGlobalBufferAndViews(wasmMemory.buffer); - return 1 - } catch (e) { - console.error("emscripten_realloc_buffer: Attempted to grow heap from " + buffer.byteLength + " bytes to " + size + " bytes, but got error: " + e); - } - } - - function _emscripten_resize_heap(requestedSize) { - var oldSize = _emscripten_get_heap_size(); - if (requestedSize <= oldSize) { - return false - } - var PAGE_MULTIPLE = 65536; - var maxHeapSize = 1073741824; - if (requestedSize > maxHeapSize) { - err("Cannot enlarge memory, asked to go up to " + requestedSize + " bytes, but the limit is " + maxHeapSize + " bytes!"); - return false - } - var minHeapSize = 16777216; - for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { - var overGrownHeapSize = oldSize * (1 + .2 / cutDown); - overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296); - var newSize = Math.min(maxHeapSize, alignUp(Math.max(minHeapSize, requestedSize, overGrownHeapSize), PAGE_MULTIPLE)); - var replacement = emscripten_realloc_buffer(newSize); - if (replacement) { - return true - } - } - err("Failed to grow the heap from " + oldSize + " bytes to " + newSize + " bytes, not enough memory!"); - return false - } - var JSEvents = { - keyEvent: 0, - mouseEvent: 0, - wheelEvent: 0, - uiEvent: 0, - focusEvent: 0, - deviceOrientationEvent: 0, - deviceMotionEvent: 0, - fullscreenChangeEvent: 0, - pointerlockChangeEvent: 0, - visibilityChangeEvent: 0, - touchEvent: 0, - previousFullscreenElement: null, - previousScreenX: null, - previousScreenY: null, - removeEventListenersRegistered: false, - removeAllEventListeners: function () { - for (var i = JSEvents.eventHandlers.length - 1; i >= 0; --i) { - JSEvents._removeHandler(i); - } - JSEvents.eventHandlers = []; - JSEvents.deferredCalls = []; - }, - registerRemoveEventListeners: function () { - if (!JSEvents.removeEventListenersRegistered) { - JSEvents.removeEventListenersRegistered = true; - } - }, - deferredCalls: [], - deferCall: function (targetFunction, precedence, argsList) { - function arraysHaveEqualContent(arrA, arrB) { - if (arrA.length != arrB.length) return false; - for (var i in arrA) { - if (arrA[i] != arrB[i]) return false - } - return true - } - for (var i in JSEvents.deferredCalls) { - var call = JSEvents.deferredCalls[i]; - if (call.targetFunction == targetFunction && arraysHaveEqualContent(call.argsList, argsList)) { - return - } - } - JSEvents.deferredCalls.push({ - targetFunction: targetFunction, - precedence: precedence, - argsList: argsList - }); - JSEvents.deferredCalls.sort(function (x, y) { - return x.precedence < y.precedence - }); - }, - removeDeferredCalls: function (targetFunction) { - for (var i = 0; i < JSEvents.deferredCalls.length; ++i) { - if (JSEvents.deferredCalls[i].targetFunction == targetFunction) { - JSEvents.deferredCalls.splice(i, 1); - --i; - } - } - }, - canPerformEventHandlerRequests: function () { - return JSEvents.inEventHandler && JSEvents.currentEventHandler.allowsDeferredCalls - }, - runDeferredCalls: function () { - if (!JSEvents.canPerformEventHandlerRequests()) { - return - } - for (var i = 0; i < JSEvents.deferredCalls.length; ++i) { - var call = JSEvents.deferredCalls[i]; - JSEvents.deferredCalls.splice(i, 1); - --i; - call.targetFunction.apply(null, call.argsList); - } - }, - inEventHandler: 0, - currentEventHandler: null, - eventHandlers: [], - removeAllHandlersOnTarget: function (target, eventTypeString) { - for (var i = 0; i < JSEvents.eventHandlers.length; ++i) { - if (JSEvents.eventHandlers[i].target == target && (!eventTypeString || eventTypeString == JSEvents.eventHandlers[i].eventTypeString)) { - JSEvents._removeHandler(i--); - } - } - }, - _removeHandler: function (i) { - var h = JSEvents.eventHandlers[i]; - h.target.removeEventListener(h.eventTypeString, h.eventListenerFunc, h.useCapture); - JSEvents.eventHandlers.splice(i, 1); - }, - registerOrRemoveHandler: function (eventHandler) { - var jsEventHandler = function jsEventHandler(event) { - ++JSEvents.inEventHandler; - JSEvents.currentEventHandler = eventHandler; - JSEvents.runDeferredCalls(); - eventHandler.handlerFunc(event); - JSEvents.runDeferredCalls(); - --JSEvents.inEventHandler; - }; - if (eventHandler.callbackfunc) { - eventHandler.eventListenerFunc = jsEventHandler; - eventHandler.target.addEventListener(eventHandler.eventTypeString, jsEventHandler, eventHandler.useCapture); - JSEvents.eventHandlers.push(eventHandler); - JSEvents.registerRemoveEventListeners(); - } else { - for (var i = 0; i < JSEvents.eventHandlers.length; ++i) { - if (JSEvents.eventHandlers[i].target == eventHandler.target && JSEvents.eventHandlers[i].eventTypeString == eventHandler.eventTypeString) { - JSEvents._removeHandler(i--); - } - } - } - }, - queueEventHandlerOnThread_iiii: function (targetThread, eventHandlerFunc, eventTypeId, eventData, userData) { - var stackTop = stackSave(); - var varargs = stackAlloc(12); - GROWABLE_HEAP_I32()[varargs >> 2] = eventTypeId; - GROWABLE_HEAP_I32()[varargs + 4 >> 2] = eventData; - GROWABLE_HEAP_I32()[varargs + 8 >> 2] = userData; - _emscripten_async_queue_on_thread_(targetThread, 637534208, eventHandlerFunc, eventData, varargs); - stackRestore(stackTop); - }, - getTargetThreadForEventCallback: function (targetThread) { - switch (targetThread) { - case 1: - return 0; - case 2: - return PThread.currentProxiedOperationCallerThread; - default: - return targetThread - } - }, - getNodeNameForTarget: function (target) { - if (!target) return ""; - if (target == window) return "#window"; - if (target == screen) return "#screen"; - return target && target.nodeName ? target.nodeName : "" - }, - fullscreenEnabled: function () { - return document.fullscreenEnabled || document.webkitFullscreenEnabled - } - }; - - function stringToNewUTF8(jsString) { - var length = lengthBytesUTF8(jsString) + 1; - var cString = _malloc(length); - stringToUTF8(jsString, cString, length); - return cString - } - - function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread, targetCanvas, width, height) { - var stackTop = stackSave(); - var varargs = stackAlloc(12); - var targetCanvasPtr = 0; - if (targetCanvas) { - targetCanvasPtr = stringToNewUTF8(targetCanvas); - } - GROWABLE_HEAP_I32()[varargs >> 2] = targetCanvasPtr; - GROWABLE_HEAP_I32()[varargs + 4 >> 2] = width; - GROWABLE_HEAP_I32()[varargs + 8 >> 2] = height; - _emscripten_async_queue_on_thread_(targetThread, 657457152, 0, targetCanvasPtr, varargs); - stackRestore(stackTop); - } - - function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread, targetCanvas, width, height) { - targetCanvas = targetCanvas ? UTF8ToString(targetCanvas) : ""; - _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread, targetCanvas, width, height); - } - - function __maybeCStringToJsString(cString) { - return cString === cString + 0 ? UTF8ToString(cString) : cString - } - var __specialEventTargets = [0, typeof document !== "undefined" ? document : 0, typeof window !== "undefined" ? window : 0]; - - function __findEventTarget(target) { - var domElement = __specialEventTargets[target] || (typeof document !== "undefined" ? document.querySelector(__maybeCStringToJsString(target)) : undefined); - return domElement - } - - function __findCanvasEventTarget(target) { - return __findEventTarget(target) - } - - function _emscripten_set_canvas_element_size_calling_thread(target, width, height) { - var canvas = __findCanvasEventTarget(target); - if (!canvas) return -4; - if (canvas.canvasSharedPtr) { - GROWABLE_HEAP_I32()[canvas.canvasSharedPtr >> 2] = width; - GROWABLE_HEAP_I32()[canvas.canvasSharedPtr + 4 >> 2] = height; - } - if (canvas.offscreenCanvas || !canvas.controlTransferredOffscreen) { - if (canvas.offscreenCanvas) canvas = canvas.offscreenCanvas; - var autoResizeViewport = false; - if (canvas.GLctxObject && canvas.GLctxObject.GLctx) { - var prevViewport = canvas.GLctxObject.GLctx.getParameter(2978); - autoResizeViewport = prevViewport[0] === 0 && prevViewport[1] === 0 && prevViewport[2] === canvas.width && prevViewport[3] === canvas.height; - } - canvas.width = width; - canvas.height = height; - if (autoResizeViewport) { - canvas.GLctxObject.GLctx.viewport(0, 0, width, height); - } - } else if (canvas.canvasSharedPtr) { - var targetThread = GROWABLE_HEAP_I32()[canvas.canvasSharedPtr + 8 >> 2]; - _emscripten_set_offscreencanvas_size_on_target_thread(targetThread, target, width, height); - return 1 - } else { - return -4 - } - return 0 - } - - function _emscripten_set_canvas_element_size_main_thread(target, width, height) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(2, 1, target, width, height); - return _emscripten_set_canvas_element_size_calling_thread(target, width, height) - } - - function _emscripten_set_canvas_element_size(target, width, height) { - var canvas = __findCanvasEventTarget(target); - if (canvas) { - return _emscripten_set_canvas_element_size_calling_thread(target, width, height) - } else { - return _emscripten_set_canvas_element_size_main_thread(target, width, height) - } - } - - function _emscripten_set_current_thread_status(newStatus) {} - - function __webgl_acquireInstancedArraysExtension(ctx) { - var ext = ctx.getExtension("ANGLE_instanced_arrays"); - if (ext) { - ctx["vertexAttribDivisor"] = function (index, divisor) { - ext["vertexAttribDivisorANGLE"](index, divisor); - }; - ctx["drawArraysInstanced"] = function (mode, first, count, primcount) { - ext["drawArraysInstancedANGLE"](mode, first, count, primcount); - }; - ctx["drawElementsInstanced"] = function (mode, count, type, indices, primcount) { - ext["drawElementsInstancedANGLE"](mode, count, type, indices, primcount); - }; - } - } - - function __webgl_acquireVertexArrayObjectExtension(ctx) { - var ext = ctx.getExtension("OES_vertex_array_object"); - if (ext) { - ctx["createVertexArray"] = function () { - return ext["createVertexArrayOES"]() - }; - ctx["deleteVertexArray"] = function (vao) { - ext["deleteVertexArrayOES"](vao); - }; - ctx["bindVertexArray"] = function (vao) { - ext["bindVertexArrayOES"](vao); - }; - ctx["isVertexArray"] = function (vao) { - return ext["isVertexArrayOES"](vao) - }; - } - } - - function __webgl_acquireDrawBuffersExtension(ctx) { - var ext = ctx.getExtension("WEBGL_draw_buffers"); - if (ext) { - ctx["drawBuffers"] = function (n, bufs) { - ext["drawBuffersWEBGL"](n, bufs); - }; - } - } - var GL = { - counter: 1, - lastError: 0, - buffers: [], - mappedBuffers: {}, - programs: [], - framebuffers: [], - renderbuffers: [], - textures: [], - uniforms: [], - shaders: [], - vaos: [], - contexts: {}, - currentContext: null, - offscreenCanvases: {}, - timerQueriesEXT: [], - programInfos: {}, - stringCache: {}, - unpackAlignment: 4, - init: function () { - var miniTempFloatBuffer = new Float32Array(GL.MINI_TEMP_BUFFER_SIZE); - for (var i = 0; i < GL.MINI_TEMP_BUFFER_SIZE; i++) { - GL.miniTempBufferFloatViews[i] = miniTempFloatBuffer.subarray(0, i + 1); - } - var miniTempIntBuffer = new Int32Array(GL.MINI_TEMP_BUFFER_SIZE); - for (var i = 0; i < GL.MINI_TEMP_BUFFER_SIZE; i++) { - GL.miniTempBufferIntViews[i] = miniTempIntBuffer.subarray(0, i + 1); - } - }, - recordError: function recordError(errorCode) { - if (!GL.lastError) { - GL.lastError = errorCode; - } - }, - getNewId: function (table) { - var ret = GL.counter++; - for (var i = table.length; i < ret; i++) { - table[i] = null; - } - return ret - }, - MINI_TEMP_BUFFER_SIZE: 256, - miniTempBufferFloatViews: [0], - miniTempBufferIntViews: [0], - getSource: function (shader, count, string, length) { - var source = ""; - for (var i = 0; i < count; ++i) { - var len = length ? GROWABLE_HEAP_I32()[length + i * 4 >> 2] : -1; - source += UTF8ToString(GROWABLE_HEAP_I32()[string + i * 4 >> 2], len < 0 ? undefined : len); - } - return source - }, - createContext: function (canvas, webGLContextAttributes) { - var ctx = canvas.getContext("webgl", webGLContextAttributes); - if (!ctx) return 0; - var handle = GL.registerContext(ctx, webGLContextAttributes); - return handle - }, - registerContext: function (ctx, webGLContextAttributes) { - var handle = _malloc(8); - GROWABLE_HEAP_I32()[handle + 4 >> 2] = _pthread_self(); - var context = { - handle: handle, - attributes: webGLContextAttributes, - version: webGLContextAttributes.majorVersion, - GLctx: ctx - }; - if (ctx.canvas) ctx.canvas.GLctxObject = context; - GL.contexts[handle] = context; - if (typeof webGLContextAttributes.enableExtensionsByDefault === "undefined" || webGLContextAttributes.enableExtensionsByDefault) { - GL.initExtensions(context); - } - return handle - }, - makeContextCurrent: function (contextHandle) { - GL.currentContext = GL.contexts[contextHandle]; - Module.ctx = GLctx = GL.currentContext && GL.currentContext.GLctx; - return !(contextHandle && !GLctx) - }, - getContext: function (contextHandle) { - return GL.contexts[contextHandle] - }, - deleteContext: function (contextHandle) { - if (GL.currentContext === GL.contexts[contextHandle]) GL.currentContext = null; - if (typeof JSEvents === "object") JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas); - if (GL.contexts[contextHandle] && GL.contexts[contextHandle].GLctx.canvas) GL.contexts[contextHandle].GLctx.canvas.GLctxObject = undefined; - _free(GL.contexts[contextHandle].handle); - GL.contexts[contextHandle] = null; - }, - initExtensions: function (context) { - if (!context) context = GL.currentContext; - if (context.initExtensionsDone) return; - context.initExtensionsDone = true; - var GLctx = context.GLctx; - if (context.version < 2) { - __webgl_acquireInstancedArraysExtension(GLctx); - __webgl_acquireVertexArrayObjectExtension(GLctx); - __webgl_acquireDrawBuffersExtension(GLctx); - } - GLctx.disjointTimerQueryExt = GLctx.getExtension("EXT_disjoint_timer_query"); - var automaticallyEnabledExtensions = ["OES_texture_float", "OES_texture_half_float", "OES_standard_derivatives", "OES_vertex_array_object", "WEBGL_compressed_texture_s3tc", "WEBGL_depth_texture", "OES_element_index_uint", "EXT_texture_filter_anisotropic", "EXT_frag_depth", "WEBGL_draw_buffers", "ANGLE_instanced_arrays", "OES_texture_float_linear", "OES_texture_half_float_linear", "EXT_blend_minmax", "EXT_shader_texture_lod", "EXT_texture_norm16", "WEBGL_compressed_texture_pvrtc", "EXT_color_buffer_half_float", "WEBGL_color_buffer_float", "EXT_sRGB", "WEBGL_compressed_texture_etc1", "EXT_disjoint_timer_query", "WEBGL_compressed_texture_etc", "WEBGL_compressed_texture_astc", "EXT_color_buffer_float", "WEBGL_compressed_texture_s3tc_srgb", "EXT_disjoint_timer_query_webgl2", "WEBKIT_WEBGL_compressed_texture_pvrtc"]; - var exts = GLctx.getSupportedExtensions() || []; - exts.forEach(function (ext) { - if (automaticallyEnabledExtensions.indexOf(ext) != -1) { - GLctx.getExtension(ext); - } - }); - }, - populateUniformTable: function (program) { - var p = GL.programs[program]; - var ptable = GL.programInfos[program] = { - uniforms: {}, - maxUniformLength: 0, - maxAttributeLength: -1, - maxUniformBlockNameLength: -1 - }; - var utable = ptable.uniforms; - var numUniforms = GLctx.getProgramParameter(p, 35718); - for (var i = 0; i < numUniforms; ++i) { - var u = GLctx.getActiveUniform(p, i); - var name = u.name; - ptable.maxUniformLength = Math.max(ptable.maxUniformLength, name.length + 1); - if (name.slice(-1) == "]") { - name = name.slice(0, name.lastIndexOf("[")); - } - var loc = GLctx.getUniformLocation(p, name); - if (loc) { - var id = GL.getNewId(GL.uniforms); - utable[name] = [u.size, id]; - GL.uniforms[id] = loc; - for (var j = 1; j < u.size; ++j) { - var n = name + "[" + j + "]"; - loc = GLctx.getUniformLocation(p, n); - id = GL.getNewId(GL.uniforms); - GL.uniforms[id] = loc; - } - } - } - } - }; - var __emscripten_webgl_power_preferences = ["default", "low-power", "high-performance"]; - - function _emscripten_webgl_do_create_context(target, attributes) { - assert(attributes); - var contextAttributes = {}; - var a = attributes >> 2; - contextAttributes["alpha"] = !!GROWABLE_HEAP_I32()[a + (0 >> 2)]; - contextAttributes["depth"] = !!GROWABLE_HEAP_I32()[a + (4 >> 2)]; - contextAttributes["stencil"] = !!GROWABLE_HEAP_I32()[a + (8 >> 2)]; - contextAttributes["antialias"] = !!GROWABLE_HEAP_I32()[a + (12 >> 2)]; - contextAttributes["premultipliedAlpha"] = !!GROWABLE_HEAP_I32()[a + (16 >> 2)]; - contextAttributes["preserveDrawingBuffer"] = !!GROWABLE_HEAP_I32()[a + (20 >> 2)]; - var powerPreference = GROWABLE_HEAP_I32()[a + (24 >> 2)]; - contextAttributes["powerPreference"] = __emscripten_webgl_power_preferences[powerPreference]; - contextAttributes["failIfMajorPerformanceCaveat"] = !!GROWABLE_HEAP_I32()[a + (28 >> 2)]; - contextAttributes.majorVersion = GROWABLE_HEAP_I32()[a + (32 >> 2)]; - contextAttributes.minorVersion = GROWABLE_HEAP_I32()[a + (36 >> 2)]; - contextAttributes.enableExtensionsByDefault = GROWABLE_HEAP_I32()[a + (40 >> 2)]; - contextAttributes.explicitSwapControl = GROWABLE_HEAP_I32()[a + (44 >> 2)]; - contextAttributes.proxyContextToMainThread = GROWABLE_HEAP_I32()[a + (48 >> 2)]; - contextAttributes.renderViaOffscreenBackBuffer = GROWABLE_HEAP_I32()[a + (52 >> 2)]; - var canvas = __findCanvasEventTarget(target); - if (!canvas) { - return 0 - } - if (contextAttributes.explicitSwapControl) { - return 0 - } - var contextHandle = GL.createContext(canvas, contextAttributes); - return contextHandle - } - - function _emscripten_webgl_create_context(a0, a1) { - return _emscripten_webgl_do_create_context(a0, a1) - } - var SYSCALLS = { - mappings: {}, - buffers: [null, [], - [] - ], - printChar: function (stream, curr) { - var buffer = SYSCALLS.buffers[stream]; - assert(buffer); - if (curr === 0 || curr === 10) { - (stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0)); - buffer.length = 0; - } else { - buffer.push(curr); - } - }, - varargs: undefined, - get: function () { - assert(SYSCALLS.varargs != undefined); - SYSCALLS.varargs += 4; - var ret = GROWABLE_HEAP_I32()[SYSCALLS.varargs - 4 >> 2]; - return ret - }, - getStr: function (ptr) { - var ret = UTF8ToString(ptr); - return ret - }, - get64: function (low, high) { - if (low >= 0) assert(high === 0); - else assert(high === -1); - return low - } - }; - - function _fd_close(fd) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(3, 1, fd); - abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM"); - return 0 - } - - function _fd_seek(fd, offset_low, offset_high, whence, newOffset) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(4, 1, fd, offset_low, offset_high, whence, newOffset); - abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM"); - } - - function _fd_write(fd, iov, iovcnt, pnum) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(5, 1, fd, iov, iovcnt, pnum); - var num = 0; - for (var i = 0; i < iovcnt; i++) { - var ptr = GROWABLE_HEAP_I32()[iov + i * 8 >> 2]; - var len = GROWABLE_HEAP_I32()[iov + (i * 8 + 4) >> 2]; - for (var j = 0; j < len; j++) { - SYSCALLS.printChar(fd, GROWABLE_HEAP_U8()[ptr + j]); - } - num += len; - } - GROWABLE_HEAP_I32()[pnum >> 2] = num; - return 0 - } - - function _pthread_cleanup_pop(execute) { - var routine = PThread.exitHandlers.pop(); - if (execute) routine(); - } - - function _pthread_cleanup_push(routine, arg) { - if (PThread.exitHandlers === null) { - PThread.exitHandlers = []; - } - PThread.exitHandlers.push(function () { - dynCall_vi(routine, arg); - }); - } - - function __spawn_thread(threadParams) { - if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _spawn_thread() can only ever be called from main application thread!"; - var worker = PThread.getNewWorker(); - if (worker.pthread !== undefined) throw "Internal error!"; - if (!threadParams.pthread_ptr) throw "Internal error, no pthread ptr!"; - PThread.runningWorkers.push(worker); - var tlsMemory = _malloc(128 * 4); - for (var i = 0; i < 128; ++i) { - GROWABLE_HEAP_I32()[tlsMemory + i * 4 >> 2] = 0; - } - var stackHigh = threadParams.stackBase + threadParams.stackSize; - var pthread = PThread.pthreads[threadParams.pthread_ptr] = { - worker: worker, - stackBase: threadParams.stackBase, - stackSize: threadParams.stackSize, - allocatedOwnStack: threadParams.allocatedOwnStack, - thread: threadParams.pthread_ptr, - threadInfoStruct: threadParams.pthread_ptr - }; - var tis = pthread.threadInfoStruct >> 2; - Atomics.store(GROWABLE_HEAP_U32(), tis + (0 >> 2), 0); - Atomics.store(GROWABLE_HEAP_U32(), tis + (4 >> 2), 0); - Atomics.store(GROWABLE_HEAP_U32(), tis + (8 >> 2), 0); - Atomics.store(GROWABLE_HEAP_U32(), tis + (68 >> 2), threadParams.detached); - Atomics.store(GROWABLE_HEAP_U32(), tis + (104 >> 2), tlsMemory); - Atomics.store(GROWABLE_HEAP_U32(), tis + (48 >> 2), 0); - Atomics.store(GROWABLE_HEAP_U32(), tis + (40 >> 2), pthread.threadInfoStruct); - Atomics.store(GROWABLE_HEAP_U32(), tis + (44 >> 2), 42); - Atomics.store(GROWABLE_HEAP_U32(), tis + (108 >> 2), threadParams.stackSize); - Atomics.store(GROWABLE_HEAP_U32(), tis + (84 >> 2), threadParams.stackSize); - Atomics.store(GROWABLE_HEAP_U32(), tis + (80 >> 2), stackHigh); - Atomics.store(GROWABLE_HEAP_U32(), tis + (108 + 8 >> 2), stackHigh); - Atomics.store(GROWABLE_HEAP_U32(), tis + (108 + 12 >> 2), threadParams.detached); - Atomics.store(GROWABLE_HEAP_U32(), tis + (108 + 20 >> 2), threadParams.schedPolicy); - Atomics.store(GROWABLE_HEAP_U32(), tis + (108 + 24 >> 2), threadParams.schedPrio); - var global_libc = _emscripten_get_global_libc(); - var global_locale = global_libc + 40; - Atomics.store(GROWABLE_HEAP_U32(), tis + (176 >> 2), global_locale); - worker.pthread = pthread; - var msg = { - "cmd": "run", - "start_routine": threadParams.startRoutine, - "arg": threadParams.arg, - "threadInfoStruct": threadParams.pthread_ptr, - "selfThreadId": threadParams.pthread_ptr, - "parentThreadId": threadParams.parent_pthread_ptr, - "stackBase": threadParams.stackBase, - "stackSize": threadParams.stackSize - }; - worker.runPthread = function () { - msg.time = performance.now(); - worker.postMessage(msg, threadParams.transferList); - }; - if (worker.loaded) { - worker.runPthread(); - delete worker.runPthread; - } - } - - function _pthread_getschedparam(thread, policy, schedparam) { - if (!policy && !schedparam) return ERRNO_CODES.EINVAL; - if (!thread) { - err("pthread_getschedparam called with a null thread pointer!"); - return ERRNO_CODES.ESRCH - } - var self = GROWABLE_HEAP_I32()[thread + 12 >> 2]; - if (self !== thread) { - err("pthread_getschedparam attempted on thread " + thread + ", which does not point to a valid thread, or does not exist anymore!"); - return ERRNO_CODES.ESRCH - } - var schedPolicy = Atomics.load(GROWABLE_HEAP_U32(), thread + 108 + 20 >> 2); - var schedPrio = Atomics.load(GROWABLE_HEAP_U32(), thread + 108 + 24 >> 2); - if (policy) GROWABLE_HEAP_I32()[policy >> 2] = schedPolicy; - if (schedparam) GROWABLE_HEAP_I32()[schedparam >> 2] = schedPrio; - return 0 - } - - function _pthread_self() { - return __pthread_ptr | 0 - } - Module["_pthread_self"] = _pthread_self; - - function _pthread_create(pthread_ptr, attr, start_routine, arg) { - if (typeof SharedArrayBuffer === "undefined") { - err("Current environment does not support SharedArrayBuffer, pthreads are not available!"); - return 6 - } - if (!pthread_ptr) { - err("pthread_create called with a null thread pointer!"); - return 28 - } - var transferList = []; - var error = 0; - if (ENVIRONMENT_IS_PTHREAD && (transferList.length === 0 || error)) { - return _emscripten_sync_run_in_main_thread_4(687865856, pthread_ptr, attr, start_routine, arg) - } - var stackSize = 0; - var stackBase = 0; - var detached = 0; - var schedPolicy = 0; - var schedPrio = 0; - if (attr) { - stackSize = GROWABLE_HEAP_I32()[attr >> 2]; - stackSize += 81920; - stackBase = GROWABLE_HEAP_I32()[attr + 8 >> 2]; - detached = GROWABLE_HEAP_I32()[attr + 12 >> 2] !== 0; - var inheritSched = GROWABLE_HEAP_I32()[attr + 16 >> 2] === 0; - if (inheritSched) { - var prevSchedPolicy = GROWABLE_HEAP_I32()[attr + 20 >> 2]; - var prevSchedPrio = GROWABLE_HEAP_I32()[attr + 24 >> 2]; - var parentThreadPtr = PThread.currentProxiedOperationCallerThread ? PThread.currentProxiedOperationCallerThread : _pthread_self(); - _pthread_getschedparam(parentThreadPtr, attr + 20, attr + 24); - schedPolicy = GROWABLE_HEAP_I32()[attr + 20 >> 2]; - schedPrio = GROWABLE_HEAP_I32()[attr + 24 >> 2]; - GROWABLE_HEAP_I32()[attr + 20 >> 2] = prevSchedPolicy; - GROWABLE_HEAP_I32()[attr + 24 >> 2] = prevSchedPrio; - } else { - schedPolicy = GROWABLE_HEAP_I32()[attr + 20 >> 2]; - schedPrio = GROWABLE_HEAP_I32()[attr + 24 >> 2]; - } - } else { - stackSize = 2097152; - } - var allocatedOwnStack = stackBase == 0; - if (allocatedOwnStack) { - stackBase = _memalign(16, stackSize); - } else { - stackBase -= stackSize; - assert(stackBase > 0); - } - var threadInfoStruct = _malloc(232); - for (var i = 0; i < 232 >> 2; ++i) GROWABLE_HEAP_U32()[(threadInfoStruct >> 2) + i] = 0; - GROWABLE_HEAP_I32()[pthread_ptr >> 2] = threadInfoStruct; - GROWABLE_HEAP_I32()[threadInfoStruct + 12 >> 2] = threadInfoStruct; - var headPtr = threadInfoStruct + 156; - GROWABLE_HEAP_I32()[headPtr >> 2] = headPtr; - var threadParams = { - stackBase: stackBase, - stackSize: stackSize, - allocatedOwnStack: allocatedOwnStack, - schedPolicy: schedPolicy, - schedPrio: schedPrio, - detached: detached, - startRoutine: start_routine, - pthread_ptr: threadInfoStruct, - parent_pthread_ptr: _pthread_self(), - arg: arg, - transferList: transferList - }; - if (ENVIRONMENT_IS_PTHREAD) { - threadParams.cmd = "spawnThread"; - postMessage(threadParams, transferList); - } else { - __spawn_thread(threadParams); - } - return 0 - } - - function _roundf(d) { - d = +d; - return d >= +0 ? +Math_floor(d + +.5) : +Math_ceil(d - +.5) - } - if (!ENVIRONMENT_IS_PTHREAD) PThread.initMainThreadBlock(); - else PThread.initWorker(); - var GLctx; - GL.init(); - var proxiedFunctionTable = [null, _atexit, _emscripten_set_canvas_element_size_main_thread, _fd_close, _fd_seek, _fd_write]; - var asmLibraryArg = { - "__assert_fail": ___assert_fail, - "__handle_stack_overflow": ___handle_stack_overflow, - "_emscripten_notify_thread_queue": __emscripten_notify_thread_queue, - "abort": _abort, - "emscripten_conditional_set_current_thread_status": _emscripten_conditional_set_current_thread_status, - "emscripten_futex_wait": _emscripten_futex_wait, - "emscripten_futex_wake": _emscripten_futex_wake, - "emscripten_get_now": _emscripten_get_now, - "emscripten_is_main_browser_thread": _emscripten_is_main_browser_thread, - "emscripten_is_main_runtime_thread": _emscripten_is_main_runtime_thread, - "emscripten_memcpy_big": _emscripten_memcpy_big, - "emscripten_receive_on_main_thread_js": _emscripten_receive_on_main_thread_js, - "emscripten_resize_heap": _emscripten_resize_heap, - "emscripten_set_canvas_element_size": _emscripten_set_canvas_element_size, - "emscripten_set_current_thread_status": _emscripten_set_current_thread_status, - "emscripten_webgl_create_context": _emscripten_webgl_create_context, - "fd_close": _fd_close, - "fd_seek": _fd_seek, - "fd_write": _fd_write, - "initPthreadsJS": initPthreadsJS, - "memory": wasmMemory || Module["wasmMemory"], - "pthread_cleanup_pop": _pthread_cleanup_pop, - "pthread_cleanup_push": _pthread_cleanup_push, - "pthread_create": _pthread_create, - "pthread_self": _pthread_self, - "roundf": _roundf, - "table": wasmTable - }; - var asm = createWasm(); - Module["asm"] = asm; - var ___wasm_call_ctors = Module["___wasm_call_ctors"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["__wasm_call_ctors"].apply(null, arguments) - }; - var _init = Module["_init"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["init"].apply(null, arguments) - }; - var _register_tensor = Module["_register_tensor"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["register_tensor"].apply(null, arguments) - }; - var _dispose_data = Module["_dispose_data"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["dispose_data"].apply(null, arguments) - }; - var _dispose = Module["_dispose"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["dispose"].apply(null, arguments) - }; - var _Abs = Module["_Abs"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Abs"].apply(null, arguments) - }; - var _Add = Module["_Add"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Add"].apply(null, arguments) - }; - var _AddN = Module["_AddN"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["AddN"].apply(null, arguments) - }; - var _ArgMax = Module["_ArgMax"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["ArgMax"].apply(null, arguments) - }; - var _AvgPool = Module["_AvgPool"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["AvgPool"].apply(null, arguments) - }; - var _BatchMatMul = Module["_BatchMatMul"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["BatchMatMul"].apply(null, arguments) - }; - var _ClipByValue = Module["_ClipByValue"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["ClipByValue"].apply(null, arguments) - }; - var _Conv2D = Module["_Conv2D"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Conv2D"].apply(null, arguments) - }; - var _Cos = Module["_Cos"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Cos"].apply(null, arguments) - }; - var _CropAndResize = Module["_CropAndResize"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["CropAndResize"].apply(null, arguments) - }; - var _DepthwiseConv2dNative = Module["_DepthwiseConv2dNative"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["DepthwiseConv2dNative"].apply(null, arguments) - }; - var _Div = Module["_Div"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Div"].apply(null, arguments) - }; - var _Exp = Module["_Exp"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Exp"].apply(null, arguments) - }; - var _FloorDiv = Module["_FloorDiv"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["FloorDiv"].apply(null, arguments) - }; - var _FusedBatchNorm = Module["_FusedBatchNorm"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["FusedBatchNorm"].apply(null, arguments) - }; - var _FusedConv2D = Module["_FusedConv2D"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["FusedConv2D"].apply(null, arguments) - }; - var _FusedDepthwiseConv2D = Module["_FusedDepthwiseConv2D"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["FusedDepthwiseConv2D"].apply(null, arguments) - }; - var _Gather = Module["_Gather"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Gather"].apply(null, arguments) - }; - var _GatherNd = Module["_GatherNd"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["GatherNd"].apply(null, arguments) - }; - var _Greater = Module["_Greater"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Greater"].apply(null, arguments) - }; - var _GreaterEqual = Module["_GreaterEqual"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["GreaterEqual"].apply(null, arguments) - }; - var _Less = Module["_Less"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Less"].apply(null, arguments) - }; - var _LessEqual = Module["_LessEqual"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["LessEqual"].apply(null, arguments) - }; - var _Log = Module["_Log"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Log"].apply(null, arguments) - }; - var _LogicalAnd = Module["_LogicalAnd"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["LogicalAnd"].apply(null, arguments) - }; - var _Max = Module["_Max"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Max"].apply(null, arguments) - }; - var _MaxPool = Module["_MaxPool"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["MaxPool"].apply(null, arguments) - }; - var _Maximum = Module["_Maximum"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Maximum"].apply(null, arguments) - }; - var _Min = Module["_Min"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Min"].apply(null, arguments) - }; - var _Minimum = Module["_Minimum"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Minimum"].apply(null, arguments) - }; - var _Mul = Module["_Mul"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Mul"].apply(null, arguments) - }; - var _Neg = Module["_Neg"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Neg"].apply(null, arguments) - }; - var _NonMaxSuppressionV3 = Module["_NonMaxSuppressionV3"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["NonMaxSuppressionV3"].apply(null, arguments) - }; - var _NonMaxSuppressionV5 = Module["_NonMaxSuppressionV5"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["NonMaxSuppressionV5"].apply(null, arguments) - }; - var _NotEqual = Module["_NotEqual"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["NotEqual"].apply(null, arguments) - }; - var _PadV2 = Module["_PadV2"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["PadV2"].apply(null, arguments) - }; - var _Pow = Module["_Pow"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Pow"].apply(null, arguments) - }; - var _Prelu = Module["_Prelu"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Prelu"].apply(null, arguments) - }; - var _Relu = Module["_Relu"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Relu"].apply(null, arguments) - }; - var _Relu6 = Module["_Relu6"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Relu6"].apply(null, arguments) - }; - var _ResizeBilinear = Module["_ResizeBilinear"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["ResizeBilinear"].apply(null, arguments) - }; - var _Rsqrt = Module["_Rsqrt"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Rsqrt"].apply(null, arguments) - }; - var _ScatterNd = Module["_ScatterNd"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["ScatterNd"].apply(null, arguments) - }; - var _Sigmoid = Module["_Sigmoid"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Sigmoid"].apply(null, arguments) - }; - var _Sin = Module["_Sin"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Sin"].apply(null, arguments) - }; - var _Softmax = Module["_Softmax"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Softmax"].apply(null, arguments) - }; - var _Square = Module["_Square"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Square"].apply(null, arguments) - }; - var _Sub = Module["_Sub"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Sub"].apply(null, arguments) - }; - var _Sum = Module["_Sum"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Sum"].apply(null, arguments) - }; - var _Tanh = Module["_Tanh"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Tanh"].apply(null, arguments) - }; - var _Tile = Module["_Tile"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Tile"].apply(null, arguments) - }; - var _Transpose = Module["_Transpose"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Transpose"].apply(null, arguments) - }; - var __FusedMatMul = Module["__FusedMatMul"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["_FusedMatMul"].apply(null, arguments) - }; - var _malloc = Module["_malloc"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["malloc"].apply(null, arguments) - }; - var _free = Module["_free"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["free"].apply(null, arguments) - }; - var ___em_js__initPthreadsJS = Module["___em_js__initPthreadsJS"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["__em_js__initPthreadsJS"].apply(null, arguments) - }; - var _emscripten_get_global_libc = Module["_emscripten_get_global_libc"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_get_global_libc"].apply(null, arguments) - }; - var _memalign = Module["_memalign"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["memalign"].apply(null, arguments) - }; - var ___pthread_tsd_run_dtors = Module["___pthread_tsd_run_dtors"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["__pthread_tsd_run_dtors"].apply(null, arguments) - }; - var _emscripten_main_thread_process_queued_calls = Module["_emscripten_main_thread_process_queued_calls"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null, arguments) - }; - var _emscripten_current_thread_process_queued_calls = Module["_emscripten_current_thread_process_queued_calls"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null, arguments) - }; - var _emscripten_register_main_browser_thread_id = Module["_emscripten_register_main_browser_thread_id"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null, arguments) - }; - var _emscripten_main_browser_thread_id = Module["_emscripten_main_browser_thread_id"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_main_browser_thread_id"].apply(null, arguments) - }; - var _emscripten_async_run_in_main_thread = Module["_emscripten_async_run_in_main_thread"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread = Module["_emscripten_sync_run_in_main_thread"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_0 = Module["_emscripten_sync_run_in_main_thread_0"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_1 = Module["_emscripten_sync_run_in_main_thread_1"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_2 = Module["_emscripten_sync_run_in_main_thread_2"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_xprintf_varargs = Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_3 = Module["_emscripten_sync_run_in_main_thread_3"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_4 = Module["_emscripten_sync_run_in_main_thread_4"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_5 = Module["_emscripten_sync_run_in_main_thread_5"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_6 = Module["_emscripten_sync_run_in_main_thread_6"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_7 = Module["_emscripten_sync_run_in_main_thread_7"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null, arguments) - }; - var _emscripten_run_in_main_runtime_thread_js = Module["_emscripten_run_in_main_runtime_thread_js"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null, arguments) - }; - var _emscripten_async_queue_on_thread_ = Module["_emscripten_async_queue_on_thread_"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null, arguments) - }; - var _emscripten_tls_init = Module["_emscripten_tls_init"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_tls_init"].apply(null, arguments) - }; - var ___set_stack_limit = Module["___set_stack_limit"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["__set_stack_limit"].apply(null, arguments) - }; - var stackSave = Module["stackSave"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["stackSave"].apply(null, arguments) - }; - var stackAlloc = Module["stackAlloc"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["stackAlloc"].apply(null, arguments) - }; - var stackRestore = Module["stackRestore"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["stackRestore"].apply(null, arguments) - }; - var dynCall_vi = Module["dynCall_vi"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["dynCall_vi"].apply(null, arguments) - }; - var dynCall_v = Module["dynCall_v"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["dynCall_v"].apply(null, arguments) - }; - var dynCall_ii = Module["dynCall_ii"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["dynCall_ii"].apply(null, arguments) - }; - Module["asm"] = asm; - if (!Object.getOwnPropertyDescriptor(Module, "intArrayFromString")) Module["intArrayFromString"] = function () { - abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "intArrayToString")) Module["intArrayToString"] = function () { - abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "ccall")) Module["ccall"] = function () { - abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - Module["cwrap"] = cwrap; - if (!Object.getOwnPropertyDescriptor(Module, "setValue")) Module["setValue"] = function () { - abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "getValue")) Module["getValue"] = function () { - abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "allocate")) Module["allocate"] = function () { - abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "getMemory")) Module["getMemory"] = function () { - abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "UTF8ArrayToString")) Module["UTF8ArrayToString"] = function () { - abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "UTF8ToString")) Module["UTF8ToString"] = function () { - abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8Array")) Module["stringToUTF8Array"] = function () { - abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8")) Module["stringToUTF8"] = function () { - abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF8")) Module["lengthBytesUTF8"] = function () { - abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function () { - abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "addOnPreRun")) Module["addOnPreRun"] = function () { - abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "addOnInit")) Module["addOnInit"] = function () { - abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "addOnPreMain")) Module["addOnPreMain"] = function () { - abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "addOnExit")) Module["addOnExit"] = function () { - abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "addOnPostRun")) Module["addOnPostRun"] = function () { - abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeStringToMemory")) Module["writeStringToMemory"] = function () { - abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeArrayToMemory")) Module["writeArrayToMemory"] = function () { - abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeAsciiToMemory")) Module["writeAsciiToMemory"] = function () { - abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "addRunDependency")) Module["addRunDependency"] = function () { - abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "removeRunDependency")) Module["removeRunDependency"] = function () { - abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createFolder")) Module["FS_createFolder"] = function () { - abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createPath")) Module["FS_createPath"] = function () { - abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createDataFile")) Module["FS_createDataFile"] = function () { - abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createPreloadedFile")) Module["FS_createPreloadedFile"] = function () { - abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createLazyFile")) Module["FS_createLazyFile"] = function () { - abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createLink")) Module["FS_createLink"] = function () { - abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createDevice")) Module["FS_createDevice"] = function () { - abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_unlink")) Module["FS_unlink"] = function () { - abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "dynamicAlloc")) Module["dynamicAlloc"] = function () { - abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "loadDynamicLibrary")) Module["loadDynamicLibrary"] = function () { - abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "loadWebAssemblyModule")) Module["loadWebAssemblyModule"] = function () { - abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "getLEB")) Module["getLEB"] = function () { - abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "getFunctionTables")) Module["getFunctionTables"] = function () { - abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "alignFunctionTables")) Module["alignFunctionTables"] = function () { - abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "registerFunctions")) Module["registerFunctions"] = function () { - abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "addFunction")) Module["addFunction"] = function () { - abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "removeFunction")) Module["removeFunction"] = function () { - abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "getFuncWrapper")) Module["getFuncWrapper"] = function () { - abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "prettyPrint")) Module["prettyPrint"] = function () { - abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "makeBigInt")) Module["makeBigInt"] = function () { - abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "dynCall")) Module["dynCall"] = function () { - abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "getCompilerSetting")) Module["getCompilerSetting"] = function () { - abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "print")) Module["print"] = function () { - abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "printErr")) Module["printErr"] = function () { - abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "getTempRet0")) Module["getTempRet0"] = function () { - abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "setTempRet0")) Module["setTempRet0"] = function () { - abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "callMain")) Module["callMain"] = function () { - abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "abort")) Module["abort"] = function () { - abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToNewUTF8")) Module["stringToNewUTF8"] = function () { - abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "emscripten_realloc_buffer")) Module["emscripten_realloc_buffer"] = function () { - abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "ENV")) Module["ENV"] = function () { - abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "setjmpId")) Module["setjmpId"] = function () { - abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_CODES")) Module["ERRNO_CODES"] = function () { - abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_MESSAGES")) Module["ERRNO_MESSAGES"] = function () { - abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "setErrNo")) Module["setErrNo"] = function () { - abort("'setErrNo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "DNS")) Module["DNS"] = function () { - abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "GAI_ERRNO_MESSAGES")) Module["GAI_ERRNO_MESSAGES"] = function () { - abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "Protocols")) Module["Protocols"] = function () { - abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "Sockets")) Module["Sockets"] = function () { - abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "UNWIND_CACHE")) Module["UNWIND_CACHE"] = function () { - abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "readAsmConstArgs")) Module["readAsmConstArgs"] = function () { - abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "jstoi_q")) Module["jstoi_q"] = function () { - abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "jstoi_s")) Module["jstoi_s"] = function () { - abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "PATH")) Module["PATH"] = function () { - abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "PATH_FS")) Module["PATH_FS"] = function () { - abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "SYSCALLS")) Module["SYSCALLS"] = function () { - abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "syscallMmap2")) Module["syscallMmap2"] = function () { - abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "syscallMunmap")) Module["syscallMunmap"] = function () { - abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "flush_NO_FILESYSTEM")) Module["flush_NO_FILESYSTEM"] = function () { - abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "JSEvents")) Module["JSEvents"] = function () { - abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "demangle")) Module["demangle"] = function () { - abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "demangleAll")) Module["demangleAll"] = function () { - abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "jsStackTrace")) Module["jsStackTrace"] = function () { - abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function () { - abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "getEnvStrings")) Module["getEnvStrings"] = function () { - abort("'getEnvStrings' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64")) Module["writeI53ToI64"] = function () { - abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Clamped")) Module["writeI53ToI64Clamped"] = function () { - abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Signaling")) Module["writeI53ToI64Signaling"] = function () { - abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Clamped")) Module["writeI53ToU64Clamped"] = function () { - abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Signaling")) Module["writeI53ToU64Signaling"] = function () { - abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "readI53FromI64")) Module["readI53FromI64"] = function () { - abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "readI53FromU64")) Module["readI53FromU64"] = function () { - abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "convertI32PairToI53")) Module["convertI32PairToI53"] = function () { - abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "convertU32PairToI53")) Module["convertU32PairToI53"] = function () { - abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "Browser")) Module["Browser"] = function () { - abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "GL")) Module["GL"] = function () { - abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGet")) Module["emscriptenWebGLGet"] = function () { - abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetTexPixelData")) Module["emscriptenWebGLGetTexPixelData"] = function () { - abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetUniform")) Module["emscriptenWebGLGetUniform"] = function () { - abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetVertexAttrib")) Module["emscriptenWebGLGetVertexAttrib"] = function () { - abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "AL")) Module["AL"] = function () { - abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "SDL_unicode")) Module["SDL_unicode"] = function () { - abort("'SDL_unicode' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "SDL_ttfContext")) Module["SDL_ttfContext"] = function () { - abort("'SDL_ttfContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "SDL_audio")) Module["SDL_audio"] = function () { - abort("'SDL_audio' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "SDL")) Module["SDL"] = function () { - abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "SDL_gfx")) Module["SDL_gfx"] = function () { - abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "GLUT")) Module["GLUT"] = function () { - abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "EGL")) Module["EGL"] = function () { - abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "GLFW_Window")) Module["GLFW_Window"] = function () { - abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "GLFW")) Module["GLFW"] = function () { - abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "GLEW")) Module["GLEW"] = function () { - abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "IDBStore")) Module["IDBStore"] = function () { - abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "runAndAbortIfError")) Module["runAndAbortIfError"] = function () { - abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - Module["PThread"] = PThread; - if (!Object.getOwnPropertyDescriptor(Module, "establishStackSpace")) Module["establishStackSpace"] = function () { - abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "getNoExitRuntime")) Module["getNoExitRuntime"] = function () { - abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "resetPrototype")) Module["resetPrototype"] = function () { - abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "warnOnce")) Module["warnOnce"] = function () { - abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "stackSave")) Module["stackSave"] = function () { - abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "stackRestore")) Module["stackRestore"] = function () { - abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "stackAlloc")) Module["stackAlloc"] = function () { - abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "AsciiToString")) Module["AsciiToString"] = function () { - abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToAscii")) Module["stringToAscii"] = function () { - abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "UTF16ToString")) Module["UTF16ToString"] = function () { - abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF16")) Module["stringToUTF16"] = function () { - abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF16")) Module["lengthBytesUTF16"] = function () { - abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "UTF32ToString")) Module["UTF32ToString"] = function () { - abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF32")) Module["stringToUTF32"] = function () { - abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF32")) Module["lengthBytesUTF32"] = function () { - abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8")) Module["allocateUTF8"] = function () { - abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8OnStack")) Module["allocateUTF8OnStack"] = function () { - abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - }; - Module["writeStackCookie"] = writeStackCookie; - Module["checkStackCookie"] = checkStackCookie; - Module["abortStackOverflow"] = abortStackOverflow; - Module["PThread"] = PThread; - Module["_pthread_self"] = _pthread_self; - Module["wasmMemory"] = wasmMemory; - Module["ExitStatus"] = ExitStatus; - if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NORMAL")) Object.defineProperty(Module, "ALLOC_NORMAL", { - configurable: true, - get: function () { - abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_STACK")) Object.defineProperty(Module, "ALLOC_STACK", { - configurable: true, - get: function () { - abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_DYNAMIC")) Object.defineProperty(Module, "ALLOC_DYNAMIC", { - configurable: true, - get: function () { - abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NONE")) Object.defineProperty(Module, "ALLOC_NONE", { - configurable: true, - get: function () { - abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)"); - } - }); - var calledRun; - Module["then"] = function (func) { - if (calledRun) { - func(Module); - } else { - var old = Module["onRuntimeInitialized"]; - Module["onRuntimeInitialized"] = function () { - if (old) old(); - func(Module); - }; - } - return Module - }; - - function ExitStatus(status) { - this.name = "ExitStatus"; - this.message = "Program terminated with exit(" + status + ")"; - this.status = status; - } - dependenciesFulfilled = function runCaller() { - if (!calledRun) run(); - if (!calledRun) dependenciesFulfilled = runCaller; - }; - - function run(args) { - if (runDependencies > 0) { - return - } - writeStackCookie(); - preRun(); - if (runDependencies > 0) return; - - function doRun() { - if (calledRun) return; - calledRun = true; - Module["calledRun"] = true; - if (ABORT) return; - initRuntime(); - preMain(); - if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"](); - assert(!Module["_main"], 'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'); - postRun(); - } - if (Module["setStatus"]) { - Module["setStatus"]("Running..."); - setTimeout(function () { - setTimeout(function () { - Module["setStatus"](""); - }, 1); - doRun(); - }, 1); - } else { - doRun(); - } - checkStackCookie(); - } - Module["run"] = run; - if (Module["preInit"]) { - if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]]; - while (Module["preInit"].length > 0) { - Module["preInit"].pop()(); - } - } - if (!ENVIRONMENT_IS_PTHREAD) noExitRuntime = true; - if (!ENVIRONMENT_IS_PTHREAD) run(); - - - return WasmBackendModule - } - ); - })(); - module.exports = WasmBackendModule; - }); - - /** - * @license - * Copyright 2019 Google Inc. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - var _this = undefined; - var WASM_PRIORITY = 2; - var BackendWasm = /** @class */ (function (_super) { - __extends(BackendWasm, _super); - - function BackendWasm(wasm) { - var _this = _super.call(this) || this; - _this.wasm = wasm; - // 0 is reserved for null data ids. - _this.dataIdNextNumber = 1; - _this.wasm.tfjs.init(); - _this.dataIdMap = new tfjsCore.DataStorage(_this, tfjsCore.engine()); - return _this; - } - BackendWasm.prototype.write = function (values, shape, dtype) { - var dataId = {}; - this.move(dataId, values, shape, dtype); - return dataId; - }; - BackendWasm.prototype.numDataIds = function () { - return this.dataIdMap.numDataIds(); - }; - BackendWasm.prototype.time = function (f) { - return __awaiter(this, void 0, void 0, function () { - var start, kernelMs; - return __generator(this, function (_a) { - start = tfjsCore.util.now(); - f(); - kernelMs = tfjsCore.util.now() - start; - return [2 /*return*/ , { - kernelMs: kernelMs - }]; - }); - }); - }; - BackendWasm.prototype.move = function (dataId, values, shape, dtype) { - var id = this.dataIdNextNumber++; - if (dtype === 'string') { - var stringBytes = values; - this.dataIdMap.set(dataId, { - id: id, - stringBytes: stringBytes, - shape: shape, - dtype: dtype, - memoryOffset: null - }); - return; - } - var size = tfjsCore.util.sizeFromShape(shape); - var numBytes = size * tfjsCore.util.bytesPerElement(dtype); - var memoryOffset = this.wasm._malloc(numBytes); - this.dataIdMap.set(dataId, { - id: id, - memoryOffset: memoryOffset, - shape: shape, - dtype: dtype - }); - this.wasm.tfjs.registerTensor(id, size, memoryOffset); - if (values != null) { - this.wasm.HEAPU8.set(new Uint8Array(values.buffer, 0, numBytes), memoryOffset); - } - }; - BackendWasm.prototype.read = function (dataId) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/ , this.readSync(dataId)]; - }); - }); - }; - BackendWasm.prototype.readSync = function (dataId) { - var _a = this.dataIdMap.get(dataId), - memoryOffset = _a.memoryOffset, - dtype = _a.dtype, - shape = _a.shape, - stringBytes = _a.stringBytes; - if (dtype === 'string') { - return stringBytes; - } - var bytes = this.wasm.HEAPU8.slice(memoryOffset, memoryOffset + tfjsCore.util.sizeFromShape(shape) * tfjsCore.util.bytesPerElement(dtype)); - return typedArrayFromBuffer(bytes.buffer, dtype); - }; - BackendWasm.prototype.disposeData = function (dataId) { - var data = this.dataIdMap.get(dataId); - this.wasm._free(data.memoryOffset); - this.wasm.tfjs.disposeData(data.id); - this.dataIdMap.delete(dataId); - }; - BackendWasm.prototype.floatPrecision = function () { - return 32; - }; - // Returns the memory offset of a tensor. Useful for debugging and unit - // testing. - BackendWasm.prototype.getMemoryOffset = function (dataId) { - return this.dataIdMap.get(dataId).memoryOffset; - }; - BackendWasm.prototype.dispose = function () { - this.wasm.tfjs.dispose(); - this.wasm = null; - }; - BackendWasm.prototype.memory = function () { - return { - unreliable: false - }; - }; - /** - * Make a tensor info for the output of an op. If `memoryOffset` is not - * present, this method allocates memory on the WASM heap. If `memoryOffset` - * is present, the memory was allocated elsewhere (in c++) and we just record - * the pointer where that memory lives. - */ - BackendWasm.prototype.makeOutput = function (shape, dtype, memoryOffset) { - var dataId; - if (memoryOffset == null) { - dataId = this.write(null /* values */ , shape, dtype); - } else { - dataId = {}; - var id = this.dataIdNextNumber++; - this.dataIdMap.set(dataId, { - id: id, - memoryOffset: memoryOffset, - shape: shape, - dtype: dtype - }); - var size = tfjsCore.util.sizeFromShape(shape); - this.wasm.tfjs.registerTensor(id, size, memoryOffset); - } - return { - dataId: dataId, - shape: shape, - dtype: dtype - }; - }; - BackendWasm.prototype.typedArrayFromHeap = function (_a) { - var shape = _a.shape, - dtype = _a.dtype, - dataId = _a.dataId; - var buffer = this.wasm.HEAPU8.buffer; - var memoryOffset = this.dataIdMap.get(dataId).memoryOffset; - var size = tfjsCore.util.sizeFromShape(shape); - switch (dtype) { - case 'float32': - return new Float32Array(buffer, memoryOffset, size); - case 'int32': - return new Int32Array(buffer, memoryOffset, size); - case 'bool': - return new Uint8Array(buffer, memoryOffset, size); - default: - throw new Error("Uknown dtype " + dtype); - } - }; - return BackendWasm; - }(tfjsCore.KernelBackend)); - tfjsCore.registerBackend('wasm', function () { - return __awaiter(_this, void 0, void 0, function () { - var wasm; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - return [4 /*yield*/ , init()]; - case 1: - wasm = (_a.sent()).wasm; - return [2 /*return*/ , new BackendWasm(wasm)]; - } - }); - }); - }, WASM_PRIORITY); - - function createInstantiateWasmFunc(path) { - // tslint:disable-next-line:no-any - return function (imports, callback) { - tfjsCore.util.fetch(path, { - credentials: 'same-origin' - }).then(function (response) { - if (!response['ok']) { - imports.env.a("failed to load wasm binary file at '" + path + "'"); - } - response.arrayBuffer().then(function (binary) { - WebAssembly.instantiate(binary, imports).then(function (output) { - callback(output.instance); - }); - }); - }); - return {}; - }; - } - /** - * Initializes the wasm module and creates the js <--> wasm bridge. - * - * NOTE: We wrap the wasm module in a object with property 'wasm' instead of - * returning Promise to avoid freezing Chrome (last tested - * in Chrome 76). - */ - function init() { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/ , new Promise(function (resolve, reject) { - var factoryConfig = {}; - if (wasmPath != null) { - factoryConfig.locateFile = function (path, prefix) { - if (path.endsWith('.wasm')) { - console.log("ASKIGN FOR THE WASM BINARY"); - console.log(wasmPath); - return wasmPath; - } - return prefix + path; - }; - // use wasm instantiateWasm override when system fetch is not available. - // For detail references - // https://github.com/emscripten-core/emscripten/blob/2bca083cbbd5a4133db61fbd74d04f7feecfa907/tests/manual_wasm_instantiate.html#L170 - if (customFetch) { - factoryConfig.instantiateWasm = createInstantiateWasmFunc(wasmPath); - } - } - var wasm = tfjsBackendWasm(factoryConfig); - var voidReturnType = null; + const wasm = WasmBackendModule(factoryConfig); + const voidReturnType = null; // Using the tfjs namespace to avoid conflict with emscripten's API. wasm.tfjs = { - init: wasm.cwrap('init', null, []), - registerTensor: wasm.cwrap('register_tensor', null, [ - 'number', - 'number', - 'number', - ]), - disposeData: wasm.cwrap('dispose_data', voidReturnType, ['number']), - dispose: wasm.cwrap('dispose', voidReturnType, []), + init: wasm.cwrap('init', null, []), + registerTensor: wasm.cwrap('register_tensor', null, [ + 'number', + 'number', + 'number', + ]), + disposeData: wasm.cwrap('dispose_data', voidReturnType, ['number']), + dispose: wasm.cwrap('dispose', voidReturnType, []), + }; + let initialized = false; + wasm.onRuntimeInitialized = () => { + initialized = true; + initAborted = false; + resolve({ wasm }); + }; + wasm.onAbort = () => { + if (initialized) { + // Emscripten already called console.warn so no need to double log. + return; + } + if (initAborted) { + // Emscripten calls `onAbort` twice, resulting in double error + // messages. + return; + } + initAborted = true; + const rejectMsg = 'Make sure the server can serve the `.wasm` file relative to the ' + + 'bundled js file. For more details see https://github.com/tensorflow/tfjs/blob/master/tfjs-backend-wasm/README.md#using-bundlers'; + reject({ message: rejectMsg }); }; - var initialized = false; - wasm.onRuntimeInitialized = function () { - initialized = true; - initAborted = false; - resolve({ - wasm: wasm - }); - }; - wasm.onAbort = function () { - if (initialized) { - // Emscripten already called console.warn so no need to double log. - return; - } - if (initAborted) { - // Emscripten calls `onAbort` twice, resulting in double error - // messages. - return; - } - initAborted = true; - var rejectMsg = 'Make sure the server can serve the `.wasm` file relative to the ' + - 'bundled js file. For more details see https://github.com/tensorflow/tfjs/blob/master/tfjs-backend-wasm/README.md#using-bundlers'; - reject({ - message: rejectMsg - }); - }; - })]; }); - }); } - function typedArrayFromBuffer(buffer, dtype) { - switch (dtype) { - case 'float32': - return new Float32Array(buffer); - case 'int32': - return new Int32Array(buffer); - case 'bool': - return new Uint8Array(buffer); - default: - throw new Error("Unknown dtype " + dtype); - } + switch (dtype) { + case 'float32': + return new Float32Array(buffer); + case 'int32': + return new Int32Array(buffer); + case 'bool': + return new Uint8Array(buffer); + default: + throw new Error(`Unknown dtype ${dtype}`); + } } - var wasmPath = null; - var initAborted = false; - var customFetch = false; + let wasmPath = null; + let initAborted = false; + let customFetch = false; /** * Sets the path to the `.wasm` file which will be fetched when the wasm * backend is initialized. See @@ -6509,29 +2834,24 @@ * the wasm file, default to false. */ /** @doc {heading: 'Environment', namespace: 'wasm'} */ - function setWasmPath(path, usePlatformFetch) { - if (usePlatformFetch === void 0) { - usePlatformFetch = false; - } - if (initAborted) { - throw new Error('The WASM backend was already initialized. Make sure you call ' + - '`setWasmPath()` before you call `tf.setBackend()` or `tf.ready()`'); - } - wasmPath = path; - customFetch = usePlatformFetch; - } - + function setWasmPath(path, usePlatformFetch = false) { + if (initAborted) { + throw new Error('The WASM backend was already initialized. Make sure you call ' + + '`setWasmPath()` before you call `tf.setBackend()` or `tf.ready()`'); + } + wasmPath = path; + customFetch = usePlatformFetch; + } + /** @license See the LICENSE file. */ // This code is auto-generated, do not modify this file! - var version = '0.0.0'; - - exports.BackendWasm = BackendWasm; - exports.setWasmPath = setWasmPath; - exports.version_wasm = version; - - Object.defineProperty(exports, '__esModule', { - value: true - }); - -}))); -//# sourceMappingURL=tf-backend-wasm.js.map + const version = '0.0.0'; + + exports.BackendWasm = BackendWasm; + exports.setWasmPath = setWasmPath; + exports.version_wasm = version; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=tf-backend-wasm.js.map diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.js b/tfjs-core/benchmarks/tfjs-backend-wasm.js new file mode 100755 index 00000000000..580fd3a6003 --- /dev/null +++ b/tfjs-core/benchmarks/tfjs-backend-wasm.js @@ -0,0 +1,3275 @@ +var WasmBackendModule = (function () { + var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; + if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; + return ( + function (WasmBackendModule) { + WasmBackendModule = WasmBackendModule || {}; + + function GROWABLE_HEAP_I8() { + if (wasmMemory.buffer != buffer) { + updateGlobalBufferAndViews(wasmMemory.buffer) + } + return HEAP8 + } + + function GROWABLE_HEAP_U8() { + if (wasmMemory.buffer != buffer) { + updateGlobalBufferAndViews(wasmMemory.buffer) + } + return HEAPU8 + } + + function GROWABLE_HEAP_I32() { + if (wasmMemory.buffer != buffer) { + updateGlobalBufferAndViews(wasmMemory.buffer) + } + return HEAP32 + } + + function GROWABLE_HEAP_U32() { + if (wasmMemory.buffer != buffer) { + updateGlobalBufferAndViews(wasmMemory.buffer) + } + return HEAPU32 + } + + function GROWABLE_HEAP_F64() { + if (wasmMemory.buffer != buffer) { + updateGlobalBufferAndViews(wasmMemory.buffer) + } + return HEAPF64 + } + var Module = typeof WasmBackendModule !== "undefined" ? WasmBackendModule : {}; + var moduleOverrides = {}; + var key; + for (key in Module) { + if (Module.hasOwnProperty(key)) { + moduleOverrides[key] = Module[key] + } + } + var arguments_ = []; + var thisProgram = "./this.program"; + var quit_ = function (status, toThrow) { + throw toThrow + }; + var ENVIRONMENT_IS_WEB = false; + var ENVIRONMENT_IS_WORKER = false; + var ENVIRONMENT_IS_NODE = false; + var ENVIRONMENT_IS_SHELL = false; + ENVIRONMENT_IS_WEB = typeof window === "object"; + ENVIRONMENT_IS_WORKER = typeof importScripts === "function"; + ENVIRONMENT_IS_NODE = typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string"; + ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER; + if (Module["ENVIRONMENT"]) { + throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)") + } + var ENVIRONMENT_IS_PTHREAD = Module["ENVIRONMENT_IS_PTHREAD"] || false; + if (ENVIRONMENT_IS_PTHREAD) { + buffer = Module["buffer"]; + DYNAMIC_BASE = Module["DYNAMIC_BASE"]; + DYNAMICTOP_PTR = Module["DYNAMICTOP_PTR"] + } + var scriptDirectory = ""; + + function locateFile(path) { + if (Module["locateFile"]) { + return Module["locateFile"](path, scriptDirectory) + } + return scriptDirectory + path + } + var read_, readAsync, readBinary, setWindowTitle; + var nodeFS; + var nodePath; + if (ENVIRONMENT_IS_NODE) { + if (ENVIRONMENT_IS_WORKER) { + scriptDirectory = require("path").dirname(scriptDirectory) + "/" + } else { + scriptDirectory = __dirname + "/" + } + read_ = function shell_read(filename, binary) { + if (!nodeFS) nodeFS = require("fs"); + if (!nodePath) nodePath = require("path"); + filename = nodePath["normalize"](filename); + return nodeFS["readFileSync"](filename, binary ? null : "utf8") + }; + readBinary = function readBinary(filename) { + var ret = read_(filename, true); + if (!ret.buffer) { + ret = new Uint8Array(ret) + } + assert(ret.buffer); + return ret + }; + if (process["argv"].length > 1) { + thisProgram = process["argv"][1].replace(/\\/g, "/") + } + arguments_ = process["argv"].slice(2); + process["on"]("uncaughtException", function (ex) { + if (!(ex instanceof ExitStatus)) { + throw ex + } + }); + process["on"]("unhandledRejection", abort); + quit_ = function (status) { + process["exit"](status) + }; + Module["inspect"] = function () { + return "[Emscripten Module object]" + }; + var nodeWorkerThreads; + try { + nodeWorkerThreads = require("worker_threads") + } catch (e) { + console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'); + throw e + } + Worker = nodeWorkerThreads.Worker + } else if (ENVIRONMENT_IS_SHELL) { + if (typeof read != "undefined") { + read_ = function shell_read(f) { + return read(f) + } + } + readBinary = function readBinary(f) { + var data; + if (typeof readbuffer === "function") { + return new Uint8Array(readbuffer(f)) + } + data = read(f, "binary"); + assert(typeof data === "object"); + return data + }; + if (typeof scriptArgs != "undefined") { + arguments_ = scriptArgs + } else if (typeof arguments != "undefined") { + arguments_ = arguments + } + if (typeof quit === "function") { + quit_ = function (status) { + quit(status) + } + } + if (typeof print !== "undefined") { + if (typeof console === "undefined") console = {}; + console.log = print; + console.warn = console.error = typeof printErr !== "undefined" ? printErr : print + } + } else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { + if (ENVIRONMENT_IS_WORKER) { + scriptDirectory = self.location.href + } else if (document.currentScript) { + scriptDirectory = document.currentScript.src + } + if (_scriptDir) { + scriptDirectory = _scriptDir + } + if (scriptDirectory.indexOf("blob:") !== 0) { + scriptDirectory = scriptDirectory.substr(0, scriptDirectory.lastIndexOf("/") + 1) + } else { + scriptDirectory = "" + } + if (ENVIRONMENT_IS_NODE) { + read_ = function shell_read(filename, binary) { + if (!nodeFS) nodeFS = require("fs"); + if (!nodePath) nodePath = require("path"); + filename = nodePath["normalize"](filename); + return nodeFS["readFileSync"](filename, binary ? null : "utf8") + }; + readBinary = function readBinary(filename) { + var ret = read_(filename, true); + if (!ret.buffer) { + ret = new Uint8Array(ret) + } + assert(ret.buffer); + return ret + } + } else { + read_ = function shell_read(url) { + var xhr = new XMLHttpRequest; + xhr.open("GET", url, false); + xhr.send(null); + return xhr.responseText + }; + if (ENVIRONMENT_IS_WORKER) { + readBinary = function readBinary(url) { + var xhr = new XMLHttpRequest; + xhr.open("GET", url, false); + xhr.responseType = "arraybuffer"; + xhr.send(null); + return new Uint8Array(xhr.response) + } + } + readAsync = function readAsync(url, onload, onerror) { + var xhr = new XMLHttpRequest; + xhr.open("GET", url, true); + xhr.responseType = "arraybuffer"; + xhr.onload = function xhr_onload() { + if (xhr.status == 200 || xhr.status == 0 && xhr.response) { + onload(xhr.response); + return + } + onerror() + }; + xhr.onerror = onerror; + xhr.send(null) + } + } + setWindowTitle = function (title) { + document.title = title + } + } else { + throw new Error("environment detection error") + } + if (ENVIRONMENT_IS_NODE) { + if (typeof performance === "undefined") { + performance = require("perf_hooks").performance + } + } + var out = Module["print"] || console.log.bind(console); + var err = Module["printErr"] || console.warn.bind(console); + for (key in moduleOverrides) { + if (moduleOverrides.hasOwnProperty(key)) { + Module[key] = moduleOverrides[key] + } + } + moduleOverrides = null; + if (Module["arguments"]) arguments_ = Module["arguments"]; + if (!Object.getOwnPropertyDescriptor(Module, "arguments")) Object.defineProperty(Module, "arguments", { + configurable: true, + get: function () { + abort("Module.arguments has been replaced with plain arguments_") + } + }); + if (Module["thisProgram"]) thisProgram = Module["thisProgram"]; + if (!Object.getOwnPropertyDescriptor(Module, "thisProgram")) Object.defineProperty(Module, "thisProgram", { + configurable: true, + get: function () { + abort("Module.thisProgram has been replaced with plain thisProgram") + } + }); + if (Module["quit"]) quit_ = Module["quit"]; + if (!Object.getOwnPropertyDescriptor(Module, "quit")) Object.defineProperty(Module, "quit", { + configurable: true, + get: function () { + abort("Module.quit has been replaced with plain quit_") + } + }); + assert(typeof Module["memoryInitializerPrefixURL"] === "undefined", "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["pthreadMainPrefixURL"] === "undefined", "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["cdInitializerPrefixURL"] === "undefined", "Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["filePackagePrefixURL"] === "undefined", "Module.filePackagePrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["read"] === "undefined", "Module.read option was removed (modify read_ in JS)"); + assert(typeof Module["readAsync"] === "undefined", "Module.readAsync option was removed (modify readAsync in JS)"); + assert(typeof Module["readBinary"] === "undefined", "Module.readBinary option was removed (modify readBinary in JS)"); + assert(typeof Module["setWindowTitle"] === "undefined", "Module.setWindowTitle option was removed (modify setWindowTitle in JS)"); + assert(typeof Module["TOTAL_MEMORY"] === "undefined", "Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"); + if (!Object.getOwnPropertyDescriptor(Module, "read")) Object.defineProperty(Module, "read", { + configurable: true, + get: function () { + abort("Module.read has been replaced with plain read_") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "readAsync")) Object.defineProperty(Module, "readAsync", { + configurable: true, + get: function () { + abort("Module.readAsync has been replaced with plain readAsync") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "readBinary")) Object.defineProperty(Module, "readBinary", { + configurable: true, + get: function () { + abort("Module.readBinary has been replaced with plain readBinary") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "setWindowTitle")) Object.defineProperty(Module, "setWindowTitle", { + configurable: true, + get: function () { + abort("Module.setWindowTitle has been replaced with plain setWindowTitle") + } + }); + assert(ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER || ENVIRONMENT_IS_NODE, "Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)"); + var stackSave; + var stackRestore; + var stackAlloc; + stackSave = stackRestore = stackAlloc = function () { + abort("cannot use the stack before compiled code is ready to run, and has provided stack access") + }; + + function warnOnce(text) { + if (!warnOnce.shown) warnOnce.shown = {}; + if (!warnOnce.shown[text]) { + warnOnce.shown[text] = 1; + err(text) + } + } + var Atomics_load = Atomics.load; + var Atomics_store = Atomics.store; + var Atomics_compareExchange = Atomics.compareExchange; + var wasmBinary; + if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"]; + if (!Object.getOwnPropertyDescriptor(Module, "wasmBinary")) Object.defineProperty(Module, "wasmBinary", { + configurable: true, + get: function () { + abort("Module.wasmBinary has been replaced with plain wasmBinary") + } + }); + var noExitRuntime; + if (Module["noExitRuntime"]) noExitRuntime = Module["noExitRuntime"]; + if (!Object.getOwnPropertyDescriptor(Module, "noExitRuntime")) Object.defineProperty(Module, "noExitRuntime", { + configurable: true, + get: function () { + abort("Module.noExitRuntime has been replaced with plain noExitRuntime") + } + }); + if (typeof WebAssembly !== "object") { + abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.") + } + var wasmMemory; + var wasmTable = new WebAssembly.Table({ + "initial": 118, + "maximum": 118 + 0, + "element": "anyfunc" + }); + var wasmModule; + var threadInfoStruct = 0; + var selfThreadId = 0; + var ABORT = false; + var EXITSTATUS = 0; + + function assert(condition, text) { + if (!condition) { + abort("Assertion failed: " + text) + } + } + + function getCFunc(ident) { + var func = Module["_" + ident]; + assert(func, "Cannot call unknown function " + ident + ", make sure it is exported"); + return func + } + + function ccall(ident, returnType, argTypes, args, opts) { + var toC = { + "string": function (str) { + var ret = 0; + if (str !== null && str !== undefined && str !== 0) { + var len = (str.length << 2) + 1; + ret = stackAlloc(len); + stringToUTF8(str, ret, len) + } + return ret + }, + "array": function (arr) { + var ret = stackAlloc(arr.length); + writeArrayToMemory(arr, ret); + return ret + } + }; + + function convertReturnValue(ret) { + if (returnType === "string") return UTF8ToString(ret); + if (returnType === "boolean") return Boolean(ret); + return ret + } + var func = getCFunc(ident); + var cArgs = []; + var stack = 0; + assert(returnType !== "array", 'Return type should not be "array".'); + if (args) { + for (var i = 0; i < args.length; i++) { + var converter = toC[argTypes[i]]; + if (converter) { + if (stack === 0) stack = stackSave(); + cArgs[i] = converter(args[i]) + } else { + cArgs[i] = args[i] + } + } + } + var ret = func.apply(null, cArgs); + ret = convertReturnValue(ret); + if (stack !== 0) stackRestore(stack); + return ret + } + + function cwrap(ident, returnType, argTypes, opts) { + return function () { + return ccall(ident, returnType, argTypes, arguments, opts) + } + } + + function UTF8ArrayToString(heap, idx, maxBytesToRead) { + var endIdx = idx + maxBytesToRead; + var str = ""; + while (!(idx >= endIdx)) { + var u0 = heap[idx++]; + if (!u0) return str; + if (!(u0 & 128)) { + str += String.fromCharCode(u0); + continue + } + var u1 = heap[idx++] & 63; + if ((u0 & 224) == 192) { + str += String.fromCharCode((u0 & 31) << 6 | u1); + continue + } + var u2 = heap[idx++] & 63; + if ((u0 & 240) == 224) { + u0 = (u0 & 15) << 12 | u1 << 6 | u2 + } else { + if ((u0 & 248) != 240) warnOnce("Invalid UTF-8 leading byte 0x" + u0.toString(16) + " encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!"); + u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heap[idx++] & 63 + } + if (u0 < 65536) { + str += String.fromCharCode(u0) + } else { + var ch = u0 - 65536; + str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023) + } + } + return str + } + + function UTF8ToString(ptr, maxBytesToRead) { + return ptr ? UTF8ArrayToString(GROWABLE_HEAP_U8(), ptr, maxBytesToRead) : "" + } + + function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { + if (!(maxBytesToWrite > 0)) return 0; + var startIdx = outIdx; + var endIdx = outIdx + maxBytesToWrite - 1; + for (var i = 0; i < str.length; ++i) { + var u = str.charCodeAt(i); + if (u >= 55296 && u <= 57343) { + var u1 = str.charCodeAt(++i); + u = 65536 + ((u & 1023) << 10) | u1 & 1023 + } + if (u <= 127) { + if (outIdx >= endIdx) break; + heap[outIdx++] = u + } else if (u <= 2047) { + if (outIdx + 1 >= endIdx) break; + heap[outIdx++] = 192 | u >> 6; + heap[outIdx++] = 128 | u & 63 + } else if (u <= 65535) { + if (outIdx + 2 >= endIdx) break; + heap[outIdx++] = 224 | u >> 12; + heap[outIdx++] = 128 | u >> 6 & 63; + heap[outIdx++] = 128 | u & 63 + } else { + if (outIdx + 3 >= endIdx) break; + if (u >= 2097152) warnOnce("Invalid Unicode code point 0x" + u.toString(16) + " encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF)."); + heap[outIdx++] = 240 | u >> 18; + heap[outIdx++] = 128 | u >> 12 & 63; + heap[outIdx++] = 128 | u >> 6 & 63; + heap[outIdx++] = 128 | u & 63 + } + } + heap[outIdx] = 0; + return outIdx - startIdx + } + + function stringToUTF8(str, outPtr, maxBytesToWrite) { + assert(typeof maxBytesToWrite == "number", "stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"); + return stringToUTF8Array(str, GROWABLE_HEAP_U8(), outPtr, maxBytesToWrite) + } + + function lengthBytesUTF8(str) { + var len = 0; + for (var i = 0; i < str.length; ++i) { + var u = str.charCodeAt(i); + if (u >= 55296 && u <= 57343) u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; + if (u <= 127) ++len; + else if (u <= 2047) len += 2; + else if (u <= 65535) len += 3; + else len += 4 + } + return len + } + + function writeArrayToMemory(array, buffer) { + assert(array.length >= 0, "writeArrayToMemory array must have a length (should be an array or typed array)"); + GROWABLE_HEAP_I8().set(array, buffer) + } + var WASM_PAGE_SIZE = 65536; + + function alignUp(x, multiple) { + if (x % multiple > 0) { + x += multiple - x % multiple + } + return x + } + var buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; + + function updateGlobalBufferAndViews(buf) { + buffer = buf; + Module["HEAP8"] = HEAP8 = new Int8Array(buf); + Module["HEAP16"] = HEAP16 = new Int16Array(buf); + Module["HEAP32"] = HEAP32 = new Int32Array(buf); + Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); + Module["HEAPU16"] = HEAPU16 = new Uint16Array(buf); + Module["HEAPU32"] = HEAPU32 = new Uint32Array(buf); + Module["HEAPF32"] = HEAPF32 = new Float32Array(buf); + Module["HEAPF64"] = HEAPF64 = new Float64Array(buf) + } + var STACK_BASE = 5255808, + STACKTOP = STACK_BASE, + STACK_MAX = 12928, + DYNAMIC_BASE = 5255808, + DYNAMICTOP_PTR = 12e3; + assert(STACK_BASE % 16 === 0, "stack must start aligned"); + assert(DYNAMIC_BASE % 16 === 0, "heap must start aligned"); + if (ENVIRONMENT_IS_PTHREAD) { + STACK_MAX = STACKTOP = STACK_MAX = 2147483647 + } + var TOTAL_STACK = 5242880; + if (Module["TOTAL_STACK"]) assert(TOTAL_STACK === Module["TOTAL_STACK"], "the stack size can no longer be determined at runtime"); + var INITIAL_INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 16777216; + if (!Object.getOwnPropertyDescriptor(Module, "INITIAL_MEMORY")) Object.defineProperty(Module, "INITIAL_MEMORY", { + configurable: true, + get: function () { + abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY") + } + }); + assert(INITIAL_INITIAL_MEMORY >= TOTAL_STACK, "INITIAL_MEMORY should be larger than TOTAL_STACK, was " + INITIAL_INITIAL_MEMORY + "! (TOTAL_STACK=" + TOTAL_STACK + ")"); + assert(typeof Int32Array !== "undefined" && typeof Float64Array !== "undefined" && Int32Array.prototype.subarray !== undefined && Int32Array.prototype.set !== undefined, "JS engine does not provide full typed array support"); + if (ENVIRONMENT_IS_PTHREAD) { + wasmMemory = Module["wasmMemory"]; + buffer = Module["buffer"] + } else { + if (Module["wasmMemory"]) { + wasmMemory = Module["wasmMemory"] + } else { + wasmMemory = new WebAssembly.Memory({ + "initial": INITIAL_INITIAL_MEMORY / WASM_PAGE_SIZE, + "maximum": 1073741824 / WASM_PAGE_SIZE, + "shared": true + }); + if (!(wasmMemory.buffer instanceof SharedArrayBuffer)) { + err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"); + if (ENVIRONMENT_IS_NODE) { + console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)") + } + throw Error("bad memory") + } + } + } + if (wasmMemory) { + buffer = wasmMemory.buffer + } + INITIAL_INITIAL_MEMORY = buffer.byteLength; + assert(INITIAL_INITIAL_MEMORY % WASM_PAGE_SIZE === 0); + assert(65536 % WASM_PAGE_SIZE === 0); + updateGlobalBufferAndViews(buffer); + if (!ENVIRONMENT_IS_PTHREAD) { + GROWABLE_HEAP_I32()[DYNAMICTOP_PTR >> 2] = DYNAMIC_BASE + } + + function writeStackCookie() { + assert((STACK_MAX & 3) == 0); + GROWABLE_HEAP_U32()[(STACK_MAX >> 2) + 1] = 34821223; + GROWABLE_HEAP_U32()[(STACK_MAX >> 2) + 2] = 2310721022; + GROWABLE_HEAP_I32()[0] = 1668509029 + } + + function checkStackCookie() { + var cookie1 = GROWABLE_HEAP_U32()[(STACK_MAX >> 2) + 1]; + var cookie2 = GROWABLE_HEAP_U32()[(STACK_MAX >> 2) + 2]; + if (cookie1 != 34821223 || cookie2 != 2310721022) { + abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x" + cookie2.toString(16) + " " + cookie1.toString(16)) + } + if (GROWABLE_HEAP_I32()[0] !== 1668509029) abort("Runtime error: The application has corrupted its heap memory area (address zero)!") + } + + function abortStackOverflow(allocSize) { + abort("Stack overflow! Attempted to allocate " + allocSize + " bytes on the stack, but stack has only " + (STACK_MAX - stackSave() + allocSize) + " bytes available!") + }(function () { + var h16 = new Int16Array(1); + var h8 = new Int8Array(h16.buffer); + h16[0] = 25459; + if (h8[0] !== 115 || h8[1] !== 99) throw "Runtime error: expected the system to be little-endian!" + })(); + + function callRuntimeCallbacks(callbacks) { + while (callbacks.length > 0) { + var callback = callbacks.shift(); + if (typeof callback == "function") { + callback(Module); + continue + } + var func = callback.func; + if (typeof func === "number") { + if (callback.arg === undefined) { + Module["dynCall_v"](func) + } else { + Module["dynCall_vi"](func, callback.arg) + } + } else { + func(callback.arg === undefined ? null : callback.arg) + } + } + } + var __ATPRERUN__ = []; + var __ATINIT__ = []; + var __ATMAIN__ = []; + var __ATEXIT__ = []; + var __ATPOSTRUN__ = []; + var runtimeInitialized = false; + var runtimeExited = false; + if (ENVIRONMENT_IS_PTHREAD) runtimeInitialized = true; + + function preRun() { + if (ENVIRONMENT_IS_PTHREAD) return; + if (Module["preRun"]) { + if (typeof Module["preRun"] == "function") Module["preRun"] = [Module["preRun"]]; + while (Module["preRun"].length) { + addOnPreRun(Module["preRun"].shift()) + } + } + callRuntimeCallbacks(__ATPRERUN__) + } + + function initRuntime() { + checkStackCookie(); + assert(!runtimeInitialized); + runtimeInitialized = true; + callRuntimeCallbacks(__ATINIT__) + } + + function preMain() { + checkStackCookie(); + if (ENVIRONMENT_IS_PTHREAD) return; + callRuntimeCallbacks(__ATMAIN__) + } + + function postRun() { + checkStackCookie(); + if (ENVIRONMENT_IS_PTHREAD) return; + if (Module["postRun"]) { + if (typeof Module["postRun"] == "function") Module["postRun"] = [Module["postRun"]]; + while (Module["postRun"].length) { + addOnPostRun(Module["postRun"].shift()) + } + } + callRuntimeCallbacks(__ATPOSTRUN__) + } + + function addOnPreRun(cb) { + __ATPRERUN__.unshift(cb) + } + + function addOnPostRun(cb) { + __ATPOSTRUN__.unshift(cb) + } + assert(Math.imul, "This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + assert(Math.fround, "This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + assert(Math.clz32, "This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + assert(Math.trunc, "This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + var Math_ceil = Math.ceil; + var Math_floor = Math.floor; + var runDependencies = 0; + var runDependencyWatcher = null; + var dependenciesFulfilled = null; + var runDependencyTracking = {}; + + function addRunDependency(id) { + assert(!ENVIRONMENT_IS_PTHREAD, "addRunDependency cannot be used in a pthread worker"); + runDependencies++; + if (Module["monitorRunDependencies"]) { + Module["monitorRunDependencies"](runDependencies) + } + if (id) { + assert(!runDependencyTracking[id]); + runDependencyTracking[id] = 1; + if (runDependencyWatcher === null && typeof setInterval !== "undefined") { + runDependencyWatcher = setInterval(function () { + if (ABORT) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null; + return + } + var shown = false; + for (var dep in runDependencyTracking) { + if (!shown) { + shown = true; + err("still waiting on run dependencies:") + } + err("dependency: " + dep) + } + if (shown) { + err("(end of list)") + } + }, 1e4) + } + } else { + err("warning: run dependency added without ID") + } + } + + function removeRunDependency(id) { + runDependencies--; + if (Module["monitorRunDependencies"]) { + Module["monitorRunDependencies"](runDependencies) + } + if (id) { + assert(runDependencyTracking[id]); + delete runDependencyTracking[id] + } else { + err("warning: run dependency removed without ID") + } + if (runDependencies == 0) { + if (runDependencyWatcher !== null) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null + } + if (dependenciesFulfilled) { + var callback = dependenciesFulfilled; + dependenciesFulfilled = null; + callback() + } + } + } + Module["preloadedImages"] = {}; + Module["preloadedAudios"] = {}; + + function abort(what) { + if (Module["onAbort"]) { + Module["onAbort"](what) + } + if (ENVIRONMENT_IS_PTHREAD) console.error("Pthread aborting at " + (new Error).stack); + what += ""; + out(what); + err(what); + ABORT = true; + EXITSTATUS = 1; + var output = "abort(" + what + ") at " + stackTrace(); + what = output; + throw new WebAssembly.RuntimeError(what) + } + var FS = { + error: function () { + abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1") + }, + init: function () { + FS.error() + }, + createDataFile: function () { + FS.error() + }, + createPreloadedFile: function () { + FS.error() + }, + createLazyFile: function () { + FS.error() + }, + open: function () { + FS.error() + }, + mkdev: function () { + FS.error() + }, + registerDevice: function () { + FS.error() + }, + analyzePath: function () { + FS.error() + }, + loadFilesFromDB: function () { + FS.error() + }, + ErrnoError: function ErrnoError() { + FS.error() + } + }; + Module["FS_createDataFile"] = FS.createDataFile; + Module["FS_createPreloadedFile"] = FS.createPreloadedFile; + + function hasPrefix(str, prefix) { + return String.prototype.startsWith ? str.startsWith(prefix) : str.indexOf(prefix) === 0 + } + var dataURIPrefix = "data:application/octet-stream;base64,"; + + function isDataURI(filename) { + return hasPrefix(filename, dataURIPrefix) + } + var fileURIPrefix = "file://"; + + function isFileURI(filename) { + return hasPrefix(filename, fileURIPrefix) + } + var wasmBinaryFile = "tfjs-backend-wasm.wasm"; + if (!isDataURI(wasmBinaryFile)) { + wasmBinaryFile = locateFile(wasmBinaryFile) + } + + function getBinary() { + try { + if (wasmBinary) { + return new Uint8Array(wasmBinary) + } + if (readBinary) { + return readBinary(wasmBinaryFile) + } else { + throw "both async and sync fetching of the wasm failed" + } + } catch (err) { + abort(err) + } + } + + function getBinaryPromise() { + if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) && typeof fetch === "function" && !isFileURI(wasmBinaryFile)) { + return fetch(wasmBinaryFile, { + credentials: "same-origin" + }).then(function (response) { + if (!response["ok"]) { + throw "failed to load wasm binary file at '" + wasmBinaryFile + "'" + } + return response["arrayBuffer"]() + }).catch(function () { + return getBinary() + }) + } + return new Promise(function (resolve, reject) { + resolve(getBinary()) + }) + } + + function createWasm() { + var info = { + "env": asmLibraryArg, + "wasi_snapshot_preview1": asmLibraryArg + }; + + function receiveInstance(instance, module) { + var exports = instance.exports; + Module["asm"] = exports; + wasmModule = module; + if (!ENVIRONMENT_IS_PTHREAD) { + var numWorkersToLoad = PThread.unusedWorkers.length; + PThread.unusedWorkers.forEach(function (w) { + PThread.loadWasmModuleToWorker(w, function () { + if (!--numWorkersToLoad) removeRunDependency("wasm-instantiate") + }) + }) + } + } + if (!ENVIRONMENT_IS_PTHREAD) { + addRunDependency("wasm-instantiate") + } + var trueModule = Module; + + function receiveInstantiatedSource(output) { + assert(Module === trueModule, "the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"); + trueModule = null; + receiveInstance(output["instance"], output["module"]) + } + + function instantiateArrayBuffer(receiver) { + return getBinaryPromise().then(function (binary) { + return WebAssembly.instantiate(binary, info) + }).then(receiver, function (reason) { + err("failed to asynchronously prepare wasm: " + reason); + abort(reason) + }) + } + + function instantiateAsync() { + if (!wasmBinary && typeof WebAssembly.instantiateStreaming === "function" && !isDataURI(wasmBinaryFile) && !isFileURI(wasmBinaryFile) && typeof fetch === "function") { + fetch(wasmBinaryFile, { + credentials: "same-origin" + }).then(function (response) { + var result = WebAssembly.instantiateStreaming(response, info); + return result.then(receiveInstantiatedSource, function (reason) { + err("wasm streaming compile failed: " + reason); + err("falling back to ArrayBuffer instantiation"); + instantiateArrayBuffer(receiveInstantiatedSource) + }) + }) + } else { + return instantiateArrayBuffer(receiveInstantiatedSource) + } + } + if (Module["instantiateWasm"]) { + try { + var exports = Module["instantiateWasm"](info, receiveInstance); + return exports + } catch (e) { + err("Module.instantiateWasm callback failed with error: " + e); + return false + } + } + instantiateAsync(); + return {} + } + var ASM_CONSTS = {}; + + function initPthreadsJS() { + PThread.initRuntime() + } + if (!ENVIRONMENT_IS_PTHREAD) __ATINIT__.push({ + func: function () { + ___wasm_call_ctors() + } + }); + + function demangle(func) { + warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"); + return func + } + + function demangleAll(text) { + var regex = /\b_Z[\w\d_]+/g; + return text.replace(regex, function (x) { + var y = demangle(x); + return x === y ? x : y + " [" + x + "]" + }) + } + var __pthread_ptr = 0; + var __pthread_is_main_runtime_thread = 0; + var __pthread_is_main_browser_thread = 0; + + function __register_pthread_ptr(pthreadPtr, isMainBrowserThread, isMainRuntimeThread) { + pthreadPtr = pthreadPtr | 0; + isMainBrowserThread = isMainBrowserThread | 0; + isMainRuntimeThread = isMainRuntimeThread | 0; + __pthread_ptr = pthreadPtr; + __pthread_is_main_browser_thread = isMainBrowserThread; + __pthread_is_main_runtime_thread = isMainRuntimeThread + } + Module["__register_pthread_ptr"] = __register_pthread_ptr; + var ERRNO_CODES = { + EPERM: 63, + ENOENT: 44, + ESRCH: 71, + EINTR: 27, + EIO: 29, + ENXIO: 60, + E2BIG: 1, + ENOEXEC: 45, + EBADF: 8, + ECHILD: 12, + EAGAIN: 6, + EWOULDBLOCK: 6, + ENOMEM: 48, + EACCES: 2, + EFAULT: 21, + ENOTBLK: 105, + EBUSY: 10, + EEXIST: 20, + EXDEV: 75, + ENODEV: 43, + ENOTDIR: 54, + EISDIR: 31, + EINVAL: 28, + ENFILE: 41, + EMFILE: 33, + ENOTTY: 59, + ETXTBSY: 74, + EFBIG: 22, + ENOSPC: 51, + ESPIPE: 70, + EROFS: 69, + EMLINK: 34, + EPIPE: 64, + EDOM: 18, + ERANGE: 68, + ENOMSG: 49, + EIDRM: 24, + ECHRNG: 106, + EL2NSYNC: 156, + EL3HLT: 107, + EL3RST: 108, + ELNRNG: 109, + EUNATCH: 110, + ENOCSI: 111, + EL2HLT: 112, + EDEADLK: 16, + ENOLCK: 46, + EBADE: 113, + EBADR: 114, + EXFULL: 115, + ENOANO: 104, + EBADRQC: 103, + EBADSLT: 102, + EDEADLOCK: 16, + EBFONT: 101, + ENOSTR: 100, + ENODATA: 116, + ETIME: 117, + ENOSR: 118, + ENONET: 119, + ENOPKG: 120, + EREMOTE: 121, + ENOLINK: 47, + EADV: 122, + ESRMNT: 123, + ECOMM: 124, + EPROTO: 65, + EMULTIHOP: 36, + EDOTDOT: 125, + EBADMSG: 9, + ENOTUNIQ: 126, + EBADFD: 127, + EREMCHG: 128, + ELIBACC: 129, + ELIBBAD: 130, + ELIBSCN: 131, + ELIBMAX: 132, + ELIBEXEC: 133, + ENOSYS: 52, + ENOTEMPTY: 55, + ENAMETOOLONG: 37, + ELOOP: 32, + EOPNOTSUPP: 138, + EPFNOSUPPORT: 139, + ECONNRESET: 15, + ENOBUFS: 42, + EAFNOSUPPORT: 5, + EPROTOTYPE: 67, + ENOTSOCK: 57, + ENOPROTOOPT: 50, + ESHUTDOWN: 140, + ECONNREFUSED: 14, + EADDRINUSE: 3, + ECONNABORTED: 13, + ENETUNREACH: 40, + ENETDOWN: 38, + ETIMEDOUT: 73, + EHOSTDOWN: 142, + EHOSTUNREACH: 23, + EINPROGRESS: 26, + EALREADY: 7, + EDESTADDRREQ: 17, + EMSGSIZE: 35, + EPROTONOSUPPORT: 66, + ESOCKTNOSUPPORT: 137, + EADDRNOTAVAIL: 4, + ENETRESET: 39, + EISCONN: 30, + ENOTCONN: 53, + ETOOMANYREFS: 141, + EUSERS: 136, + EDQUOT: 19, + ESTALE: 72, + ENOTSUP: 138, + ENOMEDIUM: 148, + EILSEQ: 25, + EOVERFLOW: 61, + ECANCELED: 11, + ENOTRECOVERABLE: 56, + EOWNERDEAD: 62, + ESTRPIPE: 135 + }; + var __main_thread_futex_wait_address = 12912; + + function _emscripten_futex_wake(addr, count) { + if (addr <= 0 || addr > GROWABLE_HEAP_I8().length || addr & 3 != 0 || count < 0) return -28; + if (count == 0) return 0; + if (count >= 2147483647) count = Infinity; + var mainThreadWaitAddress = Atomics.load(GROWABLE_HEAP_I32(), __main_thread_futex_wait_address >> 2); + var mainThreadWoken = 0; + if (mainThreadWaitAddress == addr) { + var loadedAddr = Atomics.compareExchange(GROWABLE_HEAP_I32(), __main_thread_futex_wait_address >> 2, mainThreadWaitAddress, 0); + if (loadedAddr == mainThreadWaitAddress) { + --count; + mainThreadWoken = 1; + if (count <= 0) return 1 + } + } + var ret = Atomics.notify(GROWABLE_HEAP_I32(), addr >> 2, count); + if (ret >= 0) return ret + mainThreadWoken; + throw "Atomics.notify returned an unexpected value " + ret + } + Module["_emscripten_futex_wake"] = _emscripten_futex_wake; + + function __kill_thread(pthread_ptr) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _kill_thread() can only ever be called from main application thread!"; + if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _kill_thread!"; + GROWABLE_HEAP_I32()[pthread_ptr + 12 >> 2] = 0; + var pthread = PThread.pthreads[pthread_ptr]; + pthread.worker.terminate(); + PThread.freeThreadData(pthread); + PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker), 1); + pthread.worker.pthread = undefined + } + + function __cancel_thread(pthread_ptr) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _cancel_thread() can only ever be called from main application thread!"; + if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _cancel_thread!"; + var pthread = PThread.pthreads[pthread_ptr]; + pthread.worker.postMessage({ + "cmd": "cancel" + }) + } + + function __cleanup_thread(pthread_ptr) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _cleanup_thread() can only ever be called from main application thread!"; + if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _cleanup_thread!"; + GROWABLE_HEAP_I32()[pthread_ptr + 12 >> 2] = 0; + var pthread = PThread.pthreads[pthread_ptr]; + if (pthread) { + var worker = pthread.worker; + PThread.returnWorkerToPool(worker) + } + } + var PThread = { + MAIN_THREAD_ID: 1, + mainThreadInfo: { + schedPolicy: 0, + schedPrio: 0 + }, + unusedWorkers: [], + runningWorkers: [], + initRuntime: function () { + __register_pthread_ptr(PThread.mainThreadBlock, !ENVIRONMENT_IS_WORKER, 1); + _emscripten_register_main_browser_thread_id(PThread.mainThreadBlock) + }, + initMainThreadBlock: function () { + assert(!ENVIRONMENT_IS_PTHREAD); + var pthreadPoolSize = 8; + for (var i = 0; i < pthreadPoolSize; ++i) { + PThread.allocateUnusedWorker() + } + PThread.mainThreadBlock = 12160; + for (var i = 0; i < 232 / 4; ++i) GROWABLE_HEAP_U32()[PThread.mainThreadBlock / 4 + i] = 0; + GROWABLE_HEAP_I32()[PThread.mainThreadBlock + 12 >> 2] = PThread.mainThreadBlock; + var headPtr = PThread.mainThreadBlock + 156; + GROWABLE_HEAP_I32()[headPtr >> 2] = headPtr; + var tlsMemory = 12400; + for (var i = 0; i < 128; ++i) GROWABLE_HEAP_U32()[tlsMemory / 4 + i] = 0; + Atomics.store(GROWABLE_HEAP_U32(), PThread.mainThreadBlock + 104 >> 2, tlsMemory); + Atomics.store(GROWABLE_HEAP_U32(), PThread.mainThreadBlock + 40 >> 2, PThread.mainThreadBlock); + Atomics.store(GROWABLE_HEAP_U32(), PThread.mainThreadBlock + 44 >> 2, 42) + }, + initWorker: function () {}, + pthreads: {}, + exitHandlers: null, + setThreadStatus: function () {}, + runExitHandlers: function () { + if (PThread.exitHandlers !== null) { + while (PThread.exitHandlers.length > 0) { + PThread.exitHandlers.pop()() + } + PThread.exitHandlers = null + } + if (ENVIRONMENT_IS_PTHREAD && threadInfoStruct) ___pthread_tsd_run_dtors() + }, + threadExit: function (exitCode) { + var tb = _pthread_self(); + if (tb) { + err("Pthread 0x" + tb.toString(16) + " exited."); + Atomics.store(GROWABLE_HEAP_U32(), tb + 4 >> 2, exitCode); + Atomics.store(GROWABLE_HEAP_U32(), tb + 0 >> 2, 1); + Atomics.store(GROWABLE_HEAP_U32(), tb + 60 >> 2, 1); + Atomics.store(GROWABLE_HEAP_U32(), tb + 64 >> 2, 0); + PThread.runExitHandlers(); + _emscripten_futex_wake(tb + 0, 2147483647); + __register_pthread_ptr(0, 0, 0); + threadInfoStruct = 0; + if (ENVIRONMENT_IS_PTHREAD) { + postMessage({ + "cmd": "exit" + }) + } + } + }, + threadCancel: function () { + PThread.runExitHandlers(); + Atomics.store(GROWABLE_HEAP_U32(), threadInfoStruct + 4 >> 2, -1); + Atomics.store(GROWABLE_HEAP_U32(), threadInfoStruct + 0 >> 2, 1); + _emscripten_futex_wake(threadInfoStruct + 0, 2147483647); + threadInfoStruct = selfThreadId = 0; + __register_pthread_ptr(0, 0, 0); + postMessage({ + "cmd": "cancelDone" + }) + }, + terminateAllThreads: function () { + for (var t in PThread.pthreads) { + var pthread = PThread.pthreads[t]; + if (pthread && pthread.worker) { + PThread.returnWorkerToPool(pthread.worker) + } + } + PThread.pthreads = {}; + for (var i = 0; i < PThread.unusedWorkers.length; ++i) { + var worker = PThread.unusedWorkers[i]; + assert(!worker.pthread); + worker.terminate() + } + PThread.unusedWorkers = []; + for (var i = 0; i < PThread.runningWorkers.length; ++i) { + var worker = PThread.runningWorkers[i]; + var pthread = worker.pthread; + assert(pthread, "This Worker should have a pthread it is executing"); + PThread.freeThreadData(pthread); + worker.terminate() + } + PThread.runningWorkers = [] + }, + freeThreadData: function (pthread) { + if (!pthread) return; + if (pthread.threadInfoStruct) { + var tlsMemory = GROWABLE_HEAP_I32()[pthread.threadInfoStruct + 104 >> 2]; + GROWABLE_HEAP_I32()[pthread.threadInfoStruct + 104 >> 2] = 0; + _free(tlsMemory); + _free(pthread.threadInfoStruct) + } + pthread.threadInfoStruct = 0; + if (pthread.allocatedOwnStack && pthread.stackBase) _free(pthread.stackBase); + pthread.stackBase = 0; + if (pthread.worker) pthread.worker.pthread = null + }, + returnWorkerToPool: function (worker) { + delete PThread.pthreads[worker.pthread.thread]; + PThread.unusedWorkers.push(worker); + PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker), 1); + PThread.freeThreadData(worker.pthread); + worker.pthread = undefined + }, + receiveObjectTransfer: function (data) {}, + loadWasmModuleToWorker: function (worker, onFinishedLoading) { + worker.onmessage = function (e) { + var d = e["data"]; + var cmd = d["cmd"]; + if (worker.pthread) PThread.currentProxiedOperationCallerThread = worker.pthread.threadInfoStruct; + if (d["targetThread"] && d["targetThread"] != _pthread_self()) { + var thread = PThread.pthreads[d.targetThread]; + if (thread) { + thread.worker.postMessage(e.data, d["transferList"]) + } else { + console.error('Internal error! Worker sent a message "' + cmd + '" to target pthread ' + d["targetThread"] + ", but that thread no longer exists!") + } + PThread.currentProxiedOperationCallerThread = undefined; + return + } + if (cmd === "processQueuedMainThreadWork") { + _emscripten_main_thread_process_queued_calls() + } else if (cmd === "spawnThread") { + __spawn_thread(e.data) + } else if (cmd === "cleanupThread") { + __cleanup_thread(d["thread"]) + } else if (cmd === "killThread") { + __kill_thread(d["thread"]) + } else if (cmd === "cancelThread") { + __cancel_thread(d["thread"]) + } else if (cmd === "loaded") { + worker.loaded = true; + if (onFinishedLoading) onFinishedLoading(worker); + if (worker.runPthread) { + worker.runPthread(); + delete worker.runPthread + } + } else if (cmd === "print") { + out("Thread " + d["threadId"] + ": " + d["text"]) + } else if (cmd === "printErr") { + err("Thread " + d["threadId"] + ": " + d["text"]) + } else if (cmd === "alert") { + alert("Thread " + d["threadId"] + ": " + d["text"]) + } else if (cmd === "exit") { + var detached = worker.pthread && Atomics.load(GROWABLE_HEAP_U32(), worker.pthread.thread + 68 >> 2); + if (detached) { + PThread.returnWorkerToPool(worker) + } + } else if (cmd === "cancelDone") { + PThread.returnWorkerToPool(worker) + } else if (cmd === "objectTransfer") { + PThread.receiveObjectTransfer(e.data) + } else if (e.data.target === "setimmediate") { + worker.postMessage(e.data) + } else { + err("worker sent an unknown command " + cmd) + } + PThread.currentProxiedOperationCallerThread = undefined + }; + worker.onerror = function (e) { + err("pthread sent an error! " + e.filename + ":" + e.lineno + ": " + e.message) + }; + if (ENVIRONMENT_IS_NODE) { + worker.on("message", function (data) { + worker.onmessage({ + data: data + }) + }); + worker.on("error", function (data) { + worker.onerror(data) + }); + worker.on("exit", function (data) { + console.log("worker exited - TODO: update the worker queue?") + }) + } + assert(wasmMemory instanceof WebAssembly.Memory, "WebAssembly memory should have been loaded by now!"); + assert(wasmModule instanceof WebAssembly.Module, "WebAssembly Module should have been loaded by now!"); + worker.postMessage({ + "cmd": "load", + "urlOrBlob": Module["mainScriptUrlOrBlob"] || _scriptDir, + "wasmMemory": wasmMemory, + "wasmModule": wasmModule, + "DYNAMIC_BASE": DYNAMIC_BASE, + "DYNAMICTOP_PTR": DYNAMICTOP_PTR + }) + }, + allocateUnusedWorker: function () { + var pthreadMainJs = locateFile("tfjs-backend-wasm.worker.js"); + PThread.unusedWorkers.push(new Worker(pthreadMainJs)) + }, + getNewWorker: function () { + if (PThread.unusedWorkers.length == 0) { + PThread.allocateUnusedWorker(); + PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0]) + } + if (PThread.unusedWorkers.length > 0) return PThread.unusedWorkers.pop(); + else return null + }, + busySpinWait: function (msecs) { + var t = performance.now() + msecs; + while (performance.now() < t) {} + } + }; + + function establishStackSpace(stackTop, stackMax) { + STACK_BASE = STACKTOP = stackTop; + STACK_MAX = stackMax; + ___set_stack_limit(STACK_MAX); + writeStackCookie(); + stackRestore(stackTop) + } + Module["establishStackSpace"] = establishStackSpace; + + function getNoExitRuntime() { + return noExitRuntime + } + Module["getNoExitRuntime"] = getNoExitRuntime; + + function jsStackTrace() { + var err = new Error; + if (!err.stack) { + try { + throw new Error + } catch (e) { + err = e + } + if (!err.stack) { + return "(no stack trace available)" + } + } + return err.stack.toString() + } + + function stackTrace() { + var js = jsStackTrace(); + if (Module["extraStackTrace"]) js += "\n" + Module["extraStackTrace"](); + return demangleAll(js) + } + + function ___assert_fail(condition, filename, line, func) { + abort("Assertion failed: " + UTF8ToString(condition) + ", at: " + [filename ? UTF8ToString(filename) : "unknown filename", line, func ? UTF8ToString(func) : "unknown function"]) + } + var _emscripten_get_now; + if (ENVIRONMENT_IS_NODE) { + _emscripten_get_now = function () { + var t = process["hrtime"](); + return t[0] * 1e3 + t[1] / 1e6 + } + } else if (ENVIRONMENT_IS_PTHREAD) { + _emscripten_get_now = function () { + return performance.now() - Module["__performance_now_clock_drift"] + } + } else if (typeof dateNow !== "undefined") { + _emscripten_get_now = dateNow + } else _emscripten_get_now = function () { + return performance.now() + }; + + function _atexit(func, arg) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(1, 1, func, arg); + warnOnce("atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)"); + __ATEXIT__.unshift({ + func: func, + arg: arg + }) + } + + function ___handle_stack_overflow() { + abort("stack overflow") + } + + function __emscripten_notify_thread_queue(targetThreadId, mainThreadId) { + if (targetThreadId == mainThreadId) { + postMessage({ + "cmd": "processQueuedMainThreadWork" + }) + } else if (ENVIRONMENT_IS_PTHREAD) { + postMessage({ + "targetThread": targetThreadId, + "cmd": "processThreadQueue" + }) + } else { + var pthread = PThread.pthreads[targetThreadId]; + var worker = pthread && pthread.worker; + if (!worker) { + err("Cannot send message to thread with ID " + targetThreadId + ", unknown thread ID!"); + return + } + worker.postMessage({ + "cmd": "processThreadQueue" + }) + } + return 1 + } + + function _abort() { + abort() + } + + function _emscripten_conditional_set_current_thread_status(expectedStatus, newStatus) { + expectedStatus = expectedStatus | 0; + newStatus = newStatus | 0 + } + + function _emscripten_futex_wait(addr, val, timeout) { + if (addr <= 0 || addr > GROWABLE_HEAP_I8().length || addr & 3 != 0) return -28; + if (ENVIRONMENT_IS_WORKER) { + var ret = Atomics.wait(GROWABLE_HEAP_I32(), addr >> 2, val, timeout); + if (ret === "timed-out") return -73; + if (ret === "not-equal") return -6; + if (ret === "ok") return 0; + throw "Atomics.wait returned an unexpected value " + ret + } else { + var loadedVal = Atomics.load(GROWABLE_HEAP_I32(), addr >> 2); + if (val != loadedVal) return -6; + var tNow = performance.now(); + var tEnd = tNow + timeout; + Atomics.store(GROWABLE_HEAP_I32(), __main_thread_futex_wait_address >> 2, addr); + var ourWaitAddress = addr; + while (addr == ourWaitAddress) { + tNow = performance.now(); + if (tNow > tEnd) { + return -73 + } + _emscripten_main_thread_process_queued_calls(); + addr = Atomics.load(GROWABLE_HEAP_I32(), __main_thread_futex_wait_address >> 2) + } + return 0 + } + } + + function _emscripten_is_main_browser_thread() { + return __pthread_is_main_browser_thread | 0 + } + + function _emscripten_is_main_runtime_thread() { + return __pthread_is_main_runtime_thread | 0 + } + + function _emscripten_memcpy_big(dest, src, num) { + GROWABLE_HEAP_U8().copyWithin(dest, src, src + num) + } + + function _emscripten_proxy_to_main_thread_js(index, sync) { + var numCallArgs = arguments.length - 2; + if (numCallArgs > 20 - 1) throw "emscripten_proxy_to_main_thread_js: Too many arguments " + numCallArgs + " to proxied function idx=" + index + ", maximum supported is " + (20 - 1) + "!"; + var stack = stackSave(); + var args = stackAlloc(numCallArgs * 8); + var b = args >> 3; + for (var i = 0; i < numCallArgs; i++) { + GROWABLE_HEAP_F64()[b + i] = arguments[2 + i] + } + var ret = _emscripten_run_in_main_runtime_thread_js(index, numCallArgs, args, sync); + stackRestore(stack); + return ret + } + var _emscripten_receive_on_main_thread_js_callArgs = []; + + function readAsmConstArgs(sigPtr, buf) { + if (!readAsmConstArgs.array) { + readAsmConstArgs.array = [] + } + var args = readAsmConstArgs.array; + args.length = 0; + var ch; + while (ch = GROWABLE_HEAP_U8()[sigPtr++]) { + if (ch === 100 || ch === 102) { + buf = buf + 7 & ~7; + args.push(GROWABLE_HEAP_F64()[buf >> 3]); + buf += 8 + } else if (ch === 105) { + buf = buf + 3 & ~3; + args.push(GROWABLE_HEAP_I32()[buf >> 2]); + buf += 4 + } else abort("unexpected char in asm const signature " + ch) + } + return args + } + + function _emscripten_receive_on_main_thread_js(index, numCallArgs, args) { + _emscripten_receive_on_main_thread_js_callArgs.length = numCallArgs; + var b = args >> 3; + for (var i = 0; i < numCallArgs; i++) { + _emscripten_receive_on_main_thread_js_callArgs[i] = GROWABLE_HEAP_F64()[b + i] + } + var isEmAsmConst = index < 0; + var func = !isEmAsmConst ? proxiedFunctionTable[index] : ASM_CONSTS[-index - 1]; + if (isEmAsmConst) { + var sigPtr = _emscripten_receive_on_main_thread_js_callArgs[1]; + var varargPtr = _emscripten_receive_on_main_thread_js_callArgs[2]; + var constArgs = readAsmConstArgs(sigPtr, varargPtr); + return func.apply(null, constArgs) + } + assert(func.length == numCallArgs, "Call args mismatch in emscripten_receive_on_main_thread_js"); + return func.apply(null, _emscripten_receive_on_main_thread_js_callArgs) + } + + function _emscripten_get_heap_size() { + return GROWABLE_HEAP_U8().length + } + + function emscripten_realloc_buffer(size) { + try { + wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16); + updateGlobalBufferAndViews(wasmMemory.buffer); + return 1 + } catch (e) { + console.error("emscripten_realloc_buffer: Attempted to grow heap from " + buffer.byteLength + " bytes to " + size + " bytes, but got error: " + e) + } + } + + function _emscripten_resize_heap(requestedSize) { + var oldSize = _emscripten_get_heap_size(); + if (requestedSize <= oldSize) { + return false + } + var PAGE_MULTIPLE = 65536; + var maxHeapSize = 1073741824; + if (requestedSize > maxHeapSize) { + err("Cannot enlarge memory, asked to go up to " + requestedSize + " bytes, but the limit is " + maxHeapSize + " bytes!"); + return false + } + var minHeapSize = 16777216; + for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { + var overGrownHeapSize = oldSize * (1 + .2 / cutDown); + overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296); + var newSize = Math.min(maxHeapSize, alignUp(Math.max(minHeapSize, requestedSize, overGrownHeapSize), PAGE_MULTIPLE)); + var replacement = emscripten_realloc_buffer(newSize); + if (replacement) { + return true + } + } + err("Failed to grow the heap from " + oldSize + " bytes to " + newSize + " bytes, not enough memory!"); + return false + } + var JSEvents = { + keyEvent: 0, + mouseEvent: 0, + wheelEvent: 0, + uiEvent: 0, + focusEvent: 0, + deviceOrientationEvent: 0, + deviceMotionEvent: 0, + fullscreenChangeEvent: 0, + pointerlockChangeEvent: 0, + visibilityChangeEvent: 0, + touchEvent: 0, + previousFullscreenElement: null, + previousScreenX: null, + previousScreenY: null, + removeEventListenersRegistered: false, + removeAllEventListeners: function () { + for (var i = JSEvents.eventHandlers.length - 1; i >= 0; --i) { + JSEvents._removeHandler(i) + } + JSEvents.eventHandlers = []; + JSEvents.deferredCalls = [] + }, + registerRemoveEventListeners: function () { + if (!JSEvents.removeEventListenersRegistered) { + __ATEXIT__.push(JSEvents.removeAllEventListeners); + JSEvents.removeEventListenersRegistered = true + } + }, + deferredCalls: [], + deferCall: function (targetFunction, precedence, argsList) { + function arraysHaveEqualContent(arrA, arrB) { + if (arrA.length != arrB.length) return false; + for (var i in arrA) { + if (arrA[i] != arrB[i]) return false + } + return true + } + for (var i in JSEvents.deferredCalls) { + var call = JSEvents.deferredCalls[i]; + if (call.targetFunction == targetFunction && arraysHaveEqualContent(call.argsList, argsList)) { + return + } + } + JSEvents.deferredCalls.push({ + targetFunction: targetFunction, + precedence: precedence, + argsList: argsList + }); + JSEvents.deferredCalls.sort(function (x, y) { + return x.precedence < y.precedence + }) + }, + removeDeferredCalls: function (targetFunction) { + for (var i = 0; i < JSEvents.deferredCalls.length; ++i) { + if (JSEvents.deferredCalls[i].targetFunction == targetFunction) { + JSEvents.deferredCalls.splice(i, 1); + --i + } + } + }, + canPerformEventHandlerRequests: function () { + return JSEvents.inEventHandler && JSEvents.currentEventHandler.allowsDeferredCalls + }, + runDeferredCalls: function () { + if (!JSEvents.canPerformEventHandlerRequests()) { + return + } + for (var i = 0; i < JSEvents.deferredCalls.length; ++i) { + var call = JSEvents.deferredCalls[i]; + JSEvents.deferredCalls.splice(i, 1); + --i; + call.targetFunction.apply(null, call.argsList) + } + }, + inEventHandler: 0, + currentEventHandler: null, + eventHandlers: [], + removeAllHandlersOnTarget: function (target, eventTypeString) { + for (var i = 0; i < JSEvents.eventHandlers.length; ++i) { + if (JSEvents.eventHandlers[i].target == target && (!eventTypeString || eventTypeString == JSEvents.eventHandlers[i].eventTypeString)) { + JSEvents._removeHandler(i--) + } + } + }, + _removeHandler: function (i) { + var h = JSEvents.eventHandlers[i]; + h.target.removeEventListener(h.eventTypeString, h.eventListenerFunc, h.useCapture); + JSEvents.eventHandlers.splice(i, 1) + }, + registerOrRemoveHandler: function (eventHandler) { + var jsEventHandler = function jsEventHandler(event) { + ++JSEvents.inEventHandler; + JSEvents.currentEventHandler = eventHandler; + JSEvents.runDeferredCalls(); + eventHandler.handlerFunc(event); + JSEvents.runDeferredCalls(); + --JSEvents.inEventHandler + }; + if (eventHandler.callbackfunc) { + eventHandler.eventListenerFunc = jsEventHandler; + eventHandler.target.addEventListener(eventHandler.eventTypeString, jsEventHandler, eventHandler.useCapture); + JSEvents.eventHandlers.push(eventHandler); + JSEvents.registerRemoveEventListeners() + } else { + for (var i = 0; i < JSEvents.eventHandlers.length; ++i) { + if (JSEvents.eventHandlers[i].target == eventHandler.target && JSEvents.eventHandlers[i].eventTypeString == eventHandler.eventTypeString) { + JSEvents._removeHandler(i--) + } + } + } + }, + queueEventHandlerOnThread_iiii: function (targetThread, eventHandlerFunc, eventTypeId, eventData, userData) { + var stackTop = stackSave(); + var varargs = stackAlloc(12); + GROWABLE_HEAP_I32()[varargs >> 2] = eventTypeId; + GROWABLE_HEAP_I32()[varargs + 4 >> 2] = eventData; + GROWABLE_HEAP_I32()[varargs + 8 >> 2] = userData; + _emscripten_async_queue_on_thread_(targetThread, 637534208, eventHandlerFunc, eventData, varargs); + stackRestore(stackTop) + }, + getTargetThreadForEventCallback: function (targetThread) { + switch (targetThread) { + case 1: + return 0; + case 2: + return PThread.currentProxiedOperationCallerThread; + default: + return targetThread + } + }, + getNodeNameForTarget: function (target) { + if (!target) return ""; + if (target == window) return "#window"; + if (target == screen) return "#screen"; + return target && target.nodeName ? target.nodeName : "" + }, + fullscreenEnabled: function () { + return document.fullscreenEnabled || document.webkitFullscreenEnabled + } + }; + + function stringToNewUTF8(jsString) { + var length = lengthBytesUTF8(jsString) + 1; + var cString = _malloc(length); + stringToUTF8(jsString, cString, length); + return cString + } + + function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread, targetCanvas, width, height) { + var stackTop = stackSave(); + var varargs = stackAlloc(12); + var targetCanvasPtr = 0; + if (targetCanvas) { + targetCanvasPtr = stringToNewUTF8(targetCanvas) + } + GROWABLE_HEAP_I32()[varargs >> 2] = targetCanvasPtr; + GROWABLE_HEAP_I32()[varargs + 4 >> 2] = width; + GROWABLE_HEAP_I32()[varargs + 8 >> 2] = height; + _emscripten_async_queue_on_thread_(targetThread, 657457152, 0, targetCanvasPtr, varargs); + stackRestore(stackTop) + } + + function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread, targetCanvas, width, height) { + targetCanvas = targetCanvas ? UTF8ToString(targetCanvas) : ""; + _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread, targetCanvas, width, height) + } + + function __maybeCStringToJsString(cString) { + return cString === cString + 0 ? UTF8ToString(cString) : cString + } + var __specialEventTargets = [0, typeof document !== "undefined" ? document : 0, typeof window !== "undefined" ? window : 0]; + + function __findEventTarget(target) { + var domElement = __specialEventTargets[target] || (typeof document !== "undefined" ? document.querySelector(__maybeCStringToJsString(target)) : undefined); + return domElement + } + + function __findCanvasEventTarget(target) { + return __findEventTarget(target) + } + + function _emscripten_set_canvas_element_size_calling_thread(target, width, height) { + var canvas = __findCanvasEventTarget(target); + if (!canvas) return -4; + if (canvas.canvasSharedPtr) { + GROWABLE_HEAP_I32()[canvas.canvasSharedPtr >> 2] = width; + GROWABLE_HEAP_I32()[canvas.canvasSharedPtr + 4 >> 2] = height + } + if (canvas.offscreenCanvas || !canvas.controlTransferredOffscreen) { + if (canvas.offscreenCanvas) canvas = canvas.offscreenCanvas; + var autoResizeViewport = false; + if (canvas.GLctxObject && canvas.GLctxObject.GLctx) { + var prevViewport = canvas.GLctxObject.GLctx.getParameter(2978); + autoResizeViewport = prevViewport[0] === 0 && prevViewport[1] === 0 && prevViewport[2] === canvas.width && prevViewport[3] === canvas.height + } + canvas.width = width; + canvas.height = height; + if (autoResizeViewport) { + canvas.GLctxObject.GLctx.viewport(0, 0, width, height) + } + } else if (canvas.canvasSharedPtr) { + var targetThread = GROWABLE_HEAP_I32()[canvas.canvasSharedPtr + 8 >> 2]; + _emscripten_set_offscreencanvas_size_on_target_thread(targetThread, target, width, height); + return 1 + } else { + return -4 + } + return 0 + } + + function _emscripten_set_canvas_element_size_main_thread(target, width, height) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(2, 1, target, width, height); + return _emscripten_set_canvas_element_size_calling_thread(target, width, height) + } + + function _emscripten_set_canvas_element_size(target, width, height) { + var canvas = __findCanvasEventTarget(target); + if (canvas) { + return _emscripten_set_canvas_element_size_calling_thread(target, width, height) + } else { + return _emscripten_set_canvas_element_size_main_thread(target, width, height) + } + } + + function _emscripten_set_current_thread_status(newStatus) { + newStatus = newStatus | 0 + } + + function __webgl_acquireInstancedArraysExtension(ctx) { + var ext = ctx.getExtension("ANGLE_instanced_arrays"); + if (ext) { + ctx["vertexAttribDivisor"] = function (index, divisor) { + ext["vertexAttribDivisorANGLE"](index, divisor) + }; + ctx["drawArraysInstanced"] = function (mode, first, count, primcount) { + ext["drawArraysInstancedANGLE"](mode, first, count, primcount) + }; + ctx["drawElementsInstanced"] = function (mode, count, type, indices, primcount) { + ext["drawElementsInstancedANGLE"](mode, count, type, indices, primcount) + } + } + } + + function __webgl_acquireVertexArrayObjectExtension(ctx) { + var ext = ctx.getExtension("OES_vertex_array_object"); + if (ext) { + ctx["createVertexArray"] = function () { + return ext["createVertexArrayOES"]() + }; + ctx["deleteVertexArray"] = function (vao) { + ext["deleteVertexArrayOES"](vao) + }; + ctx["bindVertexArray"] = function (vao) { + ext["bindVertexArrayOES"](vao) + }; + ctx["isVertexArray"] = function (vao) { + return ext["isVertexArrayOES"](vao) + } + } + } + + function __webgl_acquireDrawBuffersExtension(ctx) { + var ext = ctx.getExtension("WEBGL_draw_buffers"); + if (ext) { + ctx["drawBuffers"] = function (n, bufs) { + ext["drawBuffersWEBGL"](n, bufs) + } + } + } + var GL = { + counter: 1, + lastError: 0, + buffers: [], + mappedBuffers: {}, + programs: [], + framebuffers: [], + renderbuffers: [], + textures: [], + uniforms: [], + shaders: [], + vaos: [], + contexts: {}, + currentContext: null, + offscreenCanvases: {}, + timerQueriesEXT: [], + programInfos: {}, + stringCache: {}, + unpackAlignment: 4, + init: function () { + var miniTempFloatBuffer = new Float32Array(GL.MINI_TEMP_BUFFER_SIZE); + for (var i = 0; i < GL.MINI_TEMP_BUFFER_SIZE; i++) { + GL.miniTempBufferFloatViews[i] = miniTempFloatBuffer.subarray(0, i + 1) + } + var miniTempIntBuffer = new Int32Array(GL.MINI_TEMP_BUFFER_SIZE); + for (var i = 0; i < GL.MINI_TEMP_BUFFER_SIZE; i++) { + GL.miniTempBufferIntViews[i] = miniTempIntBuffer.subarray(0, i + 1) + } + }, + recordError: function recordError(errorCode) { + if (!GL.lastError) { + GL.lastError = errorCode + } + }, + getNewId: function (table) { + var ret = GL.counter++; + for (var i = table.length; i < ret; i++) { + table[i] = null + } + return ret + }, + MINI_TEMP_BUFFER_SIZE: 256, + miniTempBufferFloatViews: [0], + miniTempBufferIntViews: [0], + getSource: function (shader, count, string, length) { + var source = ""; + for (var i = 0; i < count; ++i) { + var len = length ? GROWABLE_HEAP_I32()[length + i * 4 >> 2] : -1; + source += UTF8ToString(GROWABLE_HEAP_I32()[string + i * 4 >> 2], len < 0 ? undefined : len) + } + return source + }, + createContext: function (canvas, webGLContextAttributes) { + var ctx = canvas.getContext("webgl", webGLContextAttributes); + if (!ctx) return 0; + var handle = GL.registerContext(ctx, webGLContextAttributes); + return handle + }, + registerContext: function (ctx, webGLContextAttributes) { + var handle = _malloc(8); + GROWABLE_HEAP_I32()[handle + 4 >> 2] = _pthread_self(); + var context = { + handle: handle, + attributes: webGLContextAttributes, + version: webGLContextAttributes.majorVersion, + GLctx: ctx + }; + if (ctx.canvas) ctx.canvas.GLctxObject = context; + GL.contexts[handle] = context; + if (typeof webGLContextAttributes.enableExtensionsByDefault === "undefined" || webGLContextAttributes.enableExtensionsByDefault) { + GL.initExtensions(context) + } + return handle + }, + makeContextCurrent: function (contextHandle) { + GL.currentContext = GL.contexts[contextHandle]; + Module.ctx = GLctx = GL.currentContext && GL.currentContext.GLctx; + return !(contextHandle && !GLctx) + }, + getContext: function (contextHandle) { + return GL.contexts[contextHandle] + }, + deleteContext: function (contextHandle) { + if (GL.currentContext === GL.contexts[contextHandle]) GL.currentContext = null; + if (typeof JSEvents === "object") JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas); + if (GL.contexts[contextHandle] && GL.contexts[contextHandle].GLctx.canvas) GL.contexts[contextHandle].GLctx.canvas.GLctxObject = undefined; + _free(GL.contexts[contextHandle].handle); + GL.contexts[contextHandle] = null + }, + initExtensions: function (context) { + if (!context) context = GL.currentContext; + if (context.initExtensionsDone) return; + context.initExtensionsDone = true; + var GLctx = context.GLctx; + if (context.version < 2) { + __webgl_acquireInstancedArraysExtension(GLctx); + __webgl_acquireVertexArrayObjectExtension(GLctx); + __webgl_acquireDrawBuffersExtension(GLctx) + } + GLctx.disjointTimerQueryExt = GLctx.getExtension("EXT_disjoint_timer_query"); + var automaticallyEnabledExtensions = ["OES_texture_float", "OES_texture_half_float", "OES_standard_derivatives", "OES_vertex_array_object", "WEBGL_compressed_texture_s3tc", "WEBGL_depth_texture", "OES_element_index_uint", "EXT_texture_filter_anisotropic", "EXT_frag_depth", "WEBGL_draw_buffers", "ANGLE_instanced_arrays", "OES_texture_float_linear", "OES_texture_half_float_linear", "EXT_blend_minmax", "EXT_shader_texture_lod", "EXT_texture_norm16", "WEBGL_compressed_texture_pvrtc", "EXT_color_buffer_half_float", "WEBGL_color_buffer_float", "EXT_sRGB", "WEBGL_compressed_texture_etc1", "EXT_disjoint_timer_query", "WEBGL_compressed_texture_etc", "WEBGL_compressed_texture_astc", "EXT_color_buffer_float", "WEBGL_compressed_texture_s3tc_srgb", "EXT_disjoint_timer_query_webgl2", "WEBKIT_WEBGL_compressed_texture_pvrtc"]; + var exts = GLctx.getSupportedExtensions() || []; + exts.forEach(function (ext) { + if (automaticallyEnabledExtensions.indexOf(ext) != -1) { + GLctx.getExtension(ext) + } + }) + }, + populateUniformTable: function (program) { + var p = GL.programs[program]; + var ptable = GL.programInfos[program] = { + uniforms: {}, + maxUniformLength: 0, + maxAttributeLength: -1, + maxUniformBlockNameLength: -1 + }; + var utable = ptable.uniforms; + var numUniforms = GLctx.getProgramParameter(p, 35718); + for (var i = 0; i < numUniforms; ++i) { + var u = GLctx.getActiveUniform(p, i); + var name = u.name; + ptable.maxUniformLength = Math.max(ptable.maxUniformLength, name.length + 1); + if (name.slice(-1) == "]") { + name = name.slice(0, name.lastIndexOf("[")) + } + var loc = GLctx.getUniformLocation(p, name); + if (loc) { + var id = GL.getNewId(GL.uniforms); + utable[name] = [u.size, id]; + GL.uniforms[id] = loc; + for (var j = 1; j < u.size; ++j) { + var n = name + "[" + j + "]"; + loc = GLctx.getUniformLocation(p, n); + id = GL.getNewId(GL.uniforms); + GL.uniforms[id] = loc + } + } + } + } + }; + var __emscripten_webgl_power_preferences = ["default", "low-power", "high-performance"]; + + function _emscripten_webgl_do_create_context(target, attributes) { + assert(attributes); + var contextAttributes = {}; + var a = attributes >> 2; + contextAttributes["alpha"] = !!GROWABLE_HEAP_I32()[a + (0 >> 2)]; + contextAttributes["depth"] = !!GROWABLE_HEAP_I32()[a + (4 >> 2)]; + contextAttributes["stencil"] = !!GROWABLE_HEAP_I32()[a + (8 >> 2)]; + contextAttributes["antialias"] = !!GROWABLE_HEAP_I32()[a + (12 >> 2)]; + contextAttributes["premultipliedAlpha"] = !!GROWABLE_HEAP_I32()[a + (16 >> 2)]; + contextAttributes["preserveDrawingBuffer"] = !!GROWABLE_HEAP_I32()[a + (20 >> 2)]; + var powerPreference = GROWABLE_HEAP_I32()[a + (24 >> 2)]; + contextAttributes["powerPreference"] = __emscripten_webgl_power_preferences[powerPreference]; + contextAttributes["failIfMajorPerformanceCaveat"] = !!GROWABLE_HEAP_I32()[a + (28 >> 2)]; + contextAttributes.majorVersion = GROWABLE_HEAP_I32()[a + (32 >> 2)]; + contextAttributes.minorVersion = GROWABLE_HEAP_I32()[a + (36 >> 2)]; + contextAttributes.enableExtensionsByDefault = GROWABLE_HEAP_I32()[a + (40 >> 2)]; + contextAttributes.explicitSwapControl = GROWABLE_HEAP_I32()[a + (44 >> 2)]; + contextAttributes.proxyContextToMainThread = GROWABLE_HEAP_I32()[a + (48 >> 2)]; + contextAttributes.renderViaOffscreenBackBuffer = GROWABLE_HEAP_I32()[a + (52 >> 2)]; + var canvas = __findCanvasEventTarget(target); + if (!canvas) { + return 0 + } + if (contextAttributes.explicitSwapControl) { + return 0 + } + var contextHandle = GL.createContext(canvas, contextAttributes); + return contextHandle + } + + function _emscripten_webgl_create_context(a0, a1) { + return _emscripten_webgl_do_create_context(a0, a1) + } + var PATH = { + splitPath: function (filename) { + var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; + return splitPathRe.exec(filename).slice(1) + }, + normalizeArray: function (parts, allowAboveRoot) { + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === ".") { + parts.splice(i, 1) + } else if (last === "..") { + parts.splice(i, 1); + up++ + } else if (up) { + parts.splice(i, 1); + up-- + } + } + if (allowAboveRoot) { + for (; up; up--) { + parts.unshift("..") + } + } + return parts + }, + normalize: function (path) { + var isAbsolute = path.charAt(0) === "/", + trailingSlash = path.substr(-1) === "/"; + path = PATH.normalizeArray(path.split("/").filter(function (p) { + return !!p + }), !isAbsolute).join("/"); + if (!path && !isAbsolute) { + path = "." + } + if (path && trailingSlash) { + path += "/" + } + return (isAbsolute ? "/" : "") + path + }, + dirname: function (path) { + var result = PATH.splitPath(path), + root = result[0], + dir = result[1]; + if (!root && !dir) { + return "." + } + if (dir) { + dir = dir.substr(0, dir.length - 1) + } + return root + dir + }, + basename: function (path) { + if (path === "/") return "/"; + var lastSlash = path.lastIndexOf("/"); + if (lastSlash === -1) return path; + return path.substr(lastSlash + 1) + }, + extname: function (path) { + return PATH.splitPath(path)[3] + }, + join: function () { + var paths = Array.prototype.slice.call(arguments, 0); + return PATH.normalize(paths.join("/")) + }, + join2: function (l, r) { + return PATH.normalize(l + "/" + r) + } + }; + var SYSCALLS = { + mappings: {}, + buffers: [null, [], + [] + ], + printChar: function (stream, curr) { + var buffer = SYSCALLS.buffers[stream]; + assert(buffer); + if (curr === 0 || curr === 10) { + (stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0)); + buffer.length = 0 + } else { + buffer.push(curr) + } + }, + varargs: undefined, + get: function () { + assert(SYSCALLS.varargs != undefined); + SYSCALLS.varargs += 4; + var ret = GROWABLE_HEAP_I32()[SYSCALLS.varargs - 4 >> 2]; + return ret + }, + getStr: function (ptr) { + var ret = UTF8ToString(ptr); + return ret + }, + get64: function (low, high) { + if (low >= 0) assert(high === 0); + else assert(high === -1); + return low + } + }; + + function _fd_close(fd) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(3, 1, fd); + abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM"); + return 0 + } + + function _fd_seek(fd, offset_low, offset_high, whence, newOffset) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(4, 1, fd, offset_low, offset_high, whence, newOffset); + abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM") + } + + function _fd_write(fd, iov, iovcnt, pnum) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(5, 1, fd, iov, iovcnt, pnum); + var num = 0; + for (var i = 0; i < iovcnt; i++) { + var ptr = GROWABLE_HEAP_I32()[iov + i * 8 >> 2]; + var len = GROWABLE_HEAP_I32()[iov + (i * 8 + 4) >> 2]; + for (var j = 0; j < len; j++) { + SYSCALLS.printChar(fd, GROWABLE_HEAP_U8()[ptr + j]) + } + num += len + } + GROWABLE_HEAP_I32()[pnum >> 2] = num; + return 0 + } + + function _pthread_cleanup_pop(execute) { + var routine = PThread.exitHandlers.pop(); + if (execute) routine() + } + + function _pthread_cleanup_push(routine, arg) { + if (PThread.exitHandlers === null) { + PThread.exitHandlers = [] + } + PThread.exitHandlers.push(function () { + dynCall_vi(routine, arg) + }) + } + + function __spawn_thread(threadParams) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _spawn_thread() can only ever be called from main application thread!"; + var worker = PThread.getNewWorker(); + if (worker.pthread !== undefined) throw "Internal error!"; + if (!threadParams.pthread_ptr) throw "Internal error, no pthread ptr!"; + PThread.runningWorkers.push(worker); + var tlsMemory = _malloc(128 * 4); + for (var i = 0; i < 128; ++i) { + GROWABLE_HEAP_I32()[tlsMemory + i * 4 >> 2] = 0 + } + var stackHigh = threadParams.stackBase + threadParams.stackSize; + var pthread = PThread.pthreads[threadParams.pthread_ptr] = { + worker: worker, + stackBase: threadParams.stackBase, + stackSize: threadParams.stackSize, + allocatedOwnStack: threadParams.allocatedOwnStack, + thread: threadParams.pthread_ptr, + threadInfoStruct: threadParams.pthread_ptr + }; + var tis = pthread.threadInfoStruct >> 2; + Atomics.store(GROWABLE_HEAP_U32(), tis + (0 >> 2), 0); + Atomics.store(GROWABLE_HEAP_U32(), tis + (4 >> 2), 0); + Atomics.store(GROWABLE_HEAP_U32(), tis + (8 >> 2), 0); + Atomics.store(GROWABLE_HEAP_U32(), tis + (68 >> 2), threadParams.detached); + Atomics.store(GROWABLE_HEAP_U32(), tis + (104 >> 2), tlsMemory); + Atomics.store(GROWABLE_HEAP_U32(), tis + (48 >> 2), 0); + Atomics.store(GROWABLE_HEAP_U32(), tis + (40 >> 2), pthread.threadInfoStruct); + Atomics.store(GROWABLE_HEAP_U32(), tis + (44 >> 2), 42); + Atomics.store(GROWABLE_HEAP_U32(), tis + (108 >> 2), threadParams.stackSize); + Atomics.store(GROWABLE_HEAP_U32(), tis + (84 >> 2), threadParams.stackSize); + Atomics.store(GROWABLE_HEAP_U32(), tis + (80 >> 2), stackHigh); + Atomics.store(GROWABLE_HEAP_U32(), tis + (108 + 8 >> 2), stackHigh); + Atomics.store(GROWABLE_HEAP_U32(), tis + (108 + 12 >> 2), threadParams.detached); + Atomics.store(GROWABLE_HEAP_U32(), tis + (108 + 20 >> 2), threadParams.schedPolicy); + Atomics.store(GROWABLE_HEAP_U32(), tis + (108 + 24 >> 2), threadParams.schedPrio); + var global_libc = _emscripten_get_global_libc(); + var global_locale = global_libc + 40; + Atomics.store(GROWABLE_HEAP_U32(), tis + (176 >> 2), global_locale); + worker.pthread = pthread; + var msg = { + "cmd": "run", + "start_routine": threadParams.startRoutine, + "arg": threadParams.arg, + "threadInfoStruct": threadParams.pthread_ptr, + "selfThreadId": threadParams.pthread_ptr, + "parentThreadId": threadParams.parent_pthread_ptr, + "stackBase": threadParams.stackBase, + "stackSize": threadParams.stackSize + }; + worker.runPthread = function () { + msg.time = performance.now(); + worker.postMessage(msg, threadParams.transferList) + }; + if (worker.loaded) { + worker.runPthread(); + delete worker.runPthread + } + } + + function _pthread_getschedparam(thread, policy, schedparam) { + if (!policy && !schedparam) return ERRNO_CODES.EINVAL; + if (!thread) { + err("pthread_getschedparam called with a null thread pointer!"); + return ERRNO_CODES.ESRCH + } + var self = GROWABLE_HEAP_I32()[thread + 12 >> 2]; + if (self !== thread) { + err("pthread_getschedparam attempted on thread " + thread + ", which does not point to a valid thread, or does not exist anymore!"); + return ERRNO_CODES.ESRCH + } + var schedPolicy = Atomics.load(GROWABLE_HEAP_U32(), thread + 108 + 20 >> 2); + var schedPrio = Atomics.load(GROWABLE_HEAP_U32(), thread + 108 + 24 >> 2); + if (policy) GROWABLE_HEAP_I32()[policy >> 2] = schedPolicy; + if (schedparam) GROWABLE_HEAP_I32()[schedparam >> 2] = schedPrio; + return 0 + } + + function _pthread_self() { + return __pthread_ptr | 0 + } + Module["_pthread_self"] = _pthread_self; + + function _pthread_create(pthread_ptr, attr, start_routine, arg) { + if (typeof SharedArrayBuffer === "undefined") { + err("Current environment does not support SharedArrayBuffer, pthreads are not available!"); + return 6 + } + if (!pthread_ptr) { + err("pthread_create called with a null thread pointer!"); + return 28 + } + var transferList = []; + var error = 0; + if (ENVIRONMENT_IS_PTHREAD && (transferList.length === 0 || error)) { + return _emscripten_sync_run_in_main_thread_4(687865856, pthread_ptr, attr, start_routine, arg) + } + if (error) return error; + var stackSize = 0; + var stackBase = 0; + var detached = 0; + var schedPolicy = 0; + var schedPrio = 0; + if (attr) { + stackSize = GROWABLE_HEAP_I32()[attr >> 2]; + stackSize += 81920; + stackBase = GROWABLE_HEAP_I32()[attr + 8 >> 2]; + detached = GROWABLE_HEAP_I32()[attr + 12 >> 2] !== 0; + var inheritSched = GROWABLE_HEAP_I32()[attr + 16 >> 2] === 0; + if (inheritSched) { + var prevSchedPolicy = GROWABLE_HEAP_I32()[attr + 20 >> 2]; + var prevSchedPrio = GROWABLE_HEAP_I32()[attr + 24 >> 2]; + var parentThreadPtr = PThread.currentProxiedOperationCallerThread ? PThread.currentProxiedOperationCallerThread : _pthread_self(); + _pthread_getschedparam(parentThreadPtr, attr + 20, attr + 24); + schedPolicy = GROWABLE_HEAP_I32()[attr + 20 >> 2]; + schedPrio = GROWABLE_HEAP_I32()[attr + 24 >> 2]; + GROWABLE_HEAP_I32()[attr + 20 >> 2] = prevSchedPolicy; + GROWABLE_HEAP_I32()[attr + 24 >> 2] = prevSchedPrio + } else { + schedPolicy = GROWABLE_HEAP_I32()[attr + 20 >> 2]; + schedPrio = GROWABLE_HEAP_I32()[attr + 24 >> 2] + } + } else { + stackSize = 2097152 + } + var allocatedOwnStack = stackBase == 0; + if (allocatedOwnStack) { + stackBase = _memalign(16, stackSize) + } else { + stackBase -= stackSize; + assert(stackBase > 0) + } + var threadInfoStruct = _malloc(232); + for (var i = 0; i < 232 >> 2; ++i) GROWABLE_HEAP_U32()[(threadInfoStruct >> 2) + i] = 0; + GROWABLE_HEAP_I32()[pthread_ptr >> 2] = threadInfoStruct; + GROWABLE_HEAP_I32()[threadInfoStruct + 12 >> 2] = threadInfoStruct; + var headPtr = threadInfoStruct + 156; + GROWABLE_HEAP_I32()[headPtr >> 2] = headPtr; + var threadParams = { + stackBase: stackBase, + stackSize: stackSize, + allocatedOwnStack: allocatedOwnStack, + schedPolicy: schedPolicy, + schedPrio: schedPrio, + detached: detached, + startRoutine: start_routine, + pthread_ptr: threadInfoStruct, + parent_pthread_ptr: _pthread_self(), + arg: arg, + transferList: transferList + }; + if (ENVIRONMENT_IS_PTHREAD) { + threadParams.cmd = "spawnThread"; + postMessage(threadParams, transferList) + } else { + __spawn_thread(threadParams) + } + return 0 + } + + function _roundf(d) { + d = +d; + return d >= +0 ? +Math_floor(d + +.5) : +Math_ceil(d - +.5) + } + if (!ENVIRONMENT_IS_PTHREAD) PThread.initMainThreadBlock(); + else PThread.initWorker(); + var GLctx; + GL.init(); + var proxiedFunctionTable = [null, _atexit, _emscripten_set_canvas_element_size_main_thread, _fd_close, _fd_seek, _fd_write]; + var asmLibraryArg = { + "__assert_fail": ___assert_fail, + "__handle_stack_overflow": ___handle_stack_overflow, + "_emscripten_notify_thread_queue": __emscripten_notify_thread_queue, + "abort": _abort, + "emscripten_conditional_set_current_thread_status": _emscripten_conditional_set_current_thread_status, + "emscripten_futex_wait": _emscripten_futex_wait, + "emscripten_futex_wake": _emscripten_futex_wake, + "emscripten_get_now": _emscripten_get_now, + "emscripten_is_main_browser_thread": _emscripten_is_main_browser_thread, + "emscripten_is_main_runtime_thread": _emscripten_is_main_runtime_thread, + "emscripten_memcpy_big": _emscripten_memcpy_big, + "emscripten_receive_on_main_thread_js": _emscripten_receive_on_main_thread_js, + "emscripten_resize_heap": _emscripten_resize_heap, + "emscripten_set_canvas_element_size": _emscripten_set_canvas_element_size, + "emscripten_set_current_thread_status": _emscripten_set_current_thread_status, + "emscripten_webgl_create_context": _emscripten_webgl_create_context, + "fd_close": _fd_close, + "fd_seek": _fd_seek, + "fd_write": _fd_write, + "initPthreadsJS": initPthreadsJS, + "memory": wasmMemory || Module["wasmMemory"], + "pthread_cleanup_pop": _pthread_cleanup_pop, + "pthread_cleanup_push": _pthread_cleanup_push, + "pthread_create": _pthread_create, + "pthread_self": _pthread_self, + "roundf": _roundf, + "table": wasmTable + }; + var asm = createWasm(); + Module["asm"] = asm; + var ___wasm_call_ctors = Module["___wasm_call_ctors"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__wasm_call_ctors"].apply(null, arguments) + }; + var _init = Module["_init"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["init"].apply(null, arguments) + }; + var _register_tensor = Module["_register_tensor"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["register_tensor"].apply(null, arguments) + }; + var _dispose_data = Module["_dispose_data"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dispose_data"].apply(null, arguments) + }; + var _dispose = Module["_dispose"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dispose"].apply(null, arguments) + }; + var _Abs = Module["_Abs"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Abs"].apply(null, arguments) + }; + var _Add = Module["_Add"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Add"].apply(null, arguments) + }; + var _AddN = Module["_AddN"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["AddN"].apply(null, arguments) + }; + var _ArgMax = Module["_ArgMax"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ArgMax"].apply(null, arguments) + }; + var _AvgPool = Module["_AvgPool"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["AvgPool"].apply(null, arguments) + }; + var _BatchMatMul = Module["_BatchMatMul"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["BatchMatMul"].apply(null, arguments) + }; + var _ClipByValue = Module["_ClipByValue"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ClipByValue"].apply(null, arguments) + }; + var _Conv2D = Module["_Conv2D"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Conv2D"].apply(null, arguments) + }; + var _Cos = Module["_Cos"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Cos"].apply(null, arguments) + }; + var _CropAndResize = Module["_CropAndResize"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["CropAndResize"].apply(null, arguments) + }; + var _DepthwiseConv2dNative = Module["_DepthwiseConv2dNative"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["DepthwiseConv2dNative"].apply(null, arguments) + }; + var _Div = Module["_Div"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Div"].apply(null, arguments) + }; + var _Exp = Module["_Exp"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Exp"].apply(null, arguments) + }; + var _FloorDiv = Module["_FloorDiv"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FloorDiv"].apply(null, arguments) + }; + var _FusedBatchNorm = Module["_FusedBatchNorm"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FusedBatchNorm"].apply(null, arguments) + }; + var _FusedConv2D = Module["_FusedConv2D"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FusedConv2D"].apply(null, arguments) + }; + var _FusedDepthwiseConv2D = Module["_FusedDepthwiseConv2D"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FusedDepthwiseConv2D"].apply(null, arguments) + }; + var _Gather = Module["_Gather"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Gather"].apply(null, arguments) + }; + var _GatherNd = Module["_GatherNd"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["GatherNd"].apply(null, arguments) + }; + var _Greater = Module["_Greater"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Greater"].apply(null, arguments) + }; + var _GreaterEqual = Module["_GreaterEqual"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["GreaterEqual"].apply(null, arguments) + }; + var _Less = Module["_Less"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Less"].apply(null, arguments) + }; + var _LessEqual = Module["_LessEqual"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["LessEqual"].apply(null, arguments) + }; + var _Log = Module["_Log"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Log"].apply(null, arguments) + }; + var _LogicalAnd = Module["_LogicalAnd"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["LogicalAnd"].apply(null, arguments) + }; + var _Max = Module["_Max"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Max"].apply(null, arguments) + }; + var _MaxPool = Module["_MaxPool"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["MaxPool"].apply(null, arguments) + }; + var _Maximum = Module["_Maximum"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Maximum"].apply(null, arguments) + }; + var _Min = Module["_Min"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Min"].apply(null, arguments) + }; + var _Minimum = Module["_Minimum"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Minimum"].apply(null, arguments) + }; + var _Mul = Module["_Mul"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Mul"].apply(null, arguments) + }; + var _Neg = Module["_Neg"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Neg"].apply(null, arguments) + }; + var _NonMaxSuppressionV3 = Module["_NonMaxSuppressionV3"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["NonMaxSuppressionV3"].apply(null, arguments) + }; + var _NonMaxSuppressionV5 = Module["_NonMaxSuppressionV5"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["NonMaxSuppressionV5"].apply(null, arguments) + }; + var _NotEqual = Module["_NotEqual"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["NotEqual"].apply(null, arguments) + }; + var _PadV2 = Module["_PadV2"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["PadV2"].apply(null, arguments) + }; + var _Pow = Module["_Pow"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Pow"].apply(null, arguments) + }; + var _Prelu = Module["_Prelu"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Prelu"].apply(null, arguments) + }; + var _Relu = Module["_Relu"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Relu"].apply(null, arguments) + }; + var _Relu6 = Module["_Relu6"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Relu6"].apply(null, arguments) + }; + var _ResizeBilinear = Module["_ResizeBilinear"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ResizeBilinear"].apply(null, arguments) + }; + var _Rsqrt = Module["_Rsqrt"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Rsqrt"].apply(null, arguments) + }; + var _ScatterNd = Module["_ScatterNd"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ScatterNd"].apply(null, arguments) + }; + var _Sigmoid = Module["_Sigmoid"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sigmoid"].apply(null, arguments) + }; + var _Sin = Module["_Sin"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sin"].apply(null, arguments) + }; + var _Softmax = Module["_Softmax"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Softmax"].apply(null, arguments) + }; + var _Square = Module["_Square"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Square"].apply(null, arguments) + }; + var _Sub = Module["_Sub"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sub"].apply(null, arguments) + }; + var _Sum = Module["_Sum"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sum"].apply(null, arguments) + }; + var _Tanh = Module["_Tanh"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Tanh"].apply(null, arguments) + }; + var _Tile = Module["_Tile"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Tile"].apply(null, arguments) + }; + var _Transpose = Module["_Transpose"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Transpose"].apply(null, arguments) + }; + var __FusedMatMul = Module["__FusedMatMul"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["_FusedMatMul"].apply(null, arguments) + }; + var _malloc = Module["_malloc"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["malloc"].apply(null, arguments) + }; + var _free = Module["_free"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["free"].apply(null, arguments) + }; + var ___em_js__initPthreadsJS = Module["___em_js__initPthreadsJS"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__em_js__initPthreadsJS"].apply(null, arguments) + }; + var _emscripten_get_global_libc = Module["_emscripten_get_global_libc"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_get_global_libc"].apply(null, arguments) + }; + var _memalign = Module["_memalign"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["memalign"].apply(null, arguments) + }; + var ___pthread_tsd_run_dtors = Module["___pthread_tsd_run_dtors"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__pthread_tsd_run_dtors"].apply(null, arguments) + }; + var _emscripten_main_thread_process_queued_calls = Module["_emscripten_main_thread_process_queued_calls"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null, arguments) + }; + var _emscripten_current_thread_process_queued_calls = Module["_emscripten_current_thread_process_queued_calls"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null, arguments) + }; + var _emscripten_register_main_browser_thread_id = Module["_emscripten_register_main_browser_thread_id"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null, arguments) + }; + var _emscripten_main_browser_thread_id = Module["_emscripten_main_browser_thread_id"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_main_browser_thread_id"].apply(null, arguments) + }; + var _emscripten_async_run_in_main_thread = Module["_emscripten_async_run_in_main_thread"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread = Module["_emscripten_sync_run_in_main_thread"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_0 = Module["_emscripten_sync_run_in_main_thread_0"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_1 = Module["_emscripten_sync_run_in_main_thread_1"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_2 = Module["_emscripten_sync_run_in_main_thread_2"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_xprintf_varargs = Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_3 = Module["_emscripten_sync_run_in_main_thread_3"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_4 = Module["_emscripten_sync_run_in_main_thread_4"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_5 = Module["_emscripten_sync_run_in_main_thread_5"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_6 = Module["_emscripten_sync_run_in_main_thread_6"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_7 = Module["_emscripten_sync_run_in_main_thread_7"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null, arguments) + }; + var _emscripten_run_in_main_runtime_thread_js = Module["_emscripten_run_in_main_runtime_thread_js"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null, arguments) + }; + var _emscripten_async_queue_on_thread_ = Module["_emscripten_async_queue_on_thread_"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null, arguments) + }; + var _emscripten_tls_init = Module["_emscripten_tls_init"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_tls_init"].apply(null, arguments) + }; + var ___set_stack_limit = Module["___set_stack_limit"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__set_stack_limit"].apply(null, arguments) + }; + var stackSave = Module["stackSave"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["stackSave"].apply(null, arguments) + }; + var stackAlloc = Module["stackAlloc"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["stackAlloc"].apply(null, arguments) + }; + var stackRestore = Module["stackRestore"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["stackRestore"].apply(null, arguments) + }; + var dynCall_vi = Module["dynCall_vi"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dynCall_vi"].apply(null, arguments) + }; + var dynCall_v = Module["dynCall_v"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dynCall_v"].apply(null, arguments) + }; + var dynCall_ii = Module["dynCall_ii"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dynCall_ii"].apply(null, arguments) + }; + Module["asm"] = asm; + if (!Object.getOwnPropertyDescriptor(Module, "intArrayFromString")) Module["intArrayFromString"] = function () { + abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "intArrayToString")) Module["intArrayToString"] = function () { + abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "ccall")) Module["ccall"] = function () { + abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + Module["cwrap"] = cwrap; + if (!Object.getOwnPropertyDescriptor(Module, "setValue")) Module["setValue"] = function () { + abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getValue")) Module["getValue"] = function () { + abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "allocate")) Module["allocate"] = function () { + abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getMemory")) Module["getMemory"] = function () { + abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF8ArrayToString")) Module["UTF8ArrayToString"] = function () { + abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF8ToString")) Module["UTF8ToString"] = function () { + abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8Array")) Module["stringToUTF8Array"] = function () { + abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8")) Module["stringToUTF8"] = function () { + abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF8")) Module["lengthBytesUTF8"] = function () { + abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function () { + abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnPreRun")) Module["addOnPreRun"] = function () { + abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnInit")) Module["addOnInit"] = function () { + abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnPreMain")) Module["addOnPreMain"] = function () { + abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnExit")) Module["addOnExit"] = function () { + abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnPostRun")) Module["addOnPostRun"] = function () { + abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeStringToMemory")) Module["writeStringToMemory"] = function () { + abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeArrayToMemory")) Module["writeArrayToMemory"] = function () { + abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeAsciiToMemory")) Module["writeAsciiToMemory"] = function () { + abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addRunDependency")) Module["addRunDependency"] = function () { + abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "removeRunDependency")) Module["removeRunDependency"] = function () { + abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createFolder")) Module["FS_createFolder"] = function () { + abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createPath")) Module["FS_createPath"] = function () { + abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createDataFile")) Module["FS_createDataFile"] = function () { + abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createPreloadedFile")) Module["FS_createPreloadedFile"] = function () { + abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createLazyFile")) Module["FS_createLazyFile"] = function () { + abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createLink")) Module["FS_createLink"] = function () { + abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createDevice")) Module["FS_createDevice"] = function () { + abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_unlink")) Module["FS_unlink"] = function () { + abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "dynamicAlloc")) Module["dynamicAlloc"] = function () { + abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "loadDynamicLibrary")) Module["loadDynamicLibrary"] = function () { + abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "loadWebAssemblyModule")) Module["loadWebAssemblyModule"] = function () { + abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getLEB")) Module["getLEB"] = function () { + abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getFunctionTables")) Module["getFunctionTables"] = function () { + abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "alignFunctionTables")) Module["alignFunctionTables"] = function () { + abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "registerFunctions")) Module["registerFunctions"] = function () { + abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addFunction")) Module["addFunction"] = function () { + abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "removeFunction")) Module["removeFunction"] = function () { + abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getFuncWrapper")) Module["getFuncWrapper"] = function () { + abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "prettyPrint")) Module["prettyPrint"] = function () { + abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "makeBigInt")) Module["makeBigInt"] = function () { + abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "dynCall")) Module["dynCall"] = function () { + abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getCompilerSetting")) Module["getCompilerSetting"] = function () { + abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "print")) Module["print"] = function () { + abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "printErr")) Module["printErr"] = function () { + abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getTempRet0")) Module["getTempRet0"] = function () { + abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "setTempRet0")) Module["setTempRet0"] = function () { + abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "callMain")) Module["callMain"] = function () { + abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "abort")) Module["abort"] = function () { + abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToNewUTF8")) Module["stringToNewUTF8"] = function () { + abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscripten_realloc_buffer")) Module["emscripten_realloc_buffer"] = function () { + abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "ENV")) Module["ENV"] = function () { + abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "setjmpId")) Module["setjmpId"] = function () { + abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_CODES")) Module["ERRNO_CODES"] = function () { + abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_MESSAGES")) Module["ERRNO_MESSAGES"] = function () { + abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "setErrNo")) Module["setErrNo"] = function () { + abort("'setErrNo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "DNS")) Module["DNS"] = function () { + abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GAI_ERRNO_MESSAGES")) Module["GAI_ERRNO_MESSAGES"] = function () { + abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "Protocols")) Module["Protocols"] = function () { + abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "Sockets")) Module["Sockets"] = function () { + abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UNWIND_CACHE")) Module["UNWIND_CACHE"] = function () { + abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "readAsmConstArgs")) Module["readAsmConstArgs"] = function () { + abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "jstoi_q")) Module["jstoi_q"] = function () { + abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "jstoi_s")) Module["jstoi_s"] = function () { + abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "PATH")) Module["PATH"] = function () { + abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "PATH_FS")) Module["PATH_FS"] = function () { + abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SYSCALLS")) Module["SYSCALLS"] = function () { + abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "syscallMmap2")) Module["syscallMmap2"] = function () { + abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "syscallMunmap")) Module["syscallMunmap"] = function () { + abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "flush_NO_FILESYSTEM")) Module["flush_NO_FILESYSTEM"] = function () { + abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "JSEvents")) Module["JSEvents"] = function () { + abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "demangle")) Module["demangle"] = function () { + abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "demangleAll")) Module["demangleAll"] = function () { + abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "jsStackTrace")) Module["jsStackTrace"] = function () { + abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function () { + abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getEnvStrings")) Module["getEnvStrings"] = function () { + abort("'getEnvStrings' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64")) Module["writeI53ToI64"] = function () { + abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Clamped")) Module["writeI53ToI64Clamped"] = function () { + abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Signaling")) Module["writeI53ToI64Signaling"] = function () { + abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Clamped")) Module["writeI53ToU64Clamped"] = function () { + abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Signaling")) Module["writeI53ToU64Signaling"] = function () { + abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "readI53FromI64")) Module["readI53FromI64"] = function () { + abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "readI53FromU64")) Module["readI53FromU64"] = function () { + abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "convertI32PairToI53")) Module["convertI32PairToI53"] = function () { + abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "convertU32PairToI53")) Module["convertU32PairToI53"] = function () { + abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "Browser")) Module["Browser"] = function () { + abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GL")) Module["GL"] = function () { + abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGet")) Module["emscriptenWebGLGet"] = function () { + abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetTexPixelData")) Module["emscriptenWebGLGetTexPixelData"] = function () { + abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetUniform")) Module["emscriptenWebGLGetUniform"] = function () { + abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetVertexAttrib")) Module["emscriptenWebGLGetVertexAttrib"] = function () { + abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "AL")) Module["AL"] = function () { + abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL_unicode")) Module["SDL_unicode"] = function () { + abort("'SDL_unicode' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL_ttfContext")) Module["SDL_ttfContext"] = function () { + abort("'SDL_ttfContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL_audio")) Module["SDL_audio"] = function () { + abort("'SDL_audio' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL")) Module["SDL"] = function () { + abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL_gfx")) Module["SDL_gfx"] = function () { + abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLUT")) Module["GLUT"] = function () { + abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "EGL")) Module["EGL"] = function () { + abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLFW_Window")) Module["GLFW_Window"] = function () { + abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLFW")) Module["GLFW"] = function () { + abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLEW")) Module["GLEW"] = function () { + abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "IDBStore")) Module["IDBStore"] = function () { + abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "runAndAbortIfError")) Module["runAndAbortIfError"] = function () { + abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + Module["PThread"] = PThread; + if (!Object.getOwnPropertyDescriptor(Module, "establishStackSpace")) Module["establishStackSpace"] = function () { + abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getNoExitRuntime")) Module["getNoExitRuntime"] = function () { + abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "resetPrototype")) Module["resetPrototype"] = function () { + abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "warnOnce")) Module["warnOnce"] = function () { + abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackSave")) Module["stackSave"] = function () { + abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackRestore")) Module["stackRestore"] = function () { + abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackAlloc")) Module["stackAlloc"] = function () { + abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "AsciiToString")) Module["AsciiToString"] = function () { + abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToAscii")) Module["stringToAscii"] = function () { + abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF16ToString")) Module["UTF16ToString"] = function () { + abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF16")) Module["stringToUTF16"] = function () { + abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF16")) Module["lengthBytesUTF16"] = function () { + abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF32ToString")) Module["UTF32ToString"] = function () { + abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF32")) Module["stringToUTF32"] = function () { + abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF32")) Module["lengthBytesUTF32"] = function () { + abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8")) Module["allocateUTF8"] = function () { + abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8OnStack")) Module["allocateUTF8OnStack"] = function () { + abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + Module["writeStackCookie"] = writeStackCookie; + Module["checkStackCookie"] = checkStackCookie; + Module["abortStackOverflow"] = abortStackOverflow; + Module["PThread"] = PThread; + Module["_pthread_self"] = _pthread_self; + Module["wasmMemory"] = wasmMemory; + Module["ExitStatus"] = ExitStatus; + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NORMAL")) Object.defineProperty(Module, "ALLOC_NORMAL", { + configurable: true, + get: function () { + abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_STACK")) Object.defineProperty(Module, "ALLOC_STACK", { + configurable: true, + get: function () { + abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_DYNAMIC")) Object.defineProperty(Module, "ALLOC_DYNAMIC", { + configurable: true, + get: function () { + abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NONE")) Object.defineProperty(Module, "ALLOC_NONE", { + configurable: true, + get: function () { + abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + } + }); + var calledRun; + Module["then"] = function (func) { + if (calledRun) { + func(Module) + } else { + var old = Module["onRuntimeInitialized"]; + Module["onRuntimeInitialized"] = function () { + if (old) old(); + func(Module) + } + } + return Module + }; + + function ExitStatus(status) { + this.name = "ExitStatus"; + this.message = "Program terminated with exit(" + status + ")"; + this.status = status + } + dependenciesFulfilled = function runCaller() { + if (!calledRun) run(); + if (!calledRun) dependenciesFulfilled = runCaller + }; + + function run(args) { + args = args || arguments_; + if (runDependencies > 0) { + return + } + writeStackCookie(); + preRun(); + if (runDependencies > 0) return; + + function doRun() { + if (calledRun) return; + calledRun = true; + Module["calledRun"] = true; + if (ABORT) return; + initRuntime(); + preMain(); + if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"](); + assert(!Module["_main"], 'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'); + postRun() + } + if (Module["setStatus"]) { + Module["setStatus"]("Running..."); + setTimeout(function () { + setTimeout(function () { + Module["setStatus"]("") + }, 1); + doRun() + }, 1) + } else { + doRun() + } + checkStackCookie() + } + Module["run"] = run; + if (Module["preInit"]) { + if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]]; + while (Module["preInit"].length > 0) { + Module["preInit"].pop()() + } + } + if (!ENVIRONMENT_IS_PTHREAD) noExitRuntime = true; + if (!ENVIRONMENT_IS_PTHREAD) run(); + + + return WasmBackendModule + } + ); +})(); +if (typeof exports === 'object' && typeof module === 'object') + module.exports = WasmBackendModule; +else if (typeof define === 'function' && define['amd']) + define([], function () { + return WasmBackendModule; + }); +else if (typeof exports === 'object') + exports["WasmBackendModule"] = WasmBackendModule; diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js b/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js index 7a5a7f0133d..255cb67140c 100644 --- a/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js +++ b/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js @@ -1,160 +1 @@ -var threadInfoStruct = 0; -var selfThreadId = 0; -var parentThreadId = 0; -var Module = {}; - -function assert(condition, text) { - if (!condition) abort("Assertion failed: " + text) -} - -function threadPrintErr() { - var text = Array.prototype.slice.call(arguments).join(" "); - console.error(text) -} - -function threadAlert() { - var text = Array.prototype.slice.call(arguments).join(" "); - postMessage({ - cmd: "alert", - text: text, - threadId: selfThreadId - }) -} -var out = function () { - throw "out() is not defined in worker.js." -}; -var err = threadPrintErr; -this.alert = threadAlert; -Module["instantiateWasm"] = function (info, receiveInstance) { - var instance = new WebAssembly.Instance(Module["wasmModule"], info); - Module["wasmModule"] = null; - receiveInstance(instance); - return instance.exports -}; -this.onmessage = function (e) { - try { - if (e.data.cmd === "load") { - console.log("LOADING YAY"); - console.log(e.data.urlOrBlob); - Module["DYNAMIC_BASE"] = e.data.DYNAMIC_BASE; - Module["DYNAMICTOP_PTR"] = e.data.DYNAMICTOP_PTR; - Module["wasmModule"] = e.data.wasmModule; - Module["wasmMemory"] = e.data.wasmMemory; - Module["buffer"] = Module["wasmMemory"].buffer; - Module["ENVIRONMENT_IS_PTHREAD"] = true; - console.log("ABOUT TO LOAD"); - if (typeof e.data.urlOrBlob === "string") { - console.log("IMPORT SCRIPTS?"); - importScripts(e.data.urlOrBlob) - console.log("done importing"); - } else { - var objectUrl = URL.createObjectURL(e.data.urlOrBlob); - importScripts(objectUrl); - URL.revokeObjectURL(objectUrl) - } - console.log("WORKER HAS INSTANTIATED"); - console.log(WasmBackendModule); - Module = WasmBackendModule(Module); - postMessage({ - "cmd": "loaded" - }) - } else if (e.data.cmd === "objectTransfer") { - Module["PThread"].receiveObjectTransfer(e.data) - } else if (e.data.cmd === "run") { - Module["__performance_now_clock_drift"] = performance.now() - e.data.time; - threadInfoStruct = e.data.threadInfoStruct; - Module["__register_pthread_ptr"](threadInfoStruct, 0, 0); - selfThreadId = e.data.selfThreadId; - parentThreadId = e.data.parentThreadId; - var max = e.data.stackBase; - var top = e.data.stackBase + e.data.stackSize; - assert(threadInfoStruct); - assert(selfThreadId); - assert(parentThreadId); - assert(top != 0); - assert(max != 0); - assert(top > max); - Module["establishStackSpace"](top, max); - Module["_emscripten_tls_init"](); - Module["writeStackCookie"](); - Module["PThread"].receiveObjectTransfer(e.data); - Module["PThread"].setThreadStatus(Module["_pthread_self"](), 1); - try { - var result = Module["dynCall_ii"](e.data.start_routine, e.data.arg); - Module["checkStackCookie"](); - if (!Module["getNoExitRuntime"]()) Module["PThread"].threadExit(result) - } catch (ex) { - if (ex === "Canceled!") { - Module["PThread"].threadCancel() - } else if (ex != "unwind") { - Atomics.store(Module["HEAPU32"], threadInfoStruct + 4 >> 2, ex instanceof Module["ExitStatus"] ? ex.status : -2); - Atomics.store(Module["HEAPU32"], threadInfoStruct + 0 >> 2, 1); - if (typeof Module["_emscripten_futex_wake"] !== "function") { - err("Thread Initialisation failed."); - throw ex - } - Module["_emscripten_futex_wake"](threadInfoStruct + 0, 2147483647); - if (!(ex instanceof Module["ExitStatus"])) throw ex - } else { - err("Pthread 0x" + threadInfoStruct.toString(16) + " completed its pthread main entry point with an unwind, keeping the pthread worker alive for asynchronous operation.") - } - } - } else if (e.data.cmd === "cancel") { - if (threadInfoStruct) { - Module["PThread"].threadCancel() - } - } else if (e.data.target === "setimmediate") {} else if (e.data.cmd === "processThreadQueue") { - if (threadInfoStruct) { - Module["_emscripten_current_thread_process_queued_calls"]() - } - } else { - err("worker.js received unknown command " + e.data.cmd); - err(e.data) - } - } catch (ex) { - err("worker.js onmessage() captured an uncaught exception: " + ex); - if (ex.stack) err(ex.stack); - throw ex - } -}; -if (typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string") { - self = { - location: { - href: __filename - } - }; - var onmessage = this.onmessage; - var nodeWorkerThreads = require("worker_threads"); - Worker = nodeWorkerThreads.Worker; - var parentPort = nodeWorkerThreads.parentPort; - parentPort.on("message", function (data) { - onmessage({ - data: data - }) - }); - var nodeFS = require("fs"); - var nodeRead = function (filename) { - return nodeFS.readFileSync(filename, "utf8") - }; - - function globalEval(x) { - global.require = require; - global.Module = Module; - eval.call(null, x) - } - importScripts = function (f) { - console.log('WORKER IMPORT SCRIPTS'); - console.log(f); - globalEval(nodeRead(f)) - }; - postMessage = function (msg) { - parentPort.postMessage(msg) - }; - if (typeof performance === "undefined") { - performance = { - now: function () { - return Date.now() - } - } - } -} +var threadInfoStruct=0;var selfThreadId=0;var parentThreadId=0;var Module={};function assert(condition,text){if(!condition)abort("Assertion failed: "+text)}function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:selfThreadId})}var out=function(){throw"out() is not defined in worker.js."};var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);Module["wasmModule"]=null;receiveInstance(instance);return instance.exports};this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["DYNAMIC_BASE"]=e.data.DYNAMIC_BASE;Module["DYNAMICTOP_PTR"]=e.data.DYNAMICTOP_PTR;Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}Module=WasmBackendModule(Module);postMessage({"cmd":"loaded"})}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;threadInfoStruct=e.data.threadInfoStruct;Module["__register_pthread_ptr"](threadInfoStruct,0,0);selfThreadId=e.data.selfThreadId;parentThreadId=e.data.parentThreadId;var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;assert(threadInfoStruct);assert(selfThreadId);assert(parentThreadId);assert(top!=0);assert(max!=0);assert(top>max);Module["establishStackSpace"](top,max);Module["_emscripten_tls_init"]();Module["writeStackCookie"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].setThreadStatus(Module["_pthread_self"](),1);try{var result=Module["dynCall_ii"](e.data.start_routine,e.data.arg);Module["checkStackCookie"]();if(!Module["getNoExitRuntime"]())Module["PThread"].threadExit(result)}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){Atomics.store(Module["HEAPU32"],threadInfoStruct+4>>2,ex instanceof Module["ExitStatus"]?ex.status:-2);Atomics.store(Module["HEAPU32"],threadInfoStruct+0>>2,1);if(typeof Module["_emscripten_futex_wake"]!=="function"){err("Thread Initialisation failed.");throw ex}Module["_emscripten_futex_wake"](threadInfoStruct+0,2147483647);if(!(ex instanceof Module["ExitStatus"]))throw ex}else{err("Pthread 0x"+threadInfoStruct.toString(16)+" completed its pthread main entry point with an unwind, keeping the pthread worker alive for asynchronous operation.")}}}else if(e.data.cmd==="cancel"){if(threadInfoStruct){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(threadInfoStruct){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} From 17f246788d234ca1331e1c0d59e33a8ee24c5d68 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Wed, 29 Apr 2020 16:01:06 -0400 Subject: [PATCH 55/85] add beautified worker --- .../benchmarks/tfjs-backend-wasm.worker.js | 152 +++++++++++++++++- 1 file changed, 151 insertions(+), 1 deletion(-) diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js b/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js index 255cb67140c..427a38493f0 100644 --- a/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js +++ b/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js @@ -1 +1,151 @@ -var threadInfoStruct=0;var selfThreadId=0;var parentThreadId=0;var Module={};function assert(condition,text){if(!condition)abort("Assertion failed: "+text)}function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:selfThreadId})}var out=function(){throw"out() is not defined in worker.js."};var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);Module["wasmModule"]=null;receiveInstance(instance);return instance.exports};this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["DYNAMIC_BASE"]=e.data.DYNAMIC_BASE;Module["DYNAMICTOP_PTR"]=e.data.DYNAMICTOP_PTR;Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}Module=WasmBackendModule(Module);postMessage({"cmd":"loaded"})}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;threadInfoStruct=e.data.threadInfoStruct;Module["__register_pthread_ptr"](threadInfoStruct,0,0);selfThreadId=e.data.selfThreadId;parentThreadId=e.data.parentThreadId;var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;assert(threadInfoStruct);assert(selfThreadId);assert(parentThreadId);assert(top!=0);assert(max!=0);assert(top>max);Module["establishStackSpace"](top,max);Module["_emscripten_tls_init"]();Module["writeStackCookie"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].setThreadStatus(Module["_pthread_self"](),1);try{var result=Module["dynCall_ii"](e.data.start_routine,e.data.arg);Module["checkStackCookie"]();if(!Module["getNoExitRuntime"]())Module["PThread"].threadExit(result)}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){Atomics.store(Module["HEAPU32"],threadInfoStruct+4>>2,ex instanceof Module["ExitStatus"]?ex.status:-2);Atomics.store(Module["HEAPU32"],threadInfoStruct+0>>2,1);if(typeof Module["_emscripten_futex_wake"]!=="function"){err("Thread Initialisation failed.");throw ex}Module["_emscripten_futex_wake"](threadInfoStruct+0,2147483647);if(!(ex instanceof Module["ExitStatus"]))throw ex}else{err("Pthread 0x"+threadInfoStruct.toString(16)+" completed its pthread main entry point with an unwind, keeping the pthread worker alive for asynchronous operation.")}}}else if(e.data.cmd==="cancel"){if(threadInfoStruct){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(threadInfoStruct){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} +var threadInfoStruct = 0; +var selfThreadId = 0; +var parentThreadId = 0; +var Module = {}; + +function assert(condition, text) { + if (!condition) abort("Assertion failed: " + text) +} + +function threadPrintErr() { + var text = Array.prototype.slice.call(arguments).join(" "); + console.error(text) +} + +function threadAlert() { + var text = Array.prototype.slice.call(arguments).join(" "); + postMessage({ + cmd: "alert", + text: text, + threadId: selfThreadId + }) +} +var out = function () { + throw "out() is not defined in worker.js." +}; +var err = threadPrintErr; +this.alert = threadAlert; +Module["instantiateWasm"] = function (info, receiveInstance) { + var instance = new WebAssembly.Instance(Module["wasmModule"], info); + Module["wasmModule"] = null; + receiveInstance(instance); + return instance.exports +}; +this.onmessage = function (e) { + try { + if (e.data.cmd === "load") { + Module["DYNAMIC_BASE"] = e.data.DYNAMIC_BASE; + Module["DYNAMICTOP_PTR"] = e.data.DYNAMICTOP_PTR; + Module["wasmModule"] = e.data.wasmModule; + Module["wasmMemory"] = e.data.wasmMemory; + Module["buffer"] = Module["wasmMemory"].buffer; + Module["ENVIRONMENT_IS_PTHREAD"] = true; + if (typeof e.data.urlOrBlob === "string") { + importScripts(e.data.urlOrBlob) + } else { + var objectUrl = URL.createObjectURL(e.data.urlOrBlob); + importScripts(objectUrl); + URL.revokeObjectURL(objectUrl) + } + Module = WasmBackendModule(Module); + postMessage({ + "cmd": "loaded" + }) + } else if (e.data.cmd === "objectTransfer") { + Module["PThread"].receiveObjectTransfer(e.data) + } else if (e.data.cmd === "run") { + Module["__performance_now_clock_drift"] = performance.now() - e.data.time; + threadInfoStruct = e.data.threadInfoStruct; + Module["__register_pthread_ptr"](threadInfoStruct, 0, 0); + selfThreadId = e.data.selfThreadId; + parentThreadId = e.data.parentThreadId; + var max = e.data.stackBase; + var top = e.data.stackBase + e.data.stackSize; + assert(threadInfoStruct); + assert(selfThreadId); + assert(parentThreadId); + assert(top != 0); + assert(max != 0); + assert(top > max); + Module["establishStackSpace"](top, max); + Module["_emscripten_tls_init"](); + Module["writeStackCookie"](); + Module["PThread"].receiveObjectTransfer(e.data); + Module["PThread"].setThreadStatus(Module["_pthread_self"](), 1); + try { + var result = Module["dynCall_ii"](e.data.start_routine, e.data.arg); + Module["checkStackCookie"](); + if (!Module["getNoExitRuntime"]()) Module["PThread"].threadExit(result) + } catch (ex) { + if (ex === "Canceled!") { + Module["PThread"].threadCancel() + } else if (ex != "unwind") { + Atomics.store(Module["HEAPU32"], threadInfoStruct + 4 >> 2, ex instanceof Module["ExitStatus"] ? ex.status : -2); + Atomics.store(Module["HEAPU32"], threadInfoStruct + 0 >> 2, 1); + if (typeof Module["_emscripten_futex_wake"] !== "function") { + err("Thread Initialisation failed."); + throw ex + } + Module["_emscripten_futex_wake"](threadInfoStruct + 0, 2147483647); + if (!(ex instanceof Module["ExitStatus"])) throw ex + } else { + err("Pthread 0x" + threadInfoStruct.toString(16) + " completed its pthread main entry point with an unwind, keeping the pthread worker alive for asynchronous operation.") + } + } + } else if (e.data.cmd === "cancel") { + if (threadInfoStruct) { + Module["PThread"].threadCancel() + } + } else if (e.data.target === "setimmediate") {} else if (e.data.cmd === "processThreadQueue") { + if (threadInfoStruct) { + Module["_emscripten_current_thread_process_queued_calls"]() + } + } else { + err("worker.js received unknown command " + e.data.cmd); + err(e.data) + } + } catch (ex) { + err("worker.js onmessage() captured an uncaught exception: " + ex); + if (ex.stack) err(ex.stack); + throw ex + } +}; +if (typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string") { + self = { + location: { + href: __filename + } + }; + var onmessage = this.onmessage; + var nodeWorkerThreads = require("worker_threads"); + Worker = nodeWorkerThreads.Worker; + var parentPort = nodeWorkerThreads.parentPort; + parentPort.on("message", function (data) { + onmessage({ + data: data + }) + }); + var nodeFS = require("fs"); + var nodeRead = function (filename) { + return nodeFS.readFileSync(filename, "utf8") + }; + + function globalEval(x) { + global.require = require; + global.Module = Module; + eval.call(null, x) + } + importScripts = function (f) { + globalEval(nodeRead(f)) + }; + postMessage = function (msg) { + parentPort.postMessage(msg) + }; + if (typeof performance === "undefined") { + performance = { + now: function () { + return Date.now() + } + } + } +} From 93c93ec812393737abbc17fb4fd77e6358894ba3 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Wed, 29 Apr 2020 16:17:10 -0400 Subject: [PATCH 56/85] add standalone script --- tfjs-backend-wasm/package.json | 3 +- tfjs-backend-wasm/scripts/test-standalone.sh | 9 + tfjs-core/benchmarks/tfjs-backend-wasm.js | 3281 +---------------- .../benchmarks/tfjs-backend-wasm.worker.js | 152 +- 4 files changed, 26 insertions(+), 3419 deletions(-) create mode 100755 tfjs-backend-wasm/scripts/test-standalone.sh diff --git a/tfjs-backend-wasm/package.json b/tfjs-backend-wasm/package.json index bc7710f0508..492819b70b8 100644 --- a/tfjs-backend-wasm/package.json +++ b/tfjs-backend-wasm/package.json @@ -26,7 +26,8 @@ "test-node": "ts-node -P tsconfig.test.json src/test_node.ts", "test-bundle-size": "./scripts/test-bundle-size.js", "test-cc": "bazel test //src/cc:cc_tests --test_output=all", - "test-browser-ci": "karma start --singleRun --browsers=bs_chrome_mac" + "test-browser-ci": "karma start --singleRun --browsers=bs_chrome_mac", + "test-standalone": "./scripts/test-standalone.sh" }, "browser": { "fs": false, diff --git a/tfjs-backend-wasm/scripts/test-standalone.sh b/tfjs-backend-wasm/scripts/test-standalone.sh new file mode 100755 index 00000000000..9c35af53d2d --- /dev/null +++ b/tfjs-backend-wasm/scripts/test-standalone.sh @@ -0,0 +1,9 @@ +# build, then copy to benchmarks + +yarn build # this creates wasm-out directory +rollup -c # this creates tf-backend-wasm.js + +cp dist/tf-backend-wasm.js ../tfjs-core/benchmarks/ +cp wasm-out/tfjs-backend-wasm.js ../tfjs-core/benchmarks/ +cp wasm-out/tfjs-backend-wasm.worker.js ../tfjs-core/benchmarks/ +cp wasm-out/tfjs-backend-wasm.wasm ../tfjs-core/benchmarks/ diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.js b/tfjs-core/benchmarks/tfjs-backend-wasm.js index 580fd3a6003..cff3b484656 100755 --- a/tfjs-core/benchmarks/tfjs-backend-wasm.js +++ b/tfjs-core/benchmarks/tfjs-backend-wasm.js @@ -1,3275 +1,22 @@ -var WasmBackendModule = (function () { + +var WasmBackendModule = (function() { var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; return ( - function (WasmBackendModule) { - WasmBackendModule = WasmBackendModule || {}; - - function GROWABLE_HEAP_I8() { - if (wasmMemory.buffer != buffer) { - updateGlobalBufferAndViews(wasmMemory.buffer) - } - return HEAP8 - } - - function GROWABLE_HEAP_U8() { - if (wasmMemory.buffer != buffer) { - updateGlobalBufferAndViews(wasmMemory.buffer) - } - return HEAPU8 - } - - function GROWABLE_HEAP_I32() { - if (wasmMemory.buffer != buffer) { - updateGlobalBufferAndViews(wasmMemory.buffer) - } - return HEAP32 - } - - function GROWABLE_HEAP_U32() { - if (wasmMemory.buffer != buffer) { - updateGlobalBufferAndViews(wasmMemory.buffer) - } - return HEAPU32 - } - - function GROWABLE_HEAP_F64() { - if (wasmMemory.buffer != buffer) { - updateGlobalBufferAndViews(wasmMemory.buffer) - } - return HEAPF64 - } - var Module = typeof WasmBackendModule !== "undefined" ? WasmBackendModule : {}; - var moduleOverrides = {}; - var key; - for (key in Module) { - if (Module.hasOwnProperty(key)) { - moduleOverrides[key] = Module[key] - } - } - var arguments_ = []; - var thisProgram = "./this.program"; - var quit_ = function (status, toThrow) { - throw toThrow - }; - var ENVIRONMENT_IS_WEB = false; - var ENVIRONMENT_IS_WORKER = false; - var ENVIRONMENT_IS_NODE = false; - var ENVIRONMENT_IS_SHELL = false; - ENVIRONMENT_IS_WEB = typeof window === "object"; - ENVIRONMENT_IS_WORKER = typeof importScripts === "function"; - ENVIRONMENT_IS_NODE = typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string"; - ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER; - if (Module["ENVIRONMENT"]) { - throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)") - } - var ENVIRONMENT_IS_PTHREAD = Module["ENVIRONMENT_IS_PTHREAD"] || false; - if (ENVIRONMENT_IS_PTHREAD) { - buffer = Module["buffer"]; - DYNAMIC_BASE = Module["DYNAMIC_BASE"]; - DYNAMICTOP_PTR = Module["DYNAMICTOP_PTR"] - } - var scriptDirectory = ""; - - function locateFile(path) { - if (Module["locateFile"]) { - return Module["locateFile"](path, scriptDirectory) - } - return scriptDirectory + path - } - var read_, readAsync, readBinary, setWindowTitle; - var nodeFS; - var nodePath; - if (ENVIRONMENT_IS_NODE) { - if (ENVIRONMENT_IS_WORKER) { - scriptDirectory = require("path").dirname(scriptDirectory) + "/" - } else { - scriptDirectory = __dirname + "/" - } - read_ = function shell_read(filename, binary) { - if (!nodeFS) nodeFS = require("fs"); - if (!nodePath) nodePath = require("path"); - filename = nodePath["normalize"](filename); - return nodeFS["readFileSync"](filename, binary ? null : "utf8") - }; - readBinary = function readBinary(filename) { - var ret = read_(filename, true); - if (!ret.buffer) { - ret = new Uint8Array(ret) - } - assert(ret.buffer); - return ret - }; - if (process["argv"].length > 1) { - thisProgram = process["argv"][1].replace(/\\/g, "/") - } - arguments_ = process["argv"].slice(2); - process["on"]("uncaughtException", function (ex) { - if (!(ex instanceof ExitStatus)) { - throw ex - } - }); - process["on"]("unhandledRejection", abort); - quit_ = function (status) { - process["exit"](status) - }; - Module["inspect"] = function () { - return "[Emscripten Module object]" - }; - var nodeWorkerThreads; - try { - nodeWorkerThreads = require("worker_threads") - } catch (e) { - console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'); - throw e - } - Worker = nodeWorkerThreads.Worker - } else if (ENVIRONMENT_IS_SHELL) { - if (typeof read != "undefined") { - read_ = function shell_read(f) { - return read(f) - } - } - readBinary = function readBinary(f) { - var data; - if (typeof readbuffer === "function") { - return new Uint8Array(readbuffer(f)) - } - data = read(f, "binary"); - assert(typeof data === "object"); - return data - }; - if (typeof scriptArgs != "undefined") { - arguments_ = scriptArgs - } else if (typeof arguments != "undefined") { - arguments_ = arguments - } - if (typeof quit === "function") { - quit_ = function (status) { - quit(status) - } - } - if (typeof print !== "undefined") { - if (typeof console === "undefined") console = {}; - console.log = print; - console.warn = console.error = typeof printErr !== "undefined" ? printErr : print - } - } else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { - if (ENVIRONMENT_IS_WORKER) { - scriptDirectory = self.location.href - } else if (document.currentScript) { - scriptDirectory = document.currentScript.src - } - if (_scriptDir) { - scriptDirectory = _scriptDir - } - if (scriptDirectory.indexOf("blob:") !== 0) { - scriptDirectory = scriptDirectory.substr(0, scriptDirectory.lastIndexOf("/") + 1) - } else { - scriptDirectory = "" - } - if (ENVIRONMENT_IS_NODE) { - read_ = function shell_read(filename, binary) { - if (!nodeFS) nodeFS = require("fs"); - if (!nodePath) nodePath = require("path"); - filename = nodePath["normalize"](filename); - return nodeFS["readFileSync"](filename, binary ? null : "utf8") - }; - readBinary = function readBinary(filename) { - var ret = read_(filename, true); - if (!ret.buffer) { - ret = new Uint8Array(ret) - } - assert(ret.buffer); - return ret - } - } else { - read_ = function shell_read(url) { - var xhr = new XMLHttpRequest; - xhr.open("GET", url, false); - xhr.send(null); - return xhr.responseText - }; - if (ENVIRONMENT_IS_WORKER) { - readBinary = function readBinary(url) { - var xhr = new XMLHttpRequest; - xhr.open("GET", url, false); - xhr.responseType = "arraybuffer"; - xhr.send(null); - return new Uint8Array(xhr.response) - } - } - readAsync = function readAsync(url, onload, onerror) { - var xhr = new XMLHttpRequest; - xhr.open("GET", url, true); - xhr.responseType = "arraybuffer"; - xhr.onload = function xhr_onload() { - if (xhr.status == 200 || xhr.status == 0 && xhr.response) { - onload(xhr.response); - return - } - onerror() - }; - xhr.onerror = onerror; - xhr.send(null) - } - } - setWindowTitle = function (title) { - document.title = title - } - } else { - throw new Error("environment detection error") - } - if (ENVIRONMENT_IS_NODE) { - if (typeof performance === "undefined") { - performance = require("perf_hooks").performance - } - } - var out = Module["print"] || console.log.bind(console); - var err = Module["printErr"] || console.warn.bind(console); - for (key in moduleOverrides) { - if (moduleOverrides.hasOwnProperty(key)) { - Module[key] = moduleOverrides[key] - } - } - moduleOverrides = null; - if (Module["arguments"]) arguments_ = Module["arguments"]; - if (!Object.getOwnPropertyDescriptor(Module, "arguments")) Object.defineProperty(Module, "arguments", { - configurable: true, - get: function () { - abort("Module.arguments has been replaced with plain arguments_") - } - }); - if (Module["thisProgram"]) thisProgram = Module["thisProgram"]; - if (!Object.getOwnPropertyDescriptor(Module, "thisProgram")) Object.defineProperty(Module, "thisProgram", { - configurable: true, - get: function () { - abort("Module.thisProgram has been replaced with plain thisProgram") - } - }); - if (Module["quit"]) quit_ = Module["quit"]; - if (!Object.getOwnPropertyDescriptor(Module, "quit")) Object.defineProperty(Module, "quit", { - configurable: true, - get: function () { - abort("Module.quit has been replaced with plain quit_") - } - }); - assert(typeof Module["memoryInitializerPrefixURL"] === "undefined", "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"); - assert(typeof Module["pthreadMainPrefixURL"] === "undefined", "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"); - assert(typeof Module["cdInitializerPrefixURL"] === "undefined", "Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"); - assert(typeof Module["filePackagePrefixURL"] === "undefined", "Module.filePackagePrefixURL option was removed, use Module.locateFile instead"); - assert(typeof Module["read"] === "undefined", "Module.read option was removed (modify read_ in JS)"); - assert(typeof Module["readAsync"] === "undefined", "Module.readAsync option was removed (modify readAsync in JS)"); - assert(typeof Module["readBinary"] === "undefined", "Module.readBinary option was removed (modify readBinary in JS)"); - assert(typeof Module["setWindowTitle"] === "undefined", "Module.setWindowTitle option was removed (modify setWindowTitle in JS)"); - assert(typeof Module["TOTAL_MEMORY"] === "undefined", "Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"); - if (!Object.getOwnPropertyDescriptor(Module, "read")) Object.defineProperty(Module, "read", { - configurable: true, - get: function () { - abort("Module.read has been replaced with plain read_") - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "readAsync")) Object.defineProperty(Module, "readAsync", { - configurable: true, - get: function () { - abort("Module.readAsync has been replaced with plain readAsync") - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "readBinary")) Object.defineProperty(Module, "readBinary", { - configurable: true, - get: function () { - abort("Module.readBinary has been replaced with plain readBinary") - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "setWindowTitle")) Object.defineProperty(Module, "setWindowTitle", { - configurable: true, - get: function () { - abort("Module.setWindowTitle has been replaced with plain setWindowTitle") - } - }); - assert(ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER || ENVIRONMENT_IS_NODE, "Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)"); - var stackSave; - var stackRestore; - var stackAlloc; - stackSave = stackRestore = stackAlloc = function () { - abort("cannot use the stack before compiled code is ready to run, and has provided stack access") - }; - - function warnOnce(text) { - if (!warnOnce.shown) warnOnce.shown = {}; - if (!warnOnce.shown[text]) { - warnOnce.shown[text] = 1; - err(text) - } - } - var Atomics_load = Atomics.load; - var Atomics_store = Atomics.store; - var Atomics_compareExchange = Atomics.compareExchange; - var wasmBinary; - if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"]; - if (!Object.getOwnPropertyDescriptor(Module, "wasmBinary")) Object.defineProperty(Module, "wasmBinary", { - configurable: true, - get: function () { - abort("Module.wasmBinary has been replaced with plain wasmBinary") - } - }); - var noExitRuntime; - if (Module["noExitRuntime"]) noExitRuntime = Module["noExitRuntime"]; - if (!Object.getOwnPropertyDescriptor(Module, "noExitRuntime")) Object.defineProperty(Module, "noExitRuntime", { - configurable: true, - get: function () { - abort("Module.noExitRuntime has been replaced with plain noExitRuntime") - } - }); - if (typeof WebAssembly !== "object") { - abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.") - } - var wasmMemory; - var wasmTable = new WebAssembly.Table({ - "initial": 118, - "maximum": 118 + 0, - "element": "anyfunc" - }); - var wasmModule; - var threadInfoStruct = 0; - var selfThreadId = 0; - var ABORT = false; - var EXITSTATUS = 0; - - function assert(condition, text) { - if (!condition) { - abort("Assertion failed: " + text) - } - } - - function getCFunc(ident) { - var func = Module["_" + ident]; - assert(func, "Cannot call unknown function " + ident + ", make sure it is exported"); - return func - } - - function ccall(ident, returnType, argTypes, args, opts) { - var toC = { - "string": function (str) { - var ret = 0; - if (str !== null && str !== undefined && str !== 0) { - var len = (str.length << 2) + 1; - ret = stackAlloc(len); - stringToUTF8(str, ret, len) - } - return ret - }, - "array": function (arr) { - var ret = stackAlloc(arr.length); - writeArrayToMemory(arr, ret); - return ret - } - }; - - function convertReturnValue(ret) { - if (returnType === "string") return UTF8ToString(ret); - if (returnType === "boolean") return Boolean(ret); - return ret - } - var func = getCFunc(ident); - var cArgs = []; - var stack = 0; - assert(returnType !== "array", 'Return type should not be "array".'); - if (args) { - for (var i = 0; i < args.length; i++) { - var converter = toC[argTypes[i]]; - if (converter) { - if (stack === 0) stack = stackSave(); - cArgs[i] = converter(args[i]) - } else { - cArgs[i] = args[i] - } - } - } - var ret = func.apply(null, cArgs); - ret = convertReturnValue(ret); - if (stack !== 0) stackRestore(stack); - return ret - } - - function cwrap(ident, returnType, argTypes, opts) { - return function () { - return ccall(ident, returnType, argTypes, arguments, opts) - } - } - - function UTF8ArrayToString(heap, idx, maxBytesToRead) { - var endIdx = idx + maxBytesToRead; - var str = ""; - while (!(idx >= endIdx)) { - var u0 = heap[idx++]; - if (!u0) return str; - if (!(u0 & 128)) { - str += String.fromCharCode(u0); - continue - } - var u1 = heap[idx++] & 63; - if ((u0 & 224) == 192) { - str += String.fromCharCode((u0 & 31) << 6 | u1); - continue - } - var u2 = heap[idx++] & 63; - if ((u0 & 240) == 224) { - u0 = (u0 & 15) << 12 | u1 << 6 | u2 - } else { - if ((u0 & 248) != 240) warnOnce("Invalid UTF-8 leading byte 0x" + u0.toString(16) + " encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!"); - u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heap[idx++] & 63 - } - if (u0 < 65536) { - str += String.fromCharCode(u0) - } else { - var ch = u0 - 65536; - str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023) - } - } - return str - } - - function UTF8ToString(ptr, maxBytesToRead) { - return ptr ? UTF8ArrayToString(GROWABLE_HEAP_U8(), ptr, maxBytesToRead) : "" - } - - function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { - if (!(maxBytesToWrite > 0)) return 0; - var startIdx = outIdx; - var endIdx = outIdx + maxBytesToWrite - 1; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) { - var u1 = str.charCodeAt(++i); - u = 65536 + ((u & 1023) << 10) | u1 & 1023 - } - if (u <= 127) { - if (outIdx >= endIdx) break; - heap[outIdx++] = u - } else if (u <= 2047) { - if (outIdx + 1 >= endIdx) break; - heap[outIdx++] = 192 | u >> 6; - heap[outIdx++] = 128 | u & 63 - } else if (u <= 65535) { - if (outIdx + 2 >= endIdx) break; - heap[outIdx++] = 224 | u >> 12; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63 - } else { - if (outIdx + 3 >= endIdx) break; - if (u >= 2097152) warnOnce("Invalid Unicode code point 0x" + u.toString(16) + " encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF)."); - heap[outIdx++] = 240 | u >> 18; - heap[outIdx++] = 128 | u >> 12 & 63; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63 - } - } - heap[outIdx] = 0; - return outIdx - startIdx - } - - function stringToUTF8(str, outPtr, maxBytesToWrite) { - assert(typeof maxBytesToWrite == "number", "stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"); - return stringToUTF8Array(str, GROWABLE_HEAP_U8(), outPtr, maxBytesToWrite) - } - - function lengthBytesUTF8(str) { - var len = 0; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; - if (u <= 127) ++len; - else if (u <= 2047) len += 2; - else if (u <= 65535) len += 3; - else len += 4 - } - return len - } - - function writeArrayToMemory(array, buffer) { - assert(array.length >= 0, "writeArrayToMemory array must have a length (should be an array or typed array)"); - GROWABLE_HEAP_I8().set(array, buffer) - } - var WASM_PAGE_SIZE = 65536; - - function alignUp(x, multiple) { - if (x % multiple > 0) { - x += multiple - x % multiple - } - return x - } - var buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; - - function updateGlobalBufferAndViews(buf) { - buffer = buf; - Module["HEAP8"] = HEAP8 = new Int8Array(buf); - Module["HEAP16"] = HEAP16 = new Int16Array(buf); - Module["HEAP32"] = HEAP32 = new Int32Array(buf); - Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); - Module["HEAPU16"] = HEAPU16 = new Uint16Array(buf); - Module["HEAPU32"] = HEAPU32 = new Uint32Array(buf); - Module["HEAPF32"] = HEAPF32 = new Float32Array(buf); - Module["HEAPF64"] = HEAPF64 = new Float64Array(buf) - } - var STACK_BASE = 5255808, - STACKTOP = STACK_BASE, - STACK_MAX = 12928, - DYNAMIC_BASE = 5255808, - DYNAMICTOP_PTR = 12e3; - assert(STACK_BASE % 16 === 0, "stack must start aligned"); - assert(DYNAMIC_BASE % 16 === 0, "heap must start aligned"); - if (ENVIRONMENT_IS_PTHREAD) { - STACK_MAX = STACKTOP = STACK_MAX = 2147483647 - } - var TOTAL_STACK = 5242880; - if (Module["TOTAL_STACK"]) assert(TOTAL_STACK === Module["TOTAL_STACK"], "the stack size can no longer be determined at runtime"); - var INITIAL_INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 16777216; - if (!Object.getOwnPropertyDescriptor(Module, "INITIAL_MEMORY")) Object.defineProperty(Module, "INITIAL_MEMORY", { - configurable: true, - get: function () { - abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY") - } - }); - assert(INITIAL_INITIAL_MEMORY >= TOTAL_STACK, "INITIAL_MEMORY should be larger than TOTAL_STACK, was " + INITIAL_INITIAL_MEMORY + "! (TOTAL_STACK=" + TOTAL_STACK + ")"); - assert(typeof Int32Array !== "undefined" && typeof Float64Array !== "undefined" && Int32Array.prototype.subarray !== undefined && Int32Array.prototype.set !== undefined, "JS engine does not provide full typed array support"); - if (ENVIRONMENT_IS_PTHREAD) { - wasmMemory = Module["wasmMemory"]; - buffer = Module["buffer"] - } else { - if (Module["wasmMemory"]) { - wasmMemory = Module["wasmMemory"] - } else { - wasmMemory = new WebAssembly.Memory({ - "initial": INITIAL_INITIAL_MEMORY / WASM_PAGE_SIZE, - "maximum": 1073741824 / WASM_PAGE_SIZE, - "shared": true - }); - if (!(wasmMemory.buffer instanceof SharedArrayBuffer)) { - err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"); - if (ENVIRONMENT_IS_NODE) { - console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)") - } - throw Error("bad memory") - } - } - } - if (wasmMemory) { - buffer = wasmMemory.buffer - } - INITIAL_INITIAL_MEMORY = buffer.byteLength; - assert(INITIAL_INITIAL_MEMORY % WASM_PAGE_SIZE === 0); - assert(65536 % WASM_PAGE_SIZE === 0); - updateGlobalBufferAndViews(buffer); - if (!ENVIRONMENT_IS_PTHREAD) { - GROWABLE_HEAP_I32()[DYNAMICTOP_PTR >> 2] = DYNAMIC_BASE - } - - function writeStackCookie() { - assert((STACK_MAX & 3) == 0); - GROWABLE_HEAP_U32()[(STACK_MAX >> 2) + 1] = 34821223; - GROWABLE_HEAP_U32()[(STACK_MAX >> 2) + 2] = 2310721022; - GROWABLE_HEAP_I32()[0] = 1668509029 - } - - function checkStackCookie() { - var cookie1 = GROWABLE_HEAP_U32()[(STACK_MAX >> 2) + 1]; - var cookie2 = GROWABLE_HEAP_U32()[(STACK_MAX >> 2) + 2]; - if (cookie1 != 34821223 || cookie2 != 2310721022) { - abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x" + cookie2.toString(16) + " " + cookie1.toString(16)) - } - if (GROWABLE_HEAP_I32()[0] !== 1668509029) abort("Runtime error: The application has corrupted its heap memory area (address zero)!") - } - - function abortStackOverflow(allocSize) { - abort("Stack overflow! Attempted to allocate " + allocSize + " bytes on the stack, but stack has only " + (STACK_MAX - stackSave() + allocSize) + " bytes available!") - }(function () { - var h16 = new Int16Array(1); - var h8 = new Int8Array(h16.buffer); - h16[0] = 25459; - if (h8[0] !== 115 || h8[1] !== 99) throw "Runtime error: expected the system to be little-endian!" - })(); - - function callRuntimeCallbacks(callbacks) { - while (callbacks.length > 0) { - var callback = callbacks.shift(); - if (typeof callback == "function") { - callback(Module); - continue - } - var func = callback.func; - if (typeof func === "number") { - if (callback.arg === undefined) { - Module["dynCall_v"](func) - } else { - Module["dynCall_vi"](func, callback.arg) - } - } else { - func(callback.arg === undefined ? null : callback.arg) - } - } - } - var __ATPRERUN__ = []; - var __ATINIT__ = []; - var __ATMAIN__ = []; - var __ATEXIT__ = []; - var __ATPOSTRUN__ = []; - var runtimeInitialized = false; - var runtimeExited = false; - if (ENVIRONMENT_IS_PTHREAD) runtimeInitialized = true; - - function preRun() { - if (ENVIRONMENT_IS_PTHREAD) return; - if (Module["preRun"]) { - if (typeof Module["preRun"] == "function") Module["preRun"] = [Module["preRun"]]; - while (Module["preRun"].length) { - addOnPreRun(Module["preRun"].shift()) - } - } - callRuntimeCallbacks(__ATPRERUN__) - } - - function initRuntime() { - checkStackCookie(); - assert(!runtimeInitialized); - runtimeInitialized = true; - callRuntimeCallbacks(__ATINIT__) - } - - function preMain() { - checkStackCookie(); - if (ENVIRONMENT_IS_PTHREAD) return; - callRuntimeCallbacks(__ATMAIN__) - } - - function postRun() { - checkStackCookie(); - if (ENVIRONMENT_IS_PTHREAD) return; - if (Module["postRun"]) { - if (typeof Module["postRun"] == "function") Module["postRun"] = [Module["postRun"]]; - while (Module["postRun"].length) { - addOnPostRun(Module["postRun"].shift()) - } - } - callRuntimeCallbacks(__ATPOSTRUN__) - } - - function addOnPreRun(cb) { - __ATPRERUN__.unshift(cb) - } - - function addOnPostRun(cb) { - __ATPOSTRUN__.unshift(cb) - } - assert(Math.imul, "This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); - assert(Math.fround, "This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); - assert(Math.clz32, "This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); - assert(Math.trunc, "This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); - var Math_ceil = Math.ceil; - var Math_floor = Math.floor; - var runDependencies = 0; - var runDependencyWatcher = null; - var dependenciesFulfilled = null; - var runDependencyTracking = {}; - - function addRunDependency(id) { - assert(!ENVIRONMENT_IS_PTHREAD, "addRunDependency cannot be used in a pthread worker"); - runDependencies++; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies) - } - if (id) { - assert(!runDependencyTracking[id]); - runDependencyTracking[id] = 1; - if (runDependencyWatcher === null && typeof setInterval !== "undefined") { - runDependencyWatcher = setInterval(function () { - if (ABORT) { - clearInterval(runDependencyWatcher); - runDependencyWatcher = null; - return - } - var shown = false; - for (var dep in runDependencyTracking) { - if (!shown) { - shown = true; - err("still waiting on run dependencies:") - } - err("dependency: " + dep) - } - if (shown) { - err("(end of list)") - } - }, 1e4) - } - } else { - err("warning: run dependency added without ID") - } - } - - function removeRunDependency(id) { - runDependencies--; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies) - } - if (id) { - assert(runDependencyTracking[id]); - delete runDependencyTracking[id] - } else { - err("warning: run dependency removed without ID") - } - if (runDependencies == 0) { - if (runDependencyWatcher !== null) { - clearInterval(runDependencyWatcher); - runDependencyWatcher = null - } - if (dependenciesFulfilled) { - var callback = dependenciesFulfilled; - dependenciesFulfilled = null; - callback() - } - } - } - Module["preloadedImages"] = {}; - Module["preloadedAudios"] = {}; - - function abort(what) { - if (Module["onAbort"]) { - Module["onAbort"](what) - } - if (ENVIRONMENT_IS_PTHREAD) console.error("Pthread aborting at " + (new Error).stack); - what += ""; - out(what); - err(what); - ABORT = true; - EXITSTATUS = 1; - var output = "abort(" + what + ") at " + stackTrace(); - what = output; - throw new WebAssembly.RuntimeError(what) - } - var FS = { - error: function () { - abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1") - }, - init: function () { - FS.error() - }, - createDataFile: function () { - FS.error() - }, - createPreloadedFile: function () { - FS.error() - }, - createLazyFile: function () { - FS.error() - }, - open: function () { - FS.error() - }, - mkdev: function () { - FS.error() - }, - registerDevice: function () { - FS.error() - }, - analyzePath: function () { - FS.error() - }, - loadFilesFromDB: function () { - FS.error() - }, - ErrnoError: function ErrnoError() { - FS.error() - } - }; - Module["FS_createDataFile"] = FS.createDataFile; - Module["FS_createPreloadedFile"] = FS.createPreloadedFile; - - function hasPrefix(str, prefix) { - return String.prototype.startsWith ? str.startsWith(prefix) : str.indexOf(prefix) === 0 - } - var dataURIPrefix = "data:application/octet-stream;base64,"; - - function isDataURI(filename) { - return hasPrefix(filename, dataURIPrefix) - } - var fileURIPrefix = "file://"; - - function isFileURI(filename) { - return hasPrefix(filename, fileURIPrefix) - } - var wasmBinaryFile = "tfjs-backend-wasm.wasm"; - if (!isDataURI(wasmBinaryFile)) { - wasmBinaryFile = locateFile(wasmBinaryFile) - } - - function getBinary() { - try { - if (wasmBinary) { - return new Uint8Array(wasmBinary) - } - if (readBinary) { - return readBinary(wasmBinaryFile) - } else { - throw "both async and sync fetching of the wasm failed" - } - } catch (err) { - abort(err) - } - } - - function getBinaryPromise() { - if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) && typeof fetch === "function" && !isFileURI(wasmBinaryFile)) { - return fetch(wasmBinaryFile, { - credentials: "same-origin" - }).then(function (response) { - if (!response["ok"]) { - throw "failed to load wasm binary file at '" + wasmBinaryFile + "'" - } - return response["arrayBuffer"]() - }).catch(function () { - return getBinary() - }) - } - return new Promise(function (resolve, reject) { - resolve(getBinary()) - }) - } - - function createWasm() { - var info = { - "env": asmLibraryArg, - "wasi_snapshot_preview1": asmLibraryArg - }; - - function receiveInstance(instance, module) { - var exports = instance.exports; - Module["asm"] = exports; - wasmModule = module; - if (!ENVIRONMENT_IS_PTHREAD) { - var numWorkersToLoad = PThread.unusedWorkers.length; - PThread.unusedWorkers.forEach(function (w) { - PThread.loadWasmModuleToWorker(w, function () { - if (!--numWorkersToLoad) removeRunDependency("wasm-instantiate") - }) - }) - } - } - if (!ENVIRONMENT_IS_PTHREAD) { - addRunDependency("wasm-instantiate") - } - var trueModule = Module; - - function receiveInstantiatedSource(output) { - assert(Module === trueModule, "the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"); - trueModule = null; - receiveInstance(output["instance"], output["module"]) - } - - function instantiateArrayBuffer(receiver) { - return getBinaryPromise().then(function (binary) { - return WebAssembly.instantiate(binary, info) - }).then(receiver, function (reason) { - err("failed to asynchronously prepare wasm: " + reason); - abort(reason) - }) - } - - function instantiateAsync() { - if (!wasmBinary && typeof WebAssembly.instantiateStreaming === "function" && !isDataURI(wasmBinaryFile) && !isFileURI(wasmBinaryFile) && typeof fetch === "function") { - fetch(wasmBinaryFile, { - credentials: "same-origin" - }).then(function (response) { - var result = WebAssembly.instantiateStreaming(response, info); - return result.then(receiveInstantiatedSource, function (reason) { - err("wasm streaming compile failed: " + reason); - err("falling back to ArrayBuffer instantiation"); - instantiateArrayBuffer(receiveInstantiatedSource) - }) - }) - } else { - return instantiateArrayBuffer(receiveInstantiatedSource) - } - } - if (Module["instantiateWasm"]) { - try { - var exports = Module["instantiateWasm"](info, receiveInstance); - return exports - } catch (e) { - err("Module.instantiateWasm callback failed with error: " + e); - return false - } - } - instantiateAsync(); - return {} - } - var ASM_CONSTS = {}; - - function initPthreadsJS() { - PThread.initRuntime() - } - if (!ENVIRONMENT_IS_PTHREAD) __ATINIT__.push({ - func: function () { - ___wasm_call_ctors() - } - }); - - function demangle(func) { - warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"); - return func - } - - function demangleAll(text) { - var regex = /\b_Z[\w\d_]+/g; - return text.replace(regex, function (x) { - var y = demangle(x); - return x === y ? x : y + " [" + x + "]" - }) - } - var __pthread_ptr = 0; - var __pthread_is_main_runtime_thread = 0; - var __pthread_is_main_browser_thread = 0; - - function __register_pthread_ptr(pthreadPtr, isMainBrowserThread, isMainRuntimeThread) { - pthreadPtr = pthreadPtr | 0; - isMainBrowserThread = isMainBrowserThread | 0; - isMainRuntimeThread = isMainRuntimeThread | 0; - __pthread_ptr = pthreadPtr; - __pthread_is_main_browser_thread = isMainBrowserThread; - __pthread_is_main_runtime_thread = isMainRuntimeThread - } - Module["__register_pthread_ptr"] = __register_pthread_ptr; - var ERRNO_CODES = { - EPERM: 63, - ENOENT: 44, - ESRCH: 71, - EINTR: 27, - EIO: 29, - ENXIO: 60, - E2BIG: 1, - ENOEXEC: 45, - EBADF: 8, - ECHILD: 12, - EAGAIN: 6, - EWOULDBLOCK: 6, - ENOMEM: 48, - EACCES: 2, - EFAULT: 21, - ENOTBLK: 105, - EBUSY: 10, - EEXIST: 20, - EXDEV: 75, - ENODEV: 43, - ENOTDIR: 54, - EISDIR: 31, - EINVAL: 28, - ENFILE: 41, - EMFILE: 33, - ENOTTY: 59, - ETXTBSY: 74, - EFBIG: 22, - ENOSPC: 51, - ESPIPE: 70, - EROFS: 69, - EMLINK: 34, - EPIPE: 64, - EDOM: 18, - ERANGE: 68, - ENOMSG: 49, - EIDRM: 24, - ECHRNG: 106, - EL2NSYNC: 156, - EL3HLT: 107, - EL3RST: 108, - ELNRNG: 109, - EUNATCH: 110, - ENOCSI: 111, - EL2HLT: 112, - EDEADLK: 16, - ENOLCK: 46, - EBADE: 113, - EBADR: 114, - EXFULL: 115, - ENOANO: 104, - EBADRQC: 103, - EBADSLT: 102, - EDEADLOCK: 16, - EBFONT: 101, - ENOSTR: 100, - ENODATA: 116, - ETIME: 117, - ENOSR: 118, - ENONET: 119, - ENOPKG: 120, - EREMOTE: 121, - ENOLINK: 47, - EADV: 122, - ESRMNT: 123, - ECOMM: 124, - EPROTO: 65, - EMULTIHOP: 36, - EDOTDOT: 125, - EBADMSG: 9, - ENOTUNIQ: 126, - EBADFD: 127, - EREMCHG: 128, - ELIBACC: 129, - ELIBBAD: 130, - ELIBSCN: 131, - ELIBMAX: 132, - ELIBEXEC: 133, - ENOSYS: 52, - ENOTEMPTY: 55, - ENAMETOOLONG: 37, - ELOOP: 32, - EOPNOTSUPP: 138, - EPFNOSUPPORT: 139, - ECONNRESET: 15, - ENOBUFS: 42, - EAFNOSUPPORT: 5, - EPROTOTYPE: 67, - ENOTSOCK: 57, - ENOPROTOOPT: 50, - ESHUTDOWN: 140, - ECONNREFUSED: 14, - EADDRINUSE: 3, - ECONNABORTED: 13, - ENETUNREACH: 40, - ENETDOWN: 38, - ETIMEDOUT: 73, - EHOSTDOWN: 142, - EHOSTUNREACH: 23, - EINPROGRESS: 26, - EALREADY: 7, - EDESTADDRREQ: 17, - EMSGSIZE: 35, - EPROTONOSUPPORT: 66, - ESOCKTNOSUPPORT: 137, - EADDRNOTAVAIL: 4, - ENETRESET: 39, - EISCONN: 30, - ENOTCONN: 53, - ETOOMANYREFS: 141, - EUSERS: 136, - EDQUOT: 19, - ESTALE: 72, - ENOTSUP: 138, - ENOMEDIUM: 148, - EILSEQ: 25, - EOVERFLOW: 61, - ECANCELED: 11, - ENOTRECOVERABLE: 56, - EOWNERDEAD: 62, - ESTRPIPE: 135 - }; - var __main_thread_futex_wait_address = 12912; - - function _emscripten_futex_wake(addr, count) { - if (addr <= 0 || addr > GROWABLE_HEAP_I8().length || addr & 3 != 0 || count < 0) return -28; - if (count == 0) return 0; - if (count >= 2147483647) count = Infinity; - var mainThreadWaitAddress = Atomics.load(GROWABLE_HEAP_I32(), __main_thread_futex_wait_address >> 2); - var mainThreadWoken = 0; - if (mainThreadWaitAddress == addr) { - var loadedAddr = Atomics.compareExchange(GROWABLE_HEAP_I32(), __main_thread_futex_wait_address >> 2, mainThreadWaitAddress, 0); - if (loadedAddr == mainThreadWaitAddress) { - --count; - mainThreadWoken = 1; - if (count <= 0) return 1 - } - } - var ret = Atomics.notify(GROWABLE_HEAP_I32(), addr >> 2, count); - if (ret >= 0) return ret + mainThreadWoken; - throw "Atomics.notify returned an unexpected value " + ret - } - Module["_emscripten_futex_wake"] = _emscripten_futex_wake; - - function __kill_thread(pthread_ptr) { - if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _kill_thread() can only ever be called from main application thread!"; - if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _kill_thread!"; - GROWABLE_HEAP_I32()[pthread_ptr + 12 >> 2] = 0; - var pthread = PThread.pthreads[pthread_ptr]; - pthread.worker.terminate(); - PThread.freeThreadData(pthread); - PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker), 1); - pthread.worker.pthread = undefined - } - - function __cancel_thread(pthread_ptr) { - if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _cancel_thread() can only ever be called from main application thread!"; - if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _cancel_thread!"; - var pthread = PThread.pthreads[pthread_ptr]; - pthread.worker.postMessage({ - "cmd": "cancel" - }) - } - - function __cleanup_thread(pthread_ptr) { - if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _cleanup_thread() can only ever be called from main application thread!"; - if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _cleanup_thread!"; - GROWABLE_HEAP_I32()[pthread_ptr + 12 >> 2] = 0; - var pthread = PThread.pthreads[pthread_ptr]; - if (pthread) { - var worker = pthread.worker; - PThread.returnWorkerToPool(worker) - } - } - var PThread = { - MAIN_THREAD_ID: 1, - mainThreadInfo: { - schedPolicy: 0, - schedPrio: 0 - }, - unusedWorkers: [], - runningWorkers: [], - initRuntime: function () { - __register_pthread_ptr(PThread.mainThreadBlock, !ENVIRONMENT_IS_WORKER, 1); - _emscripten_register_main_browser_thread_id(PThread.mainThreadBlock) - }, - initMainThreadBlock: function () { - assert(!ENVIRONMENT_IS_PTHREAD); - var pthreadPoolSize = 8; - for (var i = 0; i < pthreadPoolSize; ++i) { - PThread.allocateUnusedWorker() - } - PThread.mainThreadBlock = 12160; - for (var i = 0; i < 232 / 4; ++i) GROWABLE_HEAP_U32()[PThread.mainThreadBlock / 4 + i] = 0; - GROWABLE_HEAP_I32()[PThread.mainThreadBlock + 12 >> 2] = PThread.mainThreadBlock; - var headPtr = PThread.mainThreadBlock + 156; - GROWABLE_HEAP_I32()[headPtr >> 2] = headPtr; - var tlsMemory = 12400; - for (var i = 0; i < 128; ++i) GROWABLE_HEAP_U32()[tlsMemory / 4 + i] = 0; - Atomics.store(GROWABLE_HEAP_U32(), PThread.mainThreadBlock + 104 >> 2, tlsMemory); - Atomics.store(GROWABLE_HEAP_U32(), PThread.mainThreadBlock + 40 >> 2, PThread.mainThreadBlock); - Atomics.store(GROWABLE_HEAP_U32(), PThread.mainThreadBlock + 44 >> 2, 42) - }, - initWorker: function () {}, - pthreads: {}, - exitHandlers: null, - setThreadStatus: function () {}, - runExitHandlers: function () { - if (PThread.exitHandlers !== null) { - while (PThread.exitHandlers.length > 0) { - PThread.exitHandlers.pop()() - } - PThread.exitHandlers = null - } - if (ENVIRONMENT_IS_PTHREAD && threadInfoStruct) ___pthread_tsd_run_dtors() - }, - threadExit: function (exitCode) { - var tb = _pthread_self(); - if (tb) { - err("Pthread 0x" + tb.toString(16) + " exited."); - Atomics.store(GROWABLE_HEAP_U32(), tb + 4 >> 2, exitCode); - Atomics.store(GROWABLE_HEAP_U32(), tb + 0 >> 2, 1); - Atomics.store(GROWABLE_HEAP_U32(), tb + 60 >> 2, 1); - Atomics.store(GROWABLE_HEAP_U32(), tb + 64 >> 2, 0); - PThread.runExitHandlers(); - _emscripten_futex_wake(tb + 0, 2147483647); - __register_pthread_ptr(0, 0, 0); - threadInfoStruct = 0; - if (ENVIRONMENT_IS_PTHREAD) { - postMessage({ - "cmd": "exit" - }) - } - } - }, - threadCancel: function () { - PThread.runExitHandlers(); - Atomics.store(GROWABLE_HEAP_U32(), threadInfoStruct + 4 >> 2, -1); - Atomics.store(GROWABLE_HEAP_U32(), threadInfoStruct + 0 >> 2, 1); - _emscripten_futex_wake(threadInfoStruct + 0, 2147483647); - threadInfoStruct = selfThreadId = 0; - __register_pthread_ptr(0, 0, 0); - postMessage({ - "cmd": "cancelDone" - }) - }, - terminateAllThreads: function () { - for (var t in PThread.pthreads) { - var pthread = PThread.pthreads[t]; - if (pthread && pthread.worker) { - PThread.returnWorkerToPool(pthread.worker) - } - } - PThread.pthreads = {}; - for (var i = 0; i < PThread.unusedWorkers.length; ++i) { - var worker = PThread.unusedWorkers[i]; - assert(!worker.pthread); - worker.terminate() - } - PThread.unusedWorkers = []; - for (var i = 0; i < PThread.runningWorkers.length; ++i) { - var worker = PThread.runningWorkers[i]; - var pthread = worker.pthread; - assert(pthread, "This Worker should have a pthread it is executing"); - PThread.freeThreadData(pthread); - worker.terminate() - } - PThread.runningWorkers = [] - }, - freeThreadData: function (pthread) { - if (!pthread) return; - if (pthread.threadInfoStruct) { - var tlsMemory = GROWABLE_HEAP_I32()[pthread.threadInfoStruct + 104 >> 2]; - GROWABLE_HEAP_I32()[pthread.threadInfoStruct + 104 >> 2] = 0; - _free(tlsMemory); - _free(pthread.threadInfoStruct) - } - pthread.threadInfoStruct = 0; - if (pthread.allocatedOwnStack && pthread.stackBase) _free(pthread.stackBase); - pthread.stackBase = 0; - if (pthread.worker) pthread.worker.pthread = null - }, - returnWorkerToPool: function (worker) { - delete PThread.pthreads[worker.pthread.thread]; - PThread.unusedWorkers.push(worker); - PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker), 1); - PThread.freeThreadData(worker.pthread); - worker.pthread = undefined - }, - receiveObjectTransfer: function (data) {}, - loadWasmModuleToWorker: function (worker, onFinishedLoading) { - worker.onmessage = function (e) { - var d = e["data"]; - var cmd = d["cmd"]; - if (worker.pthread) PThread.currentProxiedOperationCallerThread = worker.pthread.threadInfoStruct; - if (d["targetThread"] && d["targetThread"] != _pthread_self()) { - var thread = PThread.pthreads[d.targetThread]; - if (thread) { - thread.worker.postMessage(e.data, d["transferList"]) - } else { - console.error('Internal error! Worker sent a message "' + cmd + '" to target pthread ' + d["targetThread"] + ", but that thread no longer exists!") - } - PThread.currentProxiedOperationCallerThread = undefined; - return - } - if (cmd === "processQueuedMainThreadWork") { - _emscripten_main_thread_process_queued_calls() - } else if (cmd === "spawnThread") { - __spawn_thread(e.data) - } else if (cmd === "cleanupThread") { - __cleanup_thread(d["thread"]) - } else if (cmd === "killThread") { - __kill_thread(d["thread"]) - } else if (cmd === "cancelThread") { - __cancel_thread(d["thread"]) - } else if (cmd === "loaded") { - worker.loaded = true; - if (onFinishedLoading) onFinishedLoading(worker); - if (worker.runPthread) { - worker.runPthread(); - delete worker.runPthread - } - } else if (cmd === "print") { - out("Thread " + d["threadId"] + ": " + d["text"]) - } else if (cmd === "printErr") { - err("Thread " + d["threadId"] + ": " + d["text"]) - } else if (cmd === "alert") { - alert("Thread " + d["threadId"] + ": " + d["text"]) - } else if (cmd === "exit") { - var detached = worker.pthread && Atomics.load(GROWABLE_HEAP_U32(), worker.pthread.thread + 68 >> 2); - if (detached) { - PThread.returnWorkerToPool(worker) - } - } else if (cmd === "cancelDone") { - PThread.returnWorkerToPool(worker) - } else if (cmd === "objectTransfer") { - PThread.receiveObjectTransfer(e.data) - } else if (e.data.target === "setimmediate") { - worker.postMessage(e.data) - } else { - err("worker sent an unknown command " + cmd) - } - PThread.currentProxiedOperationCallerThread = undefined - }; - worker.onerror = function (e) { - err("pthread sent an error! " + e.filename + ":" + e.lineno + ": " + e.message) - }; - if (ENVIRONMENT_IS_NODE) { - worker.on("message", function (data) { - worker.onmessage({ - data: data - }) - }); - worker.on("error", function (data) { - worker.onerror(data) - }); - worker.on("exit", function (data) { - console.log("worker exited - TODO: update the worker queue?") - }) - } - assert(wasmMemory instanceof WebAssembly.Memory, "WebAssembly memory should have been loaded by now!"); - assert(wasmModule instanceof WebAssembly.Module, "WebAssembly Module should have been loaded by now!"); - worker.postMessage({ - "cmd": "load", - "urlOrBlob": Module["mainScriptUrlOrBlob"] || _scriptDir, - "wasmMemory": wasmMemory, - "wasmModule": wasmModule, - "DYNAMIC_BASE": DYNAMIC_BASE, - "DYNAMICTOP_PTR": DYNAMICTOP_PTR - }) - }, - allocateUnusedWorker: function () { - var pthreadMainJs = locateFile("tfjs-backend-wasm.worker.js"); - PThread.unusedWorkers.push(new Worker(pthreadMainJs)) - }, - getNewWorker: function () { - if (PThread.unusedWorkers.length == 0) { - PThread.allocateUnusedWorker(); - PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0]) - } - if (PThread.unusedWorkers.length > 0) return PThread.unusedWorkers.pop(); - else return null - }, - busySpinWait: function (msecs) { - var t = performance.now() + msecs; - while (performance.now() < t) {} - } - }; - - function establishStackSpace(stackTop, stackMax) { - STACK_BASE = STACKTOP = stackTop; - STACK_MAX = stackMax; - ___set_stack_limit(STACK_MAX); - writeStackCookie(); - stackRestore(stackTop) - } - Module["establishStackSpace"] = establishStackSpace; - - function getNoExitRuntime() { - return noExitRuntime - } - Module["getNoExitRuntime"] = getNoExitRuntime; - - function jsStackTrace() { - var err = new Error; - if (!err.stack) { - try { - throw new Error - } catch (e) { - err = e - } - if (!err.stack) { - return "(no stack trace available)" - } - } - return err.stack.toString() - } - - function stackTrace() { - var js = jsStackTrace(); - if (Module["extraStackTrace"]) js += "\n" + Module["extraStackTrace"](); - return demangleAll(js) - } - - function ___assert_fail(condition, filename, line, func) { - abort("Assertion failed: " + UTF8ToString(condition) + ", at: " + [filename ? UTF8ToString(filename) : "unknown filename", line, func ? UTF8ToString(func) : "unknown function"]) - } - var _emscripten_get_now; - if (ENVIRONMENT_IS_NODE) { - _emscripten_get_now = function () { - var t = process["hrtime"](); - return t[0] * 1e3 + t[1] / 1e6 - } - } else if (ENVIRONMENT_IS_PTHREAD) { - _emscripten_get_now = function () { - return performance.now() - Module["__performance_now_clock_drift"] - } - } else if (typeof dateNow !== "undefined") { - _emscripten_get_now = dateNow - } else _emscripten_get_now = function () { - return performance.now() - }; - - function _atexit(func, arg) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(1, 1, func, arg); - warnOnce("atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)"); - __ATEXIT__.unshift({ - func: func, - arg: arg - }) - } - - function ___handle_stack_overflow() { - abort("stack overflow") - } - - function __emscripten_notify_thread_queue(targetThreadId, mainThreadId) { - if (targetThreadId == mainThreadId) { - postMessage({ - "cmd": "processQueuedMainThreadWork" - }) - } else if (ENVIRONMENT_IS_PTHREAD) { - postMessage({ - "targetThread": targetThreadId, - "cmd": "processThreadQueue" - }) - } else { - var pthread = PThread.pthreads[targetThreadId]; - var worker = pthread && pthread.worker; - if (!worker) { - err("Cannot send message to thread with ID " + targetThreadId + ", unknown thread ID!"); - return - } - worker.postMessage({ - "cmd": "processThreadQueue" - }) - } - return 1 - } - - function _abort() { - abort() - } - - function _emscripten_conditional_set_current_thread_status(expectedStatus, newStatus) { - expectedStatus = expectedStatus | 0; - newStatus = newStatus | 0 - } - - function _emscripten_futex_wait(addr, val, timeout) { - if (addr <= 0 || addr > GROWABLE_HEAP_I8().length || addr & 3 != 0) return -28; - if (ENVIRONMENT_IS_WORKER) { - var ret = Atomics.wait(GROWABLE_HEAP_I32(), addr >> 2, val, timeout); - if (ret === "timed-out") return -73; - if (ret === "not-equal") return -6; - if (ret === "ok") return 0; - throw "Atomics.wait returned an unexpected value " + ret - } else { - var loadedVal = Atomics.load(GROWABLE_HEAP_I32(), addr >> 2); - if (val != loadedVal) return -6; - var tNow = performance.now(); - var tEnd = tNow + timeout; - Atomics.store(GROWABLE_HEAP_I32(), __main_thread_futex_wait_address >> 2, addr); - var ourWaitAddress = addr; - while (addr == ourWaitAddress) { - tNow = performance.now(); - if (tNow > tEnd) { - return -73 - } - _emscripten_main_thread_process_queued_calls(); - addr = Atomics.load(GROWABLE_HEAP_I32(), __main_thread_futex_wait_address >> 2) - } - return 0 - } - } - - function _emscripten_is_main_browser_thread() { - return __pthread_is_main_browser_thread | 0 - } - - function _emscripten_is_main_runtime_thread() { - return __pthread_is_main_runtime_thread | 0 - } - - function _emscripten_memcpy_big(dest, src, num) { - GROWABLE_HEAP_U8().copyWithin(dest, src, src + num) - } - - function _emscripten_proxy_to_main_thread_js(index, sync) { - var numCallArgs = arguments.length - 2; - if (numCallArgs > 20 - 1) throw "emscripten_proxy_to_main_thread_js: Too many arguments " + numCallArgs + " to proxied function idx=" + index + ", maximum supported is " + (20 - 1) + "!"; - var stack = stackSave(); - var args = stackAlloc(numCallArgs * 8); - var b = args >> 3; - for (var i = 0; i < numCallArgs; i++) { - GROWABLE_HEAP_F64()[b + i] = arguments[2 + i] - } - var ret = _emscripten_run_in_main_runtime_thread_js(index, numCallArgs, args, sync); - stackRestore(stack); - return ret - } - var _emscripten_receive_on_main_thread_js_callArgs = []; - - function readAsmConstArgs(sigPtr, buf) { - if (!readAsmConstArgs.array) { - readAsmConstArgs.array = [] - } - var args = readAsmConstArgs.array; - args.length = 0; - var ch; - while (ch = GROWABLE_HEAP_U8()[sigPtr++]) { - if (ch === 100 || ch === 102) { - buf = buf + 7 & ~7; - args.push(GROWABLE_HEAP_F64()[buf >> 3]); - buf += 8 - } else if (ch === 105) { - buf = buf + 3 & ~3; - args.push(GROWABLE_HEAP_I32()[buf >> 2]); - buf += 4 - } else abort("unexpected char in asm const signature " + ch) - } - return args - } - - function _emscripten_receive_on_main_thread_js(index, numCallArgs, args) { - _emscripten_receive_on_main_thread_js_callArgs.length = numCallArgs; - var b = args >> 3; - for (var i = 0; i < numCallArgs; i++) { - _emscripten_receive_on_main_thread_js_callArgs[i] = GROWABLE_HEAP_F64()[b + i] - } - var isEmAsmConst = index < 0; - var func = !isEmAsmConst ? proxiedFunctionTable[index] : ASM_CONSTS[-index - 1]; - if (isEmAsmConst) { - var sigPtr = _emscripten_receive_on_main_thread_js_callArgs[1]; - var varargPtr = _emscripten_receive_on_main_thread_js_callArgs[2]; - var constArgs = readAsmConstArgs(sigPtr, varargPtr); - return func.apply(null, constArgs) - } - assert(func.length == numCallArgs, "Call args mismatch in emscripten_receive_on_main_thread_js"); - return func.apply(null, _emscripten_receive_on_main_thread_js_callArgs) - } - - function _emscripten_get_heap_size() { - return GROWABLE_HEAP_U8().length - } - - function emscripten_realloc_buffer(size) { - try { - wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16); - updateGlobalBufferAndViews(wasmMemory.buffer); - return 1 - } catch (e) { - console.error("emscripten_realloc_buffer: Attempted to grow heap from " + buffer.byteLength + " bytes to " + size + " bytes, but got error: " + e) - } - } - - function _emscripten_resize_heap(requestedSize) { - var oldSize = _emscripten_get_heap_size(); - if (requestedSize <= oldSize) { - return false - } - var PAGE_MULTIPLE = 65536; - var maxHeapSize = 1073741824; - if (requestedSize > maxHeapSize) { - err("Cannot enlarge memory, asked to go up to " + requestedSize + " bytes, but the limit is " + maxHeapSize + " bytes!"); - return false - } - var minHeapSize = 16777216; - for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { - var overGrownHeapSize = oldSize * (1 + .2 / cutDown); - overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296); - var newSize = Math.min(maxHeapSize, alignUp(Math.max(minHeapSize, requestedSize, overGrownHeapSize), PAGE_MULTIPLE)); - var replacement = emscripten_realloc_buffer(newSize); - if (replacement) { - return true - } - } - err("Failed to grow the heap from " + oldSize + " bytes to " + newSize + " bytes, not enough memory!"); - return false - } - var JSEvents = { - keyEvent: 0, - mouseEvent: 0, - wheelEvent: 0, - uiEvent: 0, - focusEvent: 0, - deviceOrientationEvent: 0, - deviceMotionEvent: 0, - fullscreenChangeEvent: 0, - pointerlockChangeEvent: 0, - visibilityChangeEvent: 0, - touchEvent: 0, - previousFullscreenElement: null, - previousScreenX: null, - previousScreenY: null, - removeEventListenersRegistered: false, - removeAllEventListeners: function () { - for (var i = JSEvents.eventHandlers.length - 1; i >= 0; --i) { - JSEvents._removeHandler(i) - } - JSEvents.eventHandlers = []; - JSEvents.deferredCalls = [] - }, - registerRemoveEventListeners: function () { - if (!JSEvents.removeEventListenersRegistered) { - __ATEXIT__.push(JSEvents.removeAllEventListeners); - JSEvents.removeEventListenersRegistered = true - } - }, - deferredCalls: [], - deferCall: function (targetFunction, precedence, argsList) { - function arraysHaveEqualContent(arrA, arrB) { - if (arrA.length != arrB.length) return false; - for (var i in arrA) { - if (arrA[i] != arrB[i]) return false - } - return true - } - for (var i in JSEvents.deferredCalls) { - var call = JSEvents.deferredCalls[i]; - if (call.targetFunction == targetFunction && arraysHaveEqualContent(call.argsList, argsList)) { - return - } - } - JSEvents.deferredCalls.push({ - targetFunction: targetFunction, - precedence: precedence, - argsList: argsList - }); - JSEvents.deferredCalls.sort(function (x, y) { - return x.precedence < y.precedence - }) - }, - removeDeferredCalls: function (targetFunction) { - for (var i = 0; i < JSEvents.deferredCalls.length; ++i) { - if (JSEvents.deferredCalls[i].targetFunction == targetFunction) { - JSEvents.deferredCalls.splice(i, 1); - --i - } - } - }, - canPerformEventHandlerRequests: function () { - return JSEvents.inEventHandler && JSEvents.currentEventHandler.allowsDeferredCalls - }, - runDeferredCalls: function () { - if (!JSEvents.canPerformEventHandlerRequests()) { - return - } - for (var i = 0; i < JSEvents.deferredCalls.length; ++i) { - var call = JSEvents.deferredCalls[i]; - JSEvents.deferredCalls.splice(i, 1); - --i; - call.targetFunction.apply(null, call.argsList) - } - }, - inEventHandler: 0, - currentEventHandler: null, - eventHandlers: [], - removeAllHandlersOnTarget: function (target, eventTypeString) { - for (var i = 0; i < JSEvents.eventHandlers.length; ++i) { - if (JSEvents.eventHandlers[i].target == target && (!eventTypeString || eventTypeString == JSEvents.eventHandlers[i].eventTypeString)) { - JSEvents._removeHandler(i--) - } - } - }, - _removeHandler: function (i) { - var h = JSEvents.eventHandlers[i]; - h.target.removeEventListener(h.eventTypeString, h.eventListenerFunc, h.useCapture); - JSEvents.eventHandlers.splice(i, 1) - }, - registerOrRemoveHandler: function (eventHandler) { - var jsEventHandler = function jsEventHandler(event) { - ++JSEvents.inEventHandler; - JSEvents.currentEventHandler = eventHandler; - JSEvents.runDeferredCalls(); - eventHandler.handlerFunc(event); - JSEvents.runDeferredCalls(); - --JSEvents.inEventHandler - }; - if (eventHandler.callbackfunc) { - eventHandler.eventListenerFunc = jsEventHandler; - eventHandler.target.addEventListener(eventHandler.eventTypeString, jsEventHandler, eventHandler.useCapture); - JSEvents.eventHandlers.push(eventHandler); - JSEvents.registerRemoveEventListeners() - } else { - for (var i = 0; i < JSEvents.eventHandlers.length; ++i) { - if (JSEvents.eventHandlers[i].target == eventHandler.target && JSEvents.eventHandlers[i].eventTypeString == eventHandler.eventTypeString) { - JSEvents._removeHandler(i--) - } - } - } - }, - queueEventHandlerOnThread_iiii: function (targetThread, eventHandlerFunc, eventTypeId, eventData, userData) { - var stackTop = stackSave(); - var varargs = stackAlloc(12); - GROWABLE_HEAP_I32()[varargs >> 2] = eventTypeId; - GROWABLE_HEAP_I32()[varargs + 4 >> 2] = eventData; - GROWABLE_HEAP_I32()[varargs + 8 >> 2] = userData; - _emscripten_async_queue_on_thread_(targetThread, 637534208, eventHandlerFunc, eventData, varargs); - stackRestore(stackTop) - }, - getTargetThreadForEventCallback: function (targetThread) { - switch (targetThread) { - case 1: - return 0; - case 2: - return PThread.currentProxiedOperationCallerThread; - default: - return targetThread - } - }, - getNodeNameForTarget: function (target) { - if (!target) return ""; - if (target == window) return "#window"; - if (target == screen) return "#screen"; - return target && target.nodeName ? target.nodeName : "" - }, - fullscreenEnabled: function () { - return document.fullscreenEnabled || document.webkitFullscreenEnabled - } - }; - - function stringToNewUTF8(jsString) { - var length = lengthBytesUTF8(jsString) + 1; - var cString = _malloc(length); - stringToUTF8(jsString, cString, length); - return cString - } - - function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread, targetCanvas, width, height) { - var stackTop = stackSave(); - var varargs = stackAlloc(12); - var targetCanvasPtr = 0; - if (targetCanvas) { - targetCanvasPtr = stringToNewUTF8(targetCanvas) - } - GROWABLE_HEAP_I32()[varargs >> 2] = targetCanvasPtr; - GROWABLE_HEAP_I32()[varargs + 4 >> 2] = width; - GROWABLE_HEAP_I32()[varargs + 8 >> 2] = height; - _emscripten_async_queue_on_thread_(targetThread, 657457152, 0, targetCanvasPtr, varargs); - stackRestore(stackTop) - } - - function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread, targetCanvas, width, height) { - targetCanvas = targetCanvas ? UTF8ToString(targetCanvas) : ""; - _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread, targetCanvas, width, height) - } - - function __maybeCStringToJsString(cString) { - return cString === cString + 0 ? UTF8ToString(cString) : cString - } - var __specialEventTargets = [0, typeof document !== "undefined" ? document : 0, typeof window !== "undefined" ? window : 0]; - - function __findEventTarget(target) { - var domElement = __specialEventTargets[target] || (typeof document !== "undefined" ? document.querySelector(__maybeCStringToJsString(target)) : undefined); - return domElement - } - - function __findCanvasEventTarget(target) { - return __findEventTarget(target) - } - - function _emscripten_set_canvas_element_size_calling_thread(target, width, height) { - var canvas = __findCanvasEventTarget(target); - if (!canvas) return -4; - if (canvas.canvasSharedPtr) { - GROWABLE_HEAP_I32()[canvas.canvasSharedPtr >> 2] = width; - GROWABLE_HEAP_I32()[canvas.canvasSharedPtr + 4 >> 2] = height - } - if (canvas.offscreenCanvas || !canvas.controlTransferredOffscreen) { - if (canvas.offscreenCanvas) canvas = canvas.offscreenCanvas; - var autoResizeViewport = false; - if (canvas.GLctxObject && canvas.GLctxObject.GLctx) { - var prevViewport = canvas.GLctxObject.GLctx.getParameter(2978); - autoResizeViewport = prevViewport[0] === 0 && prevViewport[1] === 0 && prevViewport[2] === canvas.width && prevViewport[3] === canvas.height - } - canvas.width = width; - canvas.height = height; - if (autoResizeViewport) { - canvas.GLctxObject.GLctx.viewport(0, 0, width, height) - } - } else if (canvas.canvasSharedPtr) { - var targetThread = GROWABLE_HEAP_I32()[canvas.canvasSharedPtr + 8 >> 2]; - _emscripten_set_offscreencanvas_size_on_target_thread(targetThread, target, width, height); - return 1 - } else { - return -4 - } - return 0 - } - - function _emscripten_set_canvas_element_size_main_thread(target, width, height) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(2, 1, target, width, height); - return _emscripten_set_canvas_element_size_calling_thread(target, width, height) - } - - function _emscripten_set_canvas_element_size(target, width, height) { - var canvas = __findCanvasEventTarget(target); - if (canvas) { - return _emscripten_set_canvas_element_size_calling_thread(target, width, height) - } else { - return _emscripten_set_canvas_element_size_main_thread(target, width, height) - } - } - - function _emscripten_set_current_thread_status(newStatus) { - newStatus = newStatus | 0 - } - - function __webgl_acquireInstancedArraysExtension(ctx) { - var ext = ctx.getExtension("ANGLE_instanced_arrays"); - if (ext) { - ctx["vertexAttribDivisor"] = function (index, divisor) { - ext["vertexAttribDivisorANGLE"](index, divisor) - }; - ctx["drawArraysInstanced"] = function (mode, first, count, primcount) { - ext["drawArraysInstancedANGLE"](mode, first, count, primcount) - }; - ctx["drawElementsInstanced"] = function (mode, count, type, indices, primcount) { - ext["drawElementsInstancedANGLE"](mode, count, type, indices, primcount) - } - } - } - - function __webgl_acquireVertexArrayObjectExtension(ctx) { - var ext = ctx.getExtension("OES_vertex_array_object"); - if (ext) { - ctx["createVertexArray"] = function () { - return ext["createVertexArrayOES"]() - }; - ctx["deleteVertexArray"] = function (vao) { - ext["deleteVertexArrayOES"](vao) - }; - ctx["bindVertexArray"] = function (vao) { - ext["bindVertexArrayOES"](vao) - }; - ctx["isVertexArray"] = function (vao) { - return ext["isVertexArrayOES"](vao) - } - } - } - - function __webgl_acquireDrawBuffersExtension(ctx) { - var ext = ctx.getExtension("WEBGL_draw_buffers"); - if (ext) { - ctx["drawBuffers"] = function (n, bufs) { - ext["drawBuffersWEBGL"](n, bufs) - } - } - } - var GL = { - counter: 1, - lastError: 0, - buffers: [], - mappedBuffers: {}, - programs: [], - framebuffers: [], - renderbuffers: [], - textures: [], - uniforms: [], - shaders: [], - vaos: [], - contexts: {}, - currentContext: null, - offscreenCanvases: {}, - timerQueriesEXT: [], - programInfos: {}, - stringCache: {}, - unpackAlignment: 4, - init: function () { - var miniTempFloatBuffer = new Float32Array(GL.MINI_TEMP_BUFFER_SIZE); - for (var i = 0; i < GL.MINI_TEMP_BUFFER_SIZE; i++) { - GL.miniTempBufferFloatViews[i] = miniTempFloatBuffer.subarray(0, i + 1) - } - var miniTempIntBuffer = new Int32Array(GL.MINI_TEMP_BUFFER_SIZE); - for (var i = 0; i < GL.MINI_TEMP_BUFFER_SIZE; i++) { - GL.miniTempBufferIntViews[i] = miniTempIntBuffer.subarray(0, i + 1) - } - }, - recordError: function recordError(errorCode) { - if (!GL.lastError) { - GL.lastError = errorCode - } - }, - getNewId: function (table) { - var ret = GL.counter++; - for (var i = table.length; i < ret; i++) { - table[i] = null - } - return ret - }, - MINI_TEMP_BUFFER_SIZE: 256, - miniTempBufferFloatViews: [0], - miniTempBufferIntViews: [0], - getSource: function (shader, count, string, length) { - var source = ""; - for (var i = 0; i < count; ++i) { - var len = length ? GROWABLE_HEAP_I32()[length + i * 4 >> 2] : -1; - source += UTF8ToString(GROWABLE_HEAP_I32()[string + i * 4 >> 2], len < 0 ? undefined : len) - } - return source - }, - createContext: function (canvas, webGLContextAttributes) { - var ctx = canvas.getContext("webgl", webGLContextAttributes); - if (!ctx) return 0; - var handle = GL.registerContext(ctx, webGLContextAttributes); - return handle - }, - registerContext: function (ctx, webGLContextAttributes) { - var handle = _malloc(8); - GROWABLE_HEAP_I32()[handle + 4 >> 2] = _pthread_self(); - var context = { - handle: handle, - attributes: webGLContextAttributes, - version: webGLContextAttributes.majorVersion, - GLctx: ctx - }; - if (ctx.canvas) ctx.canvas.GLctxObject = context; - GL.contexts[handle] = context; - if (typeof webGLContextAttributes.enableExtensionsByDefault === "undefined" || webGLContextAttributes.enableExtensionsByDefault) { - GL.initExtensions(context) - } - return handle - }, - makeContextCurrent: function (contextHandle) { - GL.currentContext = GL.contexts[contextHandle]; - Module.ctx = GLctx = GL.currentContext && GL.currentContext.GLctx; - return !(contextHandle && !GLctx) - }, - getContext: function (contextHandle) { - return GL.contexts[contextHandle] - }, - deleteContext: function (contextHandle) { - if (GL.currentContext === GL.contexts[contextHandle]) GL.currentContext = null; - if (typeof JSEvents === "object") JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas); - if (GL.contexts[contextHandle] && GL.contexts[contextHandle].GLctx.canvas) GL.contexts[contextHandle].GLctx.canvas.GLctxObject = undefined; - _free(GL.contexts[contextHandle].handle); - GL.contexts[contextHandle] = null - }, - initExtensions: function (context) { - if (!context) context = GL.currentContext; - if (context.initExtensionsDone) return; - context.initExtensionsDone = true; - var GLctx = context.GLctx; - if (context.version < 2) { - __webgl_acquireInstancedArraysExtension(GLctx); - __webgl_acquireVertexArrayObjectExtension(GLctx); - __webgl_acquireDrawBuffersExtension(GLctx) - } - GLctx.disjointTimerQueryExt = GLctx.getExtension("EXT_disjoint_timer_query"); - var automaticallyEnabledExtensions = ["OES_texture_float", "OES_texture_half_float", "OES_standard_derivatives", "OES_vertex_array_object", "WEBGL_compressed_texture_s3tc", "WEBGL_depth_texture", "OES_element_index_uint", "EXT_texture_filter_anisotropic", "EXT_frag_depth", "WEBGL_draw_buffers", "ANGLE_instanced_arrays", "OES_texture_float_linear", "OES_texture_half_float_linear", "EXT_blend_minmax", "EXT_shader_texture_lod", "EXT_texture_norm16", "WEBGL_compressed_texture_pvrtc", "EXT_color_buffer_half_float", "WEBGL_color_buffer_float", "EXT_sRGB", "WEBGL_compressed_texture_etc1", "EXT_disjoint_timer_query", "WEBGL_compressed_texture_etc", "WEBGL_compressed_texture_astc", "EXT_color_buffer_float", "WEBGL_compressed_texture_s3tc_srgb", "EXT_disjoint_timer_query_webgl2", "WEBKIT_WEBGL_compressed_texture_pvrtc"]; - var exts = GLctx.getSupportedExtensions() || []; - exts.forEach(function (ext) { - if (automaticallyEnabledExtensions.indexOf(ext) != -1) { - GLctx.getExtension(ext) - } - }) - }, - populateUniformTable: function (program) { - var p = GL.programs[program]; - var ptable = GL.programInfos[program] = { - uniforms: {}, - maxUniformLength: 0, - maxAttributeLength: -1, - maxUniformBlockNameLength: -1 - }; - var utable = ptable.uniforms; - var numUniforms = GLctx.getProgramParameter(p, 35718); - for (var i = 0; i < numUniforms; ++i) { - var u = GLctx.getActiveUniform(p, i); - var name = u.name; - ptable.maxUniformLength = Math.max(ptable.maxUniformLength, name.length + 1); - if (name.slice(-1) == "]") { - name = name.slice(0, name.lastIndexOf("[")) - } - var loc = GLctx.getUniformLocation(p, name); - if (loc) { - var id = GL.getNewId(GL.uniforms); - utable[name] = [u.size, id]; - GL.uniforms[id] = loc; - for (var j = 1; j < u.size; ++j) { - var n = name + "[" + j + "]"; - loc = GLctx.getUniformLocation(p, n); - id = GL.getNewId(GL.uniforms); - GL.uniforms[id] = loc - } - } - } - } - }; - var __emscripten_webgl_power_preferences = ["default", "low-power", "high-performance"]; - - function _emscripten_webgl_do_create_context(target, attributes) { - assert(attributes); - var contextAttributes = {}; - var a = attributes >> 2; - contextAttributes["alpha"] = !!GROWABLE_HEAP_I32()[a + (0 >> 2)]; - contextAttributes["depth"] = !!GROWABLE_HEAP_I32()[a + (4 >> 2)]; - contextAttributes["stencil"] = !!GROWABLE_HEAP_I32()[a + (8 >> 2)]; - contextAttributes["antialias"] = !!GROWABLE_HEAP_I32()[a + (12 >> 2)]; - contextAttributes["premultipliedAlpha"] = !!GROWABLE_HEAP_I32()[a + (16 >> 2)]; - contextAttributes["preserveDrawingBuffer"] = !!GROWABLE_HEAP_I32()[a + (20 >> 2)]; - var powerPreference = GROWABLE_HEAP_I32()[a + (24 >> 2)]; - contextAttributes["powerPreference"] = __emscripten_webgl_power_preferences[powerPreference]; - contextAttributes["failIfMajorPerformanceCaveat"] = !!GROWABLE_HEAP_I32()[a + (28 >> 2)]; - contextAttributes.majorVersion = GROWABLE_HEAP_I32()[a + (32 >> 2)]; - contextAttributes.minorVersion = GROWABLE_HEAP_I32()[a + (36 >> 2)]; - contextAttributes.enableExtensionsByDefault = GROWABLE_HEAP_I32()[a + (40 >> 2)]; - contextAttributes.explicitSwapControl = GROWABLE_HEAP_I32()[a + (44 >> 2)]; - contextAttributes.proxyContextToMainThread = GROWABLE_HEAP_I32()[a + (48 >> 2)]; - contextAttributes.renderViaOffscreenBackBuffer = GROWABLE_HEAP_I32()[a + (52 >> 2)]; - var canvas = __findCanvasEventTarget(target); - if (!canvas) { - return 0 - } - if (contextAttributes.explicitSwapControl) { - return 0 - } - var contextHandle = GL.createContext(canvas, contextAttributes); - return contextHandle - } - - function _emscripten_webgl_create_context(a0, a1) { - return _emscripten_webgl_do_create_context(a0, a1) - } - var PATH = { - splitPath: function (filename) { - var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; - return splitPathRe.exec(filename).slice(1) - }, - normalizeArray: function (parts, allowAboveRoot) { - var up = 0; - for (var i = parts.length - 1; i >= 0; i--) { - var last = parts[i]; - if (last === ".") { - parts.splice(i, 1) - } else if (last === "..") { - parts.splice(i, 1); - up++ - } else if (up) { - parts.splice(i, 1); - up-- - } - } - if (allowAboveRoot) { - for (; up; up--) { - parts.unshift("..") - } - } - return parts - }, - normalize: function (path) { - var isAbsolute = path.charAt(0) === "/", - trailingSlash = path.substr(-1) === "/"; - path = PATH.normalizeArray(path.split("/").filter(function (p) { - return !!p - }), !isAbsolute).join("/"); - if (!path && !isAbsolute) { - path = "." - } - if (path && trailingSlash) { - path += "/" - } - return (isAbsolute ? "/" : "") + path - }, - dirname: function (path) { - var result = PATH.splitPath(path), - root = result[0], - dir = result[1]; - if (!root && !dir) { - return "." - } - if (dir) { - dir = dir.substr(0, dir.length - 1) - } - return root + dir - }, - basename: function (path) { - if (path === "/") return "/"; - var lastSlash = path.lastIndexOf("/"); - if (lastSlash === -1) return path; - return path.substr(lastSlash + 1) - }, - extname: function (path) { - return PATH.splitPath(path)[3] - }, - join: function () { - var paths = Array.prototype.slice.call(arguments, 0); - return PATH.normalize(paths.join("/")) - }, - join2: function (l, r) { - return PATH.normalize(l + "/" + r) - } - }; - var SYSCALLS = { - mappings: {}, - buffers: [null, [], - [] - ], - printChar: function (stream, curr) { - var buffer = SYSCALLS.buffers[stream]; - assert(buffer); - if (curr === 0 || curr === 10) { - (stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0)); - buffer.length = 0 - } else { - buffer.push(curr) - } - }, - varargs: undefined, - get: function () { - assert(SYSCALLS.varargs != undefined); - SYSCALLS.varargs += 4; - var ret = GROWABLE_HEAP_I32()[SYSCALLS.varargs - 4 >> 2]; - return ret - }, - getStr: function (ptr) { - var ret = UTF8ToString(ptr); - return ret - }, - get64: function (low, high) { - if (low >= 0) assert(high === 0); - else assert(high === -1); - return low - } - }; - - function _fd_close(fd) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(3, 1, fd); - abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM"); - return 0 - } - - function _fd_seek(fd, offset_low, offset_high, whence, newOffset) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(4, 1, fd, offset_low, offset_high, whence, newOffset); - abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM") - } - - function _fd_write(fd, iov, iovcnt, pnum) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(5, 1, fd, iov, iovcnt, pnum); - var num = 0; - for (var i = 0; i < iovcnt; i++) { - var ptr = GROWABLE_HEAP_I32()[iov + i * 8 >> 2]; - var len = GROWABLE_HEAP_I32()[iov + (i * 8 + 4) >> 2]; - for (var j = 0; j < len; j++) { - SYSCALLS.printChar(fd, GROWABLE_HEAP_U8()[ptr + j]) - } - num += len - } - GROWABLE_HEAP_I32()[pnum >> 2] = num; - return 0 - } - - function _pthread_cleanup_pop(execute) { - var routine = PThread.exitHandlers.pop(); - if (execute) routine() - } - - function _pthread_cleanup_push(routine, arg) { - if (PThread.exitHandlers === null) { - PThread.exitHandlers = [] - } - PThread.exitHandlers.push(function () { - dynCall_vi(routine, arg) - }) - } - - function __spawn_thread(threadParams) { - if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _spawn_thread() can only ever be called from main application thread!"; - var worker = PThread.getNewWorker(); - if (worker.pthread !== undefined) throw "Internal error!"; - if (!threadParams.pthread_ptr) throw "Internal error, no pthread ptr!"; - PThread.runningWorkers.push(worker); - var tlsMemory = _malloc(128 * 4); - for (var i = 0; i < 128; ++i) { - GROWABLE_HEAP_I32()[tlsMemory + i * 4 >> 2] = 0 - } - var stackHigh = threadParams.stackBase + threadParams.stackSize; - var pthread = PThread.pthreads[threadParams.pthread_ptr] = { - worker: worker, - stackBase: threadParams.stackBase, - stackSize: threadParams.stackSize, - allocatedOwnStack: threadParams.allocatedOwnStack, - thread: threadParams.pthread_ptr, - threadInfoStruct: threadParams.pthread_ptr - }; - var tis = pthread.threadInfoStruct >> 2; - Atomics.store(GROWABLE_HEAP_U32(), tis + (0 >> 2), 0); - Atomics.store(GROWABLE_HEAP_U32(), tis + (4 >> 2), 0); - Atomics.store(GROWABLE_HEAP_U32(), tis + (8 >> 2), 0); - Atomics.store(GROWABLE_HEAP_U32(), tis + (68 >> 2), threadParams.detached); - Atomics.store(GROWABLE_HEAP_U32(), tis + (104 >> 2), tlsMemory); - Atomics.store(GROWABLE_HEAP_U32(), tis + (48 >> 2), 0); - Atomics.store(GROWABLE_HEAP_U32(), tis + (40 >> 2), pthread.threadInfoStruct); - Atomics.store(GROWABLE_HEAP_U32(), tis + (44 >> 2), 42); - Atomics.store(GROWABLE_HEAP_U32(), tis + (108 >> 2), threadParams.stackSize); - Atomics.store(GROWABLE_HEAP_U32(), tis + (84 >> 2), threadParams.stackSize); - Atomics.store(GROWABLE_HEAP_U32(), tis + (80 >> 2), stackHigh); - Atomics.store(GROWABLE_HEAP_U32(), tis + (108 + 8 >> 2), stackHigh); - Atomics.store(GROWABLE_HEAP_U32(), tis + (108 + 12 >> 2), threadParams.detached); - Atomics.store(GROWABLE_HEAP_U32(), tis + (108 + 20 >> 2), threadParams.schedPolicy); - Atomics.store(GROWABLE_HEAP_U32(), tis + (108 + 24 >> 2), threadParams.schedPrio); - var global_libc = _emscripten_get_global_libc(); - var global_locale = global_libc + 40; - Atomics.store(GROWABLE_HEAP_U32(), tis + (176 >> 2), global_locale); - worker.pthread = pthread; - var msg = { - "cmd": "run", - "start_routine": threadParams.startRoutine, - "arg": threadParams.arg, - "threadInfoStruct": threadParams.pthread_ptr, - "selfThreadId": threadParams.pthread_ptr, - "parentThreadId": threadParams.parent_pthread_ptr, - "stackBase": threadParams.stackBase, - "stackSize": threadParams.stackSize - }; - worker.runPthread = function () { - msg.time = performance.now(); - worker.postMessage(msg, threadParams.transferList) - }; - if (worker.loaded) { - worker.runPthread(); - delete worker.runPthread - } - } - - function _pthread_getschedparam(thread, policy, schedparam) { - if (!policy && !schedparam) return ERRNO_CODES.EINVAL; - if (!thread) { - err("pthread_getschedparam called with a null thread pointer!"); - return ERRNO_CODES.ESRCH - } - var self = GROWABLE_HEAP_I32()[thread + 12 >> 2]; - if (self !== thread) { - err("pthread_getschedparam attempted on thread " + thread + ", which does not point to a valid thread, or does not exist anymore!"); - return ERRNO_CODES.ESRCH - } - var schedPolicy = Atomics.load(GROWABLE_HEAP_U32(), thread + 108 + 20 >> 2); - var schedPrio = Atomics.load(GROWABLE_HEAP_U32(), thread + 108 + 24 >> 2); - if (policy) GROWABLE_HEAP_I32()[policy >> 2] = schedPolicy; - if (schedparam) GROWABLE_HEAP_I32()[schedparam >> 2] = schedPrio; - return 0 - } - - function _pthread_self() { - return __pthread_ptr | 0 - } - Module["_pthread_self"] = _pthread_self; - - function _pthread_create(pthread_ptr, attr, start_routine, arg) { - if (typeof SharedArrayBuffer === "undefined") { - err("Current environment does not support SharedArrayBuffer, pthreads are not available!"); - return 6 - } - if (!pthread_ptr) { - err("pthread_create called with a null thread pointer!"); - return 28 - } - var transferList = []; - var error = 0; - if (ENVIRONMENT_IS_PTHREAD && (transferList.length === 0 || error)) { - return _emscripten_sync_run_in_main_thread_4(687865856, pthread_ptr, attr, start_routine, arg) - } - if (error) return error; - var stackSize = 0; - var stackBase = 0; - var detached = 0; - var schedPolicy = 0; - var schedPrio = 0; - if (attr) { - stackSize = GROWABLE_HEAP_I32()[attr >> 2]; - stackSize += 81920; - stackBase = GROWABLE_HEAP_I32()[attr + 8 >> 2]; - detached = GROWABLE_HEAP_I32()[attr + 12 >> 2] !== 0; - var inheritSched = GROWABLE_HEAP_I32()[attr + 16 >> 2] === 0; - if (inheritSched) { - var prevSchedPolicy = GROWABLE_HEAP_I32()[attr + 20 >> 2]; - var prevSchedPrio = GROWABLE_HEAP_I32()[attr + 24 >> 2]; - var parentThreadPtr = PThread.currentProxiedOperationCallerThread ? PThread.currentProxiedOperationCallerThread : _pthread_self(); - _pthread_getschedparam(parentThreadPtr, attr + 20, attr + 24); - schedPolicy = GROWABLE_HEAP_I32()[attr + 20 >> 2]; - schedPrio = GROWABLE_HEAP_I32()[attr + 24 >> 2]; - GROWABLE_HEAP_I32()[attr + 20 >> 2] = prevSchedPolicy; - GROWABLE_HEAP_I32()[attr + 24 >> 2] = prevSchedPrio - } else { - schedPolicy = GROWABLE_HEAP_I32()[attr + 20 >> 2]; - schedPrio = GROWABLE_HEAP_I32()[attr + 24 >> 2] - } - } else { - stackSize = 2097152 - } - var allocatedOwnStack = stackBase == 0; - if (allocatedOwnStack) { - stackBase = _memalign(16, stackSize) - } else { - stackBase -= stackSize; - assert(stackBase > 0) - } - var threadInfoStruct = _malloc(232); - for (var i = 0; i < 232 >> 2; ++i) GROWABLE_HEAP_U32()[(threadInfoStruct >> 2) + i] = 0; - GROWABLE_HEAP_I32()[pthread_ptr >> 2] = threadInfoStruct; - GROWABLE_HEAP_I32()[threadInfoStruct + 12 >> 2] = threadInfoStruct; - var headPtr = threadInfoStruct + 156; - GROWABLE_HEAP_I32()[headPtr >> 2] = headPtr; - var threadParams = { - stackBase: stackBase, - stackSize: stackSize, - allocatedOwnStack: allocatedOwnStack, - schedPolicy: schedPolicy, - schedPrio: schedPrio, - detached: detached, - startRoutine: start_routine, - pthread_ptr: threadInfoStruct, - parent_pthread_ptr: _pthread_self(), - arg: arg, - transferList: transferList - }; - if (ENVIRONMENT_IS_PTHREAD) { - threadParams.cmd = "spawnThread"; - postMessage(threadParams, transferList) - } else { - __spawn_thread(threadParams) - } - return 0 - } - - function _roundf(d) { - d = +d; - return d >= +0 ? +Math_floor(d + +.5) : +Math_ceil(d - +.5) - } - if (!ENVIRONMENT_IS_PTHREAD) PThread.initMainThreadBlock(); - else PThread.initWorker(); - var GLctx; - GL.init(); - var proxiedFunctionTable = [null, _atexit, _emscripten_set_canvas_element_size_main_thread, _fd_close, _fd_seek, _fd_write]; - var asmLibraryArg = { - "__assert_fail": ___assert_fail, - "__handle_stack_overflow": ___handle_stack_overflow, - "_emscripten_notify_thread_queue": __emscripten_notify_thread_queue, - "abort": _abort, - "emscripten_conditional_set_current_thread_status": _emscripten_conditional_set_current_thread_status, - "emscripten_futex_wait": _emscripten_futex_wait, - "emscripten_futex_wake": _emscripten_futex_wake, - "emscripten_get_now": _emscripten_get_now, - "emscripten_is_main_browser_thread": _emscripten_is_main_browser_thread, - "emscripten_is_main_runtime_thread": _emscripten_is_main_runtime_thread, - "emscripten_memcpy_big": _emscripten_memcpy_big, - "emscripten_receive_on_main_thread_js": _emscripten_receive_on_main_thread_js, - "emscripten_resize_heap": _emscripten_resize_heap, - "emscripten_set_canvas_element_size": _emscripten_set_canvas_element_size, - "emscripten_set_current_thread_status": _emscripten_set_current_thread_status, - "emscripten_webgl_create_context": _emscripten_webgl_create_context, - "fd_close": _fd_close, - "fd_seek": _fd_seek, - "fd_write": _fd_write, - "initPthreadsJS": initPthreadsJS, - "memory": wasmMemory || Module["wasmMemory"], - "pthread_cleanup_pop": _pthread_cleanup_pop, - "pthread_cleanup_push": _pthread_cleanup_push, - "pthread_create": _pthread_create, - "pthread_self": _pthread_self, - "roundf": _roundf, - "table": wasmTable - }; - var asm = createWasm(); - Module["asm"] = asm; - var ___wasm_call_ctors = Module["___wasm_call_ctors"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["__wasm_call_ctors"].apply(null, arguments) - }; - var _init = Module["_init"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["init"].apply(null, arguments) - }; - var _register_tensor = Module["_register_tensor"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["register_tensor"].apply(null, arguments) - }; - var _dispose_data = Module["_dispose_data"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["dispose_data"].apply(null, arguments) - }; - var _dispose = Module["_dispose"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["dispose"].apply(null, arguments) - }; - var _Abs = Module["_Abs"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Abs"].apply(null, arguments) - }; - var _Add = Module["_Add"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Add"].apply(null, arguments) - }; - var _AddN = Module["_AddN"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["AddN"].apply(null, arguments) - }; - var _ArgMax = Module["_ArgMax"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["ArgMax"].apply(null, arguments) - }; - var _AvgPool = Module["_AvgPool"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["AvgPool"].apply(null, arguments) - }; - var _BatchMatMul = Module["_BatchMatMul"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["BatchMatMul"].apply(null, arguments) - }; - var _ClipByValue = Module["_ClipByValue"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["ClipByValue"].apply(null, arguments) - }; - var _Conv2D = Module["_Conv2D"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Conv2D"].apply(null, arguments) - }; - var _Cos = Module["_Cos"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Cos"].apply(null, arguments) - }; - var _CropAndResize = Module["_CropAndResize"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["CropAndResize"].apply(null, arguments) - }; - var _DepthwiseConv2dNative = Module["_DepthwiseConv2dNative"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["DepthwiseConv2dNative"].apply(null, arguments) - }; - var _Div = Module["_Div"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Div"].apply(null, arguments) - }; - var _Exp = Module["_Exp"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Exp"].apply(null, arguments) - }; - var _FloorDiv = Module["_FloorDiv"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["FloorDiv"].apply(null, arguments) - }; - var _FusedBatchNorm = Module["_FusedBatchNorm"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["FusedBatchNorm"].apply(null, arguments) - }; - var _FusedConv2D = Module["_FusedConv2D"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["FusedConv2D"].apply(null, arguments) - }; - var _FusedDepthwiseConv2D = Module["_FusedDepthwiseConv2D"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["FusedDepthwiseConv2D"].apply(null, arguments) - }; - var _Gather = Module["_Gather"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Gather"].apply(null, arguments) - }; - var _GatherNd = Module["_GatherNd"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["GatherNd"].apply(null, arguments) - }; - var _Greater = Module["_Greater"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Greater"].apply(null, arguments) - }; - var _GreaterEqual = Module["_GreaterEqual"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["GreaterEqual"].apply(null, arguments) - }; - var _Less = Module["_Less"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Less"].apply(null, arguments) - }; - var _LessEqual = Module["_LessEqual"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["LessEqual"].apply(null, arguments) - }; - var _Log = Module["_Log"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Log"].apply(null, arguments) - }; - var _LogicalAnd = Module["_LogicalAnd"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["LogicalAnd"].apply(null, arguments) - }; - var _Max = Module["_Max"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Max"].apply(null, arguments) - }; - var _MaxPool = Module["_MaxPool"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["MaxPool"].apply(null, arguments) - }; - var _Maximum = Module["_Maximum"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Maximum"].apply(null, arguments) - }; - var _Min = Module["_Min"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Min"].apply(null, arguments) - }; - var _Minimum = Module["_Minimum"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Minimum"].apply(null, arguments) - }; - var _Mul = Module["_Mul"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Mul"].apply(null, arguments) - }; - var _Neg = Module["_Neg"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Neg"].apply(null, arguments) - }; - var _NonMaxSuppressionV3 = Module["_NonMaxSuppressionV3"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["NonMaxSuppressionV3"].apply(null, arguments) - }; - var _NonMaxSuppressionV5 = Module["_NonMaxSuppressionV5"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["NonMaxSuppressionV5"].apply(null, arguments) - }; - var _NotEqual = Module["_NotEqual"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["NotEqual"].apply(null, arguments) - }; - var _PadV2 = Module["_PadV2"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["PadV2"].apply(null, arguments) - }; - var _Pow = Module["_Pow"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Pow"].apply(null, arguments) - }; - var _Prelu = Module["_Prelu"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Prelu"].apply(null, arguments) - }; - var _Relu = Module["_Relu"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Relu"].apply(null, arguments) - }; - var _Relu6 = Module["_Relu6"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Relu6"].apply(null, arguments) - }; - var _ResizeBilinear = Module["_ResizeBilinear"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["ResizeBilinear"].apply(null, arguments) - }; - var _Rsqrt = Module["_Rsqrt"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Rsqrt"].apply(null, arguments) - }; - var _ScatterNd = Module["_ScatterNd"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["ScatterNd"].apply(null, arguments) - }; - var _Sigmoid = Module["_Sigmoid"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Sigmoid"].apply(null, arguments) - }; - var _Sin = Module["_Sin"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Sin"].apply(null, arguments) - }; - var _Softmax = Module["_Softmax"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Softmax"].apply(null, arguments) - }; - var _Square = Module["_Square"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Square"].apply(null, arguments) - }; - var _Sub = Module["_Sub"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Sub"].apply(null, arguments) - }; - var _Sum = Module["_Sum"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Sum"].apply(null, arguments) - }; - var _Tanh = Module["_Tanh"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Tanh"].apply(null, arguments) - }; - var _Tile = Module["_Tile"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Tile"].apply(null, arguments) - }; - var _Transpose = Module["_Transpose"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Transpose"].apply(null, arguments) - }; - var __FusedMatMul = Module["__FusedMatMul"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["_FusedMatMul"].apply(null, arguments) - }; - var _malloc = Module["_malloc"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["malloc"].apply(null, arguments) - }; - var _free = Module["_free"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["free"].apply(null, arguments) - }; - var ___em_js__initPthreadsJS = Module["___em_js__initPthreadsJS"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["__em_js__initPthreadsJS"].apply(null, arguments) - }; - var _emscripten_get_global_libc = Module["_emscripten_get_global_libc"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_get_global_libc"].apply(null, arguments) - }; - var _memalign = Module["_memalign"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["memalign"].apply(null, arguments) - }; - var ___pthread_tsd_run_dtors = Module["___pthread_tsd_run_dtors"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["__pthread_tsd_run_dtors"].apply(null, arguments) - }; - var _emscripten_main_thread_process_queued_calls = Module["_emscripten_main_thread_process_queued_calls"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null, arguments) - }; - var _emscripten_current_thread_process_queued_calls = Module["_emscripten_current_thread_process_queued_calls"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null, arguments) - }; - var _emscripten_register_main_browser_thread_id = Module["_emscripten_register_main_browser_thread_id"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null, arguments) - }; - var _emscripten_main_browser_thread_id = Module["_emscripten_main_browser_thread_id"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_main_browser_thread_id"].apply(null, arguments) - }; - var _emscripten_async_run_in_main_thread = Module["_emscripten_async_run_in_main_thread"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread = Module["_emscripten_sync_run_in_main_thread"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_0 = Module["_emscripten_sync_run_in_main_thread_0"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_1 = Module["_emscripten_sync_run_in_main_thread_1"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_2 = Module["_emscripten_sync_run_in_main_thread_2"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_xprintf_varargs = Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_3 = Module["_emscripten_sync_run_in_main_thread_3"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_4 = Module["_emscripten_sync_run_in_main_thread_4"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_5 = Module["_emscripten_sync_run_in_main_thread_5"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_6 = Module["_emscripten_sync_run_in_main_thread_6"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_7 = Module["_emscripten_sync_run_in_main_thread_7"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null, arguments) - }; - var _emscripten_run_in_main_runtime_thread_js = Module["_emscripten_run_in_main_runtime_thread_js"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null, arguments) - }; - var _emscripten_async_queue_on_thread_ = Module["_emscripten_async_queue_on_thread_"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null, arguments) - }; - var _emscripten_tls_init = Module["_emscripten_tls_init"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_tls_init"].apply(null, arguments) - }; - var ___set_stack_limit = Module["___set_stack_limit"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["__set_stack_limit"].apply(null, arguments) - }; - var stackSave = Module["stackSave"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["stackSave"].apply(null, arguments) - }; - var stackAlloc = Module["stackAlloc"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["stackAlloc"].apply(null, arguments) - }; - var stackRestore = Module["stackRestore"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["stackRestore"].apply(null, arguments) - }; - var dynCall_vi = Module["dynCall_vi"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["dynCall_vi"].apply(null, arguments) - }; - var dynCall_v = Module["dynCall_v"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["dynCall_v"].apply(null, arguments) - }; - var dynCall_ii = Module["dynCall_ii"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["dynCall_ii"].apply(null, arguments) - }; - Module["asm"] = asm; - if (!Object.getOwnPropertyDescriptor(Module, "intArrayFromString")) Module["intArrayFromString"] = function () { - abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "intArrayToString")) Module["intArrayToString"] = function () { - abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "ccall")) Module["ccall"] = function () { - abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - Module["cwrap"] = cwrap; - if (!Object.getOwnPropertyDescriptor(Module, "setValue")) Module["setValue"] = function () { - abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getValue")) Module["getValue"] = function () { - abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "allocate")) Module["allocate"] = function () { - abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getMemory")) Module["getMemory"] = function () { - abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "UTF8ArrayToString")) Module["UTF8ArrayToString"] = function () { - abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "UTF8ToString")) Module["UTF8ToString"] = function () { - abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8Array")) Module["stringToUTF8Array"] = function () { - abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8")) Module["stringToUTF8"] = function () { - abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF8")) Module["lengthBytesUTF8"] = function () { - abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function () { - abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "addOnPreRun")) Module["addOnPreRun"] = function () { - abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "addOnInit")) Module["addOnInit"] = function () { - abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "addOnPreMain")) Module["addOnPreMain"] = function () { - abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "addOnExit")) Module["addOnExit"] = function () { - abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "addOnPostRun")) Module["addOnPostRun"] = function () { - abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeStringToMemory")) Module["writeStringToMemory"] = function () { - abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeArrayToMemory")) Module["writeArrayToMemory"] = function () { - abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeAsciiToMemory")) Module["writeAsciiToMemory"] = function () { - abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "addRunDependency")) Module["addRunDependency"] = function () { - abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "removeRunDependency")) Module["removeRunDependency"] = function () { - abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createFolder")) Module["FS_createFolder"] = function () { - abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createPath")) Module["FS_createPath"] = function () { - abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createDataFile")) Module["FS_createDataFile"] = function () { - abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createPreloadedFile")) Module["FS_createPreloadedFile"] = function () { - abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createLazyFile")) Module["FS_createLazyFile"] = function () { - abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createLink")) Module["FS_createLink"] = function () { - abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createDevice")) Module["FS_createDevice"] = function () { - abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_unlink")) Module["FS_unlink"] = function () { - abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "dynamicAlloc")) Module["dynamicAlloc"] = function () { - abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "loadDynamicLibrary")) Module["loadDynamicLibrary"] = function () { - abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "loadWebAssemblyModule")) Module["loadWebAssemblyModule"] = function () { - abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getLEB")) Module["getLEB"] = function () { - abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getFunctionTables")) Module["getFunctionTables"] = function () { - abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "alignFunctionTables")) Module["alignFunctionTables"] = function () { - abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "registerFunctions")) Module["registerFunctions"] = function () { - abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "addFunction")) Module["addFunction"] = function () { - abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "removeFunction")) Module["removeFunction"] = function () { - abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getFuncWrapper")) Module["getFuncWrapper"] = function () { - abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "prettyPrint")) Module["prettyPrint"] = function () { - abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "makeBigInt")) Module["makeBigInt"] = function () { - abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "dynCall")) Module["dynCall"] = function () { - abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getCompilerSetting")) Module["getCompilerSetting"] = function () { - abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "print")) Module["print"] = function () { - abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "printErr")) Module["printErr"] = function () { - abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getTempRet0")) Module["getTempRet0"] = function () { - abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "setTempRet0")) Module["setTempRet0"] = function () { - abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "callMain")) Module["callMain"] = function () { - abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "abort")) Module["abort"] = function () { - abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToNewUTF8")) Module["stringToNewUTF8"] = function () { - abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "emscripten_realloc_buffer")) Module["emscripten_realloc_buffer"] = function () { - abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "ENV")) Module["ENV"] = function () { - abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "setjmpId")) Module["setjmpId"] = function () { - abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_CODES")) Module["ERRNO_CODES"] = function () { - abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_MESSAGES")) Module["ERRNO_MESSAGES"] = function () { - abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "setErrNo")) Module["setErrNo"] = function () { - abort("'setErrNo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "DNS")) Module["DNS"] = function () { - abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "GAI_ERRNO_MESSAGES")) Module["GAI_ERRNO_MESSAGES"] = function () { - abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "Protocols")) Module["Protocols"] = function () { - abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "Sockets")) Module["Sockets"] = function () { - abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "UNWIND_CACHE")) Module["UNWIND_CACHE"] = function () { - abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "readAsmConstArgs")) Module["readAsmConstArgs"] = function () { - abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "jstoi_q")) Module["jstoi_q"] = function () { - abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "jstoi_s")) Module["jstoi_s"] = function () { - abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "PATH")) Module["PATH"] = function () { - abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "PATH_FS")) Module["PATH_FS"] = function () { - abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "SYSCALLS")) Module["SYSCALLS"] = function () { - abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "syscallMmap2")) Module["syscallMmap2"] = function () { - abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "syscallMunmap")) Module["syscallMunmap"] = function () { - abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "flush_NO_FILESYSTEM")) Module["flush_NO_FILESYSTEM"] = function () { - abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "JSEvents")) Module["JSEvents"] = function () { - abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "demangle")) Module["demangle"] = function () { - abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "demangleAll")) Module["demangleAll"] = function () { - abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "jsStackTrace")) Module["jsStackTrace"] = function () { - abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function () { - abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getEnvStrings")) Module["getEnvStrings"] = function () { - abort("'getEnvStrings' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64")) Module["writeI53ToI64"] = function () { - abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Clamped")) Module["writeI53ToI64Clamped"] = function () { - abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Signaling")) Module["writeI53ToI64Signaling"] = function () { - abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Clamped")) Module["writeI53ToU64Clamped"] = function () { - abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Signaling")) Module["writeI53ToU64Signaling"] = function () { - abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "readI53FromI64")) Module["readI53FromI64"] = function () { - abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "readI53FromU64")) Module["readI53FromU64"] = function () { - abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "convertI32PairToI53")) Module["convertI32PairToI53"] = function () { - abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "convertU32PairToI53")) Module["convertU32PairToI53"] = function () { - abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "Browser")) Module["Browser"] = function () { - abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "GL")) Module["GL"] = function () { - abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGet")) Module["emscriptenWebGLGet"] = function () { - abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetTexPixelData")) Module["emscriptenWebGLGetTexPixelData"] = function () { - abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetUniform")) Module["emscriptenWebGLGetUniform"] = function () { - abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetVertexAttrib")) Module["emscriptenWebGLGetVertexAttrib"] = function () { - abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "AL")) Module["AL"] = function () { - abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "SDL_unicode")) Module["SDL_unicode"] = function () { - abort("'SDL_unicode' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "SDL_ttfContext")) Module["SDL_ttfContext"] = function () { - abort("'SDL_ttfContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "SDL_audio")) Module["SDL_audio"] = function () { - abort("'SDL_audio' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "SDL")) Module["SDL"] = function () { - abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "SDL_gfx")) Module["SDL_gfx"] = function () { - abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "GLUT")) Module["GLUT"] = function () { - abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "EGL")) Module["EGL"] = function () { - abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "GLFW_Window")) Module["GLFW_Window"] = function () { - abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "GLFW")) Module["GLFW"] = function () { - abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "GLEW")) Module["GLEW"] = function () { - abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "IDBStore")) Module["IDBStore"] = function () { - abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "runAndAbortIfError")) Module["runAndAbortIfError"] = function () { - abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - Module["PThread"] = PThread; - if (!Object.getOwnPropertyDescriptor(Module, "establishStackSpace")) Module["establishStackSpace"] = function () { - abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getNoExitRuntime")) Module["getNoExitRuntime"] = function () { - abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "resetPrototype")) Module["resetPrototype"] = function () { - abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "warnOnce")) Module["warnOnce"] = function () { - abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stackSave")) Module["stackSave"] = function () { - abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stackRestore")) Module["stackRestore"] = function () { - abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stackAlloc")) Module["stackAlloc"] = function () { - abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "AsciiToString")) Module["AsciiToString"] = function () { - abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToAscii")) Module["stringToAscii"] = function () { - abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "UTF16ToString")) Module["UTF16ToString"] = function () { - abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF16")) Module["stringToUTF16"] = function () { - abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF16")) Module["lengthBytesUTF16"] = function () { - abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "UTF32ToString")) Module["UTF32ToString"] = function () { - abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF32")) Module["stringToUTF32"] = function () { - abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF32")) Module["lengthBytesUTF32"] = function () { - abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8")) Module["allocateUTF8"] = function () { - abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8OnStack")) Module["allocateUTF8OnStack"] = function () { - abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - Module["writeStackCookie"] = writeStackCookie; - Module["checkStackCookie"] = checkStackCookie; - Module["abortStackOverflow"] = abortStackOverflow; - Module["PThread"] = PThread; - Module["_pthread_self"] = _pthread_self; - Module["wasmMemory"] = wasmMemory; - Module["ExitStatus"] = ExitStatus; - if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NORMAL")) Object.defineProperty(Module, "ALLOC_NORMAL", { - configurable: true, - get: function () { - abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_STACK")) Object.defineProperty(Module, "ALLOC_STACK", { - configurable: true, - get: function () { - abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_DYNAMIC")) Object.defineProperty(Module, "ALLOC_DYNAMIC", { - configurable: true, - get: function () { - abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NONE")) Object.defineProperty(Module, "ALLOC_NONE", { - configurable: true, - get: function () { - abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - } - }); - var calledRun; - Module["then"] = function (func) { - if (calledRun) { - func(Module) - } else { - var old = Module["onRuntimeInitialized"]; - Module["onRuntimeInitialized"] = function () { - if (old) old(); - func(Module) - } - } - return Module - }; - - function ExitStatus(status) { - this.name = "ExitStatus"; - this.message = "Program terminated with exit(" + status + ")"; - this.status = status - } - dependenciesFulfilled = function runCaller() { - if (!calledRun) run(); - if (!calledRun) dependenciesFulfilled = runCaller - }; - - function run(args) { - args = args || arguments_; - if (runDependencies > 0) { - return - } - writeStackCookie(); - preRun(); - if (runDependencies > 0) return; +function(WasmBackendModule) { + WasmBackendModule = WasmBackendModule || {}; - function doRun() { - if (calledRun) return; - calledRun = true; - Module["calledRun"] = true; - if (ABORT) return; - initRuntime(); - preMain(); - if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"](); - assert(!Module["_main"], 'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'); - postRun() - } - if (Module["setStatus"]) { - Module["setStatus"]("Running..."); - setTimeout(function () { - setTimeout(function () { - Module["setStatus"]("") - }, 1); - doRun() - }, 1) - } else { - doRun() - } - checkStackCookie() - } - Module["run"] = run; - if (Module["preInit"]) { - if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]]; - while (Module["preInit"].length > 0) { - Module["preInit"].pop()() - } - } - if (!ENVIRONMENT_IS_PTHREAD) noExitRuntime = true; - if (!ENVIRONMENT_IS_PTHREAD) run(); +function GROWABLE_HEAP_I8(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAP8}function GROWABLE_HEAP_U8(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPU8}function GROWABLE_HEAP_I32(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAP32}function GROWABLE_HEAP_U32(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPU32}function GROWABLE_HEAP_F64(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPF64}var Module=typeof WasmBackendModule!=="undefined"?WasmBackendModule:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(Module["ENVIRONMENT"]){throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)")}var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"];DYNAMIC_BASE=Module["DYNAMIC_BASE"];DYNAMICTOP_PTR=Module["DYNAMICTOP_PTR"]}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{throw new Error("environment detection error")}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(!Object.getOwnPropertyDescriptor(Module,"arguments"))Object.defineProperty(Module,"arguments",{configurable:true,get:function(){abort("Module.arguments has been replaced with plain arguments_")}});if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(!Object.getOwnPropertyDescriptor(Module,"thisProgram"))Object.defineProperty(Module,"thisProgram",{configurable:true,get:function(){abort("Module.thisProgram has been replaced with plain thisProgram")}});if(Module["quit"])quit_=Module["quit"];if(!Object.getOwnPropertyDescriptor(Module,"quit"))Object.defineProperty(Module,"quit",{configurable:true,get:function(){abort("Module.quit has been replaced with plain quit_")}});assert(typeof Module["memoryInitializerPrefixURL"]==="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["pthreadMainPrefixURL"]==="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["cdInitializerPrefixURL"]==="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["filePackagePrefixURL"]==="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["read"]==="undefined","Module.read option was removed (modify read_ in JS)");assert(typeof Module["readAsync"]==="undefined","Module.readAsync option was removed (modify readAsync in JS)");assert(typeof Module["readBinary"]==="undefined","Module.readBinary option was removed (modify readBinary in JS)");assert(typeof Module["setWindowTitle"]==="undefined","Module.setWindowTitle option was removed (modify setWindowTitle in JS)");assert(typeof Module["TOTAL_MEMORY"]==="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY");if(!Object.getOwnPropertyDescriptor(Module,"read"))Object.defineProperty(Module,"read",{configurable:true,get:function(){abort("Module.read has been replaced with plain read_")}});if(!Object.getOwnPropertyDescriptor(Module,"readAsync"))Object.defineProperty(Module,"readAsync",{configurable:true,get:function(){abort("Module.readAsync has been replaced with plain readAsync")}});if(!Object.getOwnPropertyDescriptor(Module,"readBinary"))Object.defineProperty(Module,"readBinary",{configurable:true,get:function(){abort("Module.readBinary has been replaced with plain readBinary")}});if(!Object.getOwnPropertyDescriptor(Module,"setWindowTitle"))Object.defineProperty(Module,"setWindowTitle",{configurable:true,get:function(){abort("Module.setWindowTitle has been replaced with plain setWindowTitle")}});assert(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER||ENVIRONMENT_IS_NODE,"Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)");var stackSave;var stackRestore;var stackAlloc;stackSave=stackRestore=stackAlloc=function(){abort("cannot use the stack before compiled code is ready to run, and has provided stack access")};function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(!Object.getOwnPropertyDescriptor(Module,"wasmBinary"))Object.defineProperty(Module,"wasmBinary",{configurable:true,get:function(){abort("Module.wasmBinary has been replaced with plain wasmBinary")}});var noExitRuntime;if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(!Object.getOwnPropertyDescriptor(Module,"noExitRuntime"))Object.defineProperty(Module,"noExitRuntime",{configurable:true,get:function(){abort("Module.noExitRuntime has been replaced with plain noExitRuntime")}});if(typeof WebAssembly!=="object"){abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.")}var wasmMemory;var wasmTable=new WebAssembly.Table({"initial":118,"maximum":118+0,"element":"anyfunc"});var wasmModule;var threadInfoStruct=0;var selfThreadId=0;var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string")return UTF8ToString(ret);if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{if((u0&248)!=240)warnOnce("Invalid UTF-8 leading byte 0x"+u0.toString(16)+" encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!");u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(GROWABLE_HEAP_U8(),ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;if(u>=2097152)warnOnce("Invalid Unicode code point 0x"+u.toString(16)+" encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF).");heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,GROWABLE_HEAP_U8(),outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");GROWABLE_HEAP_I8().set(array,buffer)}var WASM_PAGE_SIZE=65536;function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var STACK_BASE=5255808,STACKTOP=STACK_BASE,STACK_MAX=12928,DYNAMIC_BASE=5255808,DYNAMICTOP_PTR=12e3;assert(STACK_BASE%16===0,"stack must start aligned");assert(DYNAMIC_BASE%16===0,"heap must start aligned");if(ENVIRONMENT_IS_PTHREAD){STACK_MAX=STACKTOP=STACK_MAX=2147483647}var TOTAL_STACK=5242880;if(Module["TOTAL_STACK"])assert(TOTAL_STACK===Module["TOTAL_STACK"],"the stack size can no longer be determined at runtime");var INITIAL_INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(!Object.getOwnPropertyDescriptor(Module,"INITIAL_MEMORY"))Object.defineProperty(Module,"INITIAL_MEMORY",{configurable:true,get:function(){abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY")}});assert(INITIAL_INITIAL_MEMORY>=TOTAL_STACK,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+INITIAL_INITIAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");assert(typeof Int32Array!=="undefined"&&typeof Float64Array!=="undefined"&&Int32Array.prototype.subarray!==undefined&&Int32Array.prototype.set!==undefined,"JS engine does not provide full typed array support");if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,"maximum":1073741824/WASM_PAGE_SIZE,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_INITIAL_MEMORY=buffer.byteLength;assert(INITIAL_INITIAL_MEMORY%WASM_PAGE_SIZE===0);assert(65536%WASM_PAGE_SIZE===0);updateGlobalBufferAndViews(buffer);if(!ENVIRONMENT_IS_PTHREAD){GROWABLE_HEAP_I32()[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE}function writeStackCookie(){assert((STACK_MAX&3)==0);GROWABLE_HEAP_U32()[(STACK_MAX>>2)+1]=34821223;GROWABLE_HEAP_U32()[(STACK_MAX>>2)+2]=2310721022;GROWABLE_HEAP_I32()[0]=1668509029}function checkStackCookie(){var cookie1=GROWABLE_HEAP_U32()[(STACK_MAX>>2)+1];var cookie2=GROWABLE_HEAP_U32()[(STACK_MAX>>2)+2];if(cookie1!=34821223||cookie2!=2310721022){abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+cookie2.toString(16)+" "+cookie1.toString(16))}if(GROWABLE_HEAP_I32()[0]!==1668509029)abort("Runtime error: The application has corrupted its heap memory area (address zero)!")}function abortStackOverflow(allocSize){abort("Stack overflow! Attempted to allocate "+allocSize+" bytes on the stack, but stack has only "+(STACK_MAX-stackSave()+allocSize)+" bytes available!")}(function(){var h16=new Int16Array(1);var h8=new Int8Array(h16.buffer);h16[0]=25459;if(h8[0]!==115||h8[1]!==99)throw"Runtime error: expected the system to be little-endian!"})();function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;if(ENVIRONMENT_IS_PTHREAD)runtimeInitialized=true;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){checkStackCookie();assert(!runtimeInitialized);runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATMAIN__)}function postRun(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Math_ceil=Math.ceil;var Math_floor=Math.floor;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!=="undefined"){runDependencyWatcher=setInterval(function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;err("still waiting on run dependencies:")}err("dependency: "+dep)}if(shown){err("(end of list)")}},1e4)}}else{err("warning: run dependency added without ID")}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id]}else{err("warning: run dependency removed without ID")}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";out(what);err(what);ABORT=true;EXITSTATUS=1;var output="abort("+what+") at "+stackTrace();what=output;throw new WebAssembly.RuntimeError(what)}var FS={error:function(){abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1")},init:function(){FS.error()},createDataFile:function(){FS.error()},createPreloadedFile:function(){FS.error()},createLazyFile:function(){FS.error()},open:function(){FS.error()},mkdev:function(){FS.error()},registerDevice:function(){FS.error()},analyzePath:function(){FS.error()},loadFilesFromDB:function(){FS.error()},ErrnoError:function ErrnoError(){FS.error()}};Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;function hasPrefix(str,prefix){return String.prototype.startsWith?str.startsWith(prefix):str.indexOf(prefix)===0}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return hasPrefix(filename,dataURIPrefix)}var fileURIPrefix="file://";function isFileURI(filename){return hasPrefix(filename,fileURIPrefix)}var wasmBinaryFile="tfjs-backend-wasm.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(){try{if(wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(wasmBinaryFile)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary()})}return new Promise(function(resolve,reject){resolve(getBinary())})}function createWasm(){var info={"env":asmLibraryArg,"wasi_snapshot_preview1":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){var numWorkersToLoad=PThread.unusedWorkers.length;PThread.unusedWorkers.forEach(function(w){PThread.loadWasmModuleToWorker(w,function(){if(!--numWorkersToLoad)removeRunDependency("wasm-instantiate")})})}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}var trueModule=Module;function receiveInstantiatedSource(output){assert(Module===trueModule,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");trueModule=null;receiveInstance(output["instance"],output["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var ASM_CONSTS={};function initPthreadsJS(){PThread.initRuntime()}if(!ENVIRONMENT_IS_PTHREAD)__ATINIT__.push({func:function(){___wasm_call_ctors()}});function demangle(func){warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return func}function demangleAll(text){var regex=/\b_Z[\w\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"})}var __pthread_ptr=0;var __pthread_is_main_runtime_thread=0;var __pthread_is_main_browser_thread=0;function __register_pthread_ptr(pthreadPtr,isMainBrowserThread,isMainRuntimeThread){pthreadPtr=pthreadPtr|0;isMainBrowserThread=isMainBrowserThread|0;isMainRuntimeThread=isMainRuntimeThread|0;__pthread_ptr=pthreadPtr;__pthread_is_main_browser_thread=isMainBrowserThread;__pthread_is_main_runtime_thread=isMainRuntimeThread}Module["__register_pthread_ptr"]=__register_pthread_ptr;var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var __main_thread_futex_wait_address=12912;function _emscripten_futex_wake(addr,count){if(addr<=0||addr>GROWABLE_HEAP_I8().length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(GROWABLE_HEAP_I32(),addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function __kill_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _kill_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _kill_thread!";GROWABLE_HEAP_I32()[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function __cancel_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cancel_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cancel_thread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function __cleanup_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cleanup_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cleanup_thread!";GROWABLE_HEAP_I32()[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];if(pthread){var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={MAIN_THREAD_ID:1,mainThreadInfo:{schedPolicy:0,schedPrio:0},unusedWorkers:[],runningWorkers:[],initRuntime:function(){__register_pthread_ptr(PThread.mainThreadBlock,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(PThread.mainThreadBlock)},initMainThreadBlock:function(){assert(!ENVIRONMENT_IS_PTHREAD);var pthreadPoolSize=8;for(var i=0;i>2]=PThread.mainThreadBlock;var headPtr=PThread.mainThreadBlock+156;GROWABLE_HEAP_I32()[headPtr>>2]=headPtr;var tlsMemory=12400;for(var i=0;i<128;++i)GROWABLE_HEAP_U32()[tlsMemory/4+i]=0;Atomics.store(GROWABLE_HEAP_U32(),PThread.mainThreadBlock+104>>2,tlsMemory);Atomics.store(GROWABLE_HEAP_U32(),PThread.mainThreadBlock+40>>2,PThread.mainThreadBlock);Atomics.store(GROWABLE_HEAP_U32(),PThread.mainThreadBlock+44>>2,42)},initWorker:function(){},pthreads:{},exitHandlers:null,setThreadStatus:function(){},runExitHandlers:function(){if(PThread.exitHandlers!==null){while(PThread.exitHandlers.length>0){PThread.exitHandlers.pop()()}PThread.exitHandlers=null}if(ENVIRONMENT_IS_PTHREAD&&threadInfoStruct)___pthread_tsd_run_dtors()},threadExit:function(exitCode){var tb=_pthread_self();if(tb){err("Pthread 0x"+tb.toString(16)+" exited.");Atomics.store(GROWABLE_HEAP_U32(),tb+4>>2,exitCode);Atomics.store(GROWABLE_HEAP_U32(),tb+0>>2,1);Atomics.store(GROWABLE_HEAP_U32(),tb+60>>2,1);Atomics.store(GROWABLE_HEAP_U32(),tb+64>>2,0);PThread.runExitHandlers();_emscripten_futex_wake(tb+0,2147483647);__register_pthread_ptr(0,0,0);threadInfoStruct=0;if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlers();Atomics.store(GROWABLE_HEAP_U32(),threadInfoStruct+4>>2,-1);Atomics.store(GROWABLE_HEAP_U32(),threadInfoStruct+0>>2,1);_emscripten_futex_wake(threadInfoStruct+0,2147483647);threadInfoStruct=selfThreadId=0;__register_pthread_ptr(0,0,0);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];GROWABLE_HEAP_I32()[pthread.threadInfoStruct+104>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){delete PThread.pthreads[worker.pthread.thread];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined},receiveObjectTransfer:function(data){},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){__spawn_thread(e.data)}else if(cmd==="cleanupThread"){__cleanup_thread(d["thread"])}else if(cmd==="killThread"){__kill_thread(d["thread"])}else if(cmd==="cancelThread"){__cancel_thread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(GROWABLE_HEAP_U32(),worker.pthread.thread+68>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){console.log("worker exited - TODO: update the worker queue?")})}assert(wasmMemory instanceof WebAssembly.Memory,"WebAssembly memory should have been loaded by now!");assert(wasmModule instanceof WebAssembly.Module,"WebAssembly Module should have been loaded by now!");worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule,"DYNAMIC_BASE":DYNAMIC_BASE,"DYNAMICTOP_PTR":DYNAMICTOP_PTR})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("tfjs-backend-wasm.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}if(PThread.unusedWorkers.length>0)return PThread.unusedWorkers.pop();else return null},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()GROWABLE_HEAP_I8().length||addr&3!=0)return-28;if(ENVIRONMENT_IS_WORKER){var ret=Atomics.wait(GROWABLE_HEAP_I32(),addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{var loadedVal=Atomics.load(GROWABLE_HEAP_I32(),addr>>2);if(val!=loadedVal)return-6;var tNow=performance.now();var tEnd=tNow+timeout;Atomics.store(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2,addr);var ourWaitAddress=addr;while(addr==ourWaitAddress){tNow=performance.now();if(tNow>tEnd){return-73}_emscripten_main_thread_process_queued_calls();addr=Atomics.load(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2)}return 0}}function _emscripten_is_main_browser_thread(){return __pthread_is_main_browser_thread|0}function _emscripten_is_main_runtime_thread(){return __pthread_is_main_runtime_thread|0}function _emscripten_memcpy_big(dest,src,num){GROWABLE_HEAP_U8().copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;if(numCallArgs>20-1)throw"emscripten_proxy_to_main_thread_js: Too many arguments "+numCallArgs+" to proxied function idx="+index+", maximum supported is "+(20-1)+"!";var stack=stackSave();var args=stackAlloc(numCallArgs*8);var b=args>>3;for(var i=0;i>3]);buf+=8}else if(ch===105){buf=buf+3&~3;args.push(GROWABLE_HEAP_I32()[buf>>2]);buf+=4}else abort("unexpected char in asm const signature "+ch)}return args}function _emscripten_receive_on_main_thread_js(index,numCallArgs,args){_emscripten_receive_on_main_thread_js_callArgs.length=numCallArgs;var b=args>>3;for(var i=0;i>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){console.error("emscripten_realloc_buffer: Attempted to grow heap from "+buffer.byteLength+" bytes to "+size+" bytes, but got error: "+e)}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();if(requestedSize<=oldSize){return false}var PAGE_MULTIPLE=65536;var maxHeapSize=1073741824;if(requestedSize>maxHeapSize){err("Cannot enlarge memory, asked to go up to "+requestedSize+" bytes, but the limit is "+maxHeapSize+" bytes!");return false}var minHeapSize=16777216;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(minHeapSize,requestedSize,overGrownHeapSize),PAGE_MULTIPLE));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}err("Failed to grow the heap from "+oldSize+" bytes to "+newSize+" bytes, not enough memory!");return false}var JSEvents={keyEvent:0,mouseEvent:0,wheelEvent:0,uiEvent:0,focusEvent:0,deviceOrientationEvent:0,deviceMotionEvent:0,fullscreenChangeEvent:0,pointerlockChangeEvent:0,visibilityChangeEvent:0,touchEvent:0,previousFullscreenElement:null,previousScreenX:null,previousScreenY:null,removeEventListenersRegistered:false,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;GROWABLE_HEAP_I32()[varargs+4>>2]=eventData;GROWABLE_HEAP_I32()[varargs+8>>2]=userData;_emscripten_async_queue_on_thread_(targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}GROWABLE_HEAP_I32()[varargs>>2]=targetCanvasPtr;GROWABLE_HEAP_I32()[varargs+4>>2]=width;GROWABLE_HEAP_I32()[varargs+8>>2]=height;_emscripten_async_queue_on_thread_(targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function __maybeCStringToJsString(cString){return cString===cString+0?UTF8ToString(cString):cString}var __specialEventTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function __findEventTarget(target){var domElement=__specialEventTargets[target]||(typeof document!=="undefined"?document.querySelector(__maybeCStringToJsString(target)):undefined);return domElement}function __findCanvasEventTarget(target){return __findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=__findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){GROWABLE_HEAP_I32()[canvas.canvasSharedPtr>>2]=width;GROWABLE_HEAP_I32()[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=GROWABLE_HEAP_I32()[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=__findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){newStatus=newStatus|0}function __webgl_acquireInstancedArraysExtension(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)}}}function __webgl_acquireVertexArrayObjectExtension(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)}}}function __webgl_acquireDrawBuffersExtension(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)}}}var GL={counter:1,lastError:0,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},currentContext:null,offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,init:function(){var miniTempFloatBuffer=new Float32Array(GL.MINI_TEMP_BUFFER_SIZE);for(var i=0;i>2]:-1;source+=UTF8ToString(GROWABLE_HEAP_I32()[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);GROWABLE_HEAP_I32()[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;if(context.version<2){__webgl_acquireInstancedArraysExtension(GLctx);__webgl_acquireVertexArrayObjectExtension(GLctx);__webgl_acquireDrawBuffersExtension(GLctx)}GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query");var automaticallyEnabledExtensions=["OES_texture_float","OES_texture_half_float","OES_standard_derivatives","OES_vertex_array_object","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","OES_element_index_uint","EXT_texture_filter_anisotropic","EXT_frag_depth","WEBGL_draw_buffers","ANGLE_instanced_arrays","OES_texture_float_linear","OES_texture_half_float_linear","EXT_blend_minmax","EXT_shader_texture_lod","EXT_texture_norm16","WEBGL_compressed_texture_pvrtc","EXT_color_buffer_half_float","WEBGL_color_buffer_float","EXT_sRGB","WEBGL_compressed_texture_etc1","EXT_disjoint_timer_query","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_astc","EXT_color_buffer_float","WEBGL_compressed_texture_s3tc_srgb","EXT_disjoint_timer_query_webgl2","WEBKIT_WEBGL_compressed_texture_pvrtc"];var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(automaticallyEnabledExtensions.indexOf(ext)!=-1){GLctx.getExtension(ext)}})},populateUniformTable:function(program){var p=GL.programs[program];var ptable=GL.programInfos[program]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1};var utable=ptable.uniforms;var numUniforms=GLctx.getProgramParameter(p,35718);for(var i=0;i>2;contextAttributes["alpha"]=!!GROWABLE_HEAP_I32()[a+(0>>2)];contextAttributes["depth"]=!!GROWABLE_HEAP_I32()[a+(4>>2)];contextAttributes["stencil"]=!!GROWABLE_HEAP_I32()[a+(8>>2)];contextAttributes["antialias"]=!!GROWABLE_HEAP_I32()[a+(12>>2)];contextAttributes["premultipliedAlpha"]=!!GROWABLE_HEAP_I32()[a+(16>>2)];contextAttributes["preserveDrawingBuffer"]=!!GROWABLE_HEAP_I32()[a+(20>>2)];var powerPreference=GROWABLE_HEAP_I32()[a+(24>>2)];contextAttributes["powerPreference"]=__emscripten_webgl_power_preferences[powerPreference];contextAttributes["failIfMajorPerformanceCaveat"]=!!GROWABLE_HEAP_I32()[a+(28>>2)];contextAttributes.majorVersion=GROWABLE_HEAP_I32()[a+(32>>2)];contextAttributes.minorVersion=GROWABLE_HEAP_I32()[a+(36>>2)];contextAttributes.enableExtensionsByDefault=GROWABLE_HEAP_I32()[a+(40>>2)];contextAttributes.explicitSwapControl=GROWABLE_HEAP_I32()[a+(44>>2)];contextAttributes.proxyContextToMainThread=GROWABLE_HEAP_I32()[a+(48>>2)];contextAttributes.renderViaOffscreenBackBuffer=GROWABLE_HEAP_I32()[a+(52>>2)];var canvas=__findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];assert(buffer);if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:undefined,get:function(){assert(SYSCALLS.varargs!=undefined);SYSCALLS.varargs+=4;var ret=GROWABLE_HEAP_I32()[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){if(low>=0)assert(high===0);else assert(high===-1);return low}};function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,fd);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM");return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,fd,offset_low,offset_high,whence,newOffset);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM")}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd,iov,iovcnt,pnum);var num=0;for(var i=0;i>2];var len=GROWABLE_HEAP_I32()[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}function _pthread_cleanup_pop(execute){var routine=PThread.exitHandlers.pop();if(execute)routine()}function _pthread_cleanup_push(routine,arg){if(PThread.exitHandlers===null){PThread.exitHandlers=[]}PThread.exitHandlers.push(function(){dynCall_vi(routine,arg)})}function __spawn_thread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _spawn_thread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){GROWABLE_HEAP_I32()[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,thread:threadParams.pthread_ptr,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(GROWABLE_HEAP_U32(),tis+(0>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(4>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(8>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(68>>2),threadParams.detached);Atomics.store(GROWABLE_HEAP_U32(),tis+(104>>2),tlsMemory);Atomics.store(GROWABLE_HEAP_U32(),tis+(48>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(40>>2),pthread.threadInfoStruct);Atomics.store(GROWABLE_HEAP_U32(),tis+(44>>2),42);Atomics.store(GROWABLE_HEAP_U32(),tis+(108>>2),threadParams.stackSize);Atomics.store(GROWABLE_HEAP_U32(),tis+(84>>2),threadParams.stackSize);Atomics.store(GROWABLE_HEAP_U32(),tis+(80>>2),stackHigh);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+8>>2),stackHigh);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+12>>2),threadParams.detached);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+20>>2),threadParams.schedPolicy);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+24>>2),threadParams.schedPrio);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(GROWABLE_HEAP_U32(),tis+(176>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"selfThreadId":threadParams.pthread_ptr,"parentThreadId":threadParams.parent_pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}}function _pthread_getschedparam(thread,policy,schedparam){if(!policy&&!schedparam)return ERRNO_CODES.EINVAL;if(!thread){err("pthread_getschedparam called with a null thread pointer!");return ERRNO_CODES.ESRCH}var self=GROWABLE_HEAP_I32()[thread+12>>2];if(self!==thread){err("pthread_getschedparam attempted on thread "+thread+", which does not point to a valid thread, or does not exist anymore!");return ERRNO_CODES.ESRCH}var schedPolicy=Atomics.load(GROWABLE_HEAP_U32(),thread+108+20>>2);var schedPrio=Atomics.load(GROWABLE_HEAP_U32(),thread+108+24>>2);if(policy)GROWABLE_HEAP_I32()[policy>>2]=schedPolicy;if(schedparam)GROWABLE_HEAP_I32()[schedparam>>2]=schedPrio;return 0}function _pthread_self(){return __pthread_ptr|0}Module["_pthread_self"]=_pthread_self;function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;var schedPolicy=0;var schedPrio=0;if(attr){stackSize=GROWABLE_HEAP_I32()[attr>>2];stackSize+=81920;stackBase=GROWABLE_HEAP_I32()[attr+8>>2];detached=GROWABLE_HEAP_I32()[attr+12>>2]!==0;var inheritSched=GROWABLE_HEAP_I32()[attr+16>>2]===0;if(inheritSched){var prevSchedPolicy=GROWABLE_HEAP_I32()[attr+20>>2];var prevSchedPrio=GROWABLE_HEAP_I32()[attr+24>>2];var parentThreadPtr=PThread.currentProxiedOperationCallerThread?PThread.currentProxiedOperationCallerThread:_pthread_self();_pthread_getschedparam(parentThreadPtr,attr+20,attr+24);schedPolicy=GROWABLE_HEAP_I32()[attr+20>>2];schedPrio=GROWABLE_HEAP_I32()[attr+24>>2];GROWABLE_HEAP_I32()[attr+20>>2]=prevSchedPolicy;GROWABLE_HEAP_I32()[attr+24>>2]=prevSchedPrio}else{schedPolicy=GROWABLE_HEAP_I32()[attr+20>>2];schedPrio=GROWABLE_HEAP_I32()[attr+24>>2]}}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(232);for(var i=0;i<232>>2;++i)GROWABLE_HEAP_U32()[(threadInfoStruct>>2)+i]=0;GROWABLE_HEAP_I32()[pthread_ptr>>2]=threadInfoStruct;GROWABLE_HEAP_I32()[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+156;GROWABLE_HEAP_I32()[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,schedPolicy:schedPolicy,schedPrio:schedPrio,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,parent_pthread_ptr:_pthread_self(),arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList)}else{__spawn_thread(threadParams)}return 0}function _roundf(d){d=+d;return d>=+0?+Math_floor(d+ +.5):+Math_ceil(d-+.5)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();else PThread.initWorker();var GLctx;GL.init();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_fd_close,_fd_seek,_fd_write];var asmLibraryArg={"__assert_fail":___assert_fail,"__handle_stack_overflow":___handle_stack_overflow,"_emscripten_notify_thread_queue":__emscripten_notify_thread_queue,"abort":_abort,"emscripten_conditional_set_current_thread_status":_emscripten_conditional_set_current_thread_status,"emscripten_futex_wait":_emscripten_futex_wait,"emscripten_futex_wake":_emscripten_futex_wake,"emscripten_get_now":_emscripten_get_now,"emscripten_is_main_browser_thread":_emscripten_is_main_browser_thread,"emscripten_is_main_runtime_thread":_emscripten_is_main_runtime_thread,"emscripten_memcpy_big":_emscripten_memcpy_big,"emscripten_receive_on_main_thread_js":_emscripten_receive_on_main_thread_js,"emscripten_resize_heap":_emscripten_resize_heap,"emscripten_set_canvas_element_size":_emscripten_set_canvas_element_size,"emscripten_set_current_thread_status":_emscripten_set_current_thread_status,"emscripten_webgl_create_context":_emscripten_webgl_create_context,"fd_close":_fd_close,"fd_seek":_fd_seek,"fd_write":_fd_write,"initPthreadsJS":initPthreadsJS,"memory":wasmMemory||Module["wasmMemory"],"pthread_cleanup_pop":_pthread_cleanup_pop,"pthread_cleanup_push":_pthread_cleanup_push,"pthread_create":_pthread_create,"pthread_self":_pthread_self,"roundf":_roundf,"table":wasmTable};var asm=createWasm();Module["asm"]=asm;var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__wasm_call_ctors"].apply(null,arguments)};var _init=Module["_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["init"].apply(null,arguments)};var _register_tensor=Module["_register_tensor"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["register_tensor"].apply(null,arguments)};var _dispose_data=Module["_dispose_data"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose_data"].apply(null,arguments)};var _dispose=Module["_dispose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose"].apply(null,arguments)};var _Abs=Module["_Abs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Abs"].apply(null,arguments)};var _Add=Module["_Add"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Add"].apply(null,arguments)};var _AddN=Module["_AddN"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AddN"].apply(null,arguments)};var _ArgMax=Module["_ArgMax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ArgMax"].apply(null,arguments)};var _AvgPool=Module["_AvgPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AvgPool"].apply(null,arguments)};var _BatchMatMul=Module["_BatchMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["BatchMatMul"].apply(null,arguments)};var _ClipByValue=Module["_ClipByValue"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ClipByValue"].apply(null,arguments)};var _Conv2D=Module["_Conv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Conv2D"].apply(null,arguments)};var _Cos=Module["_Cos"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Cos"].apply(null,arguments)};var _CropAndResize=Module["_CropAndResize"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["CropAndResize"].apply(null,arguments)};var _DepthwiseConv2dNative=Module["_DepthwiseConv2dNative"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["DepthwiseConv2dNative"].apply(null,arguments)};var _Div=Module["_Div"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Div"].apply(null,arguments)};var _Exp=Module["_Exp"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Exp"].apply(null,arguments)};var _FloorDiv=Module["_FloorDiv"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FloorDiv"].apply(null,arguments)};var _FusedBatchNorm=Module["_FusedBatchNorm"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedBatchNorm"].apply(null,arguments)};var _FusedConv2D=Module["_FusedConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedConv2D"].apply(null,arguments)};var _FusedDepthwiseConv2D=Module["_FusedDepthwiseConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedDepthwiseConv2D"].apply(null,arguments)};var _Gather=Module["_Gather"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Gather"].apply(null,arguments)};var _GatherNd=Module["_GatherNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GatherNd"].apply(null,arguments)};var _Greater=Module["_Greater"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Greater"].apply(null,arguments)};var _GreaterEqual=Module["_GreaterEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GreaterEqual"].apply(null,arguments)};var _Less=Module["_Less"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Less"].apply(null,arguments)};var _LessEqual=Module["_LessEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LessEqual"].apply(null,arguments)};var _Log=Module["_Log"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Log"].apply(null,arguments)};var _LogicalAnd=Module["_LogicalAnd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LogicalAnd"].apply(null,arguments)};var _Max=Module["_Max"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Max"].apply(null,arguments)};var _MaxPool=Module["_MaxPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["MaxPool"].apply(null,arguments)};var _Maximum=Module["_Maximum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Maximum"].apply(null,arguments)};var _Min=Module["_Min"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Min"].apply(null,arguments)};var _Minimum=Module["_Minimum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Minimum"].apply(null,arguments)};var _Mul=Module["_Mul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Mul"].apply(null,arguments)};var _Neg=Module["_Neg"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Neg"].apply(null,arguments)};var _NonMaxSuppressionV3=Module["_NonMaxSuppressionV3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV3"].apply(null,arguments)};var _NonMaxSuppressionV5=Module["_NonMaxSuppressionV5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV5"].apply(null,arguments)};var _NotEqual=Module["_NotEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NotEqual"].apply(null,arguments)};var _PadV2=Module["_PadV2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["PadV2"].apply(null,arguments)};var _Pow=Module["_Pow"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Pow"].apply(null,arguments)};var _Prelu=Module["_Prelu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Prelu"].apply(null,arguments)};var _Relu=Module["_Relu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu"].apply(null,arguments)};var _Relu6=Module["_Relu6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu6"].apply(null,arguments)};var _ResizeBilinear=Module["_ResizeBilinear"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ResizeBilinear"].apply(null,arguments)};var _Rsqrt=Module["_Rsqrt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Rsqrt"].apply(null,arguments)};var _ScatterNd=Module["_ScatterNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ScatterNd"].apply(null,arguments)};var _Sigmoid=Module["_Sigmoid"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sigmoid"].apply(null,arguments)};var _Sin=Module["_Sin"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sin"].apply(null,arguments)};var _Softmax=Module["_Softmax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Softmax"].apply(null,arguments)};var _Square=Module["_Square"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Square"].apply(null,arguments)};var _Sub=Module["_Sub"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sub"].apply(null,arguments)};var _Sum=Module["_Sum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sum"].apply(null,arguments)};var _Tanh=Module["_Tanh"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tanh"].apply(null,arguments)};var _Tile=Module["_Tile"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tile"].apply(null,arguments)};var _Transpose=Module["_Transpose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Transpose"].apply(null,arguments)};var __FusedMatMul=Module["__FusedMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_FusedMatMul"].apply(null,arguments)};var _malloc=Module["_malloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["malloc"].apply(null,arguments)};var _free=Module["_free"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["free"].apply(null,arguments)};var ___em_js__initPthreadsJS=Module["___em_js__initPthreadsJS"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__em_js__initPthreadsJS"].apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_get_global_libc"].apply(null,arguments)};var _memalign=Module["_memalign"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["memalign"].apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__pthread_tsd_run_dtors"].apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null,arguments)};var _emscripten_main_browser_thread_id=Module["_emscripten_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_browser_thread_id"].apply(null,arguments)};var _emscripten_async_run_in_main_thread=Module["_emscripten_async_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread=Module["_emscripten_sync_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_0=Module["_emscripten_sync_run_in_main_thread_0"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_1=Module["_emscripten_sync_run_in_main_thread_1"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_2=Module["_emscripten_sync_run_in_main_thread_2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_xprintf_varargs=Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_3=Module["_emscripten_sync_run_in_main_thread_3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_5=Module["_emscripten_sync_run_in_main_thread_5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_6=Module["_emscripten_sync_run_in_main_thread_6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_7=Module["_emscripten_sync_run_in_main_thread_7"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null,arguments)};var _emscripten_async_queue_on_thread_=Module["_emscripten_async_queue_on_thread_"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_tls_init"].apply(null,arguments)};var ___set_stack_limit=Module["___set_stack_limit"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__set_stack_limit"].apply(null,arguments)};var stackSave=Module["stackSave"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackSave"].apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackAlloc"].apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackRestore"].apply(null,arguments)};var dynCall_vi=Module["dynCall_vi"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_vi"].apply(null,arguments)};var dynCall_v=Module["dynCall_v"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_v"].apply(null,arguments)};var dynCall_ii=Module["dynCall_ii"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_ii"].apply(null,arguments)};Module["asm"]=asm;if(!Object.getOwnPropertyDescriptor(Module,"intArrayFromString"))Module["intArrayFromString"]=function(){abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"intArrayToString"))Module["intArrayToString"]=function(){abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ccall"))Module["ccall"]=function(){abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["cwrap"]=cwrap;if(!Object.getOwnPropertyDescriptor(Module,"setValue"))Module["setValue"]=function(){abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getValue"))Module["getValue"]=function(){abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocate"))Module["allocate"]=function(){abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getMemory"))Module["getMemory"]=function(){abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ArrayToString"))Module["UTF8ArrayToString"]=function(){abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ToString"))Module["UTF8ToString"]=function(){abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8Array"))Module["stringToUTF8Array"]=function(){abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8"))Module["stringToUTF8"]=function(){abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF8"))Module["lengthBytesUTF8"]=function(){abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreRun"))Module["addOnPreRun"]=function(){abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnInit"))Module["addOnInit"]=function(){abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreMain"))Module["addOnPreMain"]=function(){abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnExit"))Module["addOnExit"]=function(){abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPostRun"))Module["addOnPostRun"]=function(){abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeStringToMemory"))Module["writeStringToMemory"]=function(){abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeArrayToMemory"))Module["writeArrayToMemory"]=function(){abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeAsciiToMemory"))Module["writeAsciiToMemory"]=function(){abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addRunDependency"))Module["addRunDependency"]=function(){abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"removeRunDependency"))Module["removeRunDependency"]=function(){abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createFolder"))Module["FS_createFolder"]=function(){abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPath"))Module["FS_createPath"]=function(){abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDataFile"))Module["FS_createDataFile"]=function(){abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPreloadedFile"))Module["FS_createPreloadedFile"]=function(){abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLazyFile"))Module["FS_createLazyFile"]=function(){abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLink"))Module["FS_createLink"]=function(){abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDevice"))Module["FS_createDevice"]=function(){abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_unlink"))Module["FS_unlink"]=function(){abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"dynamicAlloc"))Module["dynamicAlloc"]=function(){abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadDynamicLibrary"))Module["loadDynamicLibrary"]=function(){abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadWebAssemblyModule"))Module["loadWebAssemblyModule"]=function(){abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getLEB"))Module["getLEB"]=function(){abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFunctionTables"))Module["getFunctionTables"]=function(){abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"alignFunctionTables"))Module["alignFunctionTables"]=function(){abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"registerFunctions"))Module["registerFunctions"]=function(){abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addFunction"))Module["addFunction"]=function(){abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"removeFunction"))Module["removeFunction"]=function(){abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFuncWrapper"))Module["getFuncWrapper"]=function(){abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"prettyPrint"))Module["prettyPrint"]=function(){abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"makeBigInt"))Module["makeBigInt"]=function(){abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"dynCall"))Module["dynCall"]=function(){abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getCompilerSetting"))Module["getCompilerSetting"]=function(){abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"print"))Module["print"]=function(){abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"printErr"))Module["printErr"]=function(){abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getTempRet0"))Module["getTempRet0"]=function(){abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setTempRet0"))Module["setTempRet0"]=function(){abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"callMain"))Module["callMain"]=function(){abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"abort"))Module["abort"]=function(){abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToNewUTF8"))Module["stringToNewUTF8"]=function(){abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscripten_realloc_buffer"))Module["emscripten_realloc_buffer"]=function(){abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ENV"))Module["ENV"]=function(){abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setjmpId"))Module["setjmpId"]=function(){abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_CODES"))Module["ERRNO_CODES"]=function(){abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_MESSAGES"))Module["ERRNO_MESSAGES"]=function(){abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setErrNo"))Module["setErrNo"]=function(){abort("'setErrNo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"DNS"))Module["DNS"]=function(){abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GAI_ERRNO_MESSAGES"))Module["GAI_ERRNO_MESSAGES"]=function(){abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Protocols"))Module["Protocols"]=function(){abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Sockets"))Module["Sockets"]=function(){abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UNWIND_CACHE"))Module["UNWIND_CACHE"]=function(){abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readAsmConstArgs"))Module["readAsmConstArgs"]=function(){abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_q"))Module["jstoi_q"]=function(){abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_s"))Module["jstoi_s"]=function(){abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH"))Module["PATH"]=function(){abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH_FS"))Module["PATH_FS"]=function(){abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SYSCALLS"))Module["SYSCALLS"]=function(){abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMmap2"))Module["syscallMmap2"]=function(){abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMunmap"))Module["syscallMunmap"]=function(){abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"flush_NO_FILESYSTEM"))Module["flush_NO_FILESYSTEM"]=function(){abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"JSEvents"))Module["JSEvents"]=function(){abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangle"))Module["demangle"]=function(){abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangleAll"))Module["demangleAll"]=function(){abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jsStackTrace"))Module["jsStackTrace"]=function(){abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getEnvStrings"))Module["getEnvStrings"]=function(){abort("'getEnvStrings' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64"))Module["writeI53ToI64"]=function(){abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Clamped"))Module["writeI53ToI64Clamped"]=function(){abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Signaling"))Module["writeI53ToI64Signaling"]=function(){abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Clamped"))Module["writeI53ToU64Clamped"]=function(){abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Signaling"))Module["writeI53ToU64Signaling"]=function(){abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromI64"))Module["readI53FromI64"]=function(){abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromU64"))Module["readI53FromU64"]=function(){abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertI32PairToI53"))Module["convertI32PairToI53"]=function(){abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertU32PairToI53"))Module["convertU32PairToI53"]=function(){abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Browser"))Module["Browser"]=function(){abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GL"))Module["GL"]=function(){abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGet"))Module["emscriptenWebGLGet"]=function(){abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetTexPixelData"))Module["emscriptenWebGLGetTexPixelData"]=function(){abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetUniform"))Module["emscriptenWebGLGetUniform"]=function(){abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetVertexAttrib"))Module["emscriptenWebGLGetVertexAttrib"]=function(){abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AL"))Module["AL"]=function(){abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_unicode"))Module["SDL_unicode"]=function(){abort("'SDL_unicode' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_ttfContext"))Module["SDL_ttfContext"]=function(){abort("'SDL_ttfContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_audio"))Module["SDL_audio"]=function(){abort("'SDL_audio' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL"))Module["SDL"]=function(){abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_gfx"))Module["SDL_gfx"]=function(){abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLUT"))Module["GLUT"]=function(){abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"EGL"))Module["EGL"]=function(){abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW_Window"))Module["GLFW_Window"]=function(){abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW"))Module["GLFW"]=function(){abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLEW"))Module["GLEW"]=function(){abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"IDBStore"))Module["IDBStore"]=function(){abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"runAndAbortIfError"))Module["runAndAbortIfError"]=function(){abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["PThread"]=PThread;if(!Object.getOwnPropertyDescriptor(Module,"establishStackSpace"))Module["establishStackSpace"]=function(){abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getNoExitRuntime"))Module["getNoExitRuntime"]=function(){abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"resetPrototype"))Module["resetPrototype"]=function(){abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"warnOnce"))Module["warnOnce"]=function(){abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackSave"))Module["stackSave"]=function(){abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackRestore"))Module["stackRestore"]=function(){abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackAlloc"))Module["stackAlloc"]=function(){abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AsciiToString"))Module["AsciiToString"]=function(){abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToAscii"))Module["stringToAscii"]=function(){abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF16ToString"))Module["UTF16ToString"]=function(){abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF16"))Module["stringToUTF16"]=function(){abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF16"))Module["lengthBytesUTF16"]=function(){abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF32ToString"))Module["UTF32ToString"]=function(){abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF32"))Module["stringToUTF32"]=function(){abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF32"))Module["lengthBytesUTF32"]=function(){abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8"))Module["allocateUTF8"]=function(){abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8OnStack"))Module["allocateUTF8OnStack"]=function(){abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["writeStackCookie"]=writeStackCookie;Module["checkStackCookie"]=checkStackCookie;Module["abortStackOverflow"]=abortStackOverflow;Module["PThread"]=PThread;Module["_pthread_self"]=_pthread_self;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NORMAL"))Object.defineProperty(Module,"ALLOC_NORMAL",{configurable:true,get:function(){abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_STACK"))Object.defineProperty(Module,"ALLOC_STACK",{configurable:true,get:function(){abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_DYNAMIC"))Object.defineProperty(Module,"ALLOC_DYNAMIC",{configurable:true,get:function(){abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NONE"))Object.defineProperty(Module,"ALLOC_NONE",{configurable:true,get:function(){abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});var calledRun;Module["then"]=function(func){if(calledRun){func(Module)}else{var old=Module["onRuntimeInitialized"];Module["onRuntimeInitialized"]=function(){if(old)old();func(Module)}}return Module};function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}writeStackCookie();preRun();if(runDependencies>0)return;function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();assert(!Module["_main"],'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}checkStackCookie()}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}if(!ENVIRONMENT_IS_PTHREAD)noExitRuntime=true;if(!ENVIRONMENT_IS_PTHREAD)run(); - return WasmBackendModule - } - ); + return WasmBackendModule +} +); })(); if (typeof exports === 'object' && typeof module === 'object') - module.exports = WasmBackendModule; -else if (typeof define === 'function' && define['amd']) - define([], function () { - return WasmBackendModule; - }); -else if (typeof exports === 'object') - exports["WasmBackendModule"] = WasmBackendModule; + module.exports = WasmBackendModule; + else if (typeof define === 'function' && define['amd']) + define([], function() { return WasmBackendModule; }); + else if (typeof exports === 'object') + exports["WasmBackendModule"] = WasmBackendModule; + \ No newline at end of file diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js b/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js index 427a38493f0..255cb67140c 100644 --- a/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js +++ b/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js @@ -1,151 +1 @@ -var threadInfoStruct = 0; -var selfThreadId = 0; -var parentThreadId = 0; -var Module = {}; - -function assert(condition, text) { - if (!condition) abort("Assertion failed: " + text) -} - -function threadPrintErr() { - var text = Array.prototype.slice.call(arguments).join(" "); - console.error(text) -} - -function threadAlert() { - var text = Array.prototype.slice.call(arguments).join(" "); - postMessage({ - cmd: "alert", - text: text, - threadId: selfThreadId - }) -} -var out = function () { - throw "out() is not defined in worker.js." -}; -var err = threadPrintErr; -this.alert = threadAlert; -Module["instantiateWasm"] = function (info, receiveInstance) { - var instance = new WebAssembly.Instance(Module["wasmModule"], info); - Module["wasmModule"] = null; - receiveInstance(instance); - return instance.exports -}; -this.onmessage = function (e) { - try { - if (e.data.cmd === "load") { - Module["DYNAMIC_BASE"] = e.data.DYNAMIC_BASE; - Module["DYNAMICTOP_PTR"] = e.data.DYNAMICTOP_PTR; - Module["wasmModule"] = e.data.wasmModule; - Module["wasmMemory"] = e.data.wasmMemory; - Module["buffer"] = Module["wasmMemory"].buffer; - Module["ENVIRONMENT_IS_PTHREAD"] = true; - if (typeof e.data.urlOrBlob === "string") { - importScripts(e.data.urlOrBlob) - } else { - var objectUrl = URL.createObjectURL(e.data.urlOrBlob); - importScripts(objectUrl); - URL.revokeObjectURL(objectUrl) - } - Module = WasmBackendModule(Module); - postMessage({ - "cmd": "loaded" - }) - } else if (e.data.cmd === "objectTransfer") { - Module["PThread"].receiveObjectTransfer(e.data) - } else if (e.data.cmd === "run") { - Module["__performance_now_clock_drift"] = performance.now() - e.data.time; - threadInfoStruct = e.data.threadInfoStruct; - Module["__register_pthread_ptr"](threadInfoStruct, 0, 0); - selfThreadId = e.data.selfThreadId; - parentThreadId = e.data.parentThreadId; - var max = e.data.stackBase; - var top = e.data.stackBase + e.data.stackSize; - assert(threadInfoStruct); - assert(selfThreadId); - assert(parentThreadId); - assert(top != 0); - assert(max != 0); - assert(top > max); - Module["establishStackSpace"](top, max); - Module["_emscripten_tls_init"](); - Module["writeStackCookie"](); - Module["PThread"].receiveObjectTransfer(e.data); - Module["PThread"].setThreadStatus(Module["_pthread_self"](), 1); - try { - var result = Module["dynCall_ii"](e.data.start_routine, e.data.arg); - Module["checkStackCookie"](); - if (!Module["getNoExitRuntime"]()) Module["PThread"].threadExit(result) - } catch (ex) { - if (ex === "Canceled!") { - Module["PThread"].threadCancel() - } else if (ex != "unwind") { - Atomics.store(Module["HEAPU32"], threadInfoStruct + 4 >> 2, ex instanceof Module["ExitStatus"] ? ex.status : -2); - Atomics.store(Module["HEAPU32"], threadInfoStruct + 0 >> 2, 1); - if (typeof Module["_emscripten_futex_wake"] !== "function") { - err("Thread Initialisation failed."); - throw ex - } - Module["_emscripten_futex_wake"](threadInfoStruct + 0, 2147483647); - if (!(ex instanceof Module["ExitStatus"])) throw ex - } else { - err("Pthread 0x" + threadInfoStruct.toString(16) + " completed its pthread main entry point with an unwind, keeping the pthread worker alive for asynchronous operation.") - } - } - } else if (e.data.cmd === "cancel") { - if (threadInfoStruct) { - Module["PThread"].threadCancel() - } - } else if (e.data.target === "setimmediate") {} else if (e.data.cmd === "processThreadQueue") { - if (threadInfoStruct) { - Module["_emscripten_current_thread_process_queued_calls"]() - } - } else { - err("worker.js received unknown command " + e.data.cmd); - err(e.data) - } - } catch (ex) { - err("worker.js onmessage() captured an uncaught exception: " + ex); - if (ex.stack) err(ex.stack); - throw ex - } -}; -if (typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string") { - self = { - location: { - href: __filename - } - }; - var onmessage = this.onmessage; - var nodeWorkerThreads = require("worker_threads"); - Worker = nodeWorkerThreads.Worker; - var parentPort = nodeWorkerThreads.parentPort; - parentPort.on("message", function (data) { - onmessage({ - data: data - }) - }); - var nodeFS = require("fs"); - var nodeRead = function (filename) { - return nodeFS.readFileSync(filename, "utf8") - }; - - function globalEval(x) { - global.require = require; - global.Module = Module; - eval.call(null, x) - } - importScripts = function (f) { - globalEval(nodeRead(f)) - }; - postMessage = function (msg) { - parentPort.postMessage(msg) - }; - if (typeof performance === "undefined") { - performance = { - now: function () { - return Date.now() - } - } - } -} +var threadInfoStruct=0;var selfThreadId=0;var parentThreadId=0;var Module={};function assert(condition,text){if(!condition)abort("Assertion failed: "+text)}function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:selfThreadId})}var out=function(){throw"out() is not defined in worker.js."};var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);Module["wasmModule"]=null;receiveInstance(instance);return instance.exports};this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["DYNAMIC_BASE"]=e.data.DYNAMIC_BASE;Module["DYNAMICTOP_PTR"]=e.data.DYNAMICTOP_PTR;Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}Module=WasmBackendModule(Module);postMessage({"cmd":"loaded"})}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;threadInfoStruct=e.data.threadInfoStruct;Module["__register_pthread_ptr"](threadInfoStruct,0,0);selfThreadId=e.data.selfThreadId;parentThreadId=e.data.parentThreadId;var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;assert(threadInfoStruct);assert(selfThreadId);assert(parentThreadId);assert(top!=0);assert(max!=0);assert(top>max);Module["establishStackSpace"](top,max);Module["_emscripten_tls_init"]();Module["writeStackCookie"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].setThreadStatus(Module["_pthread_self"](),1);try{var result=Module["dynCall_ii"](e.data.start_routine,e.data.arg);Module["checkStackCookie"]();if(!Module["getNoExitRuntime"]())Module["PThread"].threadExit(result)}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){Atomics.store(Module["HEAPU32"],threadInfoStruct+4>>2,ex instanceof Module["ExitStatus"]?ex.status:-2);Atomics.store(Module["HEAPU32"],threadInfoStruct+0>>2,1);if(typeof Module["_emscripten_futex_wake"]!=="function"){err("Thread Initialisation failed.");throw ex}Module["_emscripten_futex_wake"](threadInfoStruct+0,2147483647);if(!(ex instanceof Module["ExitStatus"]))throw ex}else{err("Pthread 0x"+threadInfoStruct.toString(16)+" completed its pthread main entry point with an unwind, keeping the pthread worker alive for asynchronous operation.")}}}else if(e.data.cmd==="cancel"){if(threadInfoStruct){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(threadInfoStruct){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} From 3bcf7d3b0b5bcba337e0bc2d9b4b0dd6c9361f77 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Thu, 30 Apr 2020 09:05:13 -0400 Subject: [PATCH 57/85] register kernel --- tfjs-backend-wasm/src/index_test.ts | 30 ++++++++++++++- tfjs-backend-wasm/src/kernels/Split.ts | 40 ++++++++++++++++++++ tfjs-backend-wasm/src/kernels/all_kernels.ts | 1 + 3 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 tfjs-backend-wasm/src/kernels/Split.ts diff --git a/tfjs-backend-wasm/src/index_test.ts b/tfjs-backend-wasm/src/index_test.ts index fb1404f8416..280064c776d 100644 --- a/tfjs-backend-wasm/src/index_test.ts +++ b/tfjs-backend-wasm/src/index_test.ts @@ -58,8 +58,8 @@ describeWithFlags('wasm init', BROWSER_ENVS, () => { }, 100); // Silences backend registration warnings. - spyOn(console, 'warn'); - spyOn(console, 'log'); + // spyOn(console, 'warn'); + // spyOn(console, 'log'); }); afterEach(() => { @@ -121,4 +121,30 @@ describeWithFlags('wasm init', BROWSER_ENVS, () => { expect(() => setWasmPath('too/late')) .toThrowError(/The WASM backend was already initialized. Make sure/); }); + + fit('split by number', async () => { + const x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]); + const res = tf.split(x, 2, 1); + expect(res.length).toEqual(2); + expect(res[0].shape).toEqual([2, 2]); + const res0data = await res[0].data(); + console.log(Array.from(res0data)); + // expectArraysClose(await res[0].data(), [1, 2, 5, 6]); + expect(res[1].shape).toEqual([2, 2]); + const res1data = await res[1].data(); + console.log(Array.from(res1data)); + // expectArraysClose(await res[1].data(), [3, 4, 7, 8]); + }); + + it('split by sizes', async () => { + const x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]); + const res = tf.split(x, [1, 2, 1], 1); + expect(res.length).toEqual(3); + expect(res[0].shape).toEqual([2, 1]); + // expectArraysClose(await res[0].data(), [1, 5]); + expect(res[1].shape).toEqual([2, 2]); + // expectArraysClose(await res[1].data(), [2, 3, 6, 7]); + expect(res[2].shape).toEqual([2, 1]); + // expectArraysClose(await res[2].data(), [4, 8]); + }); }); diff --git a/tfjs-backend-wasm/src/kernels/Split.ts b/tfjs-backend-wasm/src/kernels/Split.ts new file mode 100644 index 00000000000..eb4790c0ff5 --- /dev/null +++ b/tfjs-backend-wasm/src/kernels/Split.ts @@ -0,0 +1,40 @@ +/** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {NamedAttrMap, NamedTensorInfoMap, registerKernel} from '@tensorflow/tfjs-core'; +import {TensorInfo} from '@tensorflow/tfjs-core'; + +import {BackendWasm} from '../backend_wasm'; + +interface SplitInputs extends NamedTensorInfoMap { + x: TensorInfo; +} + +interface SplitAttrs extends NamedAttrMap { + numOrSizeSplits: number[]; + axis: number; +} + +export function split( + args: {inputs: SplitInputs, attrs: SplitAttrs, backend: BackendWasm}) { + const {inputs: {x}, attrs: {numOrSizeSplits, axis}, backend} = args; + const out = backend.makeOutput(x.shape, x.dtype); + console.log(numOrSizeSplits, axis); + return out; +} + +registerKernel({kernelName: 'SplitV', backendName: 'wasm', kernelFunc: split}); diff --git a/tfjs-backend-wasm/src/kernels/all_kernels.ts b/tfjs-backend-wasm/src/kernels/all_kernels.ts index 454fc89d85b..50ea4ab4bd0 100644 --- a/tfjs-backend-wasm/src/kernels/all_kernels.ts +++ b/tfjs-backend-wasm/src/kernels/all_kernels.ts @@ -70,6 +70,7 @@ import './Sigmoid'; import './Sin'; import './Slice'; import './Softmax'; +import './Split'; import './Square'; import './Sub'; import './Sum'; From 164a1aa5ac8f3b3740fbb04d678bcdac77ed4479 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Thu, 30 Apr 2020 09:37:22 -0400 Subject: [PATCH 58/85] add --- tfjs-backend-wasm/src/index_test.ts | 10 +++++++++- tfjs-backend-wasm/src/kernels/Split.ts | 26 ++++++++++++++++++++++---- tfjs-core/src/ops/split.ts | 1 - 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/tfjs-backend-wasm/src/index_test.ts b/tfjs-backend-wasm/src/index_test.ts index 280064c776d..a593792bee7 100644 --- a/tfjs-backend-wasm/src/index_test.ts +++ b/tfjs-backend-wasm/src/index_test.ts @@ -125,6 +125,8 @@ describeWithFlags('wasm init', BROWSER_ENVS, () => { fit('split by number', async () => { const x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]); const res = tf.split(x, 2, 1); + console.log('OUTPUT'); + console.log(res); expect(res.length).toEqual(2); expect(res[0].shape).toEqual([2, 2]); const res0data = await res[0].data(); @@ -136,15 +138,21 @@ describeWithFlags('wasm init', BROWSER_ENVS, () => { // expectArraysClose(await res[1].data(), [3, 4, 7, 8]); }); - it('split by sizes', async () => { + fit('split by sizes', async () => { const x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]); const res = tf.split(x, [1, 2, 1], 1); expect(res.length).toEqual(3); expect(res[0].shape).toEqual([2, 1]); + const res0data = await res[0].data(); + console.log(Array.from(res0data)); // expectArraysClose(await res[0].data(), [1, 5]); expect(res[1].shape).toEqual([2, 2]); + const res1data = await res[0].data(); + console.log(Array.from(res1data)); // expectArraysClose(await res[1].data(), [2, 3, 6, 7]); expect(res[2].shape).toEqual([2, 1]); + const res2data = await res[2].data(); + console.log(Array.from(res2data)); // expectArraysClose(await res[2].data(), [4, 8]); }); }); diff --git a/tfjs-backend-wasm/src/kernels/Split.ts b/tfjs-backend-wasm/src/kernels/Split.ts index eb4790c0ff5..1fd8c3be6ba 100644 --- a/tfjs-backend-wasm/src/kernels/Split.ts +++ b/tfjs-backend-wasm/src/kernels/Split.ts @@ -15,11 +15,13 @@ * ============================================================================= */ -import {NamedAttrMap, NamedTensorInfoMap, registerKernel} from '@tensorflow/tfjs-core'; +import {NamedAttrMap, NamedTensorInfoMap, registerKernel, util} from '@tensorflow/tfjs-core'; import {TensorInfo} from '@tensorflow/tfjs-core'; import {BackendWasm} from '../backend_wasm'; +import {slice} from './Slice'; + interface SplitInputs extends NamedTensorInfoMap { x: TensorInfo; } @@ -32,9 +34,25 @@ interface SplitAttrs extends NamedAttrMap { export function split( args: {inputs: SplitInputs, attrs: SplitAttrs, backend: BackendWasm}) { const {inputs: {x}, attrs: {numOrSizeSplits, axis}, backend} = args; - const out = backend.makeOutput(x.shape, x.dtype); - console.log(numOrSizeSplits, axis); - return out; + + const $axis = util.parseAxisParam(axis, x.shape)[0]; + + let splitSizes: number[]; + if (typeof (numOrSizeSplits) === 'number') { + splitSizes = + new Array(numOrSizeSplits).fill(x.shape[$axis] / numOrSizeSplits); + } else { + splitSizes = numOrSizeSplits; + } + + const begin = new Array(x.shape.length).fill(0); + const size = x.shape.slice(); + return splitSizes.map(s => { + size[$axis] = s; + const xSlice = slice({inputs: {x}, attrs: {begin, size}, backend}); + begin[$axis] += s; + return xSlice; + }); } registerKernel({kernelName: 'SplitV', backendName: 'wasm', kernelFunc: split}); diff --git a/tfjs-core/src/ops/split.ts b/tfjs-core/src/ops/split.ts index 5751f9499f7..38d2e03567b 100644 --- a/tfjs-core/src/ops/split.ts +++ b/tfjs-core/src/ops/split.ts @@ -80,7 +80,6 @@ function split_( } const forward: ForwardFunc = (backend, _) => { - const $axis = parseAxisParam(axis, $x.shape)[0]; return backend.split($x, splitSizes, $axis) as {} as T; }; From e174848c3277f1817347d891cda3d16b7299428a Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Thu, 30 Apr 2020 09:58:29 -0400 Subject: [PATCH 59/85] add sqrt --- tfjs-backend-wasm/src/cc/kernels/Sqrt.cc | 36 ++++++++++++++++++++ tfjs-backend-wasm/src/kernels/Sqrt.ts | 19 +++++++++++ tfjs-backend-wasm/src/kernels/all_kernels.ts | 1 + tfjs-core/src/ops/unary_ops.ts | 4 +-- 4 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 tfjs-backend-wasm/src/cc/kernels/Sqrt.cc create mode 100644 tfjs-backend-wasm/src/kernels/Sqrt.ts diff --git a/tfjs-backend-wasm/src/cc/kernels/Sqrt.cc b/tfjs-backend-wasm/src/cc/kernels/Sqrt.cc new file mode 100644 index 00000000000..a920d6f3527 --- /dev/null +++ b/tfjs-backend-wasm/src/cc/kernels/Sqrt.cc @@ -0,0 +1,36 @@ +/* Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ===========================================================================*/ + +#ifdef __EMSCRIPTEN__ +#include +#endif + +#include + +#include "src/cc/backend.h" +#include "src/cc/unary.h" + +namespace tfjs { +namespace wasm { +// We use C-style API to interface with Javascript. +extern "C" { + +#ifdef __EMSCRIPTEN__ +EMSCRIPTEN_KEEPALIVE +#endif +void Sqrt(const int x_id, const int out_id) { unary(x_id, out_id, sqrt); } + +} // extern "C" +} // namespace wasm +} // namespace tfjs diff --git a/tfjs-backend-wasm/src/kernels/Sqrt.ts b/tfjs-backend-wasm/src/kernels/Sqrt.ts new file mode 100644 index 00000000000..906cfe1d467 --- /dev/null +++ b/tfjs-backend-wasm/src/kernels/Sqrt.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {registerUnaryKernel} from './unary_kernel'; +registerUnaryKernel('Sqrt'); diff --git a/tfjs-backend-wasm/src/kernels/all_kernels.ts b/tfjs-backend-wasm/src/kernels/all_kernels.ts index 50ea4ab4bd0..0bf887355d4 100644 --- a/tfjs-backend-wasm/src/kernels/all_kernels.ts +++ b/tfjs-backend-wasm/src/kernels/all_kernels.ts @@ -71,6 +71,7 @@ import './Sin'; import './Slice'; import './Softmax'; import './Split'; +import './Sqrt'; import './Square'; import './Sub'; import './Sum'; diff --git a/tfjs-core/src/ops/unary_ops.ts b/tfjs-core/src/ops/unary_ops.ts index 7a33f1e0b42..1c50420490e 100644 --- a/tfjs-core/src/ops/unary_ops.ts +++ b/tfjs-core/src/ops/unary_ops.ts @@ -325,13 +325,13 @@ function sqrt_(x: T|TensorLike): T { const grad = (dy: T, saved: Tensor[]) => { const [$x] = saved; - return {$x: () => dy.div($x.toFloat().sqrt().mul(2))} as {$x: () => T}; + return {x: () => dy.div($x.toFloat().sqrt().mul(2))} as {x: () => T}; }; return ENGINE.runKernelFunc((backend, save) => { const res = backend.sqrt($x); save([$x]); return res; - }, {$x}, grad); + }, {x: $x}, grad, 'Sqrt', {}); } /** From ac5c447a58d49d8aec543707f8973e742e3f4188 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Fri, 1 May 2020 16:30:58 -0400 Subject: [PATCH 60/85] fix --- tfjs-backend-wasm/src/index_test.ts | 34 -------------------------- tfjs-backend-wasm/src/kernels/Split.ts | 3 ++- tfjs-backend-wasm/src/setup_test.ts | 1 + 3 files changed, 3 insertions(+), 35 deletions(-) diff --git a/tfjs-backend-wasm/src/index_test.ts b/tfjs-backend-wasm/src/index_test.ts index a593792bee7..6c498788956 100644 --- a/tfjs-backend-wasm/src/index_test.ts +++ b/tfjs-backend-wasm/src/index_test.ts @@ -121,38 +121,4 @@ describeWithFlags('wasm init', BROWSER_ENVS, () => { expect(() => setWasmPath('too/late')) .toThrowError(/The WASM backend was already initialized. Make sure/); }); - - fit('split by number', async () => { - const x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]); - const res = tf.split(x, 2, 1); - console.log('OUTPUT'); - console.log(res); - expect(res.length).toEqual(2); - expect(res[0].shape).toEqual([2, 2]); - const res0data = await res[0].data(); - console.log(Array.from(res0data)); - // expectArraysClose(await res[0].data(), [1, 2, 5, 6]); - expect(res[1].shape).toEqual([2, 2]); - const res1data = await res[1].data(); - console.log(Array.from(res1data)); - // expectArraysClose(await res[1].data(), [3, 4, 7, 8]); - }); - - fit('split by sizes', async () => { - const x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]); - const res = tf.split(x, [1, 2, 1], 1); - expect(res.length).toEqual(3); - expect(res[0].shape).toEqual([2, 1]); - const res0data = await res[0].data(); - console.log(Array.from(res0data)); - // expectArraysClose(await res[0].data(), [1, 5]); - expect(res[1].shape).toEqual([2, 2]); - const res1data = await res[0].data(); - console.log(Array.from(res1data)); - // expectArraysClose(await res[1].data(), [2, 3, 6, 7]); - expect(res[2].shape).toEqual([2, 1]); - const res2data = await res[2].data(); - console.log(Array.from(res2data)); - // expectArraysClose(await res[2].data(), [4, 8]); - }); }); diff --git a/tfjs-backend-wasm/src/kernels/Split.ts b/tfjs-backend-wasm/src/kernels/Split.ts index 1fd8c3be6ba..57b1a3f08a8 100644 --- a/tfjs-backend-wasm/src/kernels/Split.ts +++ b/tfjs-backend-wasm/src/kernels/Split.ts @@ -49,7 +49,8 @@ export function split( const size = x.shape.slice(); return splitSizes.map(s => { size[$axis] = s; - const xSlice = slice({inputs: {x}, attrs: {begin, size}, backend}); + const xSlice = + slice({inputs: {x}, attrs: {begin, size: [...size]}, backend}); begin[$axis] += s; return xSlice; }); diff --git a/tfjs-backend-wasm/src/setup_test.ts b/tfjs-backend-wasm/src/setup_test.ts index 56e212e7f49..8a1d62ade37 100644 --- a/tfjs-backend-wasm/src/setup_test.ts +++ b/tfjs-backend-wasm/src/setup_test.ts @@ -224,6 +224,7 @@ const TEST_FILTERS: TestFilter[] = [ include: 'transpose', excludes: ['oneHot'] // oneHot not yet implemented. }, + {include: 'split'}, {include: 'pad ', excludes: ['complex', 'zerosLike']}, {include: 'clip', excludes: ['gradient']}, {include: 'addN'}, From 641a2fa65f8de53dc868393e2d6c1c5382096aa4 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 4 May 2020 07:07:37 -0400 Subject: [PATCH 61/85] revive --- tfjs-backend-wasm/src/index_test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tfjs-backend-wasm/src/index_test.ts b/tfjs-backend-wasm/src/index_test.ts index 6c498788956..fb1404f8416 100644 --- a/tfjs-backend-wasm/src/index_test.ts +++ b/tfjs-backend-wasm/src/index_test.ts @@ -58,8 +58,8 @@ describeWithFlags('wasm init', BROWSER_ENVS, () => { }, 100); // Silences backend registration warnings. - // spyOn(console, 'warn'); - // spyOn(console, 'log'); + spyOn(console, 'warn'); + spyOn(console, 'log'); }); afterEach(() => { From 6ca0544cfbca4e200d673068ea0104e2e6605248 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 4 May 2020 07:16:32 -0400 Subject: [PATCH 62/85] fix --- tfjs-backend-wasm/src/kernels/Split.ts | 6 ++++-- tfjs-core/src/backends/split_shared.ts | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tfjs-backend-wasm/src/kernels/Split.ts b/tfjs-backend-wasm/src/kernels/Split.ts index 57b1a3f08a8..6f6957b5429 100644 --- a/tfjs-backend-wasm/src/kernels/Split.ts +++ b/tfjs-backend-wasm/src/kernels/Split.ts @@ -16,6 +16,7 @@ */ import {NamedAttrMap, NamedTensorInfoMap, registerKernel, util} from '@tensorflow/tfjs-core'; + import {TensorInfo} from '@tensorflow/tfjs-core'; import {BackendWasm} from '../backend_wasm'; @@ -48,9 +49,10 @@ export function split( const begin = new Array(x.shape.length).fill(0); const size = x.shape.slice(); return splitSizes.map(s => { - size[$axis] = s; + const xSliceSize = [...size]; + xSliceSize[$axis] = s; const xSlice = - slice({inputs: {x}, attrs: {begin, size: [...size]}, backend}); + slice({inputs: {x}, attrs: {begin, size: xSliceSize}, backend}); begin[$axis] += s; return xSlice; }); diff --git a/tfjs-core/src/backends/split_shared.ts b/tfjs-core/src/backends/split_shared.ts index 487a5d0d288..29789b8b7cb 100644 --- a/tfjs-core/src/backends/split_shared.ts +++ b/tfjs-core/src/backends/split_shared.ts @@ -17,6 +17,8 @@ import {Tensor} from '../tensor'; +// TODO(annxingyuan): Use this helper in WASM Split kernel once intermediate +// kernels have been modularized in WebGL and CPU. /** Shared implementation of the split kernel across WebGL and CPU. */ export function split( x: T, sizeSplits: number[], axis: number): T[] { From a160974ccb72055082284c718a9e7117790b643e Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 4 May 2020 07:20:27 -0400 Subject: [PATCH 63/85] add sqrt --- tfjs-backend-wasm/src/setup_test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tfjs-backend-wasm/src/setup_test.ts b/tfjs-backend-wasm/src/setup_test.ts index 8a1d62ade37..8cbf2950147 100644 --- a/tfjs-backend-wasm/src/setup_test.ts +++ b/tfjs-backend-wasm/src/setup_test.ts @@ -329,6 +329,10 @@ const TEST_FILTERS: TestFilter[] = [ startsWith: 'rsqrt ', excludes: ['gradient'] // Gradient not yet implemented. }, + { + startsWith: 'sqrt ', + excludes: ['gradient'] // Gradient not yet implemented. + }, { startsWith: 'zerosLike', // Complex numbers not supported yet. From 87254adcfd835eae60b56f325370ab680a55bb5f Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 4 May 2020 07:23:06 -0400 Subject: [PATCH 64/85] fix --- tfjs-core/src/backends/split_shared.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tfjs-core/src/backends/split_shared.ts b/tfjs-core/src/backends/split_shared.ts index 29789b8b7cb..fd45862eb88 100644 --- a/tfjs-core/src/backends/split_shared.ts +++ b/tfjs-core/src/backends/split_shared.ts @@ -25,8 +25,9 @@ export function split( const begin = new Array(x.rank).fill(0); const size = x.shape.slice(); return sizeSplits.map(s => { - size[axis] = s; - const slice = x.slice(begin, size); + const sliceSize = [...size]; + sliceSize[axis] = s; + const slice = x.slice(begin, sliceSize); begin[axis] += s; return slice; }); From cbffd803b9c6083fb3509ad8b31db2cb1327f195 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Tue, 5 May 2020 08:54:05 -0400 Subject: [PATCH 65/85] initialization works? --- tfjs-backend-wasm/src/cc/BUILD | 4 ++-- tfjs-backend-wasm/src/cc/backend.cc | 2 ++ tfjs-backend-wasm/src/cc/backend.h | 3 +++ tfjs-core/benchmarks/tfjs-backend-wasm.js | 2 +- tfjs-core/benchmarks/tfjs-backend-wasm.wasm | Bin 153337 -> 153783 bytes 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tfjs-backend-wasm/src/cc/BUILD b/tfjs-backend-wasm/src/cc/BUILD index 94b45dc4f3d..08b66c15990 100644 --- a/tfjs-backend-wasm/src/cc/BUILD +++ b/tfjs-backend-wasm/src/cc/BUILD @@ -11,7 +11,6 @@ cc_binary( name = "tfjs-backend-wasm.js", srcs = ["backend.cc"] + KERNELS_WITH_KEEPALIVE, linkopts = [ - "-s ALLOW_MEMORY_GROWTH=1", "-s DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=[]", "-s DISABLE_EXCEPTION_CATCHING=1", "-s FILESYSTEM=0", @@ -22,7 +21,8 @@ cc_binary( "-s EXPORT_NAME=WasmBackendModule", "-s MALLOC=emmalloc", "-s USE_PTHREADS=1", - "-s PTHREAD_POOL_SIZE=10", + "-s PTHREAD_POOL_SIZE=8", + "-s INITIAL_MEMORY=1Gb", "-s MAXIMUM_MEMORY=1Gb", "-s ASSERTIONS=1", ], diff --git a/tfjs-backend-wasm/src/cc/backend.cc b/tfjs-backend-wasm/src/cc/backend.cc index f462ccc90f8..7b3a9daa868 100644 --- a/tfjs-backend-wasm/src/cc/backend.cc +++ b/tfjs-backend-wasm/src/cc/backend.cc @@ -49,6 +49,8 @@ TensorInfo &get_tensor_info_out(const size_t tensor_id) { size_t xnn_operator_count = 0; +pthreadpool *threadpool = pthreadpool_create(1); + // Registers a disposal callback for a tensor id with a given callback function. void register_disposal_callback(const size_t tensor_id, const DisposeFunction dispose_fn) { diff --git a/tfjs-backend-wasm/src/cc/backend.h b/tfjs-backend-wasm/src/cc/backend.h index 581066ec8ef..c5082ba0d72 100644 --- a/tfjs-backend-wasm/src/cc/backend.h +++ b/tfjs-backend-wasm/src/cc/backend.h @@ -15,6 +15,7 @@ #ifndef BACKEND_H_ #define BACKEND_H_ +#include #include #include @@ -81,6 +82,8 @@ const size_t num_tensors(); // The number of instantiated XNN operators. extern size_t xnn_operator_count; + +extern pthreadpool *threadpool; } // namespace backend namespace wasm { diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.js b/tfjs-core/benchmarks/tfjs-backend-wasm.js index cff3b484656..a94e2628e96 100755 --- a/tfjs-core/benchmarks/tfjs-backend-wasm.js +++ b/tfjs-core/benchmarks/tfjs-backend-wasm.js @@ -6,7 +6,7 @@ var WasmBackendModule = (function() { function(WasmBackendModule) { WasmBackendModule = WasmBackendModule || {}; -function GROWABLE_HEAP_I8(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAP8}function GROWABLE_HEAP_U8(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPU8}function GROWABLE_HEAP_I32(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAP32}function GROWABLE_HEAP_U32(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPU32}function GROWABLE_HEAP_F64(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPF64}var Module=typeof WasmBackendModule!=="undefined"?WasmBackendModule:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(Module["ENVIRONMENT"]){throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)")}var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"];DYNAMIC_BASE=Module["DYNAMIC_BASE"];DYNAMICTOP_PTR=Module["DYNAMICTOP_PTR"]}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{throw new Error("environment detection error")}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(!Object.getOwnPropertyDescriptor(Module,"arguments"))Object.defineProperty(Module,"arguments",{configurable:true,get:function(){abort("Module.arguments has been replaced with plain arguments_")}});if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(!Object.getOwnPropertyDescriptor(Module,"thisProgram"))Object.defineProperty(Module,"thisProgram",{configurable:true,get:function(){abort("Module.thisProgram has been replaced with plain thisProgram")}});if(Module["quit"])quit_=Module["quit"];if(!Object.getOwnPropertyDescriptor(Module,"quit"))Object.defineProperty(Module,"quit",{configurable:true,get:function(){abort("Module.quit has been replaced with plain quit_")}});assert(typeof Module["memoryInitializerPrefixURL"]==="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["pthreadMainPrefixURL"]==="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["cdInitializerPrefixURL"]==="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["filePackagePrefixURL"]==="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["read"]==="undefined","Module.read option was removed (modify read_ in JS)");assert(typeof Module["readAsync"]==="undefined","Module.readAsync option was removed (modify readAsync in JS)");assert(typeof Module["readBinary"]==="undefined","Module.readBinary option was removed (modify readBinary in JS)");assert(typeof Module["setWindowTitle"]==="undefined","Module.setWindowTitle option was removed (modify setWindowTitle in JS)");assert(typeof Module["TOTAL_MEMORY"]==="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY");if(!Object.getOwnPropertyDescriptor(Module,"read"))Object.defineProperty(Module,"read",{configurable:true,get:function(){abort("Module.read has been replaced with plain read_")}});if(!Object.getOwnPropertyDescriptor(Module,"readAsync"))Object.defineProperty(Module,"readAsync",{configurable:true,get:function(){abort("Module.readAsync has been replaced with plain readAsync")}});if(!Object.getOwnPropertyDescriptor(Module,"readBinary"))Object.defineProperty(Module,"readBinary",{configurable:true,get:function(){abort("Module.readBinary has been replaced with plain readBinary")}});if(!Object.getOwnPropertyDescriptor(Module,"setWindowTitle"))Object.defineProperty(Module,"setWindowTitle",{configurable:true,get:function(){abort("Module.setWindowTitle has been replaced with plain setWindowTitle")}});assert(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER||ENVIRONMENT_IS_NODE,"Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)");var stackSave;var stackRestore;var stackAlloc;stackSave=stackRestore=stackAlloc=function(){abort("cannot use the stack before compiled code is ready to run, and has provided stack access")};function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(!Object.getOwnPropertyDescriptor(Module,"wasmBinary"))Object.defineProperty(Module,"wasmBinary",{configurable:true,get:function(){abort("Module.wasmBinary has been replaced with plain wasmBinary")}});var noExitRuntime;if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(!Object.getOwnPropertyDescriptor(Module,"noExitRuntime"))Object.defineProperty(Module,"noExitRuntime",{configurable:true,get:function(){abort("Module.noExitRuntime has been replaced with plain noExitRuntime")}});if(typeof WebAssembly!=="object"){abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.")}var wasmMemory;var wasmTable=new WebAssembly.Table({"initial":118,"maximum":118+0,"element":"anyfunc"});var wasmModule;var threadInfoStruct=0;var selfThreadId=0;var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string")return UTF8ToString(ret);if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{if((u0&248)!=240)warnOnce("Invalid UTF-8 leading byte 0x"+u0.toString(16)+" encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!");u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(GROWABLE_HEAP_U8(),ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;if(u>=2097152)warnOnce("Invalid Unicode code point 0x"+u.toString(16)+" encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF).");heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,GROWABLE_HEAP_U8(),outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");GROWABLE_HEAP_I8().set(array,buffer)}var WASM_PAGE_SIZE=65536;function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var STACK_BASE=5255808,STACKTOP=STACK_BASE,STACK_MAX=12928,DYNAMIC_BASE=5255808,DYNAMICTOP_PTR=12e3;assert(STACK_BASE%16===0,"stack must start aligned");assert(DYNAMIC_BASE%16===0,"heap must start aligned");if(ENVIRONMENT_IS_PTHREAD){STACK_MAX=STACKTOP=STACK_MAX=2147483647}var TOTAL_STACK=5242880;if(Module["TOTAL_STACK"])assert(TOTAL_STACK===Module["TOTAL_STACK"],"the stack size can no longer be determined at runtime");var INITIAL_INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(!Object.getOwnPropertyDescriptor(Module,"INITIAL_MEMORY"))Object.defineProperty(Module,"INITIAL_MEMORY",{configurable:true,get:function(){abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY")}});assert(INITIAL_INITIAL_MEMORY>=TOTAL_STACK,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+INITIAL_INITIAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");assert(typeof Int32Array!=="undefined"&&typeof Float64Array!=="undefined"&&Int32Array.prototype.subarray!==undefined&&Int32Array.prototype.set!==undefined,"JS engine does not provide full typed array support");if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,"maximum":1073741824/WASM_PAGE_SIZE,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_INITIAL_MEMORY=buffer.byteLength;assert(INITIAL_INITIAL_MEMORY%WASM_PAGE_SIZE===0);assert(65536%WASM_PAGE_SIZE===0);updateGlobalBufferAndViews(buffer);if(!ENVIRONMENT_IS_PTHREAD){GROWABLE_HEAP_I32()[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE}function writeStackCookie(){assert((STACK_MAX&3)==0);GROWABLE_HEAP_U32()[(STACK_MAX>>2)+1]=34821223;GROWABLE_HEAP_U32()[(STACK_MAX>>2)+2]=2310721022;GROWABLE_HEAP_I32()[0]=1668509029}function checkStackCookie(){var cookie1=GROWABLE_HEAP_U32()[(STACK_MAX>>2)+1];var cookie2=GROWABLE_HEAP_U32()[(STACK_MAX>>2)+2];if(cookie1!=34821223||cookie2!=2310721022){abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+cookie2.toString(16)+" "+cookie1.toString(16))}if(GROWABLE_HEAP_I32()[0]!==1668509029)abort("Runtime error: The application has corrupted its heap memory area (address zero)!")}function abortStackOverflow(allocSize){abort("Stack overflow! Attempted to allocate "+allocSize+" bytes on the stack, but stack has only "+(STACK_MAX-stackSave()+allocSize)+" bytes available!")}(function(){var h16=new Int16Array(1);var h8=new Int8Array(h16.buffer);h16[0]=25459;if(h8[0]!==115||h8[1]!==99)throw"Runtime error: expected the system to be little-endian!"})();function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;if(ENVIRONMENT_IS_PTHREAD)runtimeInitialized=true;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){checkStackCookie();assert(!runtimeInitialized);runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATMAIN__)}function postRun(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Math_ceil=Math.ceil;var Math_floor=Math.floor;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!=="undefined"){runDependencyWatcher=setInterval(function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;err("still waiting on run dependencies:")}err("dependency: "+dep)}if(shown){err("(end of list)")}},1e4)}}else{err("warning: run dependency added without ID")}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id]}else{err("warning: run dependency removed without ID")}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";out(what);err(what);ABORT=true;EXITSTATUS=1;var output="abort("+what+") at "+stackTrace();what=output;throw new WebAssembly.RuntimeError(what)}var FS={error:function(){abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1")},init:function(){FS.error()},createDataFile:function(){FS.error()},createPreloadedFile:function(){FS.error()},createLazyFile:function(){FS.error()},open:function(){FS.error()},mkdev:function(){FS.error()},registerDevice:function(){FS.error()},analyzePath:function(){FS.error()},loadFilesFromDB:function(){FS.error()},ErrnoError:function ErrnoError(){FS.error()}};Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;function hasPrefix(str,prefix){return String.prototype.startsWith?str.startsWith(prefix):str.indexOf(prefix)===0}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return hasPrefix(filename,dataURIPrefix)}var fileURIPrefix="file://";function isFileURI(filename){return hasPrefix(filename,fileURIPrefix)}var wasmBinaryFile="tfjs-backend-wasm.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(){try{if(wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(wasmBinaryFile)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary()})}return new Promise(function(resolve,reject){resolve(getBinary())})}function createWasm(){var info={"env":asmLibraryArg,"wasi_snapshot_preview1":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){var numWorkersToLoad=PThread.unusedWorkers.length;PThread.unusedWorkers.forEach(function(w){PThread.loadWasmModuleToWorker(w,function(){if(!--numWorkersToLoad)removeRunDependency("wasm-instantiate")})})}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}var trueModule=Module;function receiveInstantiatedSource(output){assert(Module===trueModule,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");trueModule=null;receiveInstance(output["instance"],output["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var ASM_CONSTS={};function initPthreadsJS(){PThread.initRuntime()}if(!ENVIRONMENT_IS_PTHREAD)__ATINIT__.push({func:function(){___wasm_call_ctors()}});function demangle(func){warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return func}function demangleAll(text){var regex=/\b_Z[\w\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"})}var __pthread_ptr=0;var __pthread_is_main_runtime_thread=0;var __pthread_is_main_browser_thread=0;function __register_pthread_ptr(pthreadPtr,isMainBrowserThread,isMainRuntimeThread){pthreadPtr=pthreadPtr|0;isMainBrowserThread=isMainBrowserThread|0;isMainRuntimeThread=isMainRuntimeThread|0;__pthread_ptr=pthreadPtr;__pthread_is_main_browser_thread=isMainBrowserThread;__pthread_is_main_runtime_thread=isMainRuntimeThread}Module["__register_pthread_ptr"]=__register_pthread_ptr;var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var __main_thread_futex_wait_address=12912;function _emscripten_futex_wake(addr,count){if(addr<=0||addr>GROWABLE_HEAP_I8().length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(GROWABLE_HEAP_I32(),addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function __kill_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _kill_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _kill_thread!";GROWABLE_HEAP_I32()[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function __cancel_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cancel_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cancel_thread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function __cleanup_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cleanup_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cleanup_thread!";GROWABLE_HEAP_I32()[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];if(pthread){var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={MAIN_THREAD_ID:1,mainThreadInfo:{schedPolicy:0,schedPrio:0},unusedWorkers:[],runningWorkers:[],initRuntime:function(){__register_pthread_ptr(PThread.mainThreadBlock,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(PThread.mainThreadBlock)},initMainThreadBlock:function(){assert(!ENVIRONMENT_IS_PTHREAD);var pthreadPoolSize=8;for(var i=0;i>2]=PThread.mainThreadBlock;var headPtr=PThread.mainThreadBlock+156;GROWABLE_HEAP_I32()[headPtr>>2]=headPtr;var tlsMemory=12400;for(var i=0;i<128;++i)GROWABLE_HEAP_U32()[tlsMemory/4+i]=0;Atomics.store(GROWABLE_HEAP_U32(),PThread.mainThreadBlock+104>>2,tlsMemory);Atomics.store(GROWABLE_HEAP_U32(),PThread.mainThreadBlock+40>>2,PThread.mainThreadBlock);Atomics.store(GROWABLE_HEAP_U32(),PThread.mainThreadBlock+44>>2,42)},initWorker:function(){},pthreads:{},exitHandlers:null,setThreadStatus:function(){},runExitHandlers:function(){if(PThread.exitHandlers!==null){while(PThread.exitHandlers.length>0){PThread.exitHandlers.pop()()}PThread.exitHandlers=null}if(ENVIRONMENT_IS_PTHREAD&&threadInfoStruct)___pthread_tsd_run_dtors()},threadExit:function(exitCode){var tb=_pthread_self();if(tb){err("Pthread 0x"+tb.toString(16)+" exited.");Atomics.store(GROWABLE_HEAP_U32(),tb+4>>2,exitCode);Atomics.store(GROWABLE_HEAP_U32(),tb+0>>2,1);Atomics.store(GROWABLE_HEAP_U32(),tb+60>>2,1);Atomics.store(GROWABLE_HEAP_U32(),tb+64>>2,0);PThread.runExitHandlers();_emscripten_futex_wake(tb+0,2147483647);__register_pthread_ptr(0,0,0);threadInfoStruct=0;if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlers();Atomics.store(GROWABLE_HEAP_U32(),threadInfoStruct+4>>2,-1);Atomics.store(GROWABLE_HEAP_U32(),threadInfoStruct+0>>2,1);_emscripten_futex_wake(threadInfoStruct+0,2147483647);threadInfoStruct=selfThreadId=0;__register_pthread_ptr(0,0,0);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];GROWABLE_HEAP_I32()[pthread.threadInfoStruct+104>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){delete PThread.pthreads[worker.pthread.thread];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined},receiveObjectTransfer:function(data){},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){__spawn_thread(e.data)}else if(cmd==="cleanupThread"){__cleanup_thread(d["thread"])}else if(cmd==="killThread"){__kill_thread(d["thread"])}else if(cmd==="cancelThread"){__cancel_thread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(GROWABLE_HEAP_U32(),worker.pthread.thread+68>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){console.log("worker exited - TODO: update the worker queue?")})}assert(wasmMemory instanceof WebAssembly.Memory,"WebAssembly memory should have been loaded by now!");assert(wasmModule instanceof WebAssembly.Module,"WebAssembly Module should have been loaded by now!");worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule,"DYNAMIC_BASE":DYNAMIC_BASE,"DYNAMICTOP_PTR":DYNAMICTOP_PTR})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("tfjs-backend-wasm.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}if(PThread.unusedWorkers.length>0)return PThread.unusedWorkers.pop();else return null},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()GROWABLE_HEAP_I8().length||addr&3!=0)return-28;if(ENVIRONMENT_IS_WORKER){var ret=Atomics.wait(GROWABLE_HEAP_I32(),addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{var loadedVal=Atomics.load(GROWABLE_HEAP_I32(),addr>>2);if(val!=loadedVal)return-6;var tNow=performance.now();var tEnd=tNow+timeout;Atomics.store(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2,addr);var ourWaitAddress=addr;while(addr==ourWaitAddress){tNow=performance.now();if(tNow>tEnd){return-73}_emscripten_main_thread_process_queued_calls();addr=Atomics.load(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2)}return 0}}function _emscripten_is_main_browser_thread(){return __pthread_is_main_browser_thread|0}function _emscripten_is_main_runtime_thread(){return __pthread_is_main_runtime_thread|0}function _emscripten_memcpy_big(dest,src,num){GROWABLE_HEAP_U8().copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;if(numCallArgs>20-1)throw"emscripten_proxy_to_main_thread_js: Too many arguments "+numCallArgs+" to proxied function idx="+index+", maximum supported is "+(20-1)+"!";var stack=stackSave();var args=stackAlloc(numCallArgs*8);var b=args>>3;for(var i=0;i>3]);buf+=8}else if(ch===105){buf=buf+3&~3;args.push(GROWABLE_HEAP_I32()[buf>>2]);buf+=4}else abort("unexpected char in asm const signature "+ch)}return args}function _emscripten_receive_on_main_thread_js(index,numCallArgs,args){_emscripten_receive_on_main_thread_js_callArgs.length=numCallArgs;var b=args>>3;for(var i=0;i>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){console.error("emscripten_realloc_buffer: Attempted to grow heap from "+buffer.byteLength+" bytes to "+size+" bytes, but got error: "+e)}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();if(requestedSize<=oldSize){return false}var PAGE_MULTIPLE=65536;var maxHeapSize=1073741824;if(requestedSize>maxHeapSize){err("Cannot enlarge memory, asked to go up to "+requestedSize+" bytes, but the limit is "+maxHeapSize+" bytes!");return false}var minHeapSize=16777216;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(minHeapSize,requestedSize,overGrownHeapSize),PAGE_MULTIPLE));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}err("Failed to grow the heap from "+oldSize+" bytes to "+newSize+" bytes, not enough memory!");return false}var JSEvents={keyEvent:0,mouseEvent:0,wheelEvent:0,uiEvent:0,focusEvent:0,deviceOrientationEvent:0,deviceMotionEvent:0,fullscreenChangeEvent:0,pointerlockChangeEvent:0,visibilityChangeEvent:0,touchEvent:0,previousFullscreenElement:null,previousScreenX:null,previousScreenY:null,removeEventListenersRegistered:false,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;GROWABLE_HEAP_I32()[varargs+4>>2]=eventData;GROWABLE_HEAP_I32()[varargs+8>>2]=userData;_emscripten_async_queue_on_thread_(targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}GROWABLE_HEAP_I32()[varargs>>2]=targetCanvasPtr;GROWABLE_HEAP_I32()[varargs+4>>2]=width;GROWABLE_HEAP_I32()[varargs+8>>2]=height;_emscripten_async_queue_on_thread_(targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function __maybeCStringToJsString(cString){return cString===cString+0?UTF8ToString(cString):cString}var __specialEventTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function __findEventTarget(target){var domElement=__specialEventTargets[target]||(typeof document!=="undefined"?document.querySelector(__maybeCStringToJsString(target)):undefined);return domElement}function __findCanvasEventTarget(target){return __findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=__findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){GROWABLE_HEAP_I32()[canvas.canvasSharedPtr>>2]=width;GROWABLE_HEAP_I32()[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=GROWABLE_HEAP_I32()[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=__findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){newStatus=newStatus|0}function __webgl_acquireInstancedArraysExtension(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)}}}function __webgl_acquireVertexArrayObjectExtension(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)}}}function __webgl_acquireDrawBuffersExtension(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)}}}var GL={counter:1,lastError:0,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},currentContext:null,offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,init:function(){var miniTempFloatBuffer=new Float32Array(GL.MINI_TEMP_BUFFER_SIZE);for(var i=0;i>2]:-1;source+=UTF8ToString(GROWABLE_HEAP_I32()[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);GROWABLE_HEAP_I32()[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;if(context.version<2){__webgl_acquireInstancedArraysExtension(GLctx);__webgl_acquireVertexArrayObjectExtension(GLctx);__webgl_acquireDrawBuffersExtension(GLctx)}GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query");var automaticallyEnabledExtensions=["OES_texture_float","OES_texture_half_float","OES_standard_derivatives","OES_vertex_array_object","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","OES_element_index_uint","EXT_texture_filter_anisotropic","EXT_frag_depth","WEBGL_draw_buffers","ANGLE_instanced_arrays","OES_texture_float_linear","OES_texture_half_float_linear","EXT_blend_minmax","EXT_shader_texture_lod","EXT_texture_norm16","WEBGL_compressed_texture_pvrtc","EXT_color_buffer_half_float","WEBGL_color_buffer_float","EXT_sRGB","WEBGL_compressed_texture_etc1","EXT_disjoint_timer_query","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_astc","EXT_color_buffer_float","WEBGL_compressed_texture_s3tc_srgb","EXT_disjoint_timer_query_webgl2","WEBKIT_WEBGL_compressed_texture_pvrtc"];var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(automaticallyEnabledExtensions.indexOf(ext)!=-1){GLctx.getExtension(ext)}})},populateUniformTable:function(program){var p=GL.programs[program];var ptable=GL.programInfos[program]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1};var utable=ptable.uniforms;var numUniforms=GLctx.getProgramParameter(p,35718);for(var i=0;i>2;contextAttributes["alpha"]=!!GROWABLE_HEAP_I32()[a+(0>>2)];contextAttributes["depth"]=!!GROWABLE_HEAP_I32()[a+(4>>2)];contextAttributes["stencil"]=!!GROWABLE_HEAP_I32()[a+(8>>2)];contextAttributes["antialias"]=!!GROWABLE_HEAP_I32()[a+(12>>2)];contextAttributes["premultipliedAlpha"]=!!GROWABLE_HEAP_I32()[a+(16>>2)];contextAttributes["preserveDrawingBuffer"]=!!GROWABLE_HEAP_I32()[a+(20>>2)];var powerPreference=GROWABLE_HEAP_I32()[a+(24>>2)];contextAttributes["powerPreference"]=__emscripten_webgl_power_preferences[powerPreference];contextAttributes["failIfMajorPerformanceCaveat"]=!!GROWABLE_HEAP_I32()[a+(28>>2)];contextAttributes.majorVersion=GROWABLE_HEAP_I32()[a+(32>>2)];contextAttributes.minorVersion=GROWABLE_HEAP_I32()[a+(36>>2)];contextAttributes.enableExtensionsByDefault=GROWABLE_HEAP_I32()[a+(40>>2)];contextAttributes.explicitSwapControl=GROWABLE_HEAP_I32()[a+(44>>2)];contextAttributes.proxyContextToMainThread=GROWABLE_HEAP_I32()[a+(48>>2)];contextAttributes.renderViaOffscreenBackBuffer=GROWABLE_HEAP_I32()[a+(52>>2)];var canvas=__findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];assert(buffer);if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:undefined,get:function(){assert(SYSCALLS.varargs!=undefined);SYSCALLS.varargs+=4;var ret=GROWABLE_HEAP_I32()[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){if(low>=0)assert(high===0);else assert(high===-1);return low}};function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,fd);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM");return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,fd,offset_low,offset_high,whence,newOffset);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM")}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd,iov,iovcnt,pnum);var num=0;for(var i=0;i>2];var len=GROWABLE_HEAP_I32()[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}function _pthread_cleanup_pop(execute){var routine=PThread.exitHandlers.pop();if(execute)routine()}function _pthread_cleanup_push(routine,arg){if(PThread.exitHandlers===null){PThread.exitHandlers=[]}PThread.exitHandlers.push(function(){dynCall_vi(routine,arg)})}function __spawn_thread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _spawn_thread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){GROWABLE_HEAP_I32()[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,thread:threadParams.pthread_ptr,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(GROWABLE_HEAP_U32(),tis+(0>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(4>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(8>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(68>>2),threadParams.detached);Atomics.store(GROWABLE_HEAP_U32(),tis+(104>>2),tlsMemory);Atomics.store(GROWABLE_HEAP_U32(),tis+(48>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(40>>2),pthread.threadInfoStruct);Atomics.store(GROWABLE_HEAP_U32(),tis+(44>>2),42);Atomics.store(GROWABLE_HEAP_U32(),tis+(108>>2),threadParams.stackSize);Atomics.store(GROWABLE_HEAP_U32(),tis+(84>>2),threadParams.stackSize);Atomics.store(GROWABLE_HEAP_U32(),tis+(80>>2),stackHigh);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+8>>2),stackHigh);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+12>>2),threadParams.detached);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+20>>2),threadParams.schedPolicy);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+24>>2),threadParams.schedPrio);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(GROWABLE_HEAP_U32(),tis+(176>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"selfThreadId":threadParams.pthread_ptr,"parentThreadId":threadParams.parent_pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}}function _pthread_getschedparam(thread,policy,schedparam){if(!policy&&!schedparam)return ERRNO_CODES.EINVAL;if(!thread){err("pthread_getschedparam called with a null thread pointer!");return ERRNO_CODES.ESRCH}var self=GROWABLE_HEAP_I32()[thread+12>>2];if(self!==thread){err("pthread_getschedparam attempted on thread "+thread+", which does not point to a valid thread, or does not exist anymore!");return ERRNO_CODES.ESRCH}var schedPolicy=Atomics.load(GROWABLE_HEAP_U32(),thread+108+20>>2);var schedPrio=Atomics.load(GROWABLE_HEAP_U32(),thread+108+24>>2);if(policy)GROWABLE_HEAP_I32()[policy>>2]=schedPolicy;if(schedparam)GROWABLE_HEAP_I32()[schedparam>>2]=schedPrio;return 0}function _pthread_self(){return __pthread_ptr|0}Module["_pthread_self"]=_pthread_self;function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;var schedPolicy=0;var schedPrio=0;if(attr){stackSize=GROWABLE_HEAP_I32()[attr>>2];stackSize+=81920;stackBase=GROWABLE_HEAP_I32()[attr+8>>2];detached=GROWABLE_HEAP_I32()[attr+12>>2]!==0;var inheritSched=GROWABLE_HEAP_I32()[attr+16>>2]===0;if(inheritSched){var prevSchedPolicy=GROWABLE_HEAP_I32()[attr+20>>2];var prevSchedPrio=GROWABLE_HEAP_I32()[attr+24>>2];var parentThreadPtr=PThread.currentProxiedOperationCallerThread?PThread.currentProxiedOperationCallerThread:_pthread_self();_pthread_getschedparam(parentThreadPtr,attr+20,attr+24);schedPolicy=GROWABLE_HEAP_I32()[attr+20>>2];schedPrio=GROWABLE_HEAP_I32()[attr+24>>2];GROWABLE_HEAP_I32()[attr+20>>2]=prevSchedPolicy;GROWABLE_HEAP_I32()[attr+24>>2]=prevSchedPrio}else{schedPolicy=GROWABLE_HEAP_I32()[attr+20>>2];schedPrio=GROWABLE_HEAP_I32()[attr+24>>2]}}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(232);for(var i=0;i<232>>2;++i)GROWABLE_HEAP_U32()[(threadInfoStruct>>2)+i]=0;GROWABLE_HEAP_I32()[pthread_ptr>>2]=threadInfoStruct;GROWABLE_HEAP_I32()[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+156;GROWABLE_HEAP_I32()[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,schedPolicy:schedPolicy,schedPrio:schedPrio,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,parent_pthread_ptr:_pthread_self(),arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList)}else{__spawn_thread(threadParams)}return 0}function _roundf(d){d=+d;return d>=+0?+Math_floor(d+ +.5):+Math_ceil(d-+.5)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();else PThread.initWorker();var GLctx;GL.init();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_fd_close,_fd_seek,_fd_write];var asmLibraryArg={"__assert_fail":___assert_fail,"__handle_stack_overflow":___handle_stack_overflow,"_emscripten_notify_thread_queue":__emscripten_notify_thread_queue,"abort":_abort,"emscripten_conditional_set_current_thread_status":_emscripten_conditional_set_current_thread_status,"emscripten_futex_wait":_emscripten_futex_wait,"emscripten_futex_wake":_emscripten_futex_wake,"emscripten_get_now":_emscripten_get_now,"emscripten_is_main_browser_thread":_emscripten_is_main_browser_thread,"emscripten_is_main_runtime_thread":_emscripten_is_main_runtime_thread,"emscripten_memcpy_big":_emscripten_memcpy_big,"emscripten_receive_on_main_thread_js":_emscripten_receive_on_main_thread_js,"emscripten_resize_heap":_emscripten_resize_heap,"emscripten_set_canvas_element_size":_emscripten_set_canvas_element_size,"emscripten_set_current_thread_status":_emscripten_set_current_thread_status,"emscripten_webgl_create_context":_emscripten_webgl_create_context,"fd_close":_fd_close,"fd_seek":_fd_seek,"fd_write":_fd_write,"initPthreadsJS":initPthreadsJS,"memory":wasmMemory||Module["wasmMemory"],"pthread_cleanup_pop":_pthread_cleanup_pop,"pthread_cleanup_push":_pthread_cleanup_push,"pthread_create":_pthread_create,"pthread_self":_pthread_self,"roundf":_roundf,"table":wasmTable};var asm=createWasm();Module["asm"]=asm;var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__wasm_call_ctors"].apply(null,arguments)};var _init=Module["_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["init"].apply(null,arguments)};var _register_tensor=Module["_register_tensor"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["register_tensor"].apply(null,arguments)};var _dispose_data=Module["_dispose_data"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose_data"].apply(null,arguments)};var _dispose=Module["_dispose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose"].apply(null,arguments)};var _Abs=Module["_Abs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Abs"].apply(null,arguments)};var _Add=Module["_Add"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Add"].apply(null,arguments)};var _AddN=Module["_AddN"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AddN"].apply(null,arguments)};var _ArgMax=Module["_ArgMax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ArgMax"].apply(null,arguments)};var _AvgPool=Module["_AvgPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AvgPool"].apply(null,arguments)};var _BatchMatMul=Module["_BatchMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["BatchMatMul"].apply(null,arguments)};var _ClipByValue=Module["_ClipByValue"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ClipByValue"].apply(null,arguments)};var _Conv2D=Module["_Conv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Conv2D"].apply(null,arguments)};var _Cos=Module["_Cos"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Cos"].apply(null,arguments)};var _CropAndResize=Module["_CropAndResize"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["CropAndResize"].apply(null,arguments)};var _DepthwiseConv2dNative=Module["_DepthwiseConv2dNative"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["DepthwiseConv2dNative"].apply(null,arguments)};var _Div=Module["_Div"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Div"].apply(null,arguments)};var _Exp=Module["_Exp"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Exp"].apply(null,arguments)};var _FloorDiv=Module["_FloorDiv"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FloorDiv"].apply(null,arguments)};var _FusedBatchNorm=Module["_FusedBatchNorm"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedBatchNorm"].apply(null,arguments)};var _FusedConv2D=Module["_FusedConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedConv2D"].apply(null,arguments)};var _FusedDepthwiseConv2D=Module["_FusedDepthwiseConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedDepthwiseConv2D"].apply(null,arguments)};var _Gather=Module["_Gather"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Gather"].apply(null,arguments)};var _GatherNd=Module["_GatherNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GatherNd"].apply(null,arguments)};var _Greater=Module["_Greater"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Greater"].apply(null,arguments)};var _GreaterEqual=Module["_GreaterEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GreaterEqual"].apply(null,arguments)};var _Less=Module["_Less"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Less"].apply(null,arguments)};var _LessEqual=Module["_LessEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LessEqual"].apply(null,arguments)};var _Log=Module["_Log"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Log"].apply(null,arguments)};var _LogicalAnd=Module["_LogicalAnd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LogicalAnd"].apply(null,arguments)};var _Max=Module["_Max"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Max"].apply(null,arguments)};var _MaxPool=Module["_MaxPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["MaxPool"].apply(null,arguments)};var _Maximum=Module["_Maximum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Maximum"].apply(null,arguments)};var _Min=Module["_Min"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Min"].apply(null,arguments)};var _Minimum=Module["_Minimum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Minimum"].apply(null,arguments)};var _Mul=Module["_Mul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Mul"].apply(null,arguments)};var _Neg=Module["_Neg"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Neg"].apply(null,arguments)};var _NonMaxSuppressionV3=Module["_NonMaxSuppressionV3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV3"].apply(null,arguments)};var _NonMaxSuppressionV5=Module["_NonMaxSuppressionV5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV5"].apply(null,arguments)};var _NotEqual=Module["_NotEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NotEqual"].apply(null,arguments)};var _PadV2=Module["_PadV2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["PadV2"].apply(null,arguments)};var _Pow=Module["_Pow"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Pow"].apply(null,arguments)};var _Prelu=Module["_Prelu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Prelu"].apply(null,arguments)};var _Relu=Module["_Relu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu"].apply(null,arguments)};var _Relu6=Module["_Relu6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu6"].apply(null,arguments)};var _ResizeBilinear=Module["_ResizeBilinear"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ResizeBilinear"].apply(null,arguments)};var _Rsqrt=Module["_Rsqrt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Rsqrt"].apply(null,arguments)};var _ScatterNd=Module["_ScatterNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ScatterNd"].apply(null,arguments)};var _Sigmoid=Module["_Sigmoid"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sigmoid"].apply(null,arguments)};var _Sin=Module["_Sin"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sin"].apply(null,arguments)};var _Softmax=Module["_Softmax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Softmax"].apply(null,arguments)};var _Square=Module["_Square"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Square"].apply(null,arguments)};var _Sub=Module["_Sub"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sub"].apply(null,arguments)};var _Sum=Module["_Sum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sum"].apply(null,arguments)};var _Tanh=Module["_Tanh"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tanh"].apply(null,arguments)};var _Tile=Module["_Tile"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tile"].apply(null,arguments)};var _Transpose=Module["_Transpose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Transpose"].apply(null,arguments)};var __FusedMatMul=Module["__FusedMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_FusedMatMul"].apply(null,arguments)};var _malloc=Module["_malloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["malloc"].apply(null,arguments)};var _free=Module["_free"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["free"].apply(null,arguments)};var ___em_js__initPthreadsJS=Module["___em_js__initPthreadsJS"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__em_js__initPthreadsJS"].apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_get_global_libc"].apply(null,arguments)};var _memalign=Module["_memalign"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["memalign"].apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__pthread_tsd_run_dtors"].apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null,arguments)};var _emscripten_main_browser_thread_id=Module["_emscripten_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_browser_thread_id"].apply(null,arguments)};var _emscripten_async_run_in_main_thread=Module["_emscripten_async_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread=Module["_emscripten_sync_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_0=Module["_emscripten_sync_run_in_main_thread_0"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_1=Module["_emscripten_sync_run_in_main_thread_1"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_2=Module["_emscripten_sync_run_in_main_thread_2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_xprintf_varargs=Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_3=Module["_emscripten_sync_run_in_main_thread_3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_5=Module["_emscripten_sync_run_in_main_thread_5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_6=Module["_emscripten_sync_run_in_main_thread_6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_7=Module["_emscripten_sync_run_in_main_thread_7"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null,arguments)};var _emscripten_async_queue_on_thread_=Module["_emscripten_async_queue_on_thread_"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_tls_init"].apply(null,arguments)};var ___set_stack_limit=Module["___set_stack_limit"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__set_stack_limit"].apply(null,arguments)};var stackSave=Module["stackSave"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackSave"].apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackAlloc"].apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackRestore"].apply(null,arguments)};var dynCall_vi=Module["dynCall_vi"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_vi"].apply(null,arguments)};var dynCall_v=Module["dynCall_v"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_v"].apply(null,arguments)};var dynCall_ii=Module["dynCall_ii"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_ii"].apply(null,arguments)};Module["asm"]=asm;if(!Object.getOwnPropertyDescriptor(Module,"intArrayFromString"))Module["intArrayFromString"]=function(){abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"intArrayToString"))Module["intArrayToString"]=function(){abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ccall"))Module["ccall"]=function(){abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["cwrap"]=cwrap;if(!Object.getOwnPropertyDescriptor(Module,"setValue"))Module["setValue"]=function(){abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getValue"))Module["getValue"]=function(){abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocate"))Module["allocate"]=function(){abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getMemory"))Module["getMemory"]=function(){abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ArrayToString"))Module["UTF8ArrayToString"]=function(){abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ToString"))Module["UTF8ToString"]=function(){abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8Array"))Module["stringToUTF8Array"]=function(){abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8"))Module["stringToUTF8"]=function(){abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF8"))Module["lengthBytesUTF8"]=function(){abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreRun"))Module["addOnPreRun"]=function(){abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnInit"))Module["addOnInit"]=function(){abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreMain"))Module["addOnPreMain"]=function(){abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnExit"))Module["addOnExit"]=function(){abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPostRun"))Module["addOnPostRun"]=function(){abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeStringToMemory"))Module["writeStringToMemory"]=function(){abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeArrayToMemory"))Module["writeArrayToMemory"]=function(){abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeAsciiToMemory"))Module["writeAsciiToMemory"]=function(){abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addRunDependency"))Module["addRunDependency"]=function(){abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"removeRunDependency"))Module["removeRunDependency"]=function(){abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createFolder"))Module["FS_createFolder"]=function(){abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPath"))Module["FS_createPath"]=function(){abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDataFile"))Module["FS_createDataFile"]=function(){abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPreloadedFile"))Module["FS_createPreloadedFile"]=function(){abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLazyFile"))Module["FS_createLazyFile"]=function(){abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLink"))Module["FS_createLink"]=function(){abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDevice"))Module["FS_createDevice"]=function(){abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_unlink"))Module["FS_unlink"]=function(){abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"dynamicAlloc"))Module["dynamicAlloc"]=function(){abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadDynamicLibrary"))Module["loadDynamicLibrary"]=function(){abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadWebAssemblyModule"))Module["loadWebAssemblyModule"]=function(){abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getLEB"))Module["getLEB"]=function(){abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFunctionTables"))Module["getFunctionTables"]=function(){abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"alignFunctionTables"))Module["alignFunctionTables"]=function(){abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"registerFunctions"))Module["registerFunctions"]=function(){abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addFunction"))Module["addFunction"]=function(){abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"removeFunction"))Module["removeFunction"]=function(){abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFuncWrapper"))Module["getFuncWrapper"]=function(){abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"prettyPrint"))Module["prettyPrint"]=function(){abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"makeBigInt"))Module["makeBigInt"]=function(){abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"dynCall"))Module["dynCall"]=function(){abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getCompilerSetting"))Module["getCompilerSetting"]=function(){abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"print"))Module["print"]=function(){abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"printErr"))Module["printErr"]=function(){abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getTempRet0"))Module["getTempRet0"]=function(){abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setTempRet0"))Module["setTempRet0"]=function(){abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"callMain"))Module["callMain"]=function(){abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"abort"))Module["abort"]=function(){abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToNewUTF8"))Module["stringToNewUTF8"]=function(){abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscripten_realloc_buffer"))Module["emscripten_realloc_buffer"]=function(){abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ENV"))Module["ENV"]=function(){abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setjmpId"))Module["setjmpId"]=function(){abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_CODES"))Module["ERRNO_CODES"]=function(){abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_MESSAGES"))Module["ERRNO_MESSAGES"]=function(){abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setErrNo"))Module["setErrNo"]=function(){abort("'setErrNo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"DNS"))Module["DNS"]=function(){abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GAI_ERRNO_MESSAGES"))Module["GAI_ERRNO_MESSAGES"]=function(){abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Protocols"))Module["Protocols"]=function(){abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Sockets"))Module["Sockets"]=function(){abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UNWIND_CACHE"))Module["UNWIND_CACHE"]=function(){abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readAsmConstArgs"))Module["readAsmConstArgs"]=function(){abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_q"))Module["jstoi_q"]=function(){abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_s"))Module["jstoi_s"]=function(){abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH"))Module["PATH"]=function(){abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH_FS"))Module["PATH_FS"]=function(){abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SYSCALLS"))Module["SYSCALLS"]=function(){abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMmap2"))Module["syscallMmap2"]=function(){abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMunmap"))Module["syscallMunmap"]=function(){abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"flush_NO_FILESYSTEM"))Module["flush_NO_FILESYSTEM"]=function(){abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"JSEvents"))Module["JSEvents"]=function(){abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangle"))Module["demangle"]=function(){abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangleAll"))Module["demangleAll"]=function(){abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jsStackTrace"))Module["jsStackTrace"]=function(){abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getEnvStrings"))Module["getEnvStrings"]=function(){abort("'getEnvStrings' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64"))Module["writeI53ToI64"]=function(){abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Clamped"))Module["writeI53ToI64Clamped"]=function(){abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Signaling"))Module["writeI53ToI64Signaling"]=function(){abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Clamped"))Module["writeI53ToU64Clamped"]=function(){abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Signaling"))Module["writeI53ToU64Signaling"]=function(){abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromI64"))Module["readI53FromI64"]=function(){abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromU64"))Module["readI53FromU64"]=function(){abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertI32PairToI53"))Module["convertI32PairToI53"]=function(){abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertU32PairToI53"))Module["convertU32PairToI53"]=function(){abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Browser"))Module["Browser"]=function(){abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GL"))Module["GL"]=function(){abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGet"))Module["emscriptenWebGLGet"]=function(){abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetTexPixelData"))Module["emscriptenWebGLGetTexPixelData"]=function(){abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetUniform"))Module["emscriptenWebGLGetUniform"]=function(){abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetVertexAttrib"))Module["emscriptenWebGLGetVertexAttrib"]=function(){abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AL"))Module["AL"]=function(){abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_unicode"))Module["SDL_unicode"]=function(){abort("'SDL_unicode' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_ttfContext"))Module["SDL_ttfContext"]=function(){abort("'SDL_ttfContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_audio"))Module["SDL_audio"]=function(){abort("'SDL_audio' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL"))Module["SDL"]=function(){abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_gfx"))Module["SDL_gfx"]=function(){abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLUT"))Module["GLUT"]=function(){abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"EGL"))Module["EGL"]=function(){abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW_Window"))Module["GLFW_Window"]=function(){abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW"))Module["GLFW"]=function(){abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLEW"))Module["GLEW"]=function(){abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"IDBStore"))Module["IDBStore"]=function(){abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"runAndAbortIfError"))Module["runAndAbortIfError"]=function(){abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["PThread"]=PThread;if(!Object.getOwnPropertyDescriptor(Module,"establishStackSpace"))Module["establishStackSpace"]=function(){abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getNoExitRuntime"))Module["getNoExitRuntime"]=function(){abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"resetPrototype"))Module["resetPrototype"]=function(){abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"warnOnce"))Module["warnOnce"]=function(){abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackSave"))Module["stackSave"]=function(){abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackRestore"))Module["stackRestore"]=function(){abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackAlloc"))Module["stackAlloc"]=function(){abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AsciiToString"))Module["AsciiToString"]=function(){abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToAscii"))Module["stringToAscii"]=function(){abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF16ToString"))Module["UTF16ToString"]=function(){abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF16"))Module["stringToUTF16"]=function(){abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF16"))Module["lengthBytesUTF16"]=function(){abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF32ToString"))Module["UTF32ToString"]=function(){abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF32"))Module["stringToUTF32"]=function(){abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF32"))Module["lengthBytesUTF32"]=function(){abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8"))Module["allocateUTF8"]=function(){abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8OnStack"))Module["allocateUTF8OnStack"]=function(){abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["writeStackCookie"]=writeStackCookie;Module["checkStackCookie"]=checkStackCookie;Module["abortStackOverflow"]=abortStackOverflow;Module["PThread"]=PThread;Module["_pthread_self"]=_pthread_self;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NORMAL"))Object.defineProperty(Module,"ALLOC_NORMAL",{configurable:true,get:function(){abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_STACK"))Object.defineProperty(Module,"ALLOC_STACK",{configurable:true,get:function(){abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_DYNAMIC"))Object.defineProperty(Module,"ALLOC_DYNAMIC",{configurable:true,get:function(){abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NONE"))Object.defineProperty(Module,"ALLOC_NONE",{configurable:true,get:function(){abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});var calledRun;Module["then"]=function(func){if(calledRun){func(Module)}else{var old=Module["onRuntimeInitialized"];Module["onRuntimeInitialized"]=function(){if(old)old();func(Module)}}return Module};function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}writeStackCookie();preRun();if(runDependencies>0)return;function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();assert(!Module["_main"],'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}checkStackCookie()}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}if(!ENVIRONMENT_IS_PTHREAD)noExitRuntime=true;if(!ENVIRONMENT_IS_PTHREAD)run(); +var Module=typeof WasmBackendModule!=="undefined"?WasmBackendModule:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(Module["ENVIRONMENT"]){throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)")}var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"];DYNAMIC_BASE=Module["DYNAMIC_BASE"];DYNAMICTOP_PTR=Module["DYNAMICTOP_PTR"]}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{throw new Error("environment detection error")}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(!Object.getOwnPropertyDescriptor(Module,"arguments"))Object.defineProperty(Module,"arguments",{configurable:true,get:function(){abort("Module.arguments has been replaced with plain arguments_")}});if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(!Object.getOwnPropertyDescriptor(Module,"thisProgram"))Object.defineProperty(Module,"thisProgram",{configurable:true,get:function(){abort("Module.thisProgram has been replaced with plain thisProgram")}});if(Module["quit"])quit_=Module["quit"];if(!Object.getOwnPropertyDescriptor(Module,"quit"))Object.defineProperty(Module,"quit",{configurable:true,get:function(){abort("Module.quit has been replaced with plain quit_")}});assert(typeof Module["memoryInitializerPrefixURL"]==="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["pthreadMainPrefixURL"]==="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["cdInitializerPrefixURL"]==="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["filePackagePrefixURL"]==="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["read"]==="undefined","Module.read option was removed (modify read_ in JS)");assert(typeof Module["readAsync"]==="undefined","Module.readAsync option was removed (modify readAsync in JS)");assert(typeof Module["readBinary"]==="undefined","Module.readBinary option was removed (modify readBinary in JS)");assert(typeof Module["setWindowTitle"]==="undefined","Module.setWindowTitle option was removed (modify setWindowTitle in JS)");assert(typeof Module["TOTAL_MEMORY"]==="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY");if(!Object.getOwnPropertyDescriptor(Module,"read"))Object.defineProperty(Module,"read",{configurable:true,get:function(){abort("Module.read has been replaced with plain read_")}});if(!Object.getOwnPropertyDescriptor(Module,"readAsync"))Object.defineProperty(Module,"readAsync",{configurable:true,get:function(){abort("Module.readAsync has been replaced with plain readAsync")}});if(!Object.getOwnPropertyDescriptor(Module,"readBinary"))Object.defineProperty(Module,"readBinary",{configurable:true,get:function(){abort("Module.readBinary has been replaced with plain readBinary")}});if(!Object.getOwnPropertyDescriptor(Module,"setWindowTitle"))Object.defineProperty(Module,"setWindowTitle",{configurable:true,get:function(){abort("Module.setWindowTitle has been replaced with plain setWindowTitle")}});assert(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER||ENVIRONMENT_IS_NODE,"Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)");var stackSave;var stackRestore;var stackAlloc;stackSave=stackRestore=stackAlloc=function(){abort("cannot use the stack before compiled code is ready to run, and has provided stack access")};function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(!Object.getOwnPropertyDescriptor(Module,"wasmBinary"))Object.defineProperty(Module,"wasmBinary",{configurable:true,get:function(){abort("Module.wasmBinary has been replaced with plain wasmBinary")}});var noExitRuntime;if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(!Object.getOwnPropertyDescriptor(Module,"noExitRuntime"))Object.defineProperty(Module,"noExitRuntime",{configurable:true,get:function(){abort("Module.noExitRuntime has been replaced with plain noExitRuntime")}});if(typeof WebAssembly!=="object"){abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.")}var wasmMemory;var wasmTable=new WebAssembly.Table({"initial":119,"maximum":119+0,"element":"anyfunc"});var wasmModule;var threadInfoStruct=0;var selfThreadId=0;var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string")return UTF8ToString(ret);if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{if((u0&248)!=240)warnOnce("Invalid UTF-8 leading byte 0x"+u0.toString(16)+" encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!");u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;if(u>=2097152)warnOnce("Invalid Unicode code point 0x"+u.toString(16)+" encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF).");heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");HEAP8.set(array,buffer)}var WASM_PAGE_SIZE=65536;var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var STACK_BASE=5255808,STACKTOP=STACK_BASE,STACK_MAX=12928,DYNAMIC_BASE=5255808,DYNAMICTOP_PTR=12e3;assert(STACK_BASE%16===0,"stack must start aligned");assert(DYNAMIC_BASE%16===0,"heap must start aligned");if(ENVIRONMENT_IS_PTHREAD){STACK_MAX=STACKTOP=STACK_MAX=2147483647}var TOTAL_STACK=5242880;if(Module["TOTAL_STACK"])assert(TOTAL_STACK===Module["TOTAL_STACK"],"the stack size can no longer be determined at runtime");var INITIAL_INITIAL_MEMORY=Module["INITIAL_MEMORY"]||1073741824;if(!Object.getOwnPropertyDescriptor(Module,"INITIAL_MEMORY"))Object.defineProperty(Module,"INITIAL_MEMORY",{configurable:true,get:function(){abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY")}});assert(INITIAL_INITIAL_MEMORY>=TOTAL_STACK,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+INITIAL_INITIAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");assert(typeof Int32Array!=="undefined"&&typeof Float64Array!=="undefined"&&Int32Array.prototype.subarray!==undefined&&Int32Array.prototype.set!==undefined,"JS engine does not provide full typed array support");if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,"maximum":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_INITIAL_MEMORY=buffer.byteLength;assert(INITIAL_INITIAL_MEMORY%WASM_PAGE_SIZE===0);updateGlobalBufferAndViews(buffer);if(!ENVIRONMENT_IS_PTHREAD){HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE}function writeStackCookie(){assert((STACK_MAX&3)==0);HEAPU32[(STACK_MAX>>2)+1]=34821223;HEAPU32[(STACK_MAX>>2)+2]=2310721022;HEAP32[0]=1668509029}function checkStackCookie(){var cookie1=HEAPU32[(STACK_MAX>>2)+1];var cookie2=HEAPU32[(STACK_MAX>>2)+2];if(cookie1!=34821223||cookie2!=2310721022){abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+cookie2.toString(16)+" "+cookie1.toString(16))}if(HEAP32[0]!==1668509029)abort("Runtime error: The application has corrupted its heap memory area (address zero)!")}function abortStackOverflow(allocSize){abort("Stack overflow! Attempted to allocate "+allocSize+" bytes on the stack, but stack has only "+(STACK_MAX-stackSave()+allocSize)+" bytes available!")}(function(){var h16=new Int16Array(1);var h8=new Int8Array(h16.buffer);h16[0]=25459;if(h8[0]!==115||h8[1]!==99)throw"Runtime error: expected the system to be little-endian!"})();function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;if(ENVIRONMENT_IS_PTHREAD)runtimeInitialized=true;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){checkStackCookie();assert(!runtimeInitialized);runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATMAIN__)}function postRun(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Math_ceil=Math.ceil;var Math_floor=Math.floor;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!=="undefined"){runDependencyWatcher=setInterval(function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;err("still waiting on run dependencies:")}err("dependency: "+dep)}if(shown){err("(end of list)")}},1e4)}}else{err("warning: run dependency added without ID")}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id]}else{err("warning: run dependency removed without ID")}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";out(what);err(what);ABORT=true;EXITSTATUS=1;var output="abort("+what+") at "+stackTrace();what=output;throw new WebAssembly.RuntimeError(what)}var FS={error:function(){abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1")},init:function(){FS.error()},createDataFile:function(){FS.error()},createPreloadedFile:function(){FS.error()},createLazyFile:function(){FS.error()},open:function(){FS.error()},mkdev:function(){FS.error()},registerDevice:function(){FS.error()},analyzePath:function(){FS.error()},loadFilesFromDB:function(){FS.error()},ErrnoError:function ErrnoError(){FS.error()}};Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;function hasPrefix(str,prefix){return String.prototype.startsWith?str.startsWith(prefix):str.indexOf(prefix)===0}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return hasPrefix(filename,dataURIPrefix)}var fileURIPrefix="file://";function isFileURI(filename){return hasPrefix(filename,fileURIPrefix)}var wasmBinaryFile="tfjs-backend-wasm.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(){try{if(wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(wasmBinaryFile)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary()})}return new Promise(function(resolve,reject){resolve(getBinary())})}function createWasm(){var info={"env":asmLibraryArg,"wasi_snapshot_preview1":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){var numWorkersToLoad=PThread.unusedWorkers.length;PThread.unusedWorkers.forEach(function(w){PThread.loadWasmModuleToWorker(w,function(){if(!--numWorkersToLoad)removeRunDependency("wasm-instantiate")})})}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}var trueModule=Module;function receiveInstantiatedSource(output){assert(Module===trueModule,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");trueModule=null;receiveInstance(output["instance"],output["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var ASM_CONSTS={};function initPthreadsJS(){PThread.initRuntime()}if(!ENVIRONMENT_IS_PTHREAD)__ATINIT__.push({func:function(){___wasm_call_ctors()}});function demangle(func){warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return func}function demangleAll(text){var regex=/\b_Z[\w\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"})}var __pthread_ptr=0;var __pthread_is_main_runtime_thread=0;var __pthread_is_main_browser_thread=0;function __register_pthread_ptr(pthreadPtr,isMainBrowserThread,isMainRuntimeThread){pthreadPtr=pthreadPtr|0;isMainBrowserThread=isMainBrowserThread|0;isMainRuntimeThread=isMainRuntimeThread|0;__pthread_ptr=pthreadPtr;__pthread_is_main_browser_thread=isMainBrowserThread;__pthread_is_main_runtime_thread=isMainRuntimeThread}Module["__register_pthread_ptr"]=__register_pthread_ptr;var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var __main_thread_futex_wait_address=12912;function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__main_thread_futex_wait_address>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__main_thread_futex_wait_address>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function __kill_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _kill_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _kill_thread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function __cancel_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cancel_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cancel_thread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function __cleanup_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cleanup_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cleanup_thread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];if(pthread){var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={MAIN_THREAD_ID:1,mainThreadInfo:{schedPolicy:0,schedPrio:0},unusedWorkers:[],runningWorkers:[],initRuntime:function(){__register_pthread_ptr(PThread.mainThreadBlock,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(PThread.mainThreadBlock)},initMainThreadBlock:function(){assert(!ENVIRONMENT_IS_PTHREAD);var pthreadPoolSize=8;for(var i=0;i>2]=PThread.mainThreadBlock;var headPtr=PThread.mainThreadBlock+156;HEAP32[headPtr>>2]=headPtr;var tlsMemory=12400;for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,PThread.mainThreadBlock+104>>2,tlsMemory);Atomics.store(HEAPU32,PThread.mainThreadBlock+40>>2,PThread.mainThreadBlock);Atomics.store(HEAPU32,PThread.mainThreadBlock+44>>2,42)},initWorker:function(){},pthreads:{},exitHandlers:null,setThreadStatus:function(){},runExitHandlers:function(){if(PThread.exitHandlers!==null){while(PThread.exitHandlers.length>0){PThread.exitHandlers.pop()()}PThread.exitHandlers=null}if(ENVIRONMENT_IS_PTHREAD&&threadInfoStruct)___pthread_tsd_run_dtors()},threadExit:function(exitCode){var tb=_pthread_self();if(tb){err("Pthread 0x"+tb.toString(16)+" exited.");Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);Atomics.store(HEAPU32,tb+60>>2,1);Atomics.store(HEAPU32,tb+64>>2,0);PThread.runExitHandlers();_emscripten_futex_wake(tb+0,2147483647);__register_pthread_ptr(0,0,0);threadInfoStruct=0;if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlers();Atomics.store(HEAPU32,threadInfoStruct+4>>2,-1);Atomics.store(HEAPU32,threadInfoStruct+0>>2,1);_emscripten_futex_wake(threadInfoStruct+0,2147483647);threadInfoStruct=selfThreadId=0;__register_pthread_ptr(0,0,0);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+104>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){delete PThread.pthreads[worker.pthread.thread];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined},receiveObjectTransfer:function(data){},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){__spawn_thread(e.data)}else if(cmd==="cleanupThread"){__cleanup_thread(d["thread"])}else if(cmd==="killThread"){__kill_thread(d["thread"])}else if(cmd==="cancelThread"){__cancel_thread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.thread+68>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){console.log("worker exited - TODO: update the worker queue?")})}assert(wasmMemory instanceof WebAssembly.Memory,"WebAssembly memory should have been loaded by now!");assert(wasmModule instanceof WebAssembly.Module,"WebAssembly Module should have been loaded by now!");worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule,"DYNAMIC_BASE":DYNAMIC_BASE,"DYNAMICTOP_PTR":DYNAMICTOP_PTR})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("tfjs-backend-wasm.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}if(PThread.unusedWorkers.length>0)return PThread.unusedWorkers.pop();else return null},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()>2]=value;return value}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg);warnOnce("atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)");__ATEXIT__.unshift({func:func,arg:arg})}function ___handle_stack_overflow(){abort("stack overflow")}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){err("Cannot send message to thread with ID "+targetThreadId+", unknown thread ID!");return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){expectedStatus=expectedStatus|0;newStatus=newStatus|0}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(ENVIRONMENT_IS_WORKER){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{var loadedVal=Atomics.load(HEAP32,addr>>2);if(val!=loadedVal)return-6;var tNow=performance.now();var tEnd=tNow+timeout;Atomics.store(HEAP32,__main_thread_futex_wait_address>>2,addr);var ourWaitAddress=addr;while(addr==ourWaitAddress){tNow=performance.now();if(tNow>tEnd){return-73}_emscripten_main_thread_process_queued_calls();addr=Atomics.load(HEAP32,__main_thread_futex_wait_address>>2)}return 0}}function _emscripten_is_main_browser_thread(){return __pthread_is_main_browser_thread|0}function _emscripten_is_main_runtime_thread(){return __pthread_is_main_runtime_thread|0}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;if(numCallArgs>20-1)throw"emscripten_proxy_to_main_thread_js: Too many arguments "+numCallArgs+" to proxied function idx="+index+", maximum supported is "+(20-1)+"!";var stack=stackSave();var args=stackAlloc(numCallArgs*8);var b=args>>3;for(var i=0;i>3]);buf+=8}else if(ch===105){buf=buf+3&~3;args.push(HEAP32[buf>>2]);buf+=4}else abort("unexpected char in asm const signature "+ch)}return args}function _emscripten_receive_on_main_thread_js(index,numCallArgs,args){_emscripten_receive_on_main_thread_js_callArgs.length=numCallArgs;var b=args>>3;for(var i=0;i=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;_emscripten_async_queue_on_thread_(targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;_emscripten_async_queue_on_thread_(targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function __maybeCStringToJsString(cString){return cString===cString+0?UTF8ToString(cString):cString}var __specialEventTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function __findEventTarget(target){var domElement=__specialEventTargets[target]||(typeof document!=="undefined"?document.querySelector(__maybeCStringToJsString(target)):undefined);return domElement}function __findCanvasEventTarget(target){return __findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=__findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=__findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){newStatus=newStatus|0}function __webgl_acquireInstancedArraysExtension(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)}}}function __webgl_acquireVertexArrayObjectExtension(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)}}}function __webgl_acquireDrawBuffersExtension(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)}}}var GL={counter:1,lastError:0,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},currentContext:null,offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,init:function(){var miniTempFloatBuffer=new Float32Array(GL.MINI_TEMP_BUFFER_SIZE);for(var i=0;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;if(context.version<2){__webgl_acquireInstancedArraysExtension(GLctx);__webgl_acquireVertexArrayObjectExtension(GLctx);__webgl_acquireDrawBuffersExtension(GLctx)}GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query");var automaticallyEnabledExtensions=["OES_texture_float","OES_texture_half_float","OES_standard_derivatives","OES_vertex_array_object","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","OES_element_index_uint","EXT_texture_filter_anisotropic","EXT_frag_depth","WEBGL_draw_buffers","ANGLE_instanced_arrays","OES_texture_float_linear","OES_texture_half_float_linear","EXT_blend_minmax","EXT_shader_texture_lod","EXT_texture_norm16","WEBGL_compressed_texture_pvrtc","EXT_color_buffer_half_float","WEBGL_color_buffer_float","EXT_sRGB","WEBGL_compressed_texture_etc1","EXT_disjoint_timer_query","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_astc","EXT_color_buffer_float","WEBGL_compressed_texture_s3tc_srgb","EXT_disjoint_timer_query_webgl2","WEBKIT_WEBGL_compressed_texture_pvrtc"];var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(automaticallyEnabledExtensions.indexOf(ext)!=-1){GLctx.getExtension(ext)}})},populateUniformTable:function(program){var p=GL.programs[program];var ptable=GL.programInfos[program]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1};var utable=ptable.uniforms;var numUniforms=GLctx.getProgramParameter(p,35718);for(var i=0;i>2;contextAttributes["alpha"]=!!HEAP32[a+(0>>2)];contextAttributes["depth"]=!!HEAP32[a+(4>>2)];contextAttributes["stencil"]=!!HEAP32[a+(8>>2)];contextAttributes["antialias"]=!!HEAP32[a+(12>>2)];contextAttributes["premultipliedAlpha"]=!!HEAP32[a+(16>>2)];contextAttributes["preserveDrawingBuffer"]=!!HEAP32[a+(20>>2)];var powerPreference=HEAP32[a+(24>>2)];contextAttributes["powerPreference"]=__emscripten_webgl_power_preferences[powerPreference];contextAttributes["failIfMajorPerformanceCaveat"]=!!HEAP32[a+(28>>2)];contextAttributes.majorVersion=HEAP32[a+(32>>2)];contextAttributes.minorVersion=HEAP32[a+(36>>2)];contextAttributes.enableExtensionsByDefault=HEAP32[a+(40>>2)];contextAttributes.explicitSwapControl=HEAP32[a+(44>>2)];contextAttributes.proxyContextToMainThread=HEAP32[a+(48>>2)];contextAttributes.renderViaOffscreenBackBuffer=HEAP32[a+(52>>2)];var canvas=__findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];assert(buffer);if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:undefined,get:function(){assert(SYSCALLS.varargs!=undefined);SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){if(low>=0)assert(high===0);else assert(high===-1);return low}};function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,fd);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM");return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,fd,offset_low,offset_high,whence,newOffset);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM")}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd,iov,iovcnt,pnum);var num=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}function _pthread_cleanup_pop(execute){var routine=PThread.exitHandlers.pop();if(execute)routine()}function _pthread_cleanup_push(routine,arg){if(PThread.exitHandlers===null){PThread.exitHandlers=[]}PThread.exitHandlers.push(function(){dynCall_vi(routine,arg)})}function __spawn_thread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _spawn_thread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,thread:threadParams.pthread_ptr,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(0>>2),0);Atomics.store(HEAPU32,tis+(4>>2),0);Atomics.store(HEAPU32,tis+(8>>2),0);Atomics.store(HEAPU32,tis+(68>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(104>>2),tlsMemory);Atomics.store(HEAPU32,tis+(48>>2),0);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(44>>2),42);Atomics.store(HEAPU32,tis+(108>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(84>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(80>>2),stackHigh);Atomics.store(HEAPU32,tis+(108+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(108+12>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(108+20>>2),threadParams.schedPolicy);Atomics.store(HEAPU32,tis+(108+24>>2),threadParams.schedPrio);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(176>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"selfThreadId":threadParams.pthread_ptr,"parentThreadId":threadParams.parent_pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}}function _pthread_getschedparam(thread,policy,schedparam){if(!policy&&!schedparam)return ERRNO_CODES.EINVAL;if(!thread){err("pthread_getschedparam called with a null thread pointer!");return ERRNO_CODES.ESRCH}var self=HEAP32[thread+12>>2];if(self!==thread){err("pthread_getschedparam attempted on thread "+thread+", which does not point to a valid thread, or does not exist anymore!");return ERRNO_CODES.ESRCH}var schedPolicy=Atomics.load(HEAPU32,thread+108+20>>2);var schedPrio=Atomics.load(HEAPU32,thread+108+24>>2);if(policy)HEAP32[policy>>2]=schedPolicy;if(schedparam)HEAP32[schedparam>>2]=schedPrio;return 0}function _pthread_self(){return __pthread_ptr|0}Module["_pthread_self"]=_pthread_self;function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;var schedPolicy=0;var schedPrio=0;if(attr){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0;var inheritSched=HEAP32[attr+16>>2]===0;if(inheritSched){var prevSchedPolicy=HEAP32[attr+20>>2];var prevSchedPrio=HEAP32[attr+24>>2];var parentThreadPtr=PThread.currentProxiedOperationCallerThread?PThread.currentProxiedOperationCallerThread:_pthread_self();_pthread_getschedparam(parentThreadPtr,attr+20,attr+24);schedPolicy=HEAP32[attr+20>>2];schedPrio=HEAP32[attr+24>>2];HEAP32[attr+20>>2]=prevSchedPolicy;HEAP32[attr+24>>2]=prevSchedPrio}else{schedPolicy=HEAP32[attr+20>>2];schedPrio=HEAP32[attr+24>>2]}}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(232);for(var i=0;i<232>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+156;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,schedPolicy:schedPolicy,schedPrio:schedPrio,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,parent_pthread_ptr:_pthread_self(),arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList)}else{__spawn_thread(threadParams)}return 0}function _roundf(d){d=+d;return d>=+0?+Math_floor(d+ +.5):+Math_ceil(d-+.5)}function _sysconf(name){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,name);switch(name){case 30:return 16384;case 85:var maxHeapSize=HEAPU8.length;return maxHeapSize/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:case 79:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator==="object")return navigator["hardwareConcurrency"]||1;return 1}}setErrNo(28);return-1}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();else PThread.initWorker();var GLctx;GL.init();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_fd_close,_fd_seek,_fd_write,_sysconf];var asmLibraryArg={"__assert_fail":___assert_fail,"__handle_stack_overflow":___handle_stack_overflow,"_emscripten_notify_thread_queue":__emscripten_notify_thread_queue,"abort":_abort,"emscripten_conditional_set_current_thread_status":_emscripten_conditional_set_current_thread_status,"emscripten_futex_wait":_emscripten_futex_wait,"emscripten_futex_wake":_emscripten_futex_wake,"emscripten_get_now":_emscripten_get_now,"emscripten_is_main_browser_thread":_emscripten_is_main_browser_thread,"emscripten_is_main_runtime_thread":_emscripten_is_main_runtime_thread,"emscripten_memcpy_big":_emscripten_memcpy_big,"emscripten_receive_on_main_thread_js":_emscripten_receive_on_main_thread_js,"emscripten_resize_heap":_emscripten_resize_heap,"emscripten_set_canvas_element_size":_emscripten_set_canvas_element_size,"emscripten_set_current_thread_status":_emscripten_set_current_thread_status,"emscripten_webgl_create_context":_emscripten_webgl_create_context,"fd_close":_fd_close,"fd_seek":_fd_seek,"fd_write":_fd_write,"initPthreadsJS":initPthreadsJS,"memory":wasmMemory||Module["wasmMemory"],"pthread_cleanup_pop":_pthread_cleanup_pop,"pthread_cleanup_push":_pthread_cleanup_push,"pthread_create":_pthread_create,"pthread_self":_pthread_self,"roundf":_roundf,"table":wasmTable};var asm=createWasm();Module["asm"]=asm;var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__wasm_call_ctors"].apply(null,arguments)};var _init=Module["_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["init"].apply(null,arguments)};var _register_tensor=Module["_register_tensor"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["register_tensor"].apply(null,arguments)};var _dispose_data=Module["_dispose_data"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose_data"].apply(null,arguments)};var _dispose=Module["_dispose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose"].apply(null,arguments)};var _Abs=Module["_Abs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Abs"].apply(null,arguments)};var _Add=Module["_Add"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Add"].apply(null,arguments)};var _AddN=Module["_AddN"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AddN"].apply(null,arguments)};var _ArgMax=Module["_ArgMax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ArgMax"].apply(null,arguments)};var _AvgPool=Module["_AvgPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AvgPool"].apply(null,arguments)};var _BatchMatMul=Module["_BatchMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["BatchMatMul"].apply(null,arguments)};var _ClipByValue=Module["_ClipByValue"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ClipByValue"].apply(null,arguments)};var _Conv2D=Module["_Conv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Conv2D"].apply(null,arguments)};var _Cos=Module["_Cos"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Cos"].apply(null,arguments)};var _CropAndResize=Module["_CropAndResize"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["CropAndResize"].apply(null,arguments)};var _DepthwiseConv2dNative=Module["_DepthwiseConv2dNative"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["DepthwiseConv2dNative"].apply(null,arguments)};var _Div=Module["_Div"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Div"].apply(null,arguments)};var _Exp=Module["_Exp"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Exp"].apply(null,arguments)};var _FloorDiv=Module["_FloorDiv"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FloorDiv"].apply(null,arguments)};var _FusedBatchNorm=Module["_FusedBatchNorm"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedBatchNorm"].apply(null,arguments)};var _FusedConv2D=Module["_FusedConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedConv2D"].apply(null,arguments)};var _FusedDepthwiseConv2D=Module["_FusedDepthwiseConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedDepthwiseConv2D"].apply(null,arguments)};var _Gather=Module["_Gather"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Gather"].apply(null,arguments)};var _GatherNd=Module["_GatherNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GatherNd"].apply(null,arguments)};var _Greater=Module["_Greater"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Greater"].apply(null,arguments)};var _GreaterEqual=Module["_GreaterEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GreaterEqual"].apply(null,arguments)};var _Less=Module["_Less"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Less"].apply(null,arguments)};var _LessEqual=Module["_LessEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LessEqual"].apply(null,arguments)};var _Log=Module["_Log"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Log"].apply(null,arguments)};var _LogicalAnd=Module["_LogicalAnd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LogicalAnd"].apply(null,arguments)};var _Max=Module["_Max"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Max"].apply(null,arguments)};var _MaxPool=Module["_MaxPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["MaxPool"].apply(null,arguments)};var _Maximum=Module["_Maximum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Maximum"].apply(null,arguments)};var _Min=Module["_Min"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Min"].apply(null,arguments)};var _Minimum=Module["_Minimum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Minimum"].apply(null,arguments)};var _Mul=Module["_Mul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Mul"].apply(null,arguments)};var _Neg=Module["_Neg"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Neg"].apply(null,arguments)};var _NonMaxSuppressionV3=Module["_NonMaxSuppressionV3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV3"].apply(null,arguments)};var _NonMaxSuppressionV5=Module["_NonMaxSuppressionV5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV5"].apply(null,arguments)};var _NotEqual=Module["_NotEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NotEqual"].apply(null,arguments)};var _PadV2=Module["_PadV2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["PadV2"].apply(null,arguments)};var _Pow=Module["_Pow"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Pow"].apply(null,arguments)};var _Prelu=Module["_Prelu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Prelu"].apply(null,arguments)};var _Relu=Module["_Relu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu"].apply(null,arguments)};var _Relu6=Module["_Relu6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu6"].apply(null,arguments)};var _ResizeBilinear=Module["_ResizeBilinear"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ResizeBilinear"].apply(null,arguments)};var _Rsqrt=Module["_Rsqrt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Rsqrt"].apply(null,arguments)};var _ScatterNd=Module["_ScatterNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ScatterNd"].apply(null,arguments)};var _Sigmoid=Module["_Sigmoid"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sigmoid"].apply(null,arguments)};var _Sin=Module["_Sin"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sin"].apply(null,arguments)};var _Softmax=Module["_Softmax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Softmax"].apply(null,arguments)};var _Square=Module["_Square"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Square"].apply(null,arguments)};var _Sub=Module["_Sub"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sub"].apply(null,arguments)};var _Sum=Module["_Sum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sum"].apply(null,arguments)};var _Tanh=Module["_Tanh"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tanh"].apply(null,arguments)};var _Tile=Module["_Tile"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tile"].apply(null,arguments)};var _Transpose=Module["_Transpose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Transpose"].apply(null,arguments)};var __FusedMatMul=Module["__FusedMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_FusedMatMul"].apply(null,arguments)};var _malloc=Module["_malloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["malloc"].apply(null,arguments)};var _free=Module["_free"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["free"].apply(null,arguments)};var ___em_js__initPthreadsJS=Module["___em_js__initPthreadsJS"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__em_js__initPthreadsJS"].apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__errno_location"].apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_get_global_libc"].apply(null,arguments)};var _memalign=Module["_memalign"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["memalign"].apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__pthread_tsd_run_dtors"].apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null,arguments)};var _emscripten_main_browser_thread_id=Module["_emscripten_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_browser_thread_id"].apply(null,arguments)};var _emscripten_async_run_in_main_thread=Module["_emscripten_async_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread=Module["_emscripten_sync_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_0=Module["_emscripten_sync_run_in_main_thread_0"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_1=Module["_emscripten_sync_run_in_main_thread_1"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_2=Module["_emscripten_sync_run_in_main_thread_2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_xprintf_varargs=Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_3=Module["_emscripten_sync_run_in_main_thread_3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_5=Module["_emscripten_sync_run_in_main_thread_5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_6=Module["_emscripten_sync_run_in_main_thread_6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_7=Module["_emscripten_sync_run_in_main_thread_7"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null,arguments)};var _emscripten_async_queue_on_thread_=Module["_emscripten_async_queue_on_thread_"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_tls_init"].apply(null,arguments)};var ___set_stack_limit=Module["___set_stack_limit"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__set_stack_limit"].apply(null,arguments)};var stackSave=Module["stackSave"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackSave"].apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackAlloc"].apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackRestore"].apply(null,arguments)};var dynCall_vi=Module["dynCall_vi"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_vi"].apply(null,arguments)};var dynCall_v=Module["dynCall_v"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_v"].apply(null,arguments)};var dynCall_ii=Module["dynCall_ii"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_ii"].apply(null,arguments)};Module["asm"]=asm;if(!Object.getOwnPropertyDescriptor(Module,"intArrayFromString"))Module["intArrayFromString"]=function(){abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"intArrayToString"))Module["intArrayToString"]=function(){abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ccall"))Module["ccall"]=function(){abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["cwrap"]=cwrap;if(!Object.getOwnPropertyDescriptor(Module,"setValue"))Module["setValue"]=function(){abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getValue"))Module["getValue"]=function(){abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocate"))Module["allocate"]=function(){abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getMemory"))Module["getMemory"]=function(){abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ArrayToString"))Module["UTF8ArrayToString"]=function(){abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ToString"))Module["UTF8ToString"]=function(){abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8Array"))Module["stringToUTF8Array"]=function(){abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8"))Module["stringToUTF8"]=function(){abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF8"))Module["lengthBytesUTF8"]=function(){abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreRun"))Module["addOnPreRun"]=function(){abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnInit"))Module["addOnInit"]=function(){abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreMain"))Module["addOnPreMain"]=function(){abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnExit"))Module["addOnExit"]=function(){abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPostRun"))Module["addOnPostRun"]=function(){abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeStringToMemory"))Module["writeStringToMemory"]=function(){abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeArrayToMemory"))Module["writeArrayToMemory"]=function(){abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeAsciiToMemory"))Module["writeAsciiToMemory"]=function(){abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addRunDependency"))Module["addRunDependency"]=function(){abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"removeRunDependency"))Module["removeRunDependency"]=function(){abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createFolder"))Module["FS_createFolder"]=function(){abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPath"))Module["FS_createPath"]=function(){abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDataFile"))Module["FS_createDataFile"]=function(){abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPreloadedFile"))Module["FS_createPreloadedFile"]=function(){abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLazyFile"))Module["FS_createLazyFile"]=function(){abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLink"))Module["FS_createLink"]=function(){abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDevice"))Module["FS_createDevice"]=function(){abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_unlink"))Module["FS_unlink"]=function(){abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"dynamicAlloc"))Module["dynamicAlloc"]=function(){abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadDynamicLibrary"))Module["loadDynamicLibrary"]=function(){abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadWebAssemblyModule"))Module["loadWebAssemblyModule"]=function(){abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getLEB"))Module["getLEB"]=function(){abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFunctionTables"))Module["getFunctionTables"]=function(){abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"alignFunctionTables"))Module["alignFunctionTables"]=function(){abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"registerFunctions"))Module["registerFunctions"]=function(){abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addFunction"))Module["addFunction"]=function(){abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"removeFunction"))Module["removeFunction"]=function(){abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFuncWrapper"))Module["getFuncWrapper"]=function(){abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"prettyPrint"))Module["prettyPrint"]=function(){abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"makeBigInt"))Module["makeBigInt"]=function(){abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"dynCall"))Module["dynCall"]=function(){abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getCompilerSetting"))Module["getCompilerSetting"]=function(){abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"print"))Module["print"]=function(){abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"printErr"))Module["printErr"]=function(){abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getTempRet0"))Module["getTempRet0"]=function(){abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setTempRet0"))Module["setTempRet0"]=function(){abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"callMain"))Module["callMain"]=function(){abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"abort"))Module["abort"]=function(){abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToNewUTF8"))Module["stringToNewUTF8"]=function(){abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"abortOnCannotGrowMemory"))Module["abortOnCannotGrowMemory"]=function(){abort("'abortOnCannotGrowMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscripten_realloc_buffer"))Module["emscripten_realloc_buffer"]=function(){abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ENV"))Module["ENV"]=function(){abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setjmpId"))Module["setjmpId"]=function(){abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_CODES"))Module["ERRNO_CODES"]=function(){abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_MESSAGES"))Module["ERRNO_MESSAGES"]=function(){abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setErrNo"))Module["setErrNo"]=function(){abort("'setErrNo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"DNS"))Module["DNS"]=function(){abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GAI_ERRNO_MESSAGES"))Module["GAI_ERRNO_MESSAGES"]=function(){abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Protocols"))Module["Protocols"]=function(){abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Sockets"))Module["Sockets"]=function(){abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UNWIND_CACHE"))Module["UNWIND_CACHE"]=function(){abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readAsmConstArgs"))Module["readAsmConstArgs"]=function(){abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_q"))Module["jstoi_q"]=function(){abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_s"))Module["jstoi_s"]=function(){abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH"))Module["PATH"]=function(){abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH_FS"))Module["PATH_FS"]=function(){abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SYSCALLS"))Module["SYSCALLS"]=function(){abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMmap2"))Module["syscallMmap2"]=function(){abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMunmap"))Module["syscallMunmap"]=function(){abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"flush_NO_FILESYSTEM"))Module["flush_NO_FILESYSTEM"]=function(){abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"JSEvents"))Module["JSEvents"]=function(){abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangle"))Module["demangle"]=function(){abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangleAll"))Module["demangleAll"]=function(){abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jsStackTrace"))Module["jsStackTrace"]=function(){abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getEnvStrings"))Module["getEnvStrings"]=function(){abort("'getEnvStrings' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64"))Module["writeI53ToI64"]=function(){abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Clamped"))Module["writeI53ToI64Clamped"]=function(){abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Signaling"))Module["writeI53ToI64Signaling"]=function(){abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Clamped"))Module["writeI53ToU64Clamped"]=function(){abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Signaling"))Module["writeI53ToU64Signaling"]=function(){abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromI64"))Module["readI53FromI64"]=function(){abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromU64"))Module["readI53FromU64"]=function(){abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertI32PairToI53"))Module["convertI32PairToI53"]=function(){abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertU32PairToI53"))Module["convertU32PairToI53"]=function(){abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Browser"))Module["Browser"]=function(){abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GL"))Module["GL"]=function(){abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGet"))Module["emscriptenWebGLGet"]=function(){abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetTexPixelData"))Module["emscriptenWebGLGetTexPixelData"]=function(){abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetUniform"))Module["emscriptenWebGLGetUniform"]=function(){abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetVertexAttrib"))Module["emscriptenWebGLGetVertexAttrib"]=function(){abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AL"))Module["AL"]=function(){abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_unicode"))Module["SDL_unicode"]=function(){abort("'SDL_unicode' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_ttfContext"))Module["SDL_ttfContext"]=function(){abort("'SDL_ttfContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_audio"))Module["SDL_audio"]=function(){abort("'SDL_audio' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL"))Module["SDL"]=function(){abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_gfx"))Module["SDL_gfx"]=function(){abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLUT"))Module["GLUT"]=function(){abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"EGL"))Module["EGL"]=function(){abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW_Window"))Module["GLFW_Window"]=function(){abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW"))Module["GLFW"]=function(){abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLEW"))Module["GLEW"]=function(){abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"IDBStore"))Module["IDBStore"]=function(){abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"runAndAbortIfError"))Module["runAndAbortIfError"]=function(){abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["PThread"]=PThread;if(!Object.getOwnPropertyDescriptor(Module,"establishStackSpace"))Module["establishStackSpace"]=function(){abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getNoExitRuntime"))Module["getNoExitRuntime"]=function(){abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"resetPrototype"))Module["resetPrototype"]=function(){abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"warnOnce"))Module["warnOnce"]=function(){abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackSave"))Module["stackSave"]=function(){abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackRestore"))Module["stackRestore"]=function(){abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackAlloc"))Module["stackAlloc"]=function(){abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AsciiToString"))Module["AsciiToString"]=function(){abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToAscii"))Module["stringToAscii"]=function(){abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF16ToString"))Module["UTF16ToString"]=function(){abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF16"))Module["stringToUTF16"]=function(){abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF16"))Module["lengthBytesUTF16"]=function(){abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF32ToString"))Module["UTF32ToString"]=function(){abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF32"))Module["stringToUTF32"]=function(){abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF32"))Module["lengthBytesUTF32"]=function(){abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8"))Module["allocateUTF8"]=function(){abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8OnStack"))Module["allocateUTF8OnStack"]=function(){abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["writeStackCookie"]=writeStackCookie;Module["checkStackCookie"]=checkStackCookie;Module["abortStackOverflow"]=abortStackOverflow;Module["PThread"]=PThread;Module["_pthread_self"]=_pthread_self;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NORMAL"))Object.defineProperty(Module,"ALLOC_NORMAL",{configurable:true,get:function(){abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_STACK"))Object.defineProperty(Module,"ALLOC_STACK",{configurable:true,get:function(){abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_DYNAMIC"))Object.defineProperty(Module,"ALLOC_DYNAMIC",{configurable:true,get:function(){abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NONE"))Object.defineProperty(Module,"ALLOC_NONE",{configurable:true,get:function(){abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});var calledRun;Module["then"]=function(func){if(calledRun){func(Module)}else{var old=Module["onRuntimeInitialized"];Module["onRuntimeInitialized"]=function(){if(old)old();func(Module)}}return Module};function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}writeStackCookie();preRun();if(runDependencies>0)return;function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();assert(!Module["_main"],'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}checkStackCookie()}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}if(!ENVIRONMENT_IS_PTHREAD)noExitRuntime=true;if(!ENVIRONMENT_IS_PTHREAD)run(); return WasmBackendModule diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.wasm b/tfjs-core/benchmarks/tfjs-backend-wasm.wasm index 6b02bba45fd27c6770060a736485313cc607dd1c..415247bc49160e0e26e7b6837c54eba7c96b716d 100644 GIT binary patch delta 8371 zcmZ`-3tUx2{-58RbD!s4IJ^WA@m$0Q#Y05U)RYmQyXITlZQBTy47>sYKC>=9QcO&@ zqm8S$`TU`1r^J``Y*Svb<4_%Hn(gw+~1sgFOs>J4`;sfoB7TBUNiHX z`RQewZ@+DAs*R9GO&;;v-**OuZTeQ)1x)&38V@G#NAzXDqDppwrvfS}K*}$gYbwv1 z>duD}GEe$}UZYm95)%-~Ou*W;E7%Amgpx!X=|KShh-4yGYNg>}T{;k_MIsJDh*<)Y zlUPmEIy7w10GrJ$SraY9IgnV06at+spaFmcNg;MSkz``B;5Z&|5QiiNlsm~28^74tP6%xsf%F7xD40S`p%Sr5Ci9T!n2r(QPA9cl0a8MNnrt=`SglqY;GfAs z>EJL33!^#l@irTA^-rMG+U@=@qM)cUu@jY;Q7+45R4-JK2&HD5)9JKEhdaX~NK9sg z+&3axksTJh-JE5OiZVrY=+GgeOCJF;$^!IJntmd_jyh2`eX%PX6eJ1x)c&Yf0X zTv|q|^r@EK?r*8Yrk0UoSWKTzUZ*k^W5^5C%t~iGkT;)HQVW|qV_b2un_LBDNM8B0 z#~;Wme_)QAoChVxT~IP)!IV7roP2T&%sItHb9)aZZ-A6jTt>X$%qcA{VMWs?8}tnd`?;ZbYqS&#ig^zUqCS^fpND% zq){E3UsC?~yn?d)0DUW%N92`1o?l8{0IMI3nNGHVWkhLyUOAFCgChWkd1lYabCW-V zJUYLujBEm%D2ExujUbIKooAyGO=LBq*=uU(}_o#h;lz=nOOW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G>v6YW8C(nPxvwVP-cqEjYn;`^d$zs%#ndQL)k z2Eyk`mLMW}8bMzH@L7}f69CUQEKz_KBwk8cJ->Yr{pdeQIs7++={j29 zrWddno{&N_pn=awp+k_wPo~l-`de2OT=q|-&?@)AHZlbF2^VYR(}vJ7NM1LDrprTF zLmO9z(~+W^n@`2X9WYN?LKQ@KTcYB0d!S99**#vcZ0YWAZ$xDq+jz%t+Ls<^GnYqy zy(#8HWwBBCKy6R%~~OS{nj&*EK6` z6zur)9D2b?5U*+CQPt_Qi$caX9&=xmkb@TvrG*sBwxM)mZ&U#{Oz}X5$Xq8C>m`RT z8b%YMQ5$uhhAA&f>y>0Te|i|rbR$LVwAjQy7)E1Zqe&is0u~v;4VH)FDrp+br>D}{ z^g=72nL<-=KR%I4XJO$>!@yi_H3Q?u>)h@%I)}?V}E57kKz^ zItrW25Otas2qz&5g{ZUD3=y(mh-{Z|*h~Ba+_>=0**%;l_CIe5q4o&=Q_ZtTJZDTy zr;A|*zA0L(@*X5&MGVv!qBVp-6E^k)t1U!r4uR9xnvLvCx&a>tj5o9BB_;_T| zYEdh!AWdB>iFdP{Tyy_1&9~&yr4}#xDLCLYQ;2$%ig{r*V5(c-pmAmt{YzhbLU?=* XeII Date: Tue, 5 May 2020 08:59:59 -0400 Subject: [PATCH 66/85] create 2 threads --- tfjs-backend-wasm/src/cc/backend.cc | 2 +- tfjs-core/benchmarks/tfjs-backend-wasm.wasm | Bin 153783 -> 154017 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/tfjs-backend-wasm/src/cc/backend.cc b/tfjs-backend-wasm/src/cc/backend.cc index 7b3a9daa868..5d7d2c202b6 100644 --- a/tfjs-backend-wasm/src/cc/backend.cc +++ b/tfjs-backend-wasm/src/cc/backend.cc @@ -49,7 +49,7 @@ TensorInfo &get_tensor_info_out(const size_t tensor_id) { size_t xnn_operator_count = 0; -pthreadpool *threadpool = pthreadpool_create(1); +pthreadpool *threadpool = pthreadpool_create(2); // Registers a disposal callback for a tensor id with a given callback function. void register_disposal_callback(const size_t tensor_id, diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.wasm b/tfjs-core/benchmarks/tfjs-backend-wasm.wasm index 415247bc49160e0e26e7b6837c54eba7c96b716d..0e5e11e5058ef0899028d5779b45457713b6ba1b 100644 GIT binary patch delta 1642 zcmY*Z3s4nh6yERKZmoSmDco_9F#ldP?e4X+E9$q>n>nH7i+&62YR3>gYUBqFd$@L137{f#M zpi)G;vw`hKmb;U&&GW#&PJk>%hNo=pLmpZKiI%q zJjdg_${W1SYdpw9ejea{{>Z)D$33j&Zq~4xmE6TEtl$M+h2FWf-`{=iMt;|eb08ZO{B>_s)AJaC7sIud-F zX8^@dVTDx?pNZ+=;R@Ww;?~JOKd*8?$>1#6?lt<8Bz17`yr< zqG?J0BovC?{fElP69ofnRfLE)UmYT&l_+`R0#PTHkFbEB#o*M~aGVlTvNr?gMCY7> z2v`@Vye}#j?RLTx1+D>2C5^(%*~aG(nt@Du4QdRT3KW$u8V0q zM-q396F;oLLNTQx2FN#xDrcH$afmRwRxQS2QC<}dED~pTg*i|lZq_~zyeE?O705U) z_8q8s2FuMN2eM&UVNRR?ezC3wqoEzb&2ycx5yC8tg<(#O!)tiSsBcV)P){O}l4kE` zMzo}HK&a$)TXk^=3Nk%ikY^rw3h`E97lg|$m!w}jX3s;i)^tN}nwPqx_mCl=KSt8E zanXpTF2&QQAz4b0)rTVZp|A-w#K}@ZfJ$R5eF4K}OiiHrPzz3Auo>F})v6}|sC&>s z(iI)5XKOqb0-@%j1SDX$RhfWnqQ*?@iQx#d7WYJyj00A2FQh>E$@VhKlMrdCy^-HC z{46wki!?=_aYxeRaq1as;|pjf*64gk7jzjnH9L#3!dT>&6hzUQ{#=HF$zALH6tDfd2wSD|!JkY_ju# z(sGfZhD7}@9Q$bUeU$-vy?l1BX5W8+0I%QXwMYH0jUCy(So=xMPrY9aih6hySO-mV zcR*{qaMfOs7z|SSsJ5rn(XPdMF$d{R9J01eLy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| 4 ++-- tfjs-core/benchmarks/tfjs-backend-wasm.wasm | Bin 154017 -> 156842 bytes 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tfjs-backend-wasm/src/cc/conv2d_impl.cc b/tfjs-backend-wasm/src/cc/conv2d_impl.cc index c3ed530ee85..d46ed814ce6 100644 --- a/tfjs-backend-wasm/src/cc/conv2d_impl.cc +++ b/tfjs-backend-wasm/src/cc/conv2d_impl.cc @@ -259,7 +259,7 @@ void conv2d(const size_t x_id, const size_t batch_size, xnn_status status = xnn_setup_convolution2d_nhwc_f32( conv2d_op, batch_size, input_height, input_width, x_buf, out_buf, - nullptr /* thread pool */); + tfjs::backend::threadpool); if (status != xnn_status_success) { util::warn( "XNN status for xnn_setup_convolution2d_nhwc_f32 is not successful. " @@ -267,7 +267,7 @@ void conv2d(const size_t x_id, const size_t batch_size, status); } - xnn_run_operator(conv2d_op, nullptr /* thread pool */); + xnn_run_operator(conv2d_op, tfjs::backend::threadpool); if (activation == FusableActivation::PRELU) { prelu(out_buf, out_info.size, prelu_weights_id, out_id); diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.wasm b/tfjs-core/benchmarks/tfjs-backend-wasm.wasm index 0e5e11e5058ef0899028d5779b45457713b6ba1b..9d6e031420bcd321a998ea98e91a1b47a300eebe 100644 GIT binary patch delta 9050 zcmaJ{349bq_O4gm(>*giGwG0%BtT~pNDv4C!UV#V2Ew7pA&3_eMiN5~5||8ltqy`9 z-eQaG!LH|eAmHktZ*TrS65j@Ktx^d1^!=kPlD%8e$%h3y86|t?|tvp zF}XeI+xWci+6td1AwFyYTUWhcg60(53tQkmqQnBlt-+nIy8#OFg%>6gkZQUTx8B5q zZ|@;etfzQyTtia6<(EpW4|ui}^<*cA|}F^@z_ka-pE zotQaxl+P!5EWgqV7L+UH37_1PpsPHClnf<9@=8qcjL*-@&I+uHdN2(=%FNGn=E0vz-V9A*oO^u1V9=YN z70k+JdBd~i>b!hS4yb;A!V~f4_cRfOZ zP$;Bon&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O6NCh#8%{s;CK1!({P From b62bb4f0352cddcc43a9452cd0bfca8143fcc097 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Tue, 5 May 2020 10:33:23 -0400 Subject: [PATCH 68/85] add ref --- tfjs-core/benchmarks/index.html | 13 +++-- tfjs-core/benchmarks/modelConfig.js | 30 +++++++++++ tfjs-core/benchmarks/tf-backend-wasm.js | 57 ++++++++++++++++++++ tfjs-core/benchmarks/tfjs-backend-wasm.js | 2 +- tfjs-core/benchmarks/tfjs-backend-wasm.wasm | Bin 156842 -> 156933 bytes 5 files changed, 96 insertions(+), 6 deletions(-) diff --git a/tfjs-core/benchmarks/index.html b/tfjs-core/benchmarks/index.html index 5884f385adc..287a7b38398 100644 --- a/tfjs-core/benchmarks/index.html +++ b/tfjs-core/benchmarks/index.html @@ -57,8 +57,11 @@

TensorFlow.js Model Benchmark

- - + + + + + @@ -74,8 +77,8 @@

TensorFlow.js Model Benchmark

'use strict'; const state = { - numRuns: 50, - benchmark: 'mobilenet_v2', + numRuns: 20, + benchmark: 'custom_forward', run: (v) => { runBenchmark(); }, @@ -353,7 +356,7 @@

TensorFlow.js Model Benchmark

await warmUpAndRecordTime(); await showMsg('Waiting for GC'); await sleep(1000); - await profileMemory(); + // await profileMemory(); await sleep(200); await measureAveragePredictTime(); await sleep(200); diff --git a/tfjs-core/benchmarks/modelConfig.js b/tfjs-core/benchmarks/modelConfig.js index d75caec96d4..2c99fb4e175 100644 --- a/tfjs-core/benchmarks/modelConfig.js +++ b/tfjs-core/benchmarks/modelConfig.js @@ -72,6 +72,36 @@ const sentences = [ ]; const benchmarks = { + 'custom_forward': { + load: async() => { + return {}; + }, + predictFunc: () => { + // FC, 3 LSTMs and a RNN. + const num_frames = 200 * 10; + const num_lf = 505; + const units = 128; + const rnn_out_units = 48; + // FC (128 outputs) | LSTM (units=128, proj=64) | LSTM (units=128, proj=64) | RNN (output=48) + layer1 = tf.layers.timeDistributed({ + layer: tf.layers.dense({units}), + inputShape: [num_frames, num_lf], + }); + cells = [ + tf.layers.lstm({units, returnSequences: true}), + tf.layers.lstm({units, returnSequences: true}), + tf.layers.lstm({units, returnSequences: true}), + tf.layers.simpleRNN({units: rnn_out_units, returnSequences: true}) + ] + return () => { + output = layer1.apply(tf.randomUniform([1, num_frames, num_lf])); + for (i = 0; i < cells.length; i++) { + output = cells[i].apply(output); + } + return output; + } + } + }, 'mobilenet_v2': { load: async () => { const url = diff --git a/tfjs-core/benchmarks/tf-backend-wasm.js b/tfjs-core/benchmarks/tf-backend-wasm.js index 67c1bd92345..20941b13a09 100644 --- a/tfjs-core/benchmarks/tf-backend-wasm.js +++ b/tfjs-core/benchmarks/tf-backend-wasm.js @@ -2291,6 +2291,63 @@ kernelFunc: softmax }); + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + function split(args) { + const { inputs: { x }, attrs: { numOrSizeSplits, axis }, backend } = args; + const $axis = tfjsCore.util.parseAxisParam(axis, x.shape)[0]; + let splitSizes; + if (typeof (numOrSizeSplits) === 'number') { + splitSizes = + new Array(numOrSizeSplits).fill(x.shape[$axis] / numOrSizeSplits); + } + else { + splitSizes = numOrSizeSplits; + } + const begin = new Array(x.shape.length).fill(0); + const size = x.shape.slice(); + return splitSizes.map(s => { + const xSliceSize = [...size]; + xSliceSize[$axis] = s; + const xSlice = slice({ inputs: { x }, attrs: { begin, size: xSliceSize }, backend }); + begin[$axis] += s; + return xSlice; + }); + } + tfjsCore.registerKernel({ kernelName: 'SplitV', backendName: 'wasm', kernelFunc: split }); + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + registerUnaryKernel('Sqrt'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.js b/tfjs-core/benchmarks/tfjs-backend-wasm.js index a94e2628e96..892b57beaa5 100755 --- a/tfjs-core/benchmarks/tfjs-backend-wasm.js +++ b/tfjs-core/benchmarks/tfjs-backend-wasm.js @@ -6,7 +6,7 @@ var WasmBackendModule = (function() { function(WasmBackendModule) { WasmBackendModule = WasmBackendModule || {}; -var Module=typeof WasmBackendModule!=="undefined"?WasmBackendModule:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(Module["ENVIRONMENT"]){throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)")}var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"];DYNAMIC_BASE=Module["DYNAMIC_BASE"];DYNAMICTOP_PTR=Module["DYNAMICTOP_PTR"]}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{throw new Error("environment detection error")}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(!Object.getOwnPropertyDescriptor(Module,"arguments"))Object.defineProperty(Module,"arguments",{configurable:true,get:function(){abort("Module.arguments has been replaced with plain arguments_")}});if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(!Object.getOwnPropertyDescriptor(Module,"thisProgram"))Object.defineProperty(Module,"thisProgram",{configurable:true,get:function(){abort("Module.thisProgram has been replaced with plain thisProgram")}});if(Module["quit"])quit_=Module["quit"];if(!Object.getOwnPropertyDescriptor(Module,"quit"))Object.defineProperty(Module,"quit",{configurable:true,get:function(){abort("Module.quit has been replaced with plain quit_")}});assert(typeof Module["memoryInitializerPrefixURL"]==="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["pthreadMainPrefixURL"]==="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["cdInitializerPrefixURL"]==="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["filePackagePrefixURL"]==="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["read"]==="undefined","Module.read option was removed (modify read_ in JS)");assert(typeof Module["readAsync"]==="undefined","Module.readAsync option was removed (modify readAsync in JS)");assert(typeof Module["readBinary"]==="undefined","Module.readBinary option was removed (modify readBinary in JS)");assert(typeof Module["setWindowTitle"]==="undefined","Module.setWindowTitle option was removed (modify setWindowTitle in JS)");assert(typeof Module["TOTAL_MEMORY"]==="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY");if(!Object.getOwnPropertyDescriptor(Module,"read"))Object.defineProperty(Module,"read",{configurable:true,get:function(){abort("Module.read has been replaced with plain read_")}});if(!Object.getOwnPropertyDescriptor(Module,"readAsync"))Object.defineProperty(Module,"readAsync",{configurable:true,get:function(){abort("Module.readAsync has been replaced with plain readAsync")}});if(!Object.getOwnPropertyDescriptor(Module,"readBinary"))Object.defineProperty(Module,"readBinary",{configurable:true,get:function(){abort("Module.readBinary has been replaced with plain readBinary")}});if(!Object.getOwnPropertyDescriptor(Module,"setWindowTitle"))Object.defineProperty(Module,"setWindowTitle",{configurable:true,get:function(){abort("Module.setWindowTitle has been replaced with plain setWindowTitle")}});assert(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER||ENVIRONMENT_IS_NODE,"Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)");var stackSave;var stackRestore;var stackAlloc;stackSave=stackRestore=stackAlloc=function(){abort("cannot use the stack before compiled code is ready to run, and has provided stack access")};function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(!Object.getOwnPropertyDescriptor(Module,"wasmBinary"))Object.defineProperty(Module,"wasmBinary",{configurable:true,get:function(){abort("Module.wasmBinary has been replaced with plain wasmBinary")}});var noExitRuntime;if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(!Object.getOwnPropertyDescriptor(Module,"noExitRuntime"))Object.defineProperty(Module,"noExitRuntime",{configurable:true,get:function(){abort("Module.noExitRuntime has been replaced with plain noExitRuntime")}});if(typeof WebAssembly!=="object"){abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.")}var wasmMemory;var wasmTable=new WebAssembly.Table({"initial":119,"maximum":119+0,"element":"anyfunc"});var wasmModule;var threadInfoStruct=0;var selfThreadId=0;var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string")return UTF8ToString(ret);if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{if((u0&248)!=240)warnOnce("Invalid UTF-8 leading byte 0x"+u0.toString(16)+" encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!");u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;if(u>=2097152)warnOnce("Invalid Unicode code point 0x"+u.toString(16)+" encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF).");heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");HEAP8.set(array,buffer)}var WASM_PAGE_SIZE=65536;var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var STACK_BASE=5255808,STACKTOP=STACK_BASE,STACK_MAX=12928,DYNAMIC_BASE=5255808,DYNAMICTOP_PTR=12e3;assert(STACK_BASE%16===0,"stack must start aligned");assert(DYNAMIC_BASE%16===0,"heap must start aligned");if(ENVIRONMENT_IS_PTHREAD){STACK_MAX=STACKTOP=STACK_MAX=2147483647}var TOTAL_STACK=5242880;if(Module["TOTAL_STACK"])assert(TOTAL_STACK===Module["TOTAL_STACK"],"the stack size can no longer be determined at runtime");var INITIAL_INITIAL_MEMORY=Module["INITIAL_MEMORY"]||1073741824;if(!Object.getOwnPropertyDescriptor(Module,"INITIAL_MEMORY"))Object.defineProperty(Module,"INITIAL_MEMORY",{configurable:true,get:function(){abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY")}});assert(INITIAL_INITIAL_MEMORY>=TOTAL_STACK,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+INITIAL_INITIAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");assert(typeof Int32Array!=="undefined"&&typeof Float64Array!=="undefined"&&Int32Array.prototype.subarray!==undefined&&Int32Array.prototype.set!==undefined,"JS engine does not provide full typed array support");if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,"maximum":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_INITIAL_MEMORY=buffer.byteLength;assert(INITIAL_INITIAL_MEMORY%WASM_PAGE_SIZE===0);updateGlobalBufferAndViews(buffer);if(!ENVIRONMENT_IS_PTHREAD){HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE}function writeStackCookie(){assert((STACK_MAX&3)==0);HEAPU32[(STACK_MAX>>2)+1]=34821223;HEAPU32[(STACK_MAX>>2)+2]=2310721022;HEAP32[0]=1668509029}function checkStackCookie(){var cookie1=HEAPU32[(STACK_MAX>>2)+1];var cookie2=HEAPU32[(STACK_MAX>>2)+2];if(cookie1!=34821223||cookie2!=2310721022){abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+cookie2.toString(16)+" "+cookie1.toString(16))}if(HEAP32[0]!==1668509029)abort("Runtime error: The application has corrupted its heap memory area (address zero)!")}function abortStackOverflow(allocSize){abort("Stack overflow! Attempted to allocate "+allocSize+" bytes on the stack, but stack has only "+(STACK_MAX-stackSave()+allocSize)+" bytes available!")}(function(){var h16=new Int16Array(1);var h8=new Int8Array(h16.buffer);h16[0]=25459;if(h8[0]!==115||h8[1]!==99)throw"Runtime error: expected the system to be little-endian!"})();function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;if(ENVIRONMENT_IS_PTHREAD)runtimeInitialized=true;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){checkStackCookie();assert(!runtimeInitialized);runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATMAIN__)}function postRun(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Math_ceil=Math.ceil;var Math_floor=Math.floor;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!=="undefined"){runDependencyWatcher=setInterval(function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;err("still waiting on run dependencies:")}err("dependency: "+dep)}if(shown){err("(end of list)")}},1e4)}}else{err("warning: run dependency added without ID")}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id]}else{err("warning: run dependency removed without ID")}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";out(what);err(what);ABORT=true;EXITSTATUS=1;var output="abort("+what+") at "+stackTrace();what=output;throw new WebAssembly.RuntimeError(what)}var FS={error:function(){abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1")},init:function(){FS.error()},createDataFile:function(){FS.error()},createPreloadedFile:function(){FS.error()},createLazyFile:function(){FS.error()},open:function(){FS.error()},mkdev:function(){FS.error()},registerDevice:function(){FS.error()},analyzePath:function(){FS.error()},loadFilesFromDB:function(){FS.error()},ErrnoError:function ErrnoError(){FS.error()}};Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;function hasPrefix(str,prefix){return String.prototype.startsWith?str.startsWith(prefix):str.indexOf(prefix)===0}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return hasPrefix(filename,dataURIPrefix)}var fileURIPrefix="file://";function isFileURI(filename){return hasPrefix(filename,fileURIPrefix)}var wasmBinaryFile="tfjs-backend-wasm.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(){try{if(wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(wasmBinaryFile)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary()})}return new Promise(function(resolve,reject){resolve(getBinary())})}function createWasm(){var info={"env":asmLibraryArg,"wasi_snapshot_preview1":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){var numWorkersToLoad=PThread.unusedWorkers.length;PThread.unusedWorkers.forEach(function(w){PThread.loadWasmModuleToWorker(w,function(){if(!--numWorkersToLoad)removeRunDependency("wasm-instantiate")})})}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}var trueModule=Module;function receiveInstantiatedSource(output){assert(Module===trueModule,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");trueModule=null;receiveInstance(output["instance"],output["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var ASM_CONSTS={};function initPthreadsJS(){PThread.initRuntime()}if(!ENVIRONMENT_IS_PTHREAD)__ATINIT__.push({func:function(){___wasm_call_ctors()}});function demangle(func){warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return func}function demangleAll(text){var regex=/\b_Z[\w\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"})}var __pthread_ptr=0;var __pthread_is_main_runtime_thread=0;var __pthread_is_main_browser_thread=0;function __register_pthread_ptr(pthreadPtr,isMainBrowserThread,isMainRuntimeThread){pthreadPtr=pthreadPtr|0;isMainBrowserThread=isMainBrowserThread|0;isMainRuntimeThread=isMainRuntimeThread|0;__pthread_ptr=pthreadPtr;__pthread_is_main_browser_thread=isMainBrowserThread;__pthread_is_main_runtime_thread=isMainRuntimeThread}Module["__register_pthread_ptr"]=__register_pthread_ptr;var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var __main_thread_futex_wait_address=12912;function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__main_thread_futex_wait_address>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__main_thread_futex_wait_address>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function __kill_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _kill_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _kill_thread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function __cancel_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cancel_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cancel_thread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function __cleanup_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cleanup_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cleanup_thread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];if(pthread){var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={MAIN_THREAD_ID:1,mainThreadInfo:{schedPolicy:0,schedPrio:0},unusedWorkers:[],runningWorkers:[],initRuntime:function(){__register_pthread_ptr(PThread.mainThreadBlock,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(PThread.mainThreadBlock)},initMainThreadBlock:function(){assert(!ENVIRONMENT_IS_PTHREAD);var pthreadPoolSize=8;for(var i=0;i>2]=PThread.mainThreadBlock;var headPtr=PThread.mainThreadBlock+156;HEAP32[headPtr>>2]=headPtr;var tlsMemory=12400;for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,PThread.mainThreadBlock+104>>2,tlsMemory);Atomics.store(HEAPU32,PThread.mainThreadBlock+40>>2,PThread.mainThreadBlock);Atomics.store(HEAPU32,PThread.mainThreadBlock+44>>2,42)},initWorker:function(){},pthreads:{},exitHandlers:null,setThreadStatus:function(){},runExitHandlers:function(){if(PThread.exitHandlers!==null){while(PThread.exitHandlers.length>0){PThread.exitHandlers.pop()()}PThread.exitHandlers=null}if(ENVIRONMENT_IS_PTHREAD&&threadInfoStruct)___pthread_tsd_run_dtors()},threadExit:function(exitCode){var tb=_pthread_self();if(tb){err("Pthread 0x"+tb.toString(16)+" exited.");Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);Atomics.store(HEAPU32,tb+60>>2,1);Atomics.store(HEAPU32,tb+64>>2,0);PThread.runExitHandlers();_emscripten_futex_wake(tb+0,2147483647);__register_pthread_ptr(0,0,0);threadInfoStruct=0;if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlers();Atomics.store(HEAPU32,threadInfoStruct+4>>2,-1);Atomics.store(HEAPU32,threadInfoStruct+0>>2,1);_emscripten_futex_wake(threadInfoStruct+0,2147483647);threadInfoStruct=selfThreadId=0;__register_pthread_ptr(0,0,0);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+104>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){delete PThread.pthreads[worker.pthread.thread];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined},receiveObjectTransfer:function(data){},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){__spawn_thread(e.data)}else if(cmd==="cleanupThread"){__cleanup_thread(d["thread"])}else if(cmd==="killThread"){__kill_thread(d["thread"])}else if(cmd==="cancelThread"){__cancel_thread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.thread+68>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){console.log("worker exited - TODO: update the worker queue?")})}assert(wasmMemory instanceof WebAssembly.Memory,"WebAssembly memory should have been loaded by now!");assert(wasmModule instanceof WebAssembly.Module,"WebAssembly Module should have been loaded by now!");worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule,"DYNAMIC_BASE":DYNAMIC_BASE,"DYNAMICTOP_PTR":DYNAMICTOP_PTR})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("tfjs-backend-wasm.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}if(PThread.unusedWorkers.length>0)return PThread.unusedWorkers.pop();else return null},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()>2]=value;return value}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg);warnOnce("atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)");__ATEXIT__.unshift({func:func,arg:arg})}function ___handle_stack_overflow(){abort("stack overflow")}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){err("Cannot send message to thread with ID "+targetThreadId+", unknown thread ID!");return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){expectedStatus=expectedStatus|0;newStatus=newStatus|0}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(ENVIRONMENT_IS_WORKER){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{var loadedVal=Atomics.load(HEAP32,addr>>2);if(val!=loadedVal)return-6;var tNow=performance.now();var tEnd=tNow+timeout;Atomics.store(HEAP32,__main_thread_futex_wait_address>>2,addr);var ourWaitAddress=addr;while(addr==ourWaitAddress){tNow=performance.now();if(tNow>tEnd){return-73}_emscripten_main_thread_process_queued_calls();addr=Atomics.load(HEAP32,__main_thread_futex_wait_address>>2)}return 0}}function _emscripten_is_main_browser_thread(){return __pthread_is_main_browser_thread|0}function _emscripten_is_main_runtime_thread(){return __pthread_is_main_runtime_thread|0}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;if(numCallArgs>20-1)throw"emscripten_proxy_to_main_thread_js: Too many arguments "+numCallArgs+" to proxied function idx="+index+", maximum supported is "+(20-1)+"!";var stack=stackSave();var args=stackAlloc(numCallArgs*8);var b=args>>3;for(var i=0;i>3]);buf+=8}else if(ch===105){buf=buf+3&~3;args.push(HEAP32[buf>>2]);buf+=4}else abort("unexpected char in asm const signature "+ch)}return args}function _emscripten_receive_on_main_thread_js(index,numCallArgs,args){_emscripten_receive_on_main_thread_js_callArgs.length=numCallArgs;var b=args>>3;for(var i=0;i=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;_emscripten_async_queue_on_thread_(targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;_emscripten_async_queue_on_thread_(targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function __maybeCStringToJsString(cString){return cString===cString+0?UTF8ToString(cString):cString}var __specialEventTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function __findEventTarget(target){var domElement=__specialEventTargets[target]||(typeof document!=="undefined"?document.querySelector(__maybeCStringToJsString(target)):undefined);return domElement}function __findCanvasEventTarget(target){return __findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=__findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=__findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){newStatus=newStatus|0}function __webgl_acquireInstancedArraysExtension(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)}}}function __webgl_acquireVertexArrayObjectExtension(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)}}}function __webgl_acquireDrawBuffersExtension(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)}}}var GL={counter:1,lastError:0,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},currentContext:null,offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,init:function(){var miniTempFloatBuffer=new Float32Array(GL.MINI_TEMP_BUFFER_SIZE);for(var i=0;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;if(context.version<2){__webgl_acquireInstancedArraysExtension(GLctx);__webgl_acquireVertexArrayObjectExtension(GLctx);__webgl_acquireDrawBuffersExtension(GLctx)}GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query");var automaticallyEnabledExtensions=["OES_texture_float","OES_texture_half_float","OES_standard_derivatives","OES_vertex_array_object","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","OES_element_index_uint","EXT_texture_filter_anisotropic","EXT_frag_depth","WEBGL_draw_buffers","ANGLE_instanced_arrays","OES_texture_float_linear","OES_texture_half_float_linear","EXT_blend_minmax","EXT_shader_texture_lod","EXT_texture_norm16","WEBGL_compressed_texture_pvrtc","EXT_color_buffer_half_float","WEBGL_color_buffer_float","EXT_sRGB","WEBGL_compressed_texture_etc1","EXT_disjoint_timer_query","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_astc","EXT_color_buffer_float","WEBGL_compressed_texture_s3tc_srgb","EXT_disjoint_timer_query_webgl2","WEBKIT_WEBGL_compressed_texture_pvrtc"];var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(automaticallyEnabledExtensions.indexOf(ext)!=-1){GLctx.getExtension(ext)}})},populateUniformTable:function(program){var p=GL.programs[program];var ptable=GL.programInfos[program]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1};var utable=ptable.uniforms;var numUniforms=GLctx.getProgramParameter(p,35718);for(var i=0;i>2;contextAttributes["alpha"]=!!HEAP32[a+(0>>2)];contextAttributes["depth"]=!!HEAP32[a+(4>>2)];contextAttributes["stencil"]=!!HEAP32[a+(8>>2)];contextAttributes["antialias"]=!!HEAP32[a+(12>>2)];contextAttributes["premultipliedAlpha"]=!!HEAP32[a+(16>>2)];contextAttributes["preserveDrawingBuffer"]=!!HEAP32[a+(20>>2)];var powerPreference=HEAP32[a+(24>>2)];contextAttributes["powerPreference"]=__emscripten_webgl_power_preferences[powerPreference];contextAttributes["failIfMajorPerformanceCaveat"]=!!HEAP32[a+(28>>2)];contextAttributes.majorVersion=HEAP32[a+(32>>2)];contextAttributes.minorVersion=HEAP32[a+(36>>2)];contextAttributes.enableExtensionsByDefault=HEAP32[a+(40>>2)];contextAttributes.explicitSwapControl=HEAP32[a+(44>>2)];contextAttributes.proxyContextToMainThread=HEAP32[a+(48>>2)];contextAttributes.renderViaOffscreenBackBuffer=HEAP32[a+(52>>2)];var canvas=__findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];assert(buffer);if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:undefined,get:function(){assert(SYSCALLS.varargs!=undefined);SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){if(low>=0)assert(high===0);else assert(high===-1);return low}};function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,fd);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM");return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,fd,offset_low,offset_high,whence,newOffset);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM")}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd,iov,iovcnt,pnum);var num=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}function _pthread_cleanup_pop(execute){var routine=PThread.exitHandlers.pop();if(execute)routine()}function _pthread_cleanup_push(routine,arg){if(PThread.exitHandlers===null){PThread.exitHandlers=[]}PThread.exitHandlers.push(function(){dynCall_vi(routine,arg)})}function __spawn_thread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _spawn_thread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,thread:threadParams.pthread_ptr,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(0>>2),0);Atomics.store(HEAPU32,tis+(4>>2),0);Atomics.store(HEAPU32,tis+(8>>2),0);Atomics.store(HEAPU32,tis+(68>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(104>>2),tlsMemory);Atomics.store(HEAPU32,tis+(48>>2),0);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(44>>2),42);Atomics.store(HEAPU32,tis+(108>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(84>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(80>>2),stackHigh);Atomics.store(HEAPU32,tis+(108+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(108+12>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(108+20>>2),threadParams.schedPolicy);Atomics.store(HEAPU32,tis+(108+24>>2),threadParams.schedPrio);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(176>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"selfThreadId":threadParams.pthread_ptr,"parentThreadId":threadParams.parent_pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}}function _pthread_getschedparam(thread,policy,schedparam){if(!policy&&!schedparam)return ERRNO_CODES.EINVAL;if(!thread){err("pthread_getschedparam called with a null thread pointer!");return ERRNO_CODES.ESRCH}var self=HEAP32[thread+12>>2];if(self!==thread){err("pthread_getschedparam attempted on thread "+thread+", which does not point to a valid thread, or does not exist anymore!");return ERRNO_CODES.ESRCH}var schedPolicy=Atomics.load(HEAPU32,thread+108+20>>2);var schedPrio=Atomics.load(HEAPU32,thread+108+24>>2);if(policy)HEAP32[policy>>2]=schedPolicy;if(schedparam)HEAP32[schedparam>>2]=schedPrio;return 0}function _pthread_self(){return __pthread_ptr|0}Module["_pthread_self"]=_pthread_self;function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;var schedPolicy=0;var schedPrio=0;if(attr){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0;var inheritSched=HEAP32[attr+16>>2]===0;if(inheritSched){var prevSchedPolicy=HEAP32[attr+20>>2];var prevSchedPrio=HEAP32[attr+24>>2];var parentThreadPtr=PThread.currentProxiedOperationCallerThread?PThread.currentProxiedOperationCallerThread:_pthread_self();_pthread_getschedparam(parentThreadPtr,attr+20,attr+24);schedPolicy=HEAP32[attr+20>>2];schedPrio=HEAP32[attr+24>>2];HEAP32[attr+20>>2]=prevSchedPolicy;HEAP32[attr+24>>2]=prevSchedPrio}else{schedPolicy=HEAP32[attr+20>>2];schedPrio=HEAP32[attr+24>>2]}}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(232);for(var i=0;i<232>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+156;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,schedPolicy:schedPolicy,schedPrio:schedPrio,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,parent_pthread_ptr:_pthread_self(),arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList)}else{__spawn_thread(threadParams)}return 0}function _roundf(d){d=+d;return d>=+0?+Math_floor(d+ +.5):+Math_ceil(d-+.5)}function _sysconf(name){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,name);switch(name){case 30:return 16384;case 85:var maxHeapSize=HEAPU8.length;return maxHeapSize/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:case 79:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator==="object")return navigator["hardwareConcurrency"]||1;return 1}}setErrNo(28);return-1}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();else PThread.initWorker();var GLctx;GL.init();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_fd_close,_fd_seek,_fd_write,_sysconf];var asmLibraryArg={"__assert_fail":___assert_fail,"__handle_stack_overflow":___handle_stack_overflow,"_emscripten_notify_thread_queue":__emscripten_notify_thread_queue,"abort":_abort,"emscripten_conditional_set_current_thread_status":_emscripten_conditional_set_current_thread_status,"emscripten_futex_wait":_emscripten_futex_wait,"emscripten_futex_wake":_emscripten_futex_wake,"emscripten_get_now":_emscripten_get_now,"emscripten_is_main_browser_thread":_emscripten_is_main_browser_thread,"emscripten_is_main_runtime_thread":_emscripten_is_main_runtime_thread,"emscripten_memcpy_big":_emscripten_memcpy_big,"emscripten_receive_on_main_thread_js":_emscripten_receive_on_main_thread_js,"emscripten_resize_heap":_emscripten_resize_heap,"emscripten_set_canvas_element_size":_emscripten_set_canvas_element_size,"emscripten_set_current_thread_status":_emscripten_set_current_thread_status,"emscripten_webgl_create_context":_emscripten_webgl_create_context,"fd_close":_fd_close,"fd_seek":_fd_seek,"fd_write":_fd_write,"initPthreadsJS":initPthreadsJS,"memory":wasmMemory||Module["wasmMemory"],"pthread_cleanup_pop":_pthread_cleanup_pop,"pthread_cleanup_push":_pthread_cleanup_push,"pthread_create":_pthread_create,"pthread_self":_pthread_self,"roundf":_roundf,"table":wasmTable};var asm=createWasm();Module["asm"]=asm;var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__wasm_call_ctors"].apply(null,arguments)};var _init=Module["_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["init"].apply(null,arguments)};var _register_tensor=Module["_register_tensor"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["register_tensor"].apply(null,arguments)};var _dispose_data=Module["_dispose_data"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose_data"].apply(null,arguments)};var _dispose=Module["_dispose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose"].apply(null,arguments)};var _Abs=Module["_Abs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Abs"].apply(null,arguments)};var _Add=Module["_Add"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Add"].apply(null,arguments)};var _AddN=Module["_AddN"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AddN"].apply(null,arguments)};var _ArgMax=Module["_ArgMax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ArgMax"].apply(null,arguments)};var _AvgPool=Module["_AvgPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AvgPool"].apply(null,arguments)};var _BatchMatMul=Module["_BatchMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["BatchMatMul"].apply(null,arguments)};var _ClipByValue=Module["_ClipByValue"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ClipByValue"].apply(null,arguments)};var _Conv2D=Module["_Conv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Conv2D"].apply(null,arguments)};var _Cos=Module["_Cos"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Cos"].apply(null,arguments)};var _CropAndResize=Module["_CropAndResize"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["CropAndResize"].apply(null,arguments)};var _DepthwiseConv2dNative=Module["_DepthwiseConv2dNative"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["DepthwiseConv2dNative"].apply(null,arguments)};var _Div=Module["_Div"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Div"].apply(null,arguments)};var _Exp=Module["_Exp"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Exp"].apply(null,arguments)};var _FloorDiv=Module["_FloorDiv"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FloorDiv"].apply(null,arguments)};var _FusedBatchNorm=Module["_FusedBatchNorm"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedBatchNorm"].apply(null,arguments)};var _FusedConv2D=Module["_FusedConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedConv2D"].apply(null,arguments)};var _FusedDepthwiseConv2D=Module["_FusedDepthwiseConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedDepthwiseConv2D"].apply(null,arguments)};var _Gather=Module["_Gather"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Gather"].apply(null,arguments)};var _GatherNd=Module["_GatherNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GatherNd"].apply(null,arguments)};var _Greater=Module["_Greater"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Greater"].apply(null,arguments)};var _GreaterEqual=Module["_GreaterEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GreaterEqual"].apply(null,arguments)};var _Less=Module["_Less"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Less"].apply(null,arguments)};var _LessEqual=Module["_LessEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LessEqual"].apply(null,arguments)};var _Log=Module["_Log"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Log"].apply(null,arguments)};var _LogicalAnd=Module["_LogicalAnd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LogicalAnd"].apply(null,arguments)};var _Max=Module["_Max"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Max"].apply(null,arguments)};var _MaxPool=Module["_MaxPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["MaxPool"].apply(null,arguments)};var _Maximum=Module["_Maximum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Maximum"].apply(null,arguments)};var _Min=Module["_Min"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Min"].apply(null,arguments)};var _Minimum=Module["_Minimum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Minimum"].apply(null,arguments)};var _Mul=Module["_Mul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Mul"].apply(null,arguments)};var _Neg=Module["_Neg"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Neg"].apply(null,arguments)};var _NonMaxSuppressionV3=Module["_NonMaxSuppressionV3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV3"].apply(null,arguments)};var _NonMaxSuppressionV5=Module["_NonMaxSuppressionV5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV5"].apply(null,arguments)};var _NotEqual=Module["_NotEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NotEqual"].apply(null,arguments)};var _PadV2=Module["_PadV2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["PadV2"].apply(null,arguments)};var _Pow=Module["_Pow"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Pow"].apply(null,arguments)};var _Prelu=Module["_Prelu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Prelu"].apply(null,arguments)};var _Relu=Module["_Relu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu"].apply(null,arguments)};var _Relu6=Module["_Relu6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu6"].apply(null,arguments)};var _ResizeBilinear=Module["_ResizeBilinear"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ResizeBilinear"].apply(null,arguments)};var _Rsqrt=Module["_Rsqrt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Rsqrt"].apply(null,arguments)};var _ScatterNd=Module["_ScatterNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ScatterNd"].apply(null,arguments)};var _Sigmoid=Module["_Sigmoid"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sigmoid"].apply(null,arguments)};var _Sin=Module["_Sin"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sin"].apply(null,arguments)};var _Softmax=Module["_Softmax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Softmax"].apply(null,arguments)};var _Square=Module["_Square"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Square"].apply(null,arguments)};var _Sub=Module["_Sub"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sub"].apply(null,arguments)};var _Sum=Module["_Sum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sum"].apply(null,arguments)};var _Tanh=Module["_Tanh"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tanh"].apply(null,arguments)};var _Tile=Module["_Tile"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tile"].apply(null,arguments)};var _Transpose=Module["_Transpose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Transpose"].apply(null,arguments)};var __FusedMatMul=Module["__FusedMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_FusedMatMul"].apply(null,arguments)};var _malloc=Module["_malloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["malloc"].apply(null,arguments)};var _free=Module["_free"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["free"].apply(null,arguments)};var ___em_js__initPthreadsJS=Module["___em_js__initPthreadsJS"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__em_js__initPthreadsJS"].apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__errno_location"].apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_get_global_libc"].apply(null,arguments)};var _memalign=Module["_memalign"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["memalign"].apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__pthread_tsd_run_dtors"].apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null,arguments)};var _emscripten_main_browser_thread_id=Module["_emscripten_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_browser_thread_id"].apply(null,arguments)};var _emscripten_async_run_in_main_thread=Module["_emscripten_async_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread=Module["_emscripten_sync_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_0=Module["_emscripten_sync_run_in_main_thread_0"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_1=Module["_emscripten_sync_run_in_main_thread_1"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_2=Module["_emscripten_sync_run_in_main_thread_2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_xprintf_varargs=Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_3=Module["_emscripten_sync_run_in_main_thread_3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_5=Module["_emscripten_sync_run_in_main_thread_5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_6=Module["_emscripten_sync_run_in_main_thread_6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_7=Module["_emscripten_sync_run_in_main_thread_7"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null,arguments)};var _emscripten_async_queue_on_thread_=Module["_emscripten_async_queue_on_thread_"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_tls_init"].apply(null,arguments)};var ___set_stack_limit=Module["___set_stack_limit"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__set_stack_limit"].apply(null,arguments)};var stackSave=Module["stackSave"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackSave"].apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackAlloc"].apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackRestore"].apply(null,arguments)};var dynCall_vi=Module["dynCall_vi"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_vi"].apply(null,arguments)};var dynCall_v=Module["dynCall_v"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_v"].apply(null,arguments)};var dynCall_ii=Module["dynCall_ii"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_ii"].apply(null,arguments)};Module["asm"]=asm;if(!Object.getOwnPropertyDescriptor(Module,"intArrayFromString"))Module["intArrayFromString"]=function(){abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"intArrayToString"))Module["intArrayToString"]=function(){abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ccall"))Module["ccall"]=function(){abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["cwrap"]=cwrap;if(!Object.getOwnPropertyDescriptor(Module,"setValue"))Module["setValue"]=function(){abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getValue"))Module["getValue"]=function(){abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocate"))Module["allocate"]=function(){abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getMemory"))Module["getMemory"]=function(){abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ArrayToString"))Module["UTF8ArrayToString"]=function(){abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ToString"))Module["UTF8ToString"]=function(){abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8Array"))Module["stringToUTF8Array"]=function(){abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8"))Module["stringToUTF8"]=function(){abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF8"))Module["lengthBytesUTF8"]=function(){abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreRun"))Module["addOnPreRun"]=function(){abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnInit"))Module["addOnInit"]=function(){abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreMain"))Module["addOnPreMain"]=function(){abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnExit"))Module["addOnExit"]=function(){abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPostRun"))Module["addOnPostRun"]=function(){abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeStringToMemory"))Module["writeStringToMemory"]=function(){abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeArrayToMemory"))Module["writeArrayToMemory"]=function(){abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeAsciiToMemory"))Module["writeAsciiToMemory"]=function(){abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addRunDependency"))Module["addRunDependency"]=function(){abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"removeRunDependency"))Module["removeRunDependency"]=function(){abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createFolder"))Module["FS_createFolder"]=function(){abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPath"))Module["FS_createPath"]=function(){abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDataFile"))Module["FS_createDataFile"]=function(){abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPreloadedFile"))Module["FS_createPreloadedFile"]=function(){abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLazyFile"))Module["FS_createLazyFile"]=function(){abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLink"))Module["FS_createLink"]=function(){abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDevice"))Module["FS_createDevice"]=function(){abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_unlink"))Module["FS_unlink"]=function(){abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"dynamicAlloc"))Module["dynamicAlloc"]=function(){abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadDynamicLibrary"))Module["loadDynamicLibrary"]=function(){abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadWebAssemblyModule"))Module["loadWebAssemblyModule"]=function(){abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getLEB"))Module["getLEB"]=function(){abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFunctionTables"))Module["getFunctionTables"]=function(){abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"alignFunctionTables"))Module["alignFunctionTables"]=function(){abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"registerFunctions"))Module["registerFunctions"]=function(){abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addFunction"))Module["addFunction"]=function(){abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"removeFunction"))Module["removeFunction"]=function(){abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFuncWrapper"))Module["getFuncWrapper"]=function(){abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"prettyPrint"))Module["prettyPrint"]=function(){abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"makeBigInt"))Module["makeBigInt"]=function(){abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"dynCall"))Module["dynCall"]=function(){abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getCompilerSetting"))Module["getCompilerSetting"]=function(){abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"print"))Module["print"]=function(){abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"printErr"))Module["printErr"]=function(){abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getTempRet0"))Module["getTempRet0"]=function(){abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setTempRet0"))Module["setTempRet0"]=function(){abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"callMain"))Module["callMain"]=function(){abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"abort"))Module["abort"]=function(){abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToNewUTF8"))Module["stringToNewUTF8"]=function(){abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"abortOnCannotGrowMemory"))Module["abortOnCannotGrowMemory"]=function(){abort("'abortOnCannotGrowMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscripten_realloc_buffer"))Module["emscripten_realloc_buffer"]=function(){abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ENV"))Module["ENV"]=function(){abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setjmpId"))Module["setjmpId"]=function(){abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_CODES"))Module["ERRNO_CODES"]=function(){abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_MESSAGES"))Module["ERRNO_MESSAGES"]=function(){abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setErrNo"))Module["setErrNo"]=function(){abort("'setErrNo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"DNS"))Module["DNS"]=function(){abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GAI_ERRNO_MESSAGES"))Module["GAI_ERRNO_MESSAGES"]=function(){abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Protocols"))Module["Protocols"]=function(){abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Sockets"))Module["Sockets"]=function(){abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UNWIND_CACHE"))Module["UNWIND_CACHE"]=function(){abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readAsmConstArgs"))Module["readAsmConstArgs"]=function(){abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_q"))Module["jstoi_q"]=function(){abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_s"))Module["jstoi_s"]=function(){abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH"))Module["PATH"]=function(){abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH_FS"))Module["PATH_FS"]=function(){abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SYSCALLS"))Module["SYSCALLS"]=function(){abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMmap2"))Module["syscallMmap2"]=function(){abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMunmap"))Module["syscallMunmap"]=function(){abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"flush_NO_FILESYSTEM"))Module["flush_NO_FILESYSTEM"]=function(){abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"JSEvents"))Module["JSEvents"]=function(){abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangle"))Module["demangle"]=function(){abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangleAll"))Module["demangleAll"]=function(){abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jsStackTrace"))Module["jsStackTrace"]=function(){abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getEnvStrings"))Module["getEnvStrings"]=function(){abort("'getEnvStrings' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64"))Module["writeI53ToI64"]=function(){abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Clamped"))Module["writeI53ToI64Clamped"]=function(){abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Signaling"))Module["writeI53ToI64Signaling"]=function(){abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Clamped"))Module["writeI53ToU64Clamped"]=function(){abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Signaling"))Module["writeI53ToU64Signaling"]=function(){abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromI64"))Module["readI53FromI64"]=function(){abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromU64"))Module["readI53FromU64"]=function(){abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertI32PairToI53"))Module["convertI32PairToI53"]=function(){abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertU32PairToI53"))Module["convertU32PairToI53"]=function(){abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Browser"))Module["Browser"]=function(){abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GL"))Module["GL"]=function(){abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGet"))Module["emscriptenWebGLGet"]=function(){abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetTexPixelData"))Module["emscriptenWebGLGetTexPixelData"]=function(){abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetUniform"))Module["emscriptenWebGLGetUniform"]=function(){abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetVertexAttrib"))Module["emscriptenWebGLGetVertexAttrib"]=function(){abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AL"))Module["AL"]=function(){abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_unicode"))Module["SDL_unicode"]=function(){abort("'SDL_unicode' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_ttfContext"))Module["SDL_ttfContext"]=function(){abort("'SDL_ttfContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_audio"))Module["SDL_audio"]=function(){abort("'SDL_audio' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL"))Module["SDL"]=function(){abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_gfx"))Module["SDL_gfx"]=function(){abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLUT"))Module["GLUT"]=function(){abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"EGL"))Module["EGL"]=function(){abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW_Window"))Module["GLFW_Window"]=function(){abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW"))Module["GLFW"]=function(){abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLEW"))Module["GLEW"]=function(){abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"IDBStore"))Module["IDBStore"]=function(){abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"runAndAbortIfError"))Module["runAndAbortIfError"]=function(){abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["PThread"]=PThread;if(!Object.getOwnPropertyDescriptor(Module,"establishStackSpace"))Module["establishStackSpace"]=function(){abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getNoExitRuntime"))Module["getNoExitRuntime"]=function(){abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"resetPrototype"))Module["resetPrototype"]=function(){abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"warnOnce"))Module["warnOnce"]=function(){abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackSave"))Module["stackSave"]=function(){abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackRestore"))Module["stackRestore"]=function(){abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackAlloc"))Module["stackAlloc"]=function(){abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AsciiToString"))Module["AsciiToString"]=function(){abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToAscii"))Module["stringToAscii"]=function(){abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF16ToString"))Module["UTF16ToString"]=function(){abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF16"))Module["stringToUTF16"]=function(){abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF16"))Module["lengthBytesUTF16"]=function(){abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF32ToString"))Module["UTF32ToString"]=function(){abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF32"))Module["stringToUTF32"]=function(){abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF32"))Module["lengthBytesUTF32"]=function(){abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8"))Module["allocateUTF8"]=function(){abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8OnStack"))Module["allocateUTF8OnStack"]=function(){abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["writeStackCookie"]=writeStackCookie;Module["checkStackCookie"]=checkStackCookie;Module["abortStackOverflow"]=abortStackOverflow;Module["PThread"]=PThread;Module["_pthread_self"]=_pthread_self;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NORMAL"))Object.defineProperty(Module,"ALLOC_NORMAL",{configurable:true,get:function(){abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_STACK"))Object.defineProperty(Module,"ALLOC_STACK",{configurable:true,get:function(){abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_DYNAMIC"))Object.defineProperty(Module,"ALLOC_DYNAMIC",{configurable:true,get:function(){abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NONE"))Object.defineProperty(Module,"ALLOC_NONE",{configurable:true,get:function(){abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});var calledRun;Module["then"]=function(func){if(calledRun){func(Module)}else{var old=Module["onRuntimeInitialized"];Module["onRuntimeInitialized"]=function(){if(old)old();func(Module)}}return Module};function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}writeStackCookie();preRun();if(runDependencies>0)return;function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();assert(!Module["_main"],'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}checkStackCookie()}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}if(!ENVIRONMENT_IS_PTHREAD)noExitRuntime=true;if(!ENVIRONMENT_IS_PTHREAD)run(); +var Module=typeof WasmBackendModule!=="undefined"?WasmBackendModule:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(Module["ENVIRONMENT"]){throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)")}var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"];DYNAMIC_BASE=Module["DYNAMIC_BASE"];DYNAMICTOP_PTR=Module["DYNAMICTOP_PTR"]}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{throw new Error("environment detection error")}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(!Object.getOwnPropertyDescriptor(Module,"arguments"))Object.defineProperty(Module,"arguments",{configurable:true,get:function(){abort("Module.arguments has been replaced with plain arguments_")}});if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(!Object.getOwnPropertyDescriptor(Module,"thisProgram"))Object.defineProperty(Module,"thisProgram",{configurable:true,get:function(){abort("Module.thisProgram has been replaced with plain thisProgram")}});if(Module["quit"])quit_=Module["quit"];if(!Object.getOwnPropertyDescriptor(Module,"quit"))Object.defineProperty(Module,"quit",{configurable:true,get:function(){abort("Module.quit has been replaced with plain quit_")}});assert(typeof Module["memoryInitializerPrefixURL"]==="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["pthreadMainPrefixURL"]==="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["cdInitializerPrefixURL"]==="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["filePackagePrefixURL"]==="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["read"]==="undefined","Module.read option was removed (modify read_ in JS)");assert(typeof Module["readAsync"]==="undefined","Module.readAsync option was removed (modify readAsync in JS)");assert(typeof Module["readBinary"]==="undefined","Module.readBinary option was removed (modify readBinary in JS)");assert(typeof Module["setWindowTitle"]==="undefined","Module.setWindowTitle option was removed (modify setWindowTitle in JS)");assert(typeof Module["TOTAL_MEMORY"]==="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY");if(!Object.getOwnPropertyDescriptor(Module,"read"))Object.defineProperty(Module,"read",{configurable:true,get:function(){abort("Module.read has been replaced with plain read_")}});if(!Object.getOwnPropertyDescriptor(Module,"readAsync"))Object.defineProperty(Module,"readAsync",{configurable:true,get:function(){abort("Module.readAsync has been replaced with plain readAsync")}});if(!Object.getOwnPropertyDescriptor(Module,"readBinary"))Object.defineProperty(Module,"readBinary",{configurable:true,get:function(){abort("Module.readBinary has been replaced with plain readBinary")}});if(!Object.getOwnPropertyDescriptor(Module,"setWindowTitle"))Object.defineProperty(Module,"setWindowTitle",{configurable:true,get:function(){abort("Module.setWindowTitle has been replaced with plain setWindowTitle")}});assert(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER||ENVIRONMENT_IS_NODE,"Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)");var stackSave;var stackRestore;var stackAlloc;stackSave=stackRestore=stackAlloc=function(){abort("cannot use the stack before compiled code is ready to run, and has provided stack access")};function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(!Object.getOwnPropertyDescriptor(Module,"wasmBinary"))Object.defineProperty(Module,"wasmBinary",{configurable:true,get:function(){abort("Module.wasmBinary has been replaced with plain wasmBinary")}});var noExitRuntime;if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(!Object.getOwnPropertyDescriptor(Module,"noExitRuntime"))Object.defineProperty(Module,"noExitRuntime",{configurable:true,get:function(){abort("Module.noExitRuntime has been replaced with plain noExitRuntime")}});if(typeof WebAssembly!=="object"){abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.")}var wasmMemory;var wasmTable=new WebAssembly.Table({"initial":119,"maximum":119+0,"element":"anyfunc"});var wasmModule;var threadInfoStruct=0;var selfThreadId=0;var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string")return UTF8ToString(ret);if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{if((u0&248)!=240)warnOnce("Invalid UTF-8 leading byte 0x"+u0.toString(16)+" encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!");u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;if(u>=2097152)warnOnce("Invalid Unicode code point 0x"+u.toString(16)+" encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF).");heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");HEAP8.set(array,buffer)}var WASM_PAGE_SIZE=65536;var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var STACK_BASE=5255808,STACKTOP=STACK_BASE,STACK_MAX=12928,DYNAMIC_BASE=5255808,DYNAMICTOP_PTR=12e3;assert(STACK_BASE%16===0,"stack must start aligned");assert(DYNAMIC_BASE%16===0,"heap must start aligned");if(ENVIRONMENT_IS_PTHREAD){STACK_MAX=STACKTOP=STACK_MAX=2147483647}var TOTAL_STACK=5242880;if(Module["TOTAL_STACK"])assert(TOTAL_STACK===Module["TOTAL_STACK"],"the stack size can no longer be determined at runtime");var INITIAL_INITIAL_MEMORY=Module["INITIAL_MEMORY"]||1073741824;if(!Object.getOwnPropertyDescriptor(Module,"INITIAL_MEMORY"))Object.defineProperty(Module,"INITIAL_MEMORY",{configurable:true,get:function(){abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY")}});assert(INITIAL_INITIAL_MEMORY>=TOTAL_STACK,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+INITIAL_INITIAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");assert(typeof Int32Array!=="undefined"&&typeof Float64Array!=="undefined"&&Int32Array.prototype.subarray!==undefined&&Int32Array.prototype.set!==undefined,"JS engine does not provide full typed array support");if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,"maximum":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_INITIAL_MEMORY=buffer.byteLength;assert(INITIAL_INITIAL_MEMORY%WASM_PAGE_SIZE===0);updateGlobalBufferAndViews(buffer);if(!ENVIRONMENT_IS_PTHREAD){HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE}function writeStackCookie(){assert((STACK_MAX&3)==0);HEAPU32[(STACK_MAX>>2)+1]=34821223;HEAPU32[(STACK_MAX>>2)+2]=2310721022;HEAP32[0]=1668509029}function checkStackCookie(){var cookie1=HEAPU32[(STACK_MAX>>2)+1];var cookie2=HEAPU32[(STACK_MAX>>2)+2];if(cookie1!=34821223||cookie2!=2310721022){abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+cookie2.toString(16)+" "+cookie1.toString(16))}if(HEAP32[0]!==1668509029)abort("Runtime error: The application has corrupted its heap memory area (address zero)!")}function abortStackOverflow(allocSize){abort("Stack overflow! Attempted to allocate "+allocSize+" bytes on the stack, but stack has only "+(STACK_MAX-stackSave()+allocSize)+" bytes available!")}(function(){var h16=new Int16Array(1);var h8=new Int8Array(h16.buffer);h16[0]=25459;if(h8[0]!==115||h8[1]!==99)throw"Runtime error: expected the system to be little-endian!"})();function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;if(ENVIRONMENT_IS_PTHREAD)runtimeInitialized=true;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){checkStackCookie();assert(!runtimeInitialized);runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATMAIN__)}function postRun(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Math_ceil=Math.ceil;var Math_floor=Math.floor;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!=="undefined"){runDependencyWatcher=setInterval(function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;err("still waiting on run dependencies:")}err("dependency: "+dep)}if(shown){err("(end of list)")}},1e4)}}else{err("warning: run dependency added without ID")}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id]}else{err("warning: run dependency removed without ID")}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";out(what);err(what);ABORT=true;EXITSTATUS=1;var output="abort("+what+") at "+stackTrace();what=output;throw new WebAssembly.RuntimeError(what)}var FS={error:function(){abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1")},init:function(){FS.error()},createDataFile:function(){FS.error()},createPreloadedFile:function(){FS.error()},createLazyFile:function(){FS.error()},open:function(){FS.error()},mkdev:function(){FS.error()},registerDevice:function(){FS.error()},analyzePath:function(){FS.error()},loadFilesFromDB:function(){FS.error()},ErrnoError:function ErrnoError(){FS.error()}};Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;function hasPrefix(str,prefix){return String.prototype.startsWith?str.startsWith(prefix):str.indexOf(prefix)===0}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return hasPrefix(filename,dataURIPrefix)}var fileURIPrefix="file://";function isFileURI(filename){return hasPrefix(filename,fileURIPrefix)}var wasmBinaryFile="tfjs-backend-wasm.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(){try{if(wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(wasmBinaryFile)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary()})}return new Promise(function(resolve,reject){resolve(getBinary())})}function createWasm(){var info={"env":asmLibraryArg,"wasi_snapshot_preview1":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){var numWorkersToLoad=PThread.unusedWorkers.length;PThread.unusedWorkers.forEach(function(w){PThread.loadWasmModuleToWorker(w,function(){if(!--numWorkersToLoad)removeRunDependency("wasm-instantiate")})})}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}var trueModule=Module;function receiveInstantiatedSource(output){assert(Module===trueModule,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");trueModule=null;receiveInstance(output["instance"],output["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var ASM_CONSTS={};function initPthreadsJS(){PThread.initRuntime()}if(!ENVIRONMENT_IS_PTHREAD)__ATINIT__.push({func:function(){___wasm_call_ctors()}});function demangle(func){warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return func}function demangleAll(text){var regex=/\b_Z[\w\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"})}var __pthread_ptr=0;var __pthread_is_main_runtime_thread=0;var __pthread_is_main_browser_thread=0;function __register_pthread_ptr(pthreadPtr,isMainBrowserThread,isMainRuntimeThread){pthreadPtr=pthreadPtr|0;isMainBrowserThread=isMainBrowserThread|0;isMainRuntimeThread=isMainRuntimeThread|0;__pthread_ptr=pthreadPtr;__pthread_is_main_browser_thread=isMainBrowserThread;__pthread_is_main_runtime_thread=isMainRuntimeThread}Module["__register_pthread_ptr"]=__register_pthread_ptr;var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var __main_thread_futex_wait_address=12912;function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__main_thread_futex_wait_address>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__main_thread_futex_wait_address>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function __kill_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _kill_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _kill_thread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function __cancel_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cancel_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cancel_thread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function __cleanup_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cleanup_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cleanup_thread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];if(pthread){var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={MAIN_THREAD_ID:1,mainThreadInfo:{schedPolicy:0,schedPrio:0},unusedWorkers:[],runningWorkers:[],initRuntime:function(){__register_pthread_ptr(PThread.mainThreadBlock,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(PThread.mainThreadBlock)},initMainThreadBlock:function(){assert(!ENVIRONMENT_IS_PTHREAD);var pthreadPoolSize=8;for(var i=0;i>2]=PThread.mainThreadBlock;var headPtr=PThread.mainThreadBlock+156;HEAP32[headPtr>>2]=headPtr;var tlsMemory=12400;for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,PThread.mainThreadBlock+104>>2,tlsMemory);Atomics.store(HEAPU32,PThread.mainThreadBlock+40>>2,PThread.mainThreadBlock);Atomics.store(HEAPU32,PThread.mainThreadBlock+44>>2,42)},initWorker:function(){},pthreads:{},exitHandlers:null,setThreadStatus:function(){},runExitHandlers:function(){if(PThread.exitHandlers!==null){while(PThread.exitHandlers.length>0){PThread.exitHandlers.pop()()}PThread.exitHandlers=null}if(ENVIRONMENT_IS_PTHREAD&&threadInfoStruct)___pthread_tsd_run_dtors()},threadExit:function(exitCode){var tb=_pthread_self();if(tb){err("Pthread 0x"+tb.toString(16)+" exited.");Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);Atomics.store(HEAPU32,tb+60>>2,1);Atomics.store(HEAPU32,tb+64>>2,0);PThread.runExitHandlers();_emscripten_futex_wake(tb+0,2147483647);__register_pthread_ptr(0,0,0);threadInfoStruct=0;if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlers();Atomics.store(HEAPU32,threadInfoStruct+4>>2,-1);Atomics.store(HEAPU32,threadInfoStruct+0>>2,1);_emscripten_futex_wake(threadInfoStruct+0,2147483647);threadInfoStruct=selfThreadId=0;__register_pthread_ptr(0,0,0);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+104>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){delete PThread.pthreads[worker.pthread.thread];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined},receiveObjectTransfer:function(data){},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){__spawn_thread(e.data)}else if(cmd==="cleanupThread"){__cleanup_thread(d["thread"])}else if(cmd==="killThread"){__kill_thread(d["thread"])}else if(cmd==="cancelThread"){__cancel_thread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.thread+68>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){console.log("worker exited - TODO: update the worker queue?")})}assert(wasmMemory instanceof WebAssembly.Memory,"WebAssembly memory should have been loaded by now!");assert(wasmModule instanceof WebAssembly.Module,"WebAssembly Module should have been loaded by now!");worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule,"DYNAMIC_BASE":DYNAMIC_BASE,"DYNAMICTOP_PTR":DYNAMICTOP_PTR})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("tfjs-backend-wasm.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}if(PThread.unusedWorkers.length>0)return PThread.unusedWorkers.pop();else return null},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()>2]=value;return value}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg);warnOnce("atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)");__ATEXIT__.unshift({func:func,arg:arg})}function ___handle_stack_overflow(){abort("stack overflow")}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){err("Cannot send message to thread with ID "+targetThreadId+", unknown thread ID!");return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){expectedStatus=expectedStatus|0;newStatus=newStatus|0}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(ENVIRONMENT_IS_WORKER){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{var loadedVal=Atomics.load(HEAP32,addr>>2);if(val!=loadedVal)return-6;var tNow=performance.now();var tEnd=tNow+timeout;Atomics.store(HEAP32,__main_thread_futex_wait_address>>2,addr);var ourWaitAddress=addr;while(addr==ourWaitAddress){tNow=performance.now();if(tNow>tEnd){return-73}_emscripten_main_thread_process_queued_calls();addr=Atomics.load(HEAP32,__main_thread_futex_wait_address>>2)}return 0}}function _emscripten_is_main_browser_thread(){return __pthread_is_main_browser_thread|0}function _emscripten_is_main_runtime_thread(){return __pthread_is_main_runtime_thread|0}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;if(numCallArgs>20-1)throw"emscripten_proxy_to_main_thread_js: Too many arguments "+numCallArgs+" to proxied function idx="+index+", maximum supported is "+(20-1)+"!";var stack=stackSave();var args=stackAlloc(numCallArgs*8);var b=args>>3;for(var i=0;i>3]);buf+=8}else if(ch===105){buf=buf+3&~3;args.push(HEAP32[buf>>2]);buf+=4}else abort("unexpected char in asm const signature "+ch)}return args}function _emscripten_receive_on_main_thread_js(index,numCallArgs,args){_emscripten_receive_on_main_thread_js_callArgs.length=numCallArgs;var b=args>>3;for(var i=0;i=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;_emscripten_async_queue_on_thread_(targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;_emscripten_async_queue_on_thread_(targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function __maybeCStringToJsString(cString){return cString===cString+0?UTF8ToString(cString):cString}var __specialEventTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function __findEventTarget(target){var domElement=__specialEventTargets[target]||(typeof document!=="undefined"?document.querySelector(__maybeCStringToJsString(target)):undefined);return domElement}function __findCanvasEventTarget(target){return __findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=__findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=__findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){newStatus=newStatus|0}function __webgl_acquireInstancedArraysExtension(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)}}}function __webgl_acquireVertexArrayObjectExtension(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)}}}function __webgl_acquireDrawBuffersExtension(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)}}}var GL={counter:1,lastError:0,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},currentContext:null,offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,init:function(){var miniTempFloatBuffer=new Float32Array(GL.MINI_TEMP_BUFFER_SIZE);for(var i=0;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;if(context.version<2){__webgl_acquireInstancedArraysExtension(GLctx);__webgl_acquireVertexArrayObjectExtension(GLctx);__webgl_acquireDrawBuffersExtension(GLctx)}GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query");var automaticallyEnabledExtensions=["OES_texture_float","OES_texture_half_float","OES_standard_derivatives","OES_vertex_array_object","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","OES_element_index_uint","EXT_texture_filter_anisotropic","EXT_frag_depth","WEBGL_draw_buffers","ANGLE_instanced_arrays","OES_texture_float_linear","OES_texture_half_float_linear","EXT_blend_minmax","EXT_shader_texture_lod","EXT_texture_norm16","WEBGL_compressed_texture_pvrtc","EXT_color_buffer_half_float","WEBGL_color_buffer_float","EXT_sRGB","WEBGL_compressed_texture_etc1","EXT_disjoint_timer_query","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_astc","EXT_color_buffer_float","WEBGL_compressed_texture_s3tc_srgb","EXT_disjoint_timer_query_webgl2","WEBKIT_WEBGL_compressed_texture_pvrtc"];var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(automaticallyEnabledExtensions.indexOf(ext)!=-1){GLctx.getExtension(ext)}})},populateUniformTable:function(program){var p=GL.programs[program];var ptable=GL.programInfos[program]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1};var utable=ptable.uniforms;var numUniforms=GLctx.getProgramParameter(p,35718);for(var i=0;i>2;contextAttributes["alpha"]=!!HEAP32[a+(0>>2)];contextAttributes["depth"]=!!HEAP32[a+(4>>2)];contextAttributes["stencil"]=!!HEAP32[a+(8>>2)];contextAttributes["antialias"]=!!HEAP32[a+(12>>2)];contextAttributes["premultipliedAlpha"]=!!HEAP32[a+(16>>2)];contextAttributes["preserveDrawingBuffer"]=!!HEAP32[a+(20>>2)];var powerPreference=HEAP32[a+(24>>2)];contextAttributes["powerPreference"]=__emscripten_webgl_power_preferences[powerPreference];contextAttributes["failIfMajorPerformanceCaveat"]=!!HEAP32[a+(28>>2)];contextAttributes.majorVersion=HEAP32[a+(32>>2)];contextAttributes.minorVersion=HEAP32[a+(36>>2)];contextAttributes.enableExtensionsByDefault=HEAP32[a+(40>>2)];contextAttributes.explicitSwapControl=HEAP32[a+(44>>2)];contextAttributes.proxyContextToMainThread=HEAP32[a+(48>>2)];contextAttributes.renderViaOffscreenBackBuffer=HEAP32[a+(52>>2)];var canvas=__findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];assert(buffer);if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:undefined,get:function(){assert(SYSCALLS.varargs!=undefined);SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){if(low>=0)assert(high===0);else assert(high===-1);return low}};function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,fd);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM");return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,fd,offset_low,offset_high,whence,newOffset);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM")}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd,iov,iovcnt,pnum);var num=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}function _pthread_cleanup_pop(execute){var routine=PThread.exitHandlers.pop();if(execute)routine()}function _pthread_cleanup_push(routine,arg){if(PThread.exitHandlers===null){PThread.exitHandlers=[]}PThread.exitHandlers.push(function(){dynCall_vi(routine,arg)})}function __spawn_thread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _spawn_thread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,thread:threadParams.pthread_ptr,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(0>>2),0);Atomics.store(HEAPU32,tis+(4>>2),0);Atomics.store(HEAPU32,tis+(8>>2),0);Atomics.store(HEAPU32,tis+(68>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(104>>2),tlsMemory);Atomics.store(HEAPU32,tis+(48>>2),0);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(44>>2),42);Atomics.store(HEAPU32,tis+(108>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(84>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(80>>2),stackHigh);Atomics.store(HEAPU32,tis+(108+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(108+12>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(108+20>>2),threadParams.schedPolicy);Atomics.store(HEAPU32,tis+(108+24>>2),threadParams.schedPrio);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(176>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"selfThreadId":threadParams.pthread_ptr,"parentThreadId":threadParams.parent_pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}}function _pthread_getschedparam(thread,policy,schedparam){if(!policy&&!schedparam)return ERRNO_CODES.EINVAL;if(!thread){err("pthread_getschedparam called with a null thread pointer!");return ERRNO_CODES.ESRCH}var self=HEAP32[thread+12>>2];if(self!==thread){err("pthread_getschedparam attempted on thread "+thread+", which does not point to a valid thread, or does not exist anymore!");return ERRNO_CODES.ESRCH}var schedPolicy=Atomics.load(HEAPU32,thread+108+20>>2);var schedPrio=Atomics.load(HEAPU32,thread+108+24>>2);if(policy)HEAP32[policy>>2]=schedPolicy;if(schedparam)HEAP32[schedparam>>2]=schedPrio;return 0}function _pthread_self(){return __pthread_ptr|0}Module["_pthread_self"]=_pthread_self;function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;var schedPolicy=0;var schedPrio=0;if(attr){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0;var inheritSched=HEAP32[attr+16>>2]===0;if(inheritSched){var prevSchedPolicy=HEAP32[attr+20>>2];var prevSchedPrio=HEAP32[attr+24>>2];var parentThreadPtr=PThread.currentProxiedOperationCallerThread?PThread.currentProxiedOperationCallerThread:_pthread_self();_pthread_getschedparam(parentThreadPtr,attr+20,attr+24);schedPolicy=HEAP32[attr+20>>2];schedPrio=HEAP32[attr+24>>2];HEAP32[attr+20>>2]=prevSchedPolicy;HEAP32[attr+24>>2]=prevSchedPrio}else{schedPolicy=HEAP32[attr+20>>2];schedPrio=HEAP32[attr+24>>2]}}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(232);for(var i=0;i<232>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+156;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,schedPolicy:schedPolicy,schedPrio:schedPrio,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,parent_pthread_ptr:_pthread_self(),arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList)}else{__spawn_thread(threadParams)}return 0}function _roundf(d){d=+d;return d>=+0?+Math_floor(d+ +.5):+Math_ceil(d-+.5)}function _sysconf(name){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,name);switch(name){case 30:return 16384;case 85:var maxHeapSize=HEAPU8.length;return maxHeapSize/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:case 79:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator==="object")return navigator["hardwareConcurrency"]||1;return 1}}setErrNo(28);return-1}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();else PThread.initWorker();var GLctx;GL.init();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_fd_close,_fd_seek,_fd_write,_sysconf];var asmLibraryArg={"__assert_fail":___assert_fail,"__handle_stack_overflow":___handle_stack_overflow,"_emscripten_notify_thread_queue":__emscripten_notify_thread_queue,"abort":_abort,"emscripten_conditional_set_current_thread_status":_emscripten_conditional_set_current_thread_status,"emscripten_futex_wait":_emscripten_futex_wait,"emscripten_futex_wake":_emscripten_futex_wake,"emscripten_get_now":_emscripten_get_now,"emscripten_is_main_browser_thread":_emscripten_is_main_browser_thread,"emscripten_is_main_runtime_thread":_emscripten_is_main_runtime_thread,"emscripten_memcpy_big":_emscripten_memcpy_big,"emscripten_receive_on_main_thread_js":_emscripten_receive_on_main_thread_js,"emscripten_resize_heap":_emscripten_resize_heap,"emscripten_set_canvas_element_size":_emscripten_set_canvas_element_size,"emscripten_set_current_thread_status":_emscripten_set_current_thread_status,"emscripten_webgl_create_context":_emscripten_webgl_create_context,"fd_close":_fd_close,"fd_seek":_fd_seek,"fd_write":_fd_write,"initPthreadsJS":initPthreadsJS,"memory":wasmMemory||Module["wasmMemory"],"pthread_cleanup_pop":_pthread_cleanup_pop,"pthread_cleanup_push":_pthread_cleanup_push,"pthread_create":_pthread_create,"pthread_self":_pthread_self,"roundf":_roundf,"table":wasmTable};var asm=createWasm();Module["asm"]=asm;var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__wasm_call_ctors"].apply(null,arguments)};var _init=Module["_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["init"].apply(null,arguments)};var _register_tensor=Module["_register_tensor"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["register_tensor"].apply(null,arguments)};var _dispose_data=Module["_dispose_data"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose_data"].apply(null,arguments)};var _dispose=Module["_dispose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose"].apply(null,arguments)};var _Abs=Module["_Abs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Abs"].apply(null,arguments)};var _Add=Module["_Add"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Add"].apply(null,arguments)};var _AddN=Module["_AddN"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AddN"].apply(null,arguments)};var _ArgMax=Module["_ArgMax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ArgMax"].apply(null,arguments)};var _AvgPool=Module["_AvgPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AvgPool"].apply(null,arguments)};var _BatchMatMul=Module["_BatchMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["BatchMatMul"].apply(null,arguments)};var _ClipByValue=Module["_ClipByValue"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ClipByValue"].apply(null,arguments)};var _Conv2D=Module["_Conv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Conv2D"].apply(null,arguments)};var _Cos=Module["_Cos"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Cos"].apply(null,arguments)};var _CropAndResize=Module["_CropAndResize"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["CropAndResize"].apply(null,arguments)};var _DepthwiseConv2dNative=Module["_DepthwiseConv2dNative"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["DepthwiseConv2dNative"].apply(null,arguments)};var _Div=Module["_Div"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Div"].apply(null,arguments)};var _Exp=Module["_Exp"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Exp"].apply(null,arguments)};var _FloorDiv=Module["_FloorDiv"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FloorDiv"].apply(null,arguments)};var _FusedBatchNorm=Module["_FusedBatchNorm"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedBatchNorm"].apply(null,arguments)};var _FusedConv2D=Module["_FusedConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedConv2D"].apply(null,arguments)};var _FusedDepthwiseConv2D=Module["_FusedDepthwiseConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedDepthwiseConv2D"].apply(null,arguments)};var _Gather=Module["_Gather"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Gather"].apply(null,arguments)};var _GatherNd=Module["_GatherNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GatherNd"].apply(null,arguments)};var _Greater=Module["_Greater"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Greater"].apply(null,arguments)};var _GreaterEqual=Module["_GreaterEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GreaterEqual"].apply(null,arguments)};var _Less=Module["_Less"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Less"].apply(null,arguments)};var _LessEqual=Module["_LessEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LessEqual"].apply(null,arguments)};var _Log=Module["_Log"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Log"].apply(null,arguments)};var _LogicalAnd=Module["_LogicalAnd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LogicalAnd"].apply(null,arguments)};var _Max=Module["_Max"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Max"].apply(null,arguments)};var _MaxPool=Module["_MaxPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["MaxPool"].apply(null,arguments)};var _Maximum=Module["_Maximum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Maximum"].apply(null,arguments)};var _Min=Module["_Min"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Min"].apply(null,arguments)};var _Minimum=Module["_Minimum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Minimum"].apply(null,arguments)};var _Mul=Module["_Mul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Mul"].apply(null,arguments)};var _Neg=Module["_Neg"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Neg"].apply(null,arguments)};var _NonMaxSuppressionV3=Module["_NonMaxSuppressionV3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV3"].apply(null,arguments)};var _NonMaxSuppressionV5=Module["_NonMaxSuppressionV5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV5"].apply(null,arguments)};var _NotEqual=Module["_NotEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NotEqual"].apply(null,arguments)};var _PadV2=Module["_PadV2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["PadV2"].apply(null,arguments)};var _Pow=Module["_Pow"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Pow"].apply(null,arguments)};var _Prelu=Module["_Prelu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Prelu"].apply(null,arguments)};var _Relu=Module["_Relu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu"].apply(null,arguments)};var _Relu6=Module["_Relu6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu6"].apply(null,arguments)};var _ResizeBilinear=Module["_ResizeBilinear"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ResizeBilinear"].apply(null,arguments)};var _Rsqrt=Module["_Rsqrt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Rsqrt"].apply(null,arguments)};var _ScatterNd=Module["_ScatterNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ScatterNd"].apply(null,arguments)};var _Sigmoid=Module["_Sigmoid"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sigmoid"].apply(null,arguments)};var _Sin=Module["_Sin"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sin"].apply(null,arguments)};var _Softmax=Module["_Softmax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Softmax"].apply(null,arguments)};var _Sqrt=Module["_Sqrt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sqrt"].apply(null,arguments)};var _Square=Module["_Square"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Square"].apply(null,arguments)};var _Sub=Module["_Sub"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sub"].apply(null,arguments)};var _Sum=Module["_Sum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sum"].apply(null,arguments)};var _Tanh=Module["_Tanh"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tanh"].apply(null,arguments)};var _Tile=Module["_Tile"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tile"].apply(null,arguments)};var _Transpose=Module["_Transpose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Transpose"].apply(null,arguments)};var __FusedMatMul=Module["__FusedMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_FusedMatMul"].apply(null,arguments)};var _malloc=Module["_malloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["malloc"].apply(null,arguments)};var _free=Module["_free"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["free"].apply(null,arguments)};var ___em_js__initPthreadsJS=Module["___em_js__initPthreadsJS"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__em_js__initPthreadsJS"].apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__errno_location"].apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_get_global_libc"].apply(null,arguments)};var _memalign=Module["_memalign"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["memalign"].apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__pthread_tsd_run_dtors"].apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null,arguments)};var _emscripten_main_browser_thread_id=Module["_emscripten_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_browser_thread_id"].apply(null,arguments)};var _emscripten_async_run_in_main_thread=Module["_emscripten_async_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread=Module["_emscripten_sync_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_0=Module["_emscripten_sync_run_in_main_thread_0"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_1=Module["_emscripten_sync_run_in_main_thread_1"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_2=Module["_emscripten_sync_run_in_main_thread_2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_xprintf_varargs=Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_3=Module["_emscripten_sync_run_in_main_thread_3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_5=Module["_emscripten_sync_run_in_main_thread_5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_6=Module["_emscripten_sync_run_in_main_thread_6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_7=Module["_emscripten_sync_run_in_main_thread_7"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null,arguments)};var _emscripten_async_queue_on_thread_=Module["_emscripten_async_queue_on_thread_"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_tls_init"].apply(null,arguments)};var ___set_stack_limit=Module["___set_stack_limit"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__set_stack_limit"].apply(null,arguments)};var stackSave=Module["stackSave"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackSave"].apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackAlloc"].apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackRestore"].apply(null,arguments)};var dynCall_vi=Module["dynCall_vi"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_vi"].apply(null,arguments)};var dynCall_v=Module["dynCall_v"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_v"].apply(null,arguments)};var dynCall_ii=Module["dynCall_ii"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_ii"].apply(null,arguments)};Module["asm"]=asm;if(!Object.getOwnPropertyDescriptor(Module,"intArrayFromString"))Module["intArrayFromString"]=function(){abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"intArrayToString"))Module["intArrayToString"]=function(){abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ccall"))Module["ccall"]=function(){abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["cwrap"]=cwrap;if(!Object.getOwnPropertyDescriptor(Module,"setValue"))Module["setValue"]=function(){abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getValue"))Module["getValue"]=function(){abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocate"))Module["allocate"]=function(){abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getMemory"))Module["getMemory"]=function(){abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ArrayToString"))Module["UTF8ArrayToString"]=function(){abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ToString"))Module["UTF8ToString"]=function(){abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8Array"))Module["stringToUTF8Array"]=function(){abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8"))Module["stringToUTF8"]=function(){abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF8"))Module["lengthBytesUTF8"]=function(){abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreRun"))Module["addOnPreRun"]=function(){abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnInit"))Module["addOnInit"]=function(){abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreMain"))Module["addOnPreMain"]=function(){abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnExit"))Module["addOnExit"]=function(){abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPostRun"))Module["addOnPostRun"]=function(){abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeStringToMemory"))Module["writeStringToMemory"]=function(){abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeArrayToMemory"))Module["writeArrayToMemory"]=function(){abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeAsciiToMemory"))Module["writeAsciiToMemory"]=function(){abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addRunDependency"))Module["addRunDependency"]=function(){abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"removeRunDependency"))Module["removeRunDependency"]=function(){abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createFolder"))Module["FS_createFolder"]=function(){abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPath"))Module["FS_createPath"]=function(){abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDataFile"))Module["FS_createDataFile"]=function(){abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPreloadedFile"))Module["FS_createPreloadedFile"]=function(){abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLazyFile"))Module["FS_createLazyFile"]=function(){abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLink"))Module["FS_createLink"]=function(){abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDevice"))Module["FS_createDevice"]=function(){abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_unlink"))Module["FS_unlink"]=function(){abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"dynamicAlloc"))Module["dynamicAlloc"]=function(){abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadDynamicLibrary"))Module["loadDynamicLibrary"]=function(){abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadWebAssemblyModule"))Module["loadWebAssemblyModule"]=function(){abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getLEB"))Module["getLEB"]=function(){abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFunctionTables"))Module["getFunctionTables"]=function(){abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"alignFunctionTables"))Module["alignFunctionTables"]=function(){abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"registerFunctions"))Module["registerFunctions"]=function(){abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addFunction"))Module["addFunction"]=function(){abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"removeFunction"))Module["removeFunction"]=function(){abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFuncWrapper"))Module["getFuncWrapper"]=function(){abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"prettyPrint"))Module["prettyPrint"]=function(){abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"makeBigInt"))Module["makeBigInt"]=function(){abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"dynCall"))Module["dynCall"]=function(){abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getCompilerSetting"))Module["getCompilerSetting"]=function(){abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"print"))Module["print"]=function(){abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"printErr"))Module["printErr"]=function(){abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getTempRet0"))Module["getTempRet0"]=function(){abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setTempRet0"))Module["setTempRet0"]=function(){abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"callMain"))Module["callMain"]=function(){abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"abort"))Module["abort"]=function(){abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToNewUTF8"))Module["stringToNewUTF8"]=function(){abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"abortOnCannotGrowMemory"))Module["abortOnCannotGrowMemory"]=function(){abort("'abortOnCannotGrowMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscripten_realloc_buffer"))Module["emscripten_realloc_buffer"]=function(){abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ENV"))Module["ENV"]=function(){abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setjmpId"))Module["setjmpId"]=function(){abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_CODES"))Module["ERRNO_CODES"]=function(){abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_MESSAGES"))Module["ERRNO_MESSAGES"]=function(){abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setErrNo"))Module["setErrNo"]=function(){abort("'setErrNo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"DNS"))Module["DNS"]=function(){abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GAI_ERRNO_MESSAGES"))Module["GAI_ERRNO_MESSAGES"]=function(){abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Protocols"))Module["Protocols"]=function(){abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Sockets"))Module["Sockets"]=function(){abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UNWIND_CACHE"))Module["UNWIND_CACHE"]=function(){abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readAsmConstArgs"))Module["readAsmConstArgs"]=function(){abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_q"))Module["jstoi_q"]=function(){abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_s"))Module["jstoi_s"]=function(){abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH"))Module["PATH"]=function(){abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH_FS"))Module["PATH_FS"]=function(){abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SYSCALLS"))Module["SYSCALLS"]=function(){abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMmap2"))Module["syscallMmap2"]=function(){abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMunmap"))Module["syscallMunmap"]=function(){abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"flush_NO_FILESYSTEM"))Module["flush_NO_FILESYSTEM"]=function(){abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"JSEvents"))Module["JSEvents"]=function(){abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangle"))Module["demangle"]=function(){abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangleAll"))Module["demangleAll"]=function(){abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jsStackTrace"))Module["jsStackTrace"]=function(){abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getEnvStrings"))Module["getEnvStrings"]=function(){abort("'getEnvStrings' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64"))Module["writeI53ToI64"]=function(){abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Clamped"))Module["writeI53ToI64Clamped"]=function(){abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Signaling"))Module["writeI53ToI64Signaling"]=function(){abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Clamped"))Module["writeI53ToU64Clamped"]=function(){abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Signaling"))Module["writeI53ToU64Signaling"]=function(){abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromI64"))Module["readI53FromI64"]=function(){abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromU64"))Module["readI53FromU64"]=function(){abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertI32PairToI53"))Module["convertI32PairToI53"]=function(){abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertU32PairToI53"))Module["convertU32PairToI53"]=function(){abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Browser"))Module["Browser"]=function(){abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GL"))Module["GL"]=function(){abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGet"))Module["emscriptenWebGLGet"]=function(){abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetTexPixelData"))Module["emscriptenWebGLGetTexPixelData"]=function(){abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetUniform"))Module["emscriptenWebGLGetUniform"]=function(){abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetVertexAttrib"))Module["emscriptenWebGLGetVertexAttrib"]=function(){abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AL"))Module["AL"]=function(){abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_unicode"))Module["SDL_unicode"]=function(){abort("'SDL_unicode' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_ttfContext"))Module["SDL_ttfContext"]=function(){abort("'SDL_ttfContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_audio"))Module["SDL_audio"]=function(){abort("'SDL_audio' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL"))Module["SDL"]=function(){abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_gfx"))Module["SDL_gfx"]=function(){abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLUT"))Module["GLUT"]=function(){abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"EGL"))Module["EGL"]=function(){abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW_Window"))Module["GLFW_Window"]=function(){abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW"))Module["GLFW"]=function(){abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLEW"))Module["GLEW"]=function(){abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"IDBStore"))Module["IDBStore"]=function(){abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"runAndAbortIfError"))Module["runAndAbortIfError"]=function(){abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["PThread"]=PThread;if(!Object.getOwnPropertyDescriptor(Module,"establishStackSpace"))Module["establishStackSpace"]=function(){abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getNoExitRuntime"))Module["getNoExitRuntime"]=function(){abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"resetPrototype"))Module["resetPrototype"]=function(){abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"warnOnce"))Module["warnOnce"]=function(){abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackSave"))Module["stackSave"]=function(){abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackRestore"))Module["stackRestore"]=function(){abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackAlloc"))Module["stackAlloc"]=function(){abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AsciiToString"))Module["AsciiToString"]=function(){abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToAscii"))Module["stringToAscii"]=function(){abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF16ToString"))Module["UTF16ToString"]=function(){abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF16"))Module["stringToUTF16"]=function(){abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF16"))Module["lengthBytesUTF16"]=function(){abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF32ToString"))Module["UTF32ToString"]=function(){abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF32"))Module["stringToUTF32"]=function(){abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF32"))Module["lengthBytesUTF32"]=function(){abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8"))Module["allocateUTF8"]=function(){abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8OnStack"))Module["allocateUTF8OnStack"]=function(){abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["writeStackCookie"]=writeStackCookie;Module["checkStackCookie"]=checkStackCookie;Module["abortStackOverflow"]=abortStackOverflow;Module["PThread"]=PThread;Module["_pthread_self"]=_pthread_self;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NORMAL"))Object.defineProperty(Module,"ALLOC_NORMAL",{configurable:true,get:function(){abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_STACK"))Object.defineProperty(Module,"ALLOC_STACK",{configurable:true,get:function(){abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_DYNAMIC"))Object.defineProperty(Module,"ALLOC_DYNAMIC",{configurable:true,get:function(){abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NONE"))Object.defineProperty(Module,"ALLOC_NONE",{configurable:true,get:function(){abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});var calledRun;Module["then"]=function(func){if(calledRun){func(Module)}else{var old=Module["onRuntimeInitialized"];Module["onRuntimeInitialized"]=function(){if(old)old();func(Module)}}return Module};function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}writeStackCookie();preRun();if(runDependencies>0)return;function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();assert(!Module["_main"],'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}checkStackCookie()}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}if(!ENVIRONMENT_IS_PTHREAD)noExitRuntime=true;if(!ENVIRONMENT_IS_PTHREAD)run(); return WasmBackendModule diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.wasm b/tfjs-core/benchmarks/tfjs-backend-wasm.wasm index 9d6e031420bcd321a998ea98e91a1b47a300eebe..2be322a7450d0b4729c3ff70e7d6d841ee8240bb 100644 GIT binary patch delta 2903 zcmZWrX>?Q77Czs;H*-Q$($W@{h5`kAqO^37hdvrQ0AdTYf&;!4LK90MZQ3MdT1r7? zkOCgzA|T4Bf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ig52WYn!*BP<|CK@y8NUwa(ix)3~|~^CkYTZAHe^oydbWcL#Kg(Aw
bdI&v@FZZL#tYsWQAJY^nAg0a!40E*QpNgXuN3gw% zu|S~$pwigqplleGHoAk1pW`Sy5g!}r?WifOb%}sDT~V5!3->fJ Date: Tue, 5 May 2020 12:46:44 -0400 Subject: [PATCH 69/85] update build --- tfjs-backend-wasm/src/cc/backend.cc | 2 +- .../src/cc/batch_mat_mul_impl.cc | 4 ++-- tfjs-backend-wasm/src/cc/binary.cc | 4 ++-- .../src/cc/kernels/ClipByValue.cc | 4 ++-- tfjs-core/benchmarks/index.html | 16 +++++++++------- tfjs-core/benchmarks/tfjs-backend-wasm.wasm | Bin 156933 -> 156992 bytes 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/tfjs-backend-wasm/src/cc/backend.cc b/tfjs-backend-wasm/src/cc/backend.cc index 5d7d2c202b6..6fef800c321 100644 --- a/tfjs-backend-wasm/src/cc/backend.cc +++ b/tfjs-backend-wasm/src/cc/backend.cc @@ -49,7 +49,7 @@ TensorInfo &get_tensor_info_out(const size_t tensor_id) { size_t xnn_operator_count = 0; -pthreadpool *threadpool = pthreadpool_create(2); +pthreadpool *threadpool = pthreadpool_create(4); // Registers a disposal callback for a tensor id with a given callback function. void register_disposal_callback(const size_t tensor_id, diff --git a/tfjs-backend-wasm/src/cc/batch_mat_mul_impl.cc b/tfjs-backend-wasm/src/cc/batch_mat_mul_impl.cc index 3faa4b0f59c..2256d0bb257 100644 --- a/tfjs-backend-wasm/src/cc/batch_mat_mul_impl.cc +++ b/tfjs-backend-wasm/src/cc/batch_mat_mul_impl.cc @@ -150,7 +150,7 @@ void xnn_matmul(const size_t a_id, const size_t* a_shape_ptr, const size_t batch_size = a_shape_ptr[1]; xnn_status status = xnn_setup_fully_connected_nc_f32(fully_connected_op, batch_size, a_buf, - out_buf, nullptr /* thread pool */); + out_buf, tfjs::backend::threadpool); if (status != xnn_status_success) { tfjs::util::warn( "XNN status for xnn_setup_fully_connected_nc_f32 is not successful. " @@ -159,7 +159,7 @@ void xnn_matmul(const size_t a_id, const size_t* a_shape_ptr, return; } - xnn_run_operator(fully_connected_op, nullptr /* thread pool */); + xnn_run_operator(fully_connected_op, tfjs::backend::threadpool); } void slow_batch_matmul(const size_t a_id, const size_t* a_shape_ptr, diff --git a/tfjs-backend-wasm/src/cc/binary.cc b/tfjs-backend-wasm/src/cc/binary.cc index dc0e4c8f70b..88b88fa4498 100644 --- a/tfjs-backend-wasm/src/cc/binary.cc +++ b/tfjs-backend-wasm/src/cc/binary.cc @@ -64,7 +64,7 @@ void binary_xnn_f32(const size_t a_id, const size_t* a_shape_ptr, const size_t batch_size = out_info.size; xnn_status status = setup_op(binary_op, a_shape_len, a_shape_ptr, b_shape_len, b_shape_ptr, - a_buf, b_buf, out_buf, nullptr /* thread pool */); + a_buf, b_buf, out_buf, tfjs::backend::threadpool); if (status != xnn_status_success) { util::warn( "XNN status for xnn_setup_*_nd_f32 is not successful. Got " @@ -73,7 +73,7 @@ void binary_xnn_f32(const size_t a_id, const size_t* a_shape_ptr, return; } - xnn_run_operator(binary_op, nullptr /* thread pool */); + xnn_run_operator(binary_op, tfjs::backend::threadpool); } } // namespace wasm diff --git a/tfjs-backend-wasm/src/cc/kernels/ClipByValue.cc b/tfjs-backend-wasm/src/cc/kernels/ClipByValue.cc index 4eaf3412578..274fa58bfc8 100644 --- a/tfjs-backend-wasm/src/cc/kernels/ClipByValue.cc +++ b/tfjs-backend-wasm/src/cc/kernels/ClipByValue.cc @@ -79,7 +79,7 @@ void ClipByValue(const size_t x_id, const float min, const float max, const size_t batch_size = x_info.size; xnn_status status = xnn_setup_clamp_nc_f32( - clamp_op, batch_size, x_buf, out_buf, nullptr /* thread pool */); + clamp_op, batch_size, x_buf, out_buf, tfjs::backend::threadpool); if (status != xnn_status_success) { util::warn( "XNN status for xnn_setup_clamp_nc_f32 is not successful. Got " @@ -87,7 +87,7 @@ void ClipByValue(const size_t x_id, const float min, const float max, status); } - xnn_run_operator(clamp_op, nullptr /* thread pool */); + xnn_run_operator(clamp_op, tfjs::backend::threadpool); } } // extern "C" diff --git a/tfjs-core/benchmarks/index.html b/tfjs-core/benchmarks/index.html index 287a7b38398..f083a5d3c0a 100644 --- a/tfjs-core/benchmarks/index.html +++ b/tfjs-core/benchmarks/index.html @@ -77,7 +77,7 @@

TensorFlow.js Model Benchmark

'use strict'; const state = { - numRuns: 20, + numRuns: 2, benchmark: 'custom_forward', run: (v) => { runBenchmark(); @@ -227,8 +227,9 @@

TensorFlow.js Model Benchmark

res = await res.data(); tmp.dispose(); } - - times.push(performance.now() - start); + const dur = performance.now() - start; + console.log(dur); + times.push(dur); const memInfo = tf.memory(); const leakedTensors = memInfo.numTensors - tensorsBefore; numLeakedTensors.push(leakedTensors); @@ -279,19 +280,20 @@

TensorFlow.js Model Benchmark

kernels.forEach(k => { const kernelName = k.scopes[0]; if (kernelTotalTime[kernelName] == null) { - kernelTotalTime[kernelName] = 0; + kernelTotalTime[kernelName] = {time: 0, count: 0}; } - kernelTotalTime[kernelName] += k.time; + kernelTotalTime[kernelName]['time'] += k.time; + kernelTotalTime[kernelName]['count'] += 1; }); const result = Object.keys(kernelTotalTime) - .map(k => [k, kernelTotalTime[k]]) + .map(k => [k, kernelTotalTime[k]['time'], kernelTotalTime[k]['count']]) .sort((a, b) => b[1] - a[1]); result.forEach(r => { const nameSpan = document.createElement('span'); nameSpan.setAttribute('title', r[0]); nameSpan.textContent = r[0]; - appendRow(tbody, nameSpan, r[1].toFixed(2)); + appendRow(tbody, nameSpan, `${r[1].toFixed(2)} (${r[2]})`); }); } } diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.wasm b/tfjs-core/benchmarks/tfjs-backend-wasm.wasm index 2be322a7450d0b4729c3ff70e7d6d841ee8240bb..9fed9e9cc82e0b4ecfeabc2f73f2bba0bc012c44 100644 GIT binary patch delta 1845 zcmYjS4RjRM6@K5Hzuldk-Pv6rSrXuF1iGPAkHMstTDwC6HLZB6?J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 6 May 2020 15:43:14 -0400 Subject: [PATCH 70/85] more builds --- tfjs-backend-wasm/src/cc/BUILD | 7 +- tfjs-backend-wasm/src/cc/backend.cc | 2 +- tfjs-core/benchmarks/modelConfig.js | 13 + tfjs-core/benchmarks/tfjs-backend-wasm.js | 2 +- tfjs-core/benchmarks/tfjs-backend-wasm.wasm | Bin 156992 -> 157093 bytes .../wasm_0_threads/tfjs-backend-wasm.js | 3382 +++++++++++++++++ .../wasm_0_threads/tfjs-backend-wasm.wasm | Bin 0 -> 157046 bytes .../wasm_2_threads/tfjs-backend-wasm.js | 3381 ++++++++++++++++ .../wasm_2_threads/tfjs-backend-wasm.wasm | Bin 0 -> 156992 bytes .../wasm_4_threads/tfjs-backend-wasm.js | 3381 ++++++++++++++++ .../wasm_4_threads/tfjs-backend-wasm.wasm | Bin 0 -> 156992 bytes 11 files changed, 10163 insertions(+), 5 deletions(-) create mode 100755 tfjs-core/benchmarks/wasm_0_threads/tfjs-backend-wasm.js create mode 100644 tfjs-core/benchmarks/wasm_0_threads/tfjs-backend-wasm.wasm create mode 100755 tfjs-core/benchmarks/wasm_2_threads/tfjs-backend-wasm.js create mode 100644 tfjs-core/benchmarks/wasm_2_threads/tfjs-backend-wasm.wasm create mode 100755 tfjs-core/benchmarks/wasm_4_threads/tfjs-backend-wasm.js create mode 100644 tfjs-core/benchmarks/wasm_4_threads/tfjs-backend-wasm.wasm diff --git a/tfjs-backend-wasm/src/cc/BUILD b/tfjs-backend-wasm/src/cc/BUILD index 08b66c15990..9ef6ac2ba79 100644 --- a/tfjs-backend-wasm/src/cc/BUILD +++ b/tfjs-backend-wasm/src/cc/BUILD @@ -21,10 +21,11 @@ cc_binary( "-s EXPORT_NAME=WasmBackendModule", "-s MALLOC=emmalloc", "-s USE_PTHREADS=1", - "-s PTHREAD_POOL_SIZE=8", - "-s INITIAL_MEMORY=1Gb", - "-s MAXIMUM_MEMORY=1Gb", + "-s PTHREAD_POOL_SIZE=5", + "-s INITIAL_MEMORY=500Mb", + "-s MAXIMUM_MEMORY=500Mb", "-s ASSERTIONS=1", + "-s PROXY_TO_PTHREAD=1", ], deps = [ ":all_kernels", diff --git a/tfjs-backend-wasm/src/cc/backend.cc b/tfjs-backend-wasm/src/cc/backend.cc index 6fef800c321..d9e6750a6c7 100644 --- a/tfjs-backend-wasm/src/cc/backend.cc +++ b/tfjs-backend-wasm/src/cc/backend.cc @@ -49,7 +49,7 @@ TensorInfo &get_tensor_info_out(const size_t tensor_id) { size_t xnn_operator_count = 0; -pthreadpool *threadpool = pthreadpool_create(4); +pthreadpool *threadpool = pthreadpool_create(5); // Registers a disposal callback for a tensor id with a given callback function. void register_disposal_callback(const size_t tensor_id, diff --git a/tfjs-core/benchmarks/modelConfig.js b/tfjs-core/benchmarks/modelConfig.js index 2c99fb4e175..3541b6e48ec 100644 --- a/tfjs-core/benchmarks/modelConfig.js +++ b/tfjs-core/benchmarks/modelConfig.js @@ -72,6 +72,19 @@ const sentences = [ ]; const benchmarks = { + 'matMul': { + load: async() => { + return {}; + }, + predictFunc: () => { + const a = tf.randomNormal([500, 500]); + const b = tf.randomNormal([500, 500]); + return () => { + const c = tf.matMul(a, b) + return c; + } + } + }, 'custom_forward': { load: async() => { return {}; diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.js b/tfjs-core/benchmarks/tfjs-backend-wasm.js index 892b57beaa5..4411a9a4b90 100755 --- a/tfjs-core/benchmarks/tfjs-backend-wasm.js +++ b/tfjs-core/benchmarks/tfjs-backend-wasm.js @@ -6,7 +6,7 @@ var WasmBackendModule = (function() { function(WasmBackendModule) { WasmBackendModule = WasmBackendModule || {}; -var Module=typeof WasmBackendModule!=="undefined"?WasmBackendModule:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(Module["ENVIRONMENT"]){throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)")}var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"];DYNAMIC_BASE=Module["DYNAMIC_BASE"];DYNAMICTOP_PTR=Module["DYNAMICTOP_PTR"]}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{throw new Error("environment detection error")}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(!Object.getOwnPropertyDescriptor(Module,"arguments"))Object.defineProperty(Module,"arguments",{configurable:true,get:function(){abort("Module.arguments has been replaced with plain arguments_")}});if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(!Object.getOwnPropertyDescriptor(Module,"thisProgram"))Object.defineProperty(Module,"thisProgram",{configurable:true,get:function(){abort("Module.thisProgram has been replaced with plain thisProgram")}});if(Module["quit"])quit_=Module["quit"];if(!Object.getOwnPropertyDescriptor(Module,"quit"))Object.defineProperty(Module,"quit",{configurable:true,get:function(){abort("Module.quit has been replaced with plain quit_")}});assert(typeof Module["memoryInitializerPrefixURL"]==="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["pthreadMainPrefixURL"]==="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["cdInitializerPrefixURL"]==="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["filePackagePrefixURL"]==="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["read"]==="undefined","Module.read option was removed (modify read_ in JS)");assert(typeof Module["readAsync"]==="undefined","Module.readAsync option was removed (modify readAsync in JS)");assert(typeof Module["readBinary"]==="undefined","Module.readBinary option was removed (modify readBinary in JS)");assert(typeof Module["setWindowTitle"]==="undefined","Module.setWindowTitle option was removed (modify setWindowTitle in JS)");assert(typeof Module["TOTAL_MEMORY"]==="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY");if(!Object.getOwnPropertyDescriptor(Module,"read"))Object.defineProperty(Module,"read",{configurable:true,get:function(){abort("Module.read has been replaced with plain read_")}});if(!Object.getOwnPropertyDescriptor(Module,"readAsync"))Object.defineProperty(Module,"readAsync",{configurable:true,get:function(){abort("Module.readAsync has been replaced with plain readAsync")}});if(!Object.getOwnPropertyDescriptor(Module,"readBinary"))Object.defineProperty(Module,"readBinary",{configurable:true,get:function(){abort("Module.readBinary has been replaced with plain readBinary")}});if(!Object.getOwnPropertyDescriptor(Module,"setWindowTitle"))Object.defineProperty(Module,"setWindowTitle",{configurable:true,get:function(){abort("Module.setWindowTitle has been replaced with plain setWindowTitle")}});assert(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER||ENVIRONMENT_IS_NODE,"Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)");var stackSave;var stackRestore;var stackAlloc;stackSave=stackRestore=stackAlloc=function(){abort("cannot use the stack before compiled code is ready to run, and has provided stack access")};function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(!Object.getOwnPropertyDescriptor(Module,"wasmBinary"))Object.defineProperty(Module,"wasmBinary",{configurable:true,get:function(){abort("Module.wasmBinary has been replaced with plain wasmBinary")}});var noExitRuntime;if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(!Object.getOwnPropertyDescriptor(Module,"noExitRuntime"))Object.defineProperty(Module,"noExitRuntime",{configurable:true,get:function(){abort("Module.noExitRuntime has been replaced with plain noExitRuntime")}});if(typeof WebAssembly!=="object"){abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.")}var wasmMemory;var wasmTable=new WebAssembly.Table({"initial":119,"maximum":119+0,"element":"anyfunc"});var wasmModule;var threadInfoStruct=0;var selfThreadId=0;var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string")return UTF8ToString(ret);if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{if((u0&248)!=240)warnOnce("Invalid UTF-8 leading byte 0x"+u0.toString(16)+" encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!");u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;if(u>=2097152)warnOnce("Invalid Unicode code point 0x"+u.toString(16)+" encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF).");heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");HEAP8.set(array,buffer)}var WASM_PAGE_SIZE=65536;var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var STACK_BASE=5255808,STACKTOP=STACK_BASE,STACK_MAX=12928,DYNAMIC_BASE=5255808,DYNAMICTOP_PTR=12e3;assert(STACK_BASE%16===0,"stack must start aligned");assert(DYNAMIC_BASE%16===0,"heap must start aligned");if(ENVIRONMENT_IS_PTHREAD){STACK_MAX=STACKTOP=STACK_MAX=2147483647}var TOTAL_STACK=5242880;if(Module["TOTAL_STACK"])assert(TOTAL_STACK===Module["TOTAL_STACK"],"the stack size can no longer be determined at runtime");var INITIAL_INITIAL_MEMORY=Module["INITIAL_MEMORY"]||1073741824;if(!Object.getOwnPropertyDescriptor(Module,"INITIAL_MEMORY"))Object.defineProperty(Module,"INITIAL_MEMORY",{configurable:true,get:function(){abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY")}});assert(INITIAL_INITIAL_MEMORY>=TOTAL_STACK,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+INITIAL_INITIAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");assert(typeof Int32Array!=="undefined"&&typeof Float64Array!=="undefined"&&Int32Array.prototype.subarray!==undefined&&Int32Array.prototype.set!==undefined,"JS engine does not provide full typed array support");if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,"maximum":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_INITIAL_MEMORY=buffer.byteLength;assert(INITIAL_INITIAL_MEMORY%WASM_PAGE_SIZE===0);updateGlobalBufferAndViews(buffer);if(!ENVIRONMENT_IS_PTHREAD){HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE}function writeStackCookie(){assert((STACK_MAX&3)==0);HEAPU32[(STACK_MAX>>2)+1]=34821223;HEAPU32[(STACK_MAX>>2)+2]=2310721022;HEAP32[0]=1668509029}function checkStackCookie(){var cookie1=HEAPU32[(STACK_MAX>>2)+1];var cookie2=HEAPU32[(STACK_MAX>>2)+2];if(cookie1!=34821223||cookie2!=2310721022){abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+cookie2.toString(16)+" "+cookie1.toString(16))}if(HEAP32[0]!==1668509029)abort("Runtime error: The application has corrupted its heap memory area (address zero)!")}function abortStackOverflow(allocSize){abort("Stack overflow! Attempted to allocate "+allocSize+" bytes on the stack, but stack has only "+(STACK_MAX-stackSave()+allocSize)+" bytes available!")}(function(){var h16=new Int16Array(1);var h8=new Int8Array(h16.buffer);h16[0]=25459;if(h8[0]!==115||h8[1]!==99)throw"Runtime error: expected the system to be little-endian!"})();function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;if(ENVIRONMENT_IS_PTHREAD)runtimeInitialized=true;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){checkStackCookie();assert(!runtimeInitialized);runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATMAIN__)}function postRun(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Math_ceil=Math.ceil;var Math_floor=Math.floor;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!=="undefined"){runDependencyWatcher=setInterval(function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;err("still waiting on run dependencies:")}err("dependency: "+dep)}if(shown){err("(end of list)")}},1e4)}}else{err("warning: run dependency added without ID")}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id]}else{err("warning: run dependency removed without ID")}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";out(what);err(what);ABORT=true;EXITSTATUS=1;var output="abort("+what+") at "+stackTrace();what=output;throw new WebAssembly.RuntimeError(what)}var FS={error:function(){abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1")},init:function(){FS.error()},createDataFile:function(){FS.error()},createPreloadedFile:function(){FS.error()},createLazyFile:function(){FS.error()},open:function(){FS.error()},mkdev:function(){FS.error()},registerDevice:function(){FS.error()},analyzePath:function(){FS.error()},loadFilesFromDB:function(){FS.error()},ErrnoError:function ErrnoError(){FS.error()}};Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;function hasPrefix(str,prefix){return String.prototype.startsWith?str.startsWith(prefix):str.indexOf(prefix)===0}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return hasPrefix(filename,dataURIPrefix)}var fileURIPrefix="file://";function isFileURI(filename){return hasPrefix(filename,fileURIPrefix)}var wasmBinaryFile="tfjs-backend-wasm.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(){try{if(wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(wasmBinaryFile)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary()})}return new Promise(function(resolve,reject){resolve(getBinary())})}function createWasm(){var info={"env":asmLibraryArg,"wasi_snapshot_preview1":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){var numWorkersToLoad=PThread.unusedWorkers.length;PThread.unusedWorkers.forEach(function(w){PThread.loadWasmModuleToWorker(w,function(){if(!--numWorkersToLoad)removeRunDependency("wasm-instantiate")})})}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}var trueModule=Module;function receiveInstantiatedSource(output){assert(Module===trueModule,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");trueModule=null;receiveInstance(output["instance"],output["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var ASM_CONSTS={};function initPthreadsJS(){PThread.initRuntime()}if(!ENVIRONMENT_IS_PTHREAD)__ATINIT__.push({func:function(){___wasm_call_ctors()}});function demangle(func){warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return func}function demangleAll(text){var regex=/\b_Z[\w\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"})}var __pthread_ptr=0;var __pthread_is_main_runtime_thread=0;var __pthread_is_main_browser_thread=0;function __register_pthread_ptr(pthreadPtr,isMainBrowserThread,isMainRuntimeThread){pthreadPtr=pthreadPtr|0;isMainBrowserThread=isMainBrowserThread|0;isMainRuntimeThread=isMainRuntimeThread|0;__pthread_ptr=pthreadPtr;__pthread_is_main_browser_thread=isMainBrowserThread;__pthread_is_main_runtime_thread=isMainRuntimeThread}Module["__register_pthread_ptr"]=__register_pthread_ptr;var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var __main_thread_futex_wait_address=12912;function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__main_thread_futex_wait_address>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__main_thread_futex_wait_address>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function __kill_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _kill_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _kill_thread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function __cancel_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cancel_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cancel_thread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function __cleanup_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cleanup_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cleanup_thread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];if(pthread){var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={MAIN_THREAD_ID:1,mainThreadInfo:{schedPolicy:0,schedPrio:0},unusedWorkers:[],runningWorkers:[],initRuntime:function(){__register_pthread_ptr(PThread.mainThreadBlock,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(PThread.mainThreadBlock)},initMainThreadBlock:function(){assert(!ENVIRONMENT_IS_PTHREAD);var pthreadPoolSize=8;for(var i=0;i>2]=PThread.mainThreadBlock;var headPtr=PThread.mainThreadBlock+156;HEAP32[headPtr>>2]=headPtr;var tlsMemory=12400;for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,PThread.mainThreadBlock+104>>2,tlsMemory);Atomics.store(HEAPU32,PThread.mainThreadBlock+40>>2,PThread.mainThreadBlock);Atomics.store(HEAPU32,PThread.mainThreadBlock+44>>2,42)},initWorker:function(){},pthreads:{},exitHandlers:null,setThreadStatus:function(){},runExitHandlers:function(){if(PThread.exitHandlers!==null){while(PThread.exitHandlers.length>0){PThread.exitHandlers.pop()()}PThread.exitHandlers=null}if(ENVIRONMENT_IS_PTHREAD&&threadInfoStruct)___pthread_tsd_run_dtors()},threadExit:function(exitCode){var tb=_pthread_self();if(tb){err("Pthread 0x"+tb.toString(16)+" exited.");Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);Atomics.store(HEAPU32,tb+60>>2,1);Atomics.store(HEAPU32,tb+64>>2,0);PThread.runExitHandlers();_emscripten_futex_wake(tb+0,2147483647);__register_pthread_ptr(0,0,0);threadInfoStruct=0;if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlers();Atomics.store(HEAPU32,threadInfoStruct+4>>2,-1);Atomics.store(HEAPU32,threadInfoStruct+0>>2,1);_emscripten_futex_wake(threadInfoStruct+0,2147483647);threadInfoStruct=selfThreadId=0;__register_pthread_ptr(0,0,0);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+104>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){delete PThread.pthreads[worker.pthread.thread];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined},receiveObjectTransfer:function(data){},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){__spawn_thread(e.data)}else if(cmd==="cleanupThread"){__cleanup_thread(d["thread"])}else if(cmd==="killThread"){__kill_thread(d["thread"])}else if(cmd==="cancelThread"){__cancel_thread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.thread+68>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){console.log("worker exited - TODO: update the worker queue?")})}assert(wasmMemory instanceof WebAssembly.Memory,"WebAssembly memory should have been loaded by now!");assert(wasmModule instanceof WebAssembly.Module,"WebAssembly Module should have been loaded by now!");worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule,"DYNAMIC_BASE":DYNAMIC_BASE,"DYNAMICTOP_PTR":DYNAMICTOP_PTR})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("tfjs-backend-wasm.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}if(PThread.unusedWorkers.length>0)return PThread.unusedWorkers.pop();else return null},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()>2]=value;return value}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg);warnOnce("atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)");__ATEXIT__.unshift({func:func,arg:arg})}function ___handle_stack_overflow(){abort("stack overflow")}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){err("Cannot send message to thread with ID "+targetThreadId+", unknown thread ID!");return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){expectedStatus=expectedStatus|0;newStatus=newStatus|0}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(ENVIRONMENT_IS_WORKER){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{var loadedVal=Atomics.load(HEAP32,addr>>2);if(val!=loadedVal)return-6;var tNow=performance.now();var tEnd=tNow+timeout;Atomics.store(HEAP32,__main_thread_futex_wait_address>>2,addr);var ourWaitAddress=addr;while(addr==ourWaitAddress){tNow=performance.now();if(tNow>tEnd){return-73}_emscripten_main_thread_process_queued_calls();addr=Atomics.load(HEAP32,__main_thread_futex_wait_address>>2)}return 0}}function _emscripten_is_main_browser_thread(){return __pthread_is_main_browser_thread|0}function _emscripten_is_main_runtime_thread(){return __pthread_is_main_runtime_thread|0}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;if(numCallArgs>20-1)throw"emscripten_proxy_to_main_thread_js: Too many arguments "+numCallArgs+" to proxied function idx="+index+", maximum supported is "+(20-1)+"!";var stack=stackSave();var args=stackAlloc(numCallArgs*8);var b=args>>3;for(var i=0;i>3]);buf+=8}else if(ch===105){buf=buf+3&~3;args.push(HEAP32[buf>>2]);buf+=4}else abort("unexpected char in asm const signature "+ch)}return args}function _emscripten_receive_on_main_thread_js(index,numCallArgs,args){_emscripten_receive_on_main_thread_js_callArgs.length=numCallArgs;var b=args>>3;for(var i=0;i=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;_emscripten_async_queue_on_thread_(targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;_emscripten_async_queue_on_thread_(targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function __maybeCStringToJsString(cString){return cString===cString+0?UTF8ToString(cString):cString}var __specialEventTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function __findEventTarget(target){var domElement=__specialEventTargets[target]||(typeof document!=="undefined"?document.querySelector(__maybeCStringToJsString(target)):undefined);return domElement}function __findCanvasEventTarget(target){return __findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=__findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=__findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){newStatus=newStatus|0}function __webgl_acquireInstancedArraysExtension(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)}}}function __webgl_acquireVertexArrayObjectExtension(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)}}}function __webgl_acquireDrawBuffersExtension(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)}}}var GL={counter:1,lastError:0,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},currentContext:null,offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,init:function(){var miniTempFloatBuffer=new Float32Array(GL.MINI_TEMP_BUFFER_SIZE);for(var i=0;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;if(context.version<2){__webgl_acquireInstancedArraysExtension(GLctx);__webgl_acquireVertexArrayObjectExtension(GLctx);__webgl_acquireDrawBuffersExtension(GLctx)}GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query");var automaticallyEnabledExtensions=["OES_texture_float","OES_texture_half_float","OES_standard_derivatives","OES_vertex_array_object","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","OES_element_index_uint","EXT_texture_filter_anisotropic","EXT_frag_depth","WEBGL_draw_buffers","ANGLE_instanced_arrays","OES_texture_float_linear","OES_texture_half_float_linear","EXT_blend_minmax","EXT_shader_texture_lod","EXT_texture_norm16","WEBGL_compressed_texture_pvrtc","EXT_color_buffer_half_float","WEBGL_color_buffer_float","EXT_sRGB","WEBGL_compressed_texture_etc1","EXT_disjoint_timer_query","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_astc","EXT_color_buffer_float","WEBGL_compressed_texture_s3tc_srgb","EXT_disjoint_timer_query_webgl2","WEBKIT_WEBGL_compressed_texture_pvrtc"];var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(automaticallyEnabledExtensions.indexOf(ext)!=-1){GLctx.getExtension(ext)}})},populateUniformTable:function(program){var p=GL.programs[program];var ptable=GL.programInfos[program]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1};var utable=ptable.uniforms;var numUniforms=GLctx.getProgramParameter(p,35718);for(var i=0;i>2;contextAttributes["alpha"]=!!HEAP32[a+(0>>2)];contextAttributes["depth"]=!!HEAP32[a+(4>>2)];contextAttributes["stencil"]=!!HEAP32[a+(8>>2)];contextAttributes["antialias"]=!!HEAP32[a+(12>>2)];contextAttributes["premultipliedAlpha"]=!!HEAP32[a+(16>>2)];contextAttributes["preserveDrawingBuffer"]=!!HEAP32[a+(20>>2)];var powerPreference=HEAP32[a+(24>>2)];contextAttributes["powerPreference"]=__emscripten_webgl_power_preferences[powerPreference];contextAttributes["failIfMajorPerformanceCaveat"]=!!HEAP32[a+(28>>2)];contextAttributes.majorVersion=HEAP32[a+(32>>2)];contextAttributes.minorVersion=HEAP32[a+(36>>2)];contextAttributes.enableExtensionsByDefault=HEAP32[a+(40>>2)];contextAttributes.explicitSwapControl=HEAP32[a+(44>>2)];contextAttributes.proxyContextToMainThread=HEAP32[a+(48>>2)];contextAttributes.renderViaOffscreenBackBuffer=HEAP32[a+(52>>2)];var canvas=__findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];assert(buffer);if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:undefined,get:function(){assert(SYSCALLS.varargs!=undefined);SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){if(low>=0)assert(high===0);else assert(high===-1);return low}};function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,fd);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM");return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,fd,offset_low,offset_high,whence,newOffset);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM")}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd,iov,iovcnt,pnum);var num=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}function _pthread_cleanup_pop(execute){var routine=PThread.exitHandlers.pop();if(execute)routine()}function _pthread_cleanup_push(routine,arg){if(PThread.exitHandlers===null){PThread.exitHandlers=[]}PThread.exitHandlers.push(function(){dynCall_vi(routine,arg)})}function __spawn_thread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _spawn_thread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,thread:threadParams.pthread_ptr,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(0>>2),0);Atomics.store(HEAPU32,tis+(4>>2),0);Atomics.store(HEAPU32,tis+(8>>2),0);Atomics.store(HEAPU32,tis+(68>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(104>>2),tlsMemory);Atomics.store(HEAPU32,tis+(48>>2),0);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(44>>2),42);Atomics.store(HEAPU32,tis+(108>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(84>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(80>>2),stackHigh);Atomics.store(HEAPU32,tis+(108+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(108+12>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(108+20>>2),threadParams.schedPolicy);Atomics.store(HEAPU32,tis+(108+24>>2),threadParams.schedPrio);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(176>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"selfThreadId":threadParams.pthread_ptr,"parentThreadId":threadParams.parent_pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}}function _pthread_getschedparam(thread,policy,schedparam){if(!policy&&!schedparam)return ERRNO_CODES.EINVAL;if(!thread){err("pthread_getschedparam called with a null thread pointer!");return ERRNO_CODES.ESRCH}var self=HEAP32[thread+12>>2];if(self!==thread){err("pthread_getschedparam attempted on thread "+thread+", which does not point to a valid thread, or does not exist anymore!");return ERRNO_CODES.ESRCH}var schedPolicy=Atomics.load(HEAPU32,thread+108+20>>2);var schedPrio=Atomics.load(HEAPU32,thread+108+24>>2);if(policy)HEAP32[policy>>2]=schedPolicy;if(schedparam)HEAP32[schedparam>>2]=schedPrio;return 0}function _pthread_self(){return __pthread_ptr|0}Module["_pthread_self"]=_pthread_self;function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;var schedPolicy=0;var schedPrio=0;if(attr){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0;var inheritSched=HEAP32[attr+16>>2]===0;if(inheritSched){var prevSchedPolicy=HEAP32[attr+20>>2];var prevSchedPrio=HEAP32[attr+24>>2];var parentThreadPtr=PThread.currentProxiedOperationCallerThread?PThread.currentProxiedOperationCallerThread:_pthread_self();_pthread_getschedparam(parentThreadPtr,attr+20,attr+24);schedPolicy=HEAP32[attr+20>>2];schedPrio=HEAP32[attr+24>>2];HEAP32[attr+20>>2]=prevSchedPolicy;HEAP32[attr+24>>2]=prevSchedPrio}else{schedPolicy=HEAP32[attr+20>>2];schedPrio=HEAP32[attr+24>>2]}}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(232);for(var i=0;i<232>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+156;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,schedPolicy:schedPolicy,schedPrio:schedPrio,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,parent_pthread_ptr:_pthread_self(),arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList)}else{__spawn_thread(threadParams)}return 0}function _roundf(d){d=+d;return d>=+0?+Math_floor(d+ +.5):+Math_ceil(d-+.5)}function _sysconf(name){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,name);switch(name){case 30:return 16384;case 85:var maxHeapSize=HEAPU8.length;return maxHeapSize/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:case 79:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator==="object")return navigator["hardwareConcurrency"]||1;return 1}}setErrNo(28);return-1}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();else PThread.initWorker();var GLctx;GL.init();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_fd_close,_fd_seek,_fd_write,_sysconf];var asmLibraryArg={"__assert_fail":___assert_fail,"__handle_stack_overflow":___handle_stack_overflow,"_emscripten_notify_thread_queue":__emscripten_notify_thread_queue,"abort":_abort,"emscripten_conditional_set_current_thread_status":_emscripten_conditional_set_current_thread_status,"emscripten_futex_wait":_emscripten_futex_wait,"emscripten_futex_wake":_emscripten_futex_wake,"emscripten_get_now":_emscripten_get_now,"emscripten_is_main_browser_thread":_emscripten_is_main_browser_thread,"emscripten_is_main_runtime_thread":_emscripten_is_main_runtime_thread,"emscripten_memcpy_big":_emscripten_memcpy_big,"emscripten_receive_on_main_thread_js":_emscripten_receive_on_main_thread_js,"emscripten_resize_heap":_emscripten_resize_heap,"emscripten_set_canvas_element_size":_emscripten_set_canvas_element_size,"emscripten_set_current_thread_status":_emscripten_set_current_thread_status,"emscripten_webgl_create_context":_emscripten_webgl_create_context,"fd_close":_fd_close,"fd_seek":_fd_seek,"fd_write":_fd_write,"initPthreadsJS":initPthreadsJS,"memory":wasmMemory||Module["wasmMemory"],"pthread_cleanup_pop":_pthread_cleanup_pop,"pthread_cleanup_push":_pthread_cleanup_push,"pthread_create":_pthread_create,"pthread_self":_pthread_self,"roundf":_roundf,"table":wasmTable};var asm=createWasm();Module["asm"]=asm;var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__wasm_call_ctors"].apply(null,arguments)};var _init=Module["_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["init"].apply(null,arguments)};var _register_tensor=Module["_register_tensor"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["register_tensor"].apply(null,arguments)};var _dispose_data=Module["_dispose_data"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose_data"].apply(null,arguments)};var _dispose=Module["_dispose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose"].apply(null,arguments)};var _Abs=Module["_Abs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Abs"].apply(null,arguments)};var _Add=Module["_Add"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Add"].apply(null,arguments)};var _AddN=Module["_AddN"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AddN"].apply(null,arguments)};var _ArgMax=Module["_ArgMax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ArgMax"].apply(null,arguments)};var _AvgPool=Module["_AvgPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AvgPool"].apply(null,arguments)};var _BatchMatMul=Module["_BatchMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["BatchMatMul"].apply(null,arguments)};var _ClipByValue=Module["_ClipByValue"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ClipByValue"].apply(null,arguments)};var _Conv2D=Module["_Conv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Conv2D"].apply(null,arguments)};var _Cos=Module["_Cos"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Cos"].apply(null,arguments)};var _CropAndResize=Module["_CropAndResize"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["CropAndResize"].apply(null,arguments)};var _DepthwiseConv2dNative=Module["_DepthwiseConv2dNative"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["DepthwiseConv2dNative"].apply(null,arguments)};var _Div=Module["_Div"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Div"].apply(null,arguments)};var _Exp=Module["_Exp"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Exp"].apply(null,arguments)};var _FloorDiv=Module["_FloorDiv"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FloorDiv"].apply(null,arguments)};var _FusedBatchNorm=Module["_FusedBatchNorm"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedBatchNorm"].apply(null,arguments)};var _FusedConv2D=Module["_FusedConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedConv2D"].apply(null,arguments)};var _FusedDepthwiseConv2D=Module["_FusedDepthwiseConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedDepthwiseConv2D"].apply(null,arguments)};var _Gather=Module["_Gather"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Gather"].apply(null,arguments)};var _GatherNd=Module["_GatherNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GatherNd"].apply(null,arguments)};var _Greater=Module["_Greater"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Greater"].apply(null,arguments)};var _GreaterEqual=Module["_GreaterEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GreaterEqual"].apply(null,arguments)};var _Less=Module["_Less"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Less"].apply(null,arguments)};var _LessEqual=Module["_LessEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LessEqual"].apply(null,arguments)};var _Log=Module["_Log"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Log"].apply(null,arguments)};var _LogicalAnd=Module["_LogicalAnd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LogicalAnd"].apply(null,arguments)};var _Max=Module["_Max"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Max"].apply(null,arguments)};var _MaxPool=Module["_MaxPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["MaxPool"].apply(null,arguments)};var _Maximum=Module["_Maximum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Maximum"].apply(null,arguments)};var _Min=Module["_Min"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Min"].apply(null,arguments)};var _Minimum=Module["_Minimum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Minimum"].apply(null,arguments)};var _Mul=Module["_Mul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Mul"].apply(null,arguments)};var _Neg=Module["_Neg"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Neg"].apply(null,arguments)};var _NonMaxSuppressionV3=Module["_NonMaxSuppressionV3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV3"].apply(null,arguments)};var _NonMaxSuppressionV5=Module["_NonMaxSuppressionV5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV5"].apply(null,arguments)};var _NotEqual=Module["_NotEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NotEqual"].apply(null,arguments)};var _PadV2=Module["_PadV2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["PadV2"].apply(null,arguments)};var _Pow=Module["_Pow"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Pow"].apply(null,arguments)};var _Prelu=Module["_Prelu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Prelu"].apply(null,arguments)};var _Relu=Module["_Relu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu"].apply(null,arguments)};var _Relu6=Module["_Relu6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu6"].apply(null,arguments)};var _ResizeBilinear=Module["_ResizeBilinear"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ResizeBilinear"].apply(null,arguments)};var _Rsqrt=Module["_Rsqrt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Rsqrt"].apply(null,arguments)};var _ScatterNd=Module["_ScatterNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ScatterNd"].apply(null,arguments)};var _Sigmoid=Module["_Sigmoid"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sigmoid"].apply(null,arguments)};var _Sin=Module["_Sin"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sin"].apply(null,arguments)};var _Softmax=Module["_Softmax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Softmax"].apply(null,arguments)};var _Sqrt=Module["_Sqrt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sqrt"].apply(null,arguments)};var _Square=Module["_Square"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Square"].apply(null,arguments)};var _Sub=Module["_Sub"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sub"].apply(null,arguments)};var _Sum=Module["_Sum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sum"].apply(null,arguments)};var _Tanh=Module["_Tanh"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tanh"].apply(null,arguments)};var _Tile=Module["_Tile"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tile"].apply(null,arguments)};var _Transpose=Module["_Transpose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Transpose"].apply(null,arguments)};var __FusedMatMul=Module["__FusedMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_FusedMatMul"].apply(null,arguments)};var _malloc=Module["_malloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["malloc"].apply(null,arguments)};var _free=Module["_free"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["free"].apply(null,arguments)};var ___em_js__initPthreadsJS=Module["___em_js__initPthreadsJS"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__em_js__initPthreadsJS"].apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__errno_location"].apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_get_global_libc"].apply(null,arguments)};var _memalign=Module["_memalign"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["memalign"].apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__pthread_tsd_run_dtors"].apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null,arguments)};var _emscripten_main_browser_thread_id=Module["_emscripten_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_browser_thread_id"].apply(null,arguments)};var _emscripten_async_run_in_main_thread=Module["_emscripten_async_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread=Module["_emscripten_sync_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_0=Module["_emscripten_sync_run_in_main_thread_0"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_1=Module["_emscripten_sync_run_in_main_thread_1"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_2=Module["_emscripten_sync_run_in_main_thread_2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_xprintf_varargs=Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_3=Module["_emscripten_sync_run_in_main_thread_3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_5=Module["_emscripten_sync_run_in_main_thread_5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_6=Module["_emscripten_sync_run_in_main_thread_6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_7=Module["_emscripten_sync_run_in_main_thread_7"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null,arguments)};var _emscripten_async_queue_on_thread_=Module["_emscripten_async_queue_on_thread_"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_tls_init"].apply(null,arguments)};var ___set_stack_limit=Module["___set_stack_limit"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__set_stack_limit"].apply(null,arguments)};var stackSave=Module["stackSave"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackSave"].apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackAlloc"].apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackRestore"].apply(null,arguments)};var dynCall_vi=Module["dynCall_vi"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_vi"].apply(null,arguments)};var dynCall_v=Module["dynCall_v"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_v"].apply(null,arguments)};var dynCall_ii=Module["dynCall_ii"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_ii"].apply(null,arguments)};Module["asm"]=asm;if(!Object.getOwnPropertyDescriptor(Module,"intArrayFromString"))Module["intArrayFromString"]=function(){abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"intArrayToString"))Module["intArrayToString"]=function(){abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ccall"))Module["ccall"]=function(){abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["cwrap"]=cwrap;if(!Object.getOwnPropertyDescriptor(Module,"setValue"))Module["setValue"]=function(){abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getValue"))Module["getValue"]=function(){abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocate"))Module["allocate"]=function(){abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getMemory"))Module["getMemory"]=function(){abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ArrayToString"))Module["UTF8ArrayToString"]=function(){abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ToString"))Module["UTF8ToString"]=function(){abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8Array"))Module["stringToUTF8Array"]=function(){abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8"))Module["stringToUTF8"]=function(){abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF8"))Module["lengthBytesUTF8"]=function(){abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreRun"))Module["addOnPreRun"]=function(){abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnInit"))Module["addOnInit"]=function(){abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreMain"))Module["addOnPreMain"]=function(){abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnExit"))Module["addOnExit"]=function(){abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPostRun"))Module["addOnPostRun"]=function(){abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeStringToMemory"))Module["writeStringToMemory"]=function(){abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeArrayToMemory"))Module["writeArrayToMemory"]=function(){abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeAsciiToMemory"))Module["writeAsciiToMemory"]=function(){abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addRunDependency"))Module["addRunDependency"]=function(){abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"removeRunDependency"))Module["removeRunDependency"]=function(){abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createFolder"))Module["FS_createFolder"]=function(){abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPath"))Module["FS_createPath"]=function(){abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDataFile"))Module["FS_createDataFile"]=function(){abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPreloadedFile"))Module["FS_createPreloadedFile"]=function(){abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLazyFile"))Module["FS_createLazyFile"]=function(){abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLink"))Module["FS_createLink"]=function(){abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDevice"))Module["FS_createDevice"]=function(){abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_unlink"))Module["FS_unlink"]=function(){abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"dynamicAlloc"))Module["dynamicAlloc"]=function(){abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadDynamicLibrary"))Module["loadDynamicLibrary"]=function(){abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadWebAssemblyModule"))Module["loadWebAssemblyModule"]=function(){abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getLEB"))Module["getLEB"]=function(){abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFunctionTables"))Module["getFunctionTables"]=function(){abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"alignFunctionTables"))Module["alignFunctionTables"]=function(){abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"registerFunctions"))Module["registerFunctions"]=function(){abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addFunction"))Module["addFunction"]=function(){abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"removeFunction"))Module["removeFunction"]=function(){abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFuncWrapper"))Module["getFuncWrapper"]=function(){abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"prettyPrint"))Module["prettyPrint"]=function(){abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"makeBigInt"))Module["makeBigInt"]=function(){abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"dynCall"))Module["dynCall"]=function(){abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getCompilerSetting"))Module["getCompilerSetting"]=function(){abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"print"))Module["print"]=function(){abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"printErr"))Module["printErr"]=function(){abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getTempRet0"))Module["getTempRet0"]=function(){abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setTempRet0"))Module["setTempRet0"]=function(){abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"callMain"))Module["callMain"]=function(){abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"abort"))Module["abort"]=function(){abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToNewUTF8"))Module["stringToNewUTF8"]=function(){abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"abortOnCannotGrowMemory"))Module["abortOnCannotGrowMemory"]=function(){abort("'abortOnCannotGrowMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscripten_realloc_buffer"))Module["emscripten_realloc_buffer"]=function(){abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ENV"))Module["ENV"]=function(){abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setjmpId"))Module["setjmpId"]=function(){abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_CODES"))Module["ERRNO_CODES"]=function(){abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_MESSAGES"))Module["ERRNO_MESSAGES"]=function(){abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setErrNo"))Module["setErrNo"]=function(){abort("'setErrNo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"DNS"))Module["DNS"]=function(){abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GAI_ERRNO_MESSAGES"))Module["GAI_ERRNO_MESSAGES"]=function(){abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Protocols"))Module["Protocols"]=function(){abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Sockets"))Module["Sockets"]=function(){abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UNWIND_CACHE"))Module["UNWIND_CACHE"]=function(){abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readAsmConstArgs"))Module["readAsmConstArgs"]=function(){abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_q"))Module["jstoi_q"]=function(){abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_s"))Module["jstoi_s"]=function(){abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH"))Module["PATH"]=function(){abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH_FS"))Module["PATH_FS"]=function(){abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SYSCALLS"))Module["SYSCALLS"]=function(){abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMmap2"))Module["syscallMmap2"]=function(){abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMunmap"))Module["syscallMunmap"]=function(){abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"flush_NO_FILESYSTEM"))Module["flush_NO_FILESYSTEM"]=function(){abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"JSEvents"))Module["JSEvents"]=function(){abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangle"))Module["demangle"]=function(){abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangleAll"))Module["demangleAll"]=function(){abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jsStackTrace"))Module["jsStackTrace"]=function(){abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getEnvStrings"))Module["getEnvStrings"]=function(){abort("'getEnvStrings' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64"))Module["writeI53ToI64"]=function(){abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Clamped"))Module["writeI53ToI64Clamped"]=function(){abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Signaling"))Module["writeI53ToI64Signaling"]=function(){abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Clamped"))Module["writeI53ToU64Clamped"]=function(){abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Signaling"))Module["writeI53ToU64Signaling"]=function(){abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromI64"))Module["readI53FromI64"]=function(){abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromU64"))Module["readI53FromU64"]=function(){abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertI32PairToI53"))Module["convertI32PairToI53"]=function(){abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertU32PairToI53"))Module["convertU32PairToI53"]=function(){abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Browser"))Module["Browser"]=function(){abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GL"))Module["GL"]=function(){abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGet"))Module["emscriptenWebGLGet"]=function(){abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetTexPixelData"))Module["emscriptenWebGLGetTexPixelData"]=function(){abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetUniform"))Module["emscriptenWebGLGetUniform"]=function(){abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetVertexAttrib"))Module["emscriptenWebGLGetVertexAttrib"]=function(){abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AL"))Module["AL"]=function(){abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_unicode"))Module["SDL_unicode"]=function(){abort("'SDL_unicode' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_ttfContext"))Module["SDL_ttfContext"]=function(){abort("'SDL_ttfContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_audio"))Module["SDL_audio"]=function(){abort("'SDL_audio' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL"))Module["SDL"]=function(){abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_gfx"))Module["SDL_gfx"]=function(){abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLUT"))Module["GLUT"]=function(){abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"EGL"))Module["EGL"]=function(){abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW_Window"))Module["GLFW_Window"]=function(){abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW"))Module["GLFW"]=function(){abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLEW"))Module["GLEW"]=function(){abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"IDBStore"))Module["IDBStore"]=function(){abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"runAndAbortIfError"))Module["runAndAbortIfError"]=function(){abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["PThread"]=PThread;if(!Object.getOwnPropertyDescriptor(Module,"establishStackSpace"))Module["establishStackSpace"]=function(){abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getNoExitRuntime"))Module["getNoExitRuntime"]=function(){abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"resetPrototype"))Module["resetPrototype"]=function(){abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"warnOnce"))Module["warnOnce"]=function(){abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackSave"))Module["stackSave"]=function(){abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackRestore"))Module["stackRestore"]=function(){abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackAlloc"))Module["stackAlloc"]=function(){abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AsciiToString"))Module["AsciiToString"]=function(){abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToAscii"))Module["stringToAscii"]=function(){abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF16ToString"))Module["UTF16ToString"]=function(){abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF16"))Module["stringToUTF16"]=function(){abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF16"))Module["lengthBytesUTF16"]=function(){abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF32ToString"))Module["UTF32ToString"]=function(){abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF32"))Module["stringToUTF32"]=function(){abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF32"))Module["lengthBytesUTF32"]=function(){abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8"))Module["allocateUTF8"]=function(){abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8OnStack"))Module["allocateUTF8OnStack"]=function(){abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["writeStackCookie"]=writeStackCookie;Module["checkStackCookie"]=checkStackCookie;Module["abortStackOverflow"]=abortStackOverflow;Module["PThread"]=PThread;Module["_pthread_self"]=_pthread_self;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NORMAL"))Object.defineProperty(Module,"ALLOC_NORMAL",{configurable:true,get:function(){abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_STACK"))Object.defineProperty(Module,"ALLOC_STACK",{configurable:true,get:function(){abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_DYNAMIC"))Object.defineProperty(Module,"ALLOC_DYNAMIC",{configurable:true,get:function(){abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NONE"))Object.defineProperty(Module,"ALLOC_NONE",{configurable:true,get:function(){abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});var calledRun;Module["then"]=function(func){if(calledRun){func(Module)}else{var old=Module["onRuntimeInitialized"];Module["onRuntimeInitialized"]=function(){if(old)old();func(Module)}}return Module};function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}writeStackCookie();preRun();if(runDependencies>0)return;function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();assert(!Module["_main"],'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}checkStackCookie()}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}if(!ENVIRONMENT_IS_PTHREAD)noExitRuntime=true;if(!ENVIRONMENT_IS_PTHREAD)run(); +var Module=typeof WasmBackendModule!=="undefined"?WasmBackendModule:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(Module["ENVIRONMENT"]){throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)")}var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"];DYNAMIC_BASE=Module["DYNAMIC_BASE"];DYNAMICTOP_PTR=Module["DYNAMICTOP_PTR"]}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{throw new Error("environment detection error")}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(!Object.getOwnPropertyDescriptor(Module,"arguments"))Object.defineProperty(Module,"arguments",{configurable:true,get:function(){abort("Module.arguments has been replaced with plain arguments_")}});if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(!Object.getOwnPropertyDescriptor(Module,"thisProgram"))Object.defineProperty(Module,"thisProgram",{configurable:true,get:function(){abort("Module.thisProgram has been replaced with plain thisProgram")}});if(Module["quit"])quit_=Module["quit"];if(!Object.getOwnPropertyDescriptor(Module,"quit"))Object.defineProperty(Module,"quit",{configurable:true,get:function(){abort("Module.quit has been replaced with plain quit_")}});assert(typeof Module["memoryInitializerPrefixURL"]==="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["pthreadMainPrefixURL"]==="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["cdInitializerPrefixURL"]==="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["filePackagePrefixURL"]==="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["read"]==="undefined","Module.read option was removed (modify read_ in JS)");assert(typeof Module["readAsync"]==="undefined","Module.readAsync option was removed (modify readAsync in JS)");assert(typeof Module["readBinary"]==="undefined","Module.readBinary option was removed (modify readBinary in JS)");assert(typeof Module["setWindowTitle"]==="undefined","Module.setWindowTitle option was removed (modify setWindowTitle in JS)");assert(typeof Module["TOTAL_MEMORY"]==="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY");if(!Object.getOwnPropertyDescriptor(Module,"read"))Object.defineProperty(Module,"read",{configurable:true,get:function(){abort("Module.read has been replaced with plain read_")}});if(!Object.getOwnPropertyDescriptor(Module,"readAsync"))Object.defineProperty(Module,"readAsync",{configurable:true,get:function(){abort("Module.readAsync has been replaced with plain readAsync")}});if(!Object.getOwnPropertyDescriptor(Module,"readBinary"))Object.defineProperty(Module,"readBinary",{configurable:true,get:function(){abort("Module.readBinary has been replaced with plain readBinary")}});if(!Object.getOwnPropertyDescriptor(Module,"setWindowTitle"))Object.defineProperty(Module,"setWindowTitle",{configurable:true,get:function(){abort("Module.setWindowTitle has been replaced with plain setWindowTitle")}});assert(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER||ENVIRONMENT_IS_NODE,"Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)");var stackSave;var stackRestore;var stackAlloc;stackSave=stackRestore=stackAlloc=function(){abort("cannot use the stack before compiled code is ready to run, and has provided stack access")};function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(!Object.getOwnPropertyDescriptor(Module,"wasmBinary"))Object.defineProperty(Module,"wasmBinary",{configurable:true,get:function(){abort("Module.wasmBinary has been replaced with plain wasmBinary")}});var noExitRuntime;if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(!Object.getOwnPropertyDescriptor(Module,"noExitRuntime"))Object.defineProperty(Module,"noExitRuntime",{configurable:true,get:function(){abort("Module.noExitRuntime has been replaced with plain noExitRuntime")}});if(typeof WebAssembly!=="object"){abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.")}var wasmMemory;var wasmTable=new WebAssembly.Table({"initial":120,"maximum":120+0,"element":"anyfunc"});var wasmModule;var threadInfoStruct=0;var selfThreadId=0;var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string")return UTF8ToString(ret);if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{if((u0&248)!=240)warnOnce("Invalid UTF-8 leading byte 0x"+u0.toString(16)+" encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!");u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;if(u>=2097152)warnOnce("Invalid Unicode code point 0x"+u.toString(16)+" encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF).");heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");HEAP8.set(array,buffer)}var WASM_PAGE_SIZE=65536;var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var STACK_BASE=5255840,STACKTOP=STACK_BASE,STACK_MAX=12960,DYNAMIC_BASE=5255840,DYNAMICTOP_PTR=12032;assert(STACK_BASE%16===0,"stack must start aligned");assert(DYNAMIC_BASE%16===0,"heap must start aligned");if(ENVIRONMENT_IS_PTHREAD){STACK_MAX=STACKTOP=STACK_MAX=2147483647}var TOTAL_STACK=5242880;if(Module["TOTAL_STACK"])assert(TOTAL_STACK===Module["TOTAL_STACK"],"the stack size can no longer be determined at runtime");var INITIAL_INITIAL_MEMORY=Module["INITIAL_MEMORY"]||524288e3;if(!Object.getOwnPropertyDescriptor(Module,"INITIAL_MEMORY"))Object.defineProperty(Module,"INITIAL_MEMORY",{configurable:true,get:function(){abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY")}});assert(INITIAL_INITIAL_MEMORY>=TOTAL_STACK,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+INITIAL_INITIAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");assert(typeof Int32Array!=="undefined"&&typeof Float64Array!=="undefined"&&Int32Array.prototype.subarray!==undefined&&Int32Array.prototype.set!==undefined,"JS engine does not provide full typed array support");if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,"maximum":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_INITIAL_MEMORY=buffer.byteLength;assert(INITIAL_INITIAL_MEMORY%WASM_PAGE_SIZE===0);updateGlobalBufferAndViews(buffer);if(!ENVIRONMENT_IS_PTHREAD){HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE}function writeStackCookie(){assert((STACK_MAX&3)==0);HEAPU32[(STACK_MAX>>2)+1]=34821223;HEAPU32[(STACK_MAX>>2)+2]=2310721022;HEAP32[0]=1668509029}function checkStackCookie(){var cookie1=HEAPU32[(STACK_MAX>>2)+1];var cookie2=HEAPU32[(STACK_MAX>>2)+2];if(cookie1!=34821223||cookie2!=2310721022){abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+cookie2.toString(16)+" "+cookie1.toString(16))}if(HEAP32[0]!==1668509029)abort("Runtime error: The application has corrupted its heap memory area (address zero)!")}function abortStackOverflow(allocSize){abort("Stack overflow! Attempted to allocate "+allocSize+" bytes on the stack, but stack has only "+(STACK_MAX-stackSave()+allocSize)+" bytes available!")}(function(){var h16=new Int16Array(1);var h8=new Int8Array(h16.buffer);h16[0]=25459;if(h8[0]!==115||h8[1]!==99)throw"Runtime error: expected the system to be little-endian!"})();function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;if(ENVIRONMENT_IS_PTHREAD)runtimeInitialized=true;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){checkStackCookie();assert(!runtimeInitialized);runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATMAIN__)}function postRun(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Math_ceil=Math.ceil;var Math_floor=Math.floor;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!=="undefined"){runDependencyWatcher=setInterval(function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;err("still waiting on run dependencies:")}err("dependency: "+dep)}if(shown){err("(end of list)")}},1e4)}}else{err("warning: run dependency added without ID")}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id]}else{err("warning: run dependency removed without ID")}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";out(what);err(what);ABORT=true;EXITSTATUS=1;var output="abort("+what+") at "+stackTrace();what=output;throw new WebAssembly.RuntimeError(what)}var FS={error:function(){abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1")},init:function(){FS.error()},createDataFile:function(){FS.error()},createPreloadedFile:function(){FS.error()},createLazyFile:function(){FS.error()},open:function(){FS.error()},mkdev:function(){FS.error()},registerDevice:function(){FS.error()},analyzePath:function(){FS.error()},loadFilesFromDB:function(){FS.error()},ErrnoError:function ErrnoError(){FS.error()}};Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;function hasPrefix(str,prefix){return String.prototype.startsWith?str.startsWith(prefix):str.indexOf(prefix)===0}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return hasPrefix(filename,dataURIPrefix)}var fileURIPrefix="file://";function isFileURI(filename){return hasPrefix(filename,fileURIPrefix)}var wasmBinaryFile="tfjs-backend-wasm.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(){try{if(wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(wasmBinaryFile)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary()})}return new Promise(function(resolve,reject){resolve(getBinary())})}function createWasm(){var info={"env":asmLibraryArg,"wasi_snapshot_preview1":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){var numWorkersToLoad=PThread.unusedWorkers.length;PThread.unusedWorkers.forEach(function(w){PThread.loadWasmModuleToWorker(w,function(){if(!--numWorkersToLoad)removeRunDependency("wasm-instantiate")})})}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}var trueModule=Module;function receiveInstantiatedSource(output){assert(Module===trueModule,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");trueModule=null;receiveInstance(output["instance"],output["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var ASM_CONSTS={};function initPthreadsJS(){PThread.initRuntime()}if(!ENVIRONMENT_IS_PTHREAD)__ATINIT__.push({func:function(){___wasm_call_ctors()}});function demangle(func){warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return func}function demangleAll(text){var regex=/\b_Z[\w\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"})}var __pthread_ptr=0;var __pthread_is_main_runtime_thread=0;var __pthread_is_main_browser_thread=0;function __register_pthread_ptr(pthreadPtr,isMainBrowserThread,isMainRuntimeThread){pthreadPtr=pthreadPtr|0;isMainBrowserThread=isMainBrowserThread|0;isMainRuntimeThread=isMainRuntimeThread|0;__pthread_ptr=pthreadPtr;__pthread_is_main_browser_thread=isMainBrowserThread;__pthread_is_main_runtime_thread=isMainRuntimeThread}Module["__register_pthread_ptr"]=__register_pthread_ptr;var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var __main_thread_futex_wait_address=12944;function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__main_thread_futex_wait_address>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__main_thread_futex_wait_address>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function __kill_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _kill_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _kill_thread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function __cancel_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cancel_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cancel_thread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function __cleanup_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cleanup_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cleanup_thread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];if(pthread){var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={MAIN_THREAD_ID:1,mainThreadInfo:{schedPolicy:0,schedPrio:0},unusedWorkers:[],runningWorkers:[],initRuntime:function(){__register_pthread_ptr(PThread.mainThreadBlock,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(PThread.mainThreadBlock)},initMainThreadBlock:function(){assert(!ENVIRONMENT_IS_PTHREAD);var pthreadPoolSize=8;for(var i=0;i>2]=PThread.mainThreadBlock;var headPtr=PThread.mainThreadBlock+156;HEAP32[headPtr>>2]=headPtr;var tlsMemory=12432;for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,PThread.mainThreadBlock+104>>2,tlsMemory);Atomics.store(HEAPU32,PThread.mainThreadBlock+40>>2,PThread.mainThreadBlock);Atomics.store(HEAPU32,PThread.mainThreadBlock+44>>2,42)},initWorker:function(){},pthreads:{},exitHandlers:null,setThreadStatus:function(){},runExitHandlers:function(){if(PThread.exitHandlers!==null){while(PThread.exitHandlers.length>0){PThread.exitHandlers.pop()()}PThread.exitHandlers=null}if(ENVIRONMENT_IS_PTHREAD&&threadInfoStruct)___pthread_tsd_run_dtors()},threadExit:function(exitCode){var tb=_pthread_self();if(tb){err("Pthread 0x"+tb.toString(16)+" exited.");Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);Atomics.store(HEAPU32,tb+60>>2,1);Atomics.store(HEAPU32,tb+64>>2,0);PThread.runExitHandlers();_emscripten_futex_wake(tb+0,2147483647);__register_pthread_ptr(0,0,0);threadInfoStruct=0;if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlers();Atomics.store(HEAPU32,threadInfoStruct+4>>2,-1);Atomics.store(HEAPU32,threadInfoStruct+0>>2,1);_emscripten_futex_wake(threadInfoStruct+0,2147483647);threadInfoStruct=selfThreadId=0;__register_pthread_ptr(0,0,0);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+104>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){delete PThread.pthreads[worker.pthread.thread];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined},receiveObjectTransfer:function(data){},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){__spawn_thread(e.data)}else if(cmd==="cleanupThread"){__cleanup_thread(d["thread"])}else if(cmd==="killThread"){__kill_thread(d["thread"])}else if(cmd==="cancelThread"){__cancel_thread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.thread+68>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){console.log("worker exited - TODO: update the worker queue?")})}assert(wasmMemory instanceof WebAssembly.Memory,"WebAssembly memory should have been loaded by now!");assert(wasmModule instanceof WebAssembly.Module,"WebAssembly Module should have been loaded by now!");worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule,"DYNAMIC_BASE":DYNAMIC_BASE,"DYNAMICTOP_PTR":DYNAMICTOP_PTR})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("tfjs-backend-wasm.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}if(PThread.unusedWorkers.length>0)return PThread.unusedWorkers.pop();else return null},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()>2]=value;return value}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg);warnOnce("atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)");__ATEXIT__.unshift({func:func,arg:arg})}function ___handle_stack_overflow(){abort("stack overflow")}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){err("Cannot send message to thread with ID "+targetThreadId+", unknown thread ID!");return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){expectedStatus=expectedStatus|0;newStatus=newStatus|0}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(ENVIRONMENT_IS_WORKER){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{var loadedVal=Atomics.load(HEAP32,addr>>2);if(val!=loadedVal)return-6;var tNow=performance.now();var tEnd=tNow+timeout;Atomics.store(HEAP32,__main_thread_futex_wait_address>>2,addr);var ourWaitAddress=addr;while(addr==ourWaitAddress){tNow=performance.now();if(tNow>tEnd){return-73}_emscripten_main_thread_process_queued_calls();addr=Atomics.load(HEAP32,__main_thread_futex_wait_address>>2)}return 0}}function _emscripten_is_main_browser_thread(){return __pthread_is_main_browser_thread|0}function _emscripten_is_main_runtime_thread(){return __pthread_is_main_runtime_thread|0}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;if(numCallArgs>20-1)throw"emscripten_proxy_to_main_thread_js: Too many arguments "+numCallArgs+" to proxied function idx="+index+", maximum supported is "+(20-1)+"!";var stack=stackSave();var args=stackAlloc(numCallArgs*8);var b=args>>3;for(var i=0;i>3]);buf+=8}else if(ch===105){buf=buf+3&~3;args.push(HEAP32[buf>>2]);buf+=4}else abort("unexpected char in asm const signature "+ch)}return args}function _emscripten_receive_on_main_thread_js(index,numCallArgs,args){_emscripten_receive_on_main_thread_js_callArgs.length=numCallArgs;var b=args>>3;for(var i=0;i=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;_emscripten_async_queue_on_thread_(targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;_emscripten_async_queue_on_thread_(targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function __maybeCStringToJsString(cString){return cString===cString+0?UTF8ToString(cString):cString}var __specialEventTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function __findEventTarget(target){var domElement=__specialEventTargets[target]||(typeof document!=="undefined"?document.querySelector(__maybeCStringToJsString(target)):undefined);return domElement}function __findCanvasEventTarget(target){return __findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=__findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=__findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){newStatus=newStatus|0}function _emscripten_set_thread_name(threadId,name){threadId=threadId|0;name=name|0}function __webgl_acquireInstancedArraysExtension(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)}}}function __webgl_acquireVertexArrayObjectExtension(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)}}}function __webgl_acquireDrawBuffersExtension(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)}}}var GL={counter:1,lastError:0,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},currentContext:null,offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,init:function(){var miniTempFloatBuffer=new Float32Array(GL.MINI_TEMP_BUFFER_SIZE);for(var i=0;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;if(context.version<2){__webgl_acquireInstancedArraysExtension(GLctx);__webgl_acquireVertexArrayObjectExtension(GLctx);__webgl_acquireDrawBuffersExtension(GLctx)}GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query");var automaticallyEnabledExtensions=["OES_texture_float","OES_texture_half_float","OES_standard_derivatives","OES_vertex_array_object","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","OES_element_index_uint","EXT_texture_filter_anisotropic","EXT_frag_depth","WEBGL_draw_buffers","ANGLE_instanced_arrays","OES_texture_float_linear","OES_texture_half_float_linear","EXT_blend_minmax","EXT_shader_texture_lod","EXT_texture_norm16","WEBGL_compressed_texture_pvrtc","EXT_color_buffer_half_float","WEBGL_color_buffer_float","EXT_sRGB","WEBGL_compressed_texture_etc1","EXT_disjoint_timer_query","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_astc","EXT_color_buffer_float","WEBGL_compressed_texture_s3tc_srgb","EXT_disjoint_timer_query_webgl2","WEBKIT_WEBGL_compressed_texture_pvrtc"];var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(automaticallyEnabledExtensions.indexOf(ext)!=-1){GLctx.getExtension(ext)}})},populateUniformTable:function(program){var p=GL.programs[program];var ptable=GL.programInfos[program]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1};var utable=ptable.uniforms;var numUniforms=GLctx.getProgramParameter(p,35718);for(var i=0;i>2;contextAttributes["alpha"]=!!HEAP32[a+(0>>2)];contextAttributes["depth"]=!!HEAP32[a+(4>>2)];contextAttributes["stencil"]=!!HEAP32[a+(8>>2)];contextAttributes["antialias"]=!!HEAP32[a+(12>>2)];contextAttributes["premultipliedAlpha"]=!!HEAP32[a+(16>>2)];contextAttributes["preserveDrawingBuffer"]=!!HEAP32[a+(20>>2)];var powerPreference=HEAP32[a+(24>>2)];contextAttributes["powerPreference"]=__emscripten_webgl_power_preferences[powerPreference];contextAttributes["failIfMajorPerformanceCaveat"]=!!HEAP32[a+(28>>2)];contextAttributes.majorVersion=HEAP32[a+(32>>2)];contextAttributes.minorVersion=HEAP32[a+(36>>2)];contextAttributes.enableExtensionsByDefault=HEAP32[a+(40>>2)];contextAttributes.explicitSwapControl=HEAP32[a+(44>>2)];contextAttributes.proxyContextToMainThread=HEAP32[a+(48>>2)];contextAttributes.renderViaOffscreenBackBuffer=HEAP32[a+(52>>2)];var canvas=__findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];assert(buffer);if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:undefined,get:function(){assert(SYSCALLS.varargs!=undefined);SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){if(low>=0)assert(high===0);else assert(high===-1);return low}};function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,fd);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM");return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,fd,offset_low,offset_high,whence,newOffset);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM")}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd,iov,iovcnt,pnum);var num=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}function _pthread_cleanup_pop(execute){var routine=PThread.exitHandlers.pop();if(execute)routine()}function _pthread_cleanup_push(routine,arg){if(PThread.exitHandlers===null){PThread.exitHandlers=[]}PThread.exitHandlers.push(function(){dynCall_vi(routine,arg)})}function __spawn_thread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _spawn_thread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,thread:threadParams.pthread_ptr,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(0>>2),0);Atomics.store(HEAPU32,tis+(4>>2),0);Atomics.store(HEAPU32,tis+(8>>2),0);Atomics.store(HEAPU32,tis+(68>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(104>>2),tlsMemory);Atomics.store(HEAPU32,tis+(48>>2),0);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(44>>2),42);Atomics.store(HEAPU32,tis+(108>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(84>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(80>>2),stackHigh);Atomics.store(HEAPU32,tis+(108+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(108+12>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(108+20>>2),threadParams.schedPolicy);Atomics.store(HEAPU32,tis+(108+24>>2),threadParams.schedPrio);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(176>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"selfThreadId":threadParams.pthread_ptr,"parentThreadId":threadParams.parent_pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}}function _pthread_getschedparam(thread,policy,schedparam){if(!policy&&!schedparam)return ERRNO_CODES.EINVAL;if(!thread){err("pthread_getschedparam called with a null thread pointer!");return ERRNO_CODES.ESRCH}var self=HEAP32[thread+12>>2];if(self!==thread){err("pthread_getschedparam attempted on thread "+thread+", which does not point to a valid thread, or does not exist anymore!");return ERRNO_CODES.ESRCH}var schedPolicy=Atomics.load(HEAPU32,thread+108+20>>2);var schedPrio=Atomics.load(HEAPU32,thread+108+24>>2);if(policy)HEAP32[policy>>2]=schedPolicy;if(schedparam)HEAP32[schedparam>>2]=schedPrio;return 0}function _pthread_self(){return __pthread_ptr|0}Module["_pthread_self"]=_pthread_self;function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;var schedPolicy=0;var schedPrio=0;if(attr){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0;var inheritSched=HEAP32[attr+16>>2]===0;if(inheritSched){var prevSchedPolicy=HEAP32[attr+20>>2];var prevSchedPrio=HEAP32[attr+24>>2];var parentThreadPtr=PThread.currentProxiedOperationCallerThread?PThread.currentProxiedOperationCallerThread:_pthread_self();_pthread_getschedparam(parentThreadPtr,attr+20,attr+24);schedPolicy=HEAP32[attr+20>>2];schedPrio=HEAP32[attr+24>>2];HEAP32[attr+20>>2]=prevSchedPolicy;HEAP32[attr+24>>2]=prevSchedPrio}else{schedPolicy=HEAP32[attr+20>>2];schedPrio=HEAP32[attr+24>>2]}}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(232);for(var i=0;i<232>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+156;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,schedPolicy:schedPolicy,schedPrio:schedPrio,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,parent_pthread_ptr:_pthread_self(),arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList)}else{__spawn_thread(threadParams)}return 0}function _roundf(d){d=+d;return d>=+0?+Math_floor(d+ +.5):+Math_ceil(d-+.5)}function _sysconf(name){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,name);switch(name){case 30:return 16384;case 85:var maxHeapSize=HEAPU8.length;return maxHeapSize/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:case 79:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator==="object")return navigator["hardwareConcurrency"]||1;return 1}}setErrNo(28);return-1}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();else PThread.initWorker();var GLctx;GL.init();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_fd_close,_fd_seek,_fd_write,_sysconf];var asmLibraryArg={"__assert_fail":___assert_fail,"__call_main":___call_main,"__handle_stack_overflow":___handle_stack_overflow,"_emscripten_notify_thread_queue":__emscripten_notify_thread_queue,"abort":_abort,"emscripten_conditional_set_current_thread_status":_emscripten_conditional_set_current_thread_status,"emscripten_futex_wait":_emscripten_futex_wait,"emscripten_futex_wake":_emscripten_futex_wake,"emscripten_get_now":_emscripten_get_now,"emscripten_is_main_browser_thread":_emscripten_is_main_browser_thread,"emscripten_is_main_runtime_thread":_emscripten_is_main_runtime_thread,"emscripten_memcpy_big":_emscripten_memcpy_big,"emscripten_receive_on_main_thread_js":_emscripten_receive_on_main_thread_js,"emscripten_resize_heap":_emscripten_resize_heap,"emscripten_set_canvas_element_size":_emscripten_set_canvas_element_size,"emscripten_set_current_thread_status":_emscripten_set_current_thread_status,"emscripten_set_thread_name":_emscripten_set_thread_name,"emscripten_webgl_create_context":_emscripten_webgl_create_context,"fd_close":_fd_close,"fd_seek":_fd_seek,"fd_write":_fd_write,"initPthreadsJS":initPthreadsJS,"memory":wasmMemory||Module["wasmMemory"],"pthread_cleanup_pop":_pthread_cleanup_pop,"pthread_cleanup_push":_pthread_cleanup_push,"pthread_create":_pthread_create,"pthread_self":_pthread_self,"roundf":_roundf,"table":wasmTable};var asm=createWasm();Module["asm"]=asm;var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__wasm_call_ctors"].apply(null,arguments)};var _init=Module["_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["init"].apply(null,arguments)};var _register_tensor=Module["_register_tensor"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["register_tensor"].apply(null,arguments)};var _dispose_data=Module["_dispose_data"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose_data"].apply(null,arguments)};var _dispose=Module["_dispose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose"].apply(null,arguments)};var _Abs=Module["_Abs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Abs"].apply(null,arguments)};var _Add=Module["_Add"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Add"].apply(null,arguments)};var _AddN=Module["_AddN"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AddN"].apply(null,arguments)};var _ArgMax=Module["_ArgMax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ArgMax"].apply(null,arguments)};var _AvgPool=Module["_AvgPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AvgPool"].apply(null,arguments)};var _BatchMatMul=Module["_BatchMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["BatchMatMul"].apply(null,arguments)};var _ClipByValue=Module["_ClipByValue"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ClipByValue"].apply(null,arguments)};var _Conv2D=Module["_Conv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Conv2D"].apply(null,arguments)};var _Cos=Module["_Cos"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Cos"].apply(null,arguments)};var _CropAndResize=Module["_CropAndResize"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["CropAndResize"].apply(null,arguments)};var _DepthwiseConv2dNative=Module["_DepthwiseConv2dNative"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["DepthwiseConv2dNative"].apply(null,arguments)};var _Div=Module["_Div"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Div"].apply(null,arguments)};var _Exp=Module["_Exp"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Exp"].apply(null,arguments)};var _FloorDiv=Module["_FloorDiv"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FloorDiv"].apply(null,arguments)};var _FusedBatchNorm=Module["_FusedBatchNorm"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedBatchNorm"].apply(null,arguments)};var _FusedConv2D=Module["_FusedConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedConv2D"].apply(null,arguments)};var _FusedDepthwiseConv2D=Module["_FusedDepthwiseConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedDepthwiseConv2D"].apply(null,arguments)};var _Gather=Module["_Gather"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Gather"].apply(null,arguments)};var _GatherNd=Module["_GatherNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GatherNd"].apply(null,arguments)};var _Greater=Module["_Greater"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Greater"].apply(null,arguments)};var _GreaterEqual=Module["_GreaterEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GreaterEqual"].apply(null,arguments)};var _Less=Module["_Less"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Less"].apply(null,arguments)};var _LessEqual=Module["_LessEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LessEqual"].apply(null,arguments)};var _Log=Module["_Log"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Log"].apply(null,arguments)};var _LogicalAnd=Module["_LogicalAnd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LogicalAnd"].apply(null,arguments)};var _Max=Module["_Max"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Max"].apply(null,arguments)};var _MaxPool=Module["_MaxPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["MaxPool"].apply(null,arguments)};var _Maximum=Module["_Maximum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Maximum"].apply(null,arguments)};var _Min=Module["_Min"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Min"].apply(null,arguments)};var _Minimum=Module["_Minimum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Minimum"].apply(null,arguments)};var _Mul=Module["_Mul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Mul"].apply(null,arguments)};var _Neg=Module["_Neg"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Neg"].apply(null,arguments)};var _NonMaxSuppressionV3=Module["_NonMaxSuppressionV3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV3"].apply(null,arguments)};var _NonMaxSuppressionV5=Module["_NonMaxSuppressionV5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV5"].apply(null,arguments)};var _NotEqual=Module["_NotEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NotEqual"].apply(null,arguments)};var _PadV2=Module["_PadV2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["PadV2"].apply(null,arguments)};var _Pow=Module["_Pow"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Pow"].apply(null,arguments)};var _Prelu=Module["_Prelu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Prelu"].apply(null,arguments)};var _Relu=Module["_Relu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu"].apply(null,arguments)};var _Relu6=Module["_Relu6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu6"].apply(null,arguments)};var _ResizeBilinear=Module["_ResizeBilinear"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ResizeBilinear"].apply(null,arguments)};var _Rsqrt=Module["_Rsqrt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Rsqrt"].apply(null,arguments)};var _ScatterNd=Module["_ScatterNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ScatterNd"].apply(null,arguments)};var _Sigmoid=Module["_Sigmoid"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sigmoid"].apply(null,arguments)};var _Sin=Module["_Sin"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sin"].apply(null,arguments)};var _Softmax=Module["_Softmax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Softmax"].apply(null,arguments)};var _Sqrt=Module["_Sqrt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sqrt"].apply(null,arguments)};var _Square=Module["_Square"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Square"].apply(null,arguments)};var _Sub=Module["_Sub"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sub"].apply(null,arguments)};var _Sum=Module["_Sum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sum"].apply(null,arguments)};var _Tanh=Module["_Tanh"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tanh"].apply(null,arguments)};var _Tile=Module["_Tile"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tile"].apply(null,arguments)};var _Transpose=Module["_Transpose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Transpose"].apply(null,arguments)};var __FusedMatMul=Module["__FusedMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_FusedMatMul"].apply(null,arguments)};var _malloc=Module["_malloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["malloc"].apply(null,arguments)};var _free=Module["_free"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["free"].apply(null,arguments)};var ___em_js__initPthreadsJS=Module["___em_js__initPthreadsJS"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__em_js__initPthreadsJS"].apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__errno_location"].apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_get_global_libc"].apply(null,arguments)};var _memalign=Module["_memalign"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["memalign"].apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__pthread_tsd_run_dtors"].apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null,arguments)};var _emscripten_main_browser_thread_id=Module["_emscripten_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_browser_thread_id"].apply(null,arguments)};var _emscripten_async_run_in_main_thread=Module["_emscripten_async_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread=Module["_emscripten_sync_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_0=Module["_emscripten_sync_run_in_main_thread_0"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_1=Module["_emscripten_sync_run_in_main_thread_1"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_2=Module["_emscripten_sync_run_in_main_thread_2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_xprintf_varargs=Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_3=Module["_emscripten_sync_run_in_main_thread_3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_5=Module["_emscripten_sync_run_in_main_thread_5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_6=Module["_emscripten_sync_run_in_main_thread_6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_7=Module["_emscripten_sync_run_in_main_thread_7"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null,arguments)};var _emscripten_async_queue_on_thread_=Module["_emscripten_async_queue_on_thread_"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_tls_init"].apply(null,arguments)};var ___set_stack_limit=Module["___set_stack_limit"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__set_stack_limit"].apply(null,arguments)};var stackSave=Module["stackSave"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackSave"].apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackAlloc"].apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackRestore"].apply(null,arguments)};var dynCall_vi=Module["dynCall_vi"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_vi"].apply(null,arguments)};var dynCall_v=Module["dynCall_v"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_v"].apply(null,arguments)};var dynCall_ii=Module["dynCall_ii"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_ii"].apply(null,arguments)};Module["asm"]=asm;if(!Object.getOwnPropertyDescriptor(Module,"intArrayFromString"))Module["intArrayFromString"]=function(){abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"intArrayToString"))Module["intArrayToString"]=function(){abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ccall"))Module["ccall"]=function(){abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["cwrap"]=cwrap;if(!Object.getOwnPropertyDescriptor(Module,"setValue"))Module["setValue"]=function(){abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getValue"))Module["getValue"]=function(){abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocate"))Module["allocate"]=function(){abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getMemory"))Module["getMemory"]=function(){abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ArrayToString"))Module["UTF8ArrayToString"]=function(){abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ToString"))Module["UTF8ToString"]=function(){abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8Array"))Module["stringToUTF8Array"]=function(){abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8"))Module["stringToUTF8"]=function(){abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF8"))Module["lengthBytesUTF8"]=function(){abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreRun"))Module["addOnPreRun"]=function(){abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnInit"))Module["addOnInit"]=function(){abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreMain"))Module["addOnPreMain"]=function(){abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnExit"))Module["addOnExit"]=function(){abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPostRun"))Module["addOnPostRun"]=function(){abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeStringToMemory"))Module["writeStringToMemory"]=function(){abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeArrayToMemory"))Module["writeArrayToMemory"]=function(){abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeAsciiToMemory"))Module["writeAsciiToMemory"]=function(){abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addRunDependency"))Module["addRunDependency"]=function(){abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"removeRunDependency"))Module["removeRunDependency"]=function(){abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createFolder"))Module["FS_createFolder"]=function(){abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPath"))Module["FS_createPath"]=function(){abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDataFile"))Module["FS_createDataFile"]=function(){abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPreloadedFile"))Module["FS_createPreloadedFile"]=function(){abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLazyFile"))Module["FS_createLazyFile"]=function(){abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLink"))Module["FS_createLink"]=function(){abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDevice"))Module["FS_createDevice"]=function(){abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_unlink"))Module["FS_unlink"]=function(){abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"dynamicAlloc"))Module["dynamicAlloc"]=function(){abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadDynamicLibrary"))Module["loadDynamicLibrary"]=function(){abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadWebAssemblyModule"))Module["loadWebAssemblyModule"]=function(){abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getLEB"))Module["getLEB"]=function(){abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFunctionTables"))Module["getFunctionTables"]=function(){abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"alignFunctionTables"))Module["alignFunctionTables"]=function(){abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"registerFunctions"))Module["registerFunctions"]=function(){abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addFunction"))Module["addFunction"]=function(){abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"removeFunction"))Module["removeFunction"]=function(){abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFuncWrapper"))Module["getFuncWrapper"]=function(){abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"prettyPrint"))Module["prettyPrint"]=function(){abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"makeBigInt"))Module["makeBigInt"]=function(){abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"dynCall"))Module["dynCall"]=function(){abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getCompilerSetting"))Module["getCompilerSetting"]=function(){abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"print"))Module["print"]=function(){abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"printErr"))Module["printErr"]=function(){abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getTempRet0"))Module["getTempRet0"]=function(){abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setTempRet0"))Module["setTempRet0"]=function(){abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"callMain"))Module["callMain"]=function(){abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"abort"))Module["abort"]=function(){abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToNewUTF8"))Module["stringToNewUTF8"]=function(){abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"abortOnCannotGrowMemory"))Module["abortOnCannotGrowMemory"]=function(){abort("'abortOnCannotGrowMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscripten_realloc_buffer"))Module["emscripten_realloc_buffer"]=function(){abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ENV"))Module["ENV"]=function(){abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setjmpId"))Module["setjmpId"]=function(){abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_CODES"))Module["ERRNO_CODES"]=function(){abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_MESSAGES"))Module["ERRNO_MESSAGES"]=function(){abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setErrNo"))Module["setErrNo"]=function(){abort("'setErrNo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"DNS"))Module["DNS"]=function(){abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GAI_ERRNO_MESSAGES"))Module["GAI_ERRNO_MESSAGES"]=function(){abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Protocols"))Module["Protocols"]=function(){abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Sockets"))Module["Sockets"]=function(){abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UNWIND_CACHE"))Module["UNWIND_CACHE"]=function(){abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readAsmConstArgs"))Module["readAsmConstArgs"]=function(){abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_q"))Module["jstoi_q"]=function(){abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_s"))Module["jstoi_s"]=function(){abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH"))Module["PATH"]=function(){abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH_FS"))Module["PATH_FS"]=function(){abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SYSCALLS"))Module["SYSCALLS"]=function(){abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMmap2"))Module["syscallMmap2"]=function(){abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMunmap"))Module["syscallMunmap"]=function(){abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"flush_NO_FILESYSTEM"))Module["flush_NO_FILESYSTEM"]=function(){abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"JSEvents"))Module["JSEvents"]=function(){abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangle"))Module["demangle"]=function(){abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangleAll"))Module["demangleAll"]=function(){abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jsStackTrace"))Module["jsStackTrace"]=function(){abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getEnvStrings"))Module["getEnvStrings"]=function(){abort("'getEnvStrings' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64"))Module["writeI53ToI64"]=function(){abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Clamped"))Module["writeI53ToI64Clamped"]=function(){abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Signaling"))Module["writeI53ToI64Signaling"]=function(){abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Clamped"))Module["writeI53ToU64Clamped"]=function(){abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Signaling"))Module["writeI53ToU64Signaling"]=function(){abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromI64"))Module["readI53FromI64"]=function(){abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromU64"))Module["readI53FromU64"]=function(){abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertI32PairToI53"))Module["convertI32PairToI53"]=function(){abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertU32PairToI53"))Module["convertU32PairToI53"]=function(){abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Browser"))Module["Browser"]=function(){abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GL"))Module["GL"]=function(){abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGet"))Module["emscriptenWebGLGet"]=function(){abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetTexPixelData"))Module["emscriptenWebGLGetTexPixelData"]=function(){abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetUniform"))Module["emscriptenWebGLGetUniform"]=function(){abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetVertexAttrib"))Module["emscriptenWebGLGetVertexAttrib"]=function(){abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AL"))Module["AL"]=function(){abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_unicode"))Module["SDL_unicode"]=function(){abort("'SDL_unicode' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_ttfContext"))Module["SDL_ttfContext"]=function(){abort("'SDL_ttfContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_audio"))Module["SDL_audio"]=function(){abort("'SDL_audio' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL"))Module["SDL"]=function(){abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_gfx"))Module["SDL_gfx"]=function(){abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLUT"))Module["GLUT"]=function(){abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"EGL"))Module["EGL"]=function(){abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW_Window"))Module["GLFW_Window"]=function(){abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW"))Module["GLFW"]=function(){abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLEW"))Module["GLEW"]=function(){abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"IDBStore"))Module["IDBStore"]=function(){abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"runAndAbortIfError"))Module["runAndAbortIfError"]=function(){abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["PThread"]=PThread;if(!Object.getOwnPropertyDescriptor(Module,"establishStackSpace"))Module["establishStackSpace"]=function(){abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getNoExitRuntime"))Module["getNoExitRuntime"]=function(){abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"resetPrototype"))Module["resetPrototype"]=function(){abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"warnOnce"))Module["warnOnce"]=function(){abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackSave"))Module["stackSave"]=function(){abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackRestore"))Module["stackRestore"]=function(){abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackAlloc"))Module["stackAlloc"]=function(){abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AsciiToString"))Module["AsciiToString"]=function(){abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToAscii"))Module["stringToAscii"]=function(){abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF16ToString"))Module["UTF16ToString"]=function(){abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF16"))Module["stringToUTF16"]=function(){abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF16"))Module["lengthBytesUTF16"]=function(){abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF32ToString"))Module["UTF32ToString"]=function(){abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF32"))Module["stringToUTF32"]=function(){abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF32"))Module["lengthBytesUTF32"]=function(){abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8"))Module["allocateUTF8"]=function(){abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8OnStack"))Module["allocateUTF8OnStack"]=function(){abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["writeStackCookie"]=writeStackCookie;Module["checkStackCookie"]=checkStackCookie;Module["abortStackOverflow"]=abortStackOverflow;Module["PThread"]=PThread;Module["_pthread_self"]=_pthread_self;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NORMAL"))Object.defineProperty(Module,"ALLOC_NORMAL",{configurable:true,get:function(){abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_STACK"))Object.defineProperty(Module,"ALLOC_STACK",{configurable:true,get:function(){abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_DYNAMIC"))Object.defineProperty(Module,"ALLOC_DYNAMIC",{configurable:true,get:function(){abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NONE"))Object.defineProperty(Module,"ALLOC_NONE",{configurable:true,get:function(){abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});var calledRun;Module["then"]=function(func){if(calledRun){func(Module)}else{var old=Module["onRuntimeInitialized"];Module["onRuntimeInitialized"]=function(){if(old)old();func(Module)}}return Module};function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}writeStackCookie();preRun();if(runDependencies>0)return;function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();assert(!Module["_main"],'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}checkStackCookie()}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}if(!ENVIRONMENT_IS_PTHREAD)noExitRuntime=true;if(!ENVIRONMENT_IS_PTHREAD)run(); return WasmBackendModule diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.wasm b/tfjs-core/benchmarks/tfjs-backend-wasm.wasm index 9fed9e9cc82e0b4ecfeabc2f73f2bba0bc012c44..2da06f1d7eeacd9b4a633f6c0e1419f7240a219a 100644 GIT binary patch delta 18480 zcmch9d3+Q_`gcFob0w2WI^@24CMS0SB%FaXXFx!1Tn}P^CFtwuQhUAKQ3uo0;&abbiDO*@kUsgY-uA+Q)Sxx!83Pmwrwteew z8r(Ek)U?-^&#bPX`O1yz8TJcvl2dVzqS_U5W@aj`Fok?kN*0AFxr#!HqB;~Ob26<{ zM!XW~Qk4irv8&{WRGbdx9Nua0z_2jYY0q*g+91WHs2)mlk**MtN}WC7;fiWg6o-ox zv%4d=J0)S1C~`zO@}g9y>TueXp@|8xT4W>(OL7uLQFlg;urLQXoldjCkvz^>+)2rf zQQR2Uri3feiXH#E(1%-97z>NEM@BjmwMZ>Cp-|CcZG96G-L{BuSGc{%85bAlh>wqt z&FG^lq^dU6W&YEV<#)N=?rGaFvxl|M0uQFr~g z@*9==nA5o7`U$nQ)yj|L9$H>MYtFdx`f-b@m4A?XSas$6p*Kw{uU=H4G?QakZOsk6 zhAVqX9ag(g*+rgVb+z-2n%R>o7FOO|p=_T*aly?Kn z9Ir}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aC(E+&t%{DZ>_-pS_Wa&yDC}6{{s&^`~Cm` diff --git a/tfjs-core/benchmarks/wasm_0_threads/tfjs-backend-wasm.js b/tfjs-core/benchmarks/wasm_0_threads/tfjs-backend-wasm.js new file mode 100755 index 00000000000..728ccc975b9 --- /dev/null +++ b/tfjs-core/benchmarks/wasm_0_threads/tfjs-backend-wasm.js @@ -0,0 +1,3382 @@ +var WasmBackendModule = (function () { + var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; + if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; + return ( + function (WasmBackendModule) { + WasmBackendModule = WasmBackendModule || {}; + + var Module = typeof WasmBackendModule !== "undefined" ? WasmBackendModule : {}; + var moduleOverrides = {}; + var key; + for (key in Module) { + if (Module.hasOwnProperty(key)) { + moduleOverrides[key] = Module[key] + } + } + var arguments_ = []; + var thisProgram = "./this.program"; + var quit_ = function (status, toThrow) { + throw toThrow + }; + var ENVIRONMENT_IS_WEB = false; + var ENVIRONMENT_IS_WORKER = false; + var ENVIRONMENT_IS_NODE = false; + var ENVIRONMENT_IS_SHELL = false; + ENVIRONMENT_IS_WEB = typeof window === "object"; + ENVIRONMENT_IS_WORKER = typeof importScripts === "function"; + ENVIRONMENT_IS_NODE = typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string"; + ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER; + if (Module["ENVIRONMENT"]) { + throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)") + } + var ENVIRONMENT_IS_PTHREAD = Module["ENVIRONMENT_IS_PTHREAD"] || false; + if (ENVIRONMENT_IS_PTHREAD) { + buffer = Module["buffer"]; + DYNAMIC_BASE = Module["DYNAMIC_BASE"]; + DYNAMICTOP_PTR = Module["DYNAMICTOP_PTR"] + } + var scriptDirectory = ""; + + function locateFile(path) { + if (Module["locateFile"]) { + return Module["locateFile"](path, scriptDirectory) + } + return scriptDirectory + path + } + var read_, readAsync, readBinary, setWindowTitle; + var nodeFS; + var nodePath; + if (ENVIRONMENT_IS_NODE) { + if (ENVIRONMENT_IS_WORKER) { + scriptDirectory = require("path").dirname(scriptDirectory) + "/" + } else { + scriptDirectory = __dirname + "/" + } + read_ = function shell_read(filename, binary) { + if (!nodeFS) nodeFS = require("fs"); + if (!nodePath) nodePath = require("path"); + filename = nodePath["normalize"](filename); + return nodeFS["readFileSync"](filename, binary ? null : "utf8") + }; + readBinary = function readBinary(filename) { + var ret = read_(filename, true); + if (!ret.buffer) { + ret = new Uint8Array(ret) + } + assert(ret.buffer); + return ret + }; + if (process["argv"].length > 1) { + thisProgram = process["argv"][1].replace(/\\/g, "/") + } + arguments_ = process["argv"].slice(2); + process["on"]("uncaughtException", function (ex) { + if (!(ex instanceof ExitStatus)) { + throw ex + } + }); + process["on"]("unhandledRejection", abort); + quit_ = function (status) { + process["exit"](status) + }; + Module["inspect"] = function () { + return "[Emscripten Module object]" + }; + var nodeWorkerThreads; + try { + nodeWorkerThreads = require("worker_threads") + } catch (e) { + console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'); + throw e + } + Worker = nodeWorkerThreads.Worker + } else if (ENVIRONMENT_IS_SHELL) { + if (typeof read != "undefined") { + read_ = function shell_read(f) { + return read(f) + } + } + readBinary = function readBinary(f) { + var data; + if (typeof readbuffer === "function") { + return new Uint8Array(readbuffer(f)) + } + data = read(f, "binary"); + assert(typeof data === "object"); + return data + }; + if (typeof scriptArgs != "undefined") { + arguments_ = scriptArgs + } else if (typeof arguments != "undefined") { + arguments_ = arguments + } + if (typeof quit === "function") { + quit_ = function (status) { + quit(status) + } + } + if (typeof print !== "undefined") { + if (typeof console === "undefined") console = {}; + console.log = print; + console.warn = console.error = typeof printErr !== "undefined" ? printErr : print + } + } else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { + if (ENVIRONMENT_IS_WORKER) { + scriptDirectory = self.location.href + } else if (document.currentScript) { + scriptDirectory = document.currentScript.src + } + if (_scriptDir) { + scriptDirectory = _scriptDir + } + if (scriptDirectory.indexOf("blob:") !== 0) { + scriptDirectory = scriptDirectory.substr(0, scriptDirectory.lastIndexOf("/") + 1) + } else { + scriptDirectory = "" + } + if (ENVIRONMENT_IS_NODE) { + read_ = function shell_read(filename, binary) { + if (!nodeFS) nodeFS = require("fs"); + if (!nodePath) nodePath = require("path"); + filename = nodePath["normalize"](filename); + return nodeFS["readFileSync"](filename, binary ? null : "utf8") + }; + readBinary = function readBinary(filename) { + var ret = read_(filename, true); + if (!ret.buffer) { + ret = new Uint8Array(ret) + } + assert(ret.buffer); + return ret + } + } else { + read_ = function shell_read(url) { + var xhr = new XMLHttpRequest; + xhr.open("GET", url, false); + xhr.send(null); + return xhr.responseText + }; + if (ENVIRONMENT_IS_WORKER) { + readBinary = function readBinary(url) { + var xhr = new XMLHttpRequest; + xhr.open("GET", url, false); + xhr.responseType = "arraybuffer"; + xhr.send(null); + return new Uint8Array(xhr.response) + } + } + readAsync = function readAsync(url, onload, onerror) { + var xhr = new XMLHttpRequest; + xhr.open("GET", url, true); + xhr.responseType = "arraybuffer"; + xhr.onload = function xhr_onload() { + if (xhr.status == 200 || xhr.status == 0 && xhr.response) { + onload(xhr.response); + return + } + onerror() + }; + xhr.onerror = onerror; + xhr.send(null) + } + } + setWindowTitle = function (title) { + document.title = title + } + } else { + throw new Error("environment detection error") + } + if (ENVIRONMENT_IS_NODE) { + if (typeof performance === "undefined") { + performance = require("perf_hooks").performance + } + } + var out = Module["print"] || console.log.bind(console); + var err = Module["printErr"] || console.warn.bind(console); + for (key in moduleOverrides) { + if (moduleOverrides.hasOwnProperty(key)) { + Module[key] = moduleOverrides[key] + } + } + moduleOverrides = null; + if (Module["arguments"]) arguments_ = Module["arguments"]; + if (!Object.getOwnPropertyDescriptor(Module, "arguments")) Object.defineProperty(Module, "arguments", { + configurable: true, + get: function () { + abort("Module.arguments has been replaced with plain arguments_") + } + }); + if (Module["thisProgram"]) thisProgram = Module["thisProgram"]; + if (!Object.getOwnPropertyDescriptor(Module, "thisProgram")) Object.defineProperty(Module, "thisProgram", { + configurable: true, + get: function () { + abort("Module.thisProgram has been replaced with plain thisProgram") + } + }); + if (Module["quit"]) quit_ = Module["quit"]; + if (!Object.getOwnPropertyDescriptor(Module, "quit")) Object.defineProperty(Module, "quit", { + configurable: true, + get: function () { + abort("Module.quit has been replaced with plain quit_") + } + }); + assert(typeof Module["memoryInitializerPrefixURL"] === "undefined", "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["pthreadMainPrefixURL"] === "undefined", "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["cdInitializerPrefixURL"] === "undefined", "Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["filePackagePrefixURL"] === "undefined", "Module.filePackagePrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["read"] === "undefined", "Module.read option was removed (modify read_ in JS)"); + assert(typeof Module["readAsync"] === "undefined", "Module.readAsync option was removed (modify readAsync in JS)"); + assert(typeof Module["readBinary"] === "undefined", "Module.readBinary option was removed (modify readBinary in JS)"); + assert(typeof Module["setWindowTitle"] === "undefined", "Module.setWindowTitle option was removed (modify setWindowTitle in JS)"); + assert(typeof Module["TOTAL_MEMORY"] === "undefined", "Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"); + if (!Object.getOwnPropertyDescriptor(Module, "read")) Object.defineProperty(Module, "read", { + configurable: true, + get: function () { + abort("Module.read has been replaced with plain read_") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "readAsync")) Object.defineProperty(Module, "readAsync", { + configurable: true, + get: function () { + abort("Module.readAsync has been replaced with plain readAsync") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "readBinary")) Object.defineProperty(Module, "readBinary", { + configurable: true, + get: function () { + abort("Module.readBinary has been replaced with plain readBinary") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "setWindowTitle")) Object.defineProperty(Module, "setWindowTitle", { + configurable: true, + get: function () { + abort("Module.setWindowTitle has been replaced with plain setWindowTitle") + } + }); + assert(ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER || ENVIRONMENT_IS_NODE, "Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)"); + var stackSave; + var stackRestore; + var stackAlloc; + stackSave = stackRestore = stackAlloc = function () { + abort("cannot use the stack before compiled code is ready to run, and has provided stack access") + }; + + function warnOnce(text) { + if (!warnOnce.shown) warnOnce.shown = {}; + if (!warnOnce.shown[text]) { + warnOnce.shown[text] = 1; + err(text) + } + } + var Atomics_load = Atomics.load; + var Atomics_store = Atomics.store; + var Atomics_compareExchange = Atomics.compareExchange; + var wasmBinary; + if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"]; + if (!Object.getOwnPropertyDescriptor(Module, "wasmBinary")) Object.defineProperty(Module, "wasmBinary", { + configurable: true, + get: function () { + abort("Module.wasmBinary has been replaced with plain wasmBinary") + } + }); + var noExitRuntime; + if (Module["noExitRuntime"]) noExitRuntime = Module["noExitRuntime"]; + if (!Object.getOwnPropertyDescriptor(Module, "noExitRuntime")) Object.defineProperty(Module, "noExitRuntime", { + configurable: true, + get: function () { + abort("Module.noExitRuntime has been replaced with plain noExitRuntime") + } + }); + if (typeof WebAssembly !== "object") { + abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.") + } + var wasmMemory; + var wasmTable = new WebAssembly.Table({ + "initial": 119, + "maximum": 119 + 0, + "element": "anyfunc" + }); + var wasmModule; + var threadInfoStruct = 0; + var selfThreadId = 0; + var ABORT = false; + var EXITSTATUS = 0; + + function assert(condition, text) { + if (!condition) { + abort("Assertion failed: " + text) + } + } + + function getCFunc(ident) { + var func = Module["_" + ident]; + assert(func, "Cannot call unknown function " + ident + ", make sure it is exported"); + return func + } + + function ccall(ident, returnType, argTypes, args, opts) { + var toC = { + "string": function (str) { + var ret = 0; + if (str !== null && str !== undefined && str !== 0) { + var len = (str.length << 2) + 1; + ret = stackAlloc(len); + stringToUTF8(str, ret, len) + } + return ret + }, + "array": function (arr) { + var ret = stackAlloc(arr.length); + writeArrayToMemory(arr, ret); + return ret + } + }; + + function convertReturnValue(ret) { + if (returnType === "string") return UTF8ToString(ret); + if (returnType === "boolean") return Boolean(ret); + return ret + } + var func = getCFunc(ident); + var cArgs = []; + var stack = 0; + assert(returnType !== "array", 'Return type should not be "array".'); + if (args) { + for (var i = 0; i < args.length; i++) { + var converter = toC[argTypes[i]]; + if (converter) { + if (stack === 0) stack = stackSave(); + cArgs[i] = converter(args[i]) + } else { + cArgs[i] = args[i] + } + } + } + var ret = func.apply(null, cArgs); + ret = convertReturnValue(ret); + if (stack !== 0) stackRestore(stack); + return ret + } + + function cwrap(ident, returnType, argTypes, opts) { + return function () { + return ccall(ident, returnType, argTypes, arguments, opts) + } + } + + function UTF8ArrayToString(heap, idx, maxBytesToRead) { + var endIdx = idx + maxBytesToRead; + var str = ""; + while (!(idx >= endIdx)) { + var u0 = heap[idx++]; + if (!u0) return str; + if (!(u0 & 128)) { + str += String.fromCharCode(u0); + continue + } + var u1 = heap[idx++] & 63; + if ((u0 & 224) == 192) { + str += String.fromCharCode((u0 & 31) << 6 | u1); + continue + } + var u2 = heap[idx++] & 63; + if ((u0 & 240) == 224) { + u0 = (u0 & 15) << 12 | u1 << 6 | u2 + } else { + if ((u0 & 248) != 240) warnOnce("Invalid UTF-8 leading byte 0x" + u0.toString(16) + " encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!"); + u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heap[idx++] & 63 + } + if (u0 < 65536) { + str += String.fromCharCode(u0) + } else { + var ch = u0 - 65536; + str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023) + } + } + return str + } + + function UTF8ToString(ptr, maxBytesToRead) { + return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "" + } + + function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { + if (!(maxBytesToWrite > 0)) return 0; + var startIdx = outIdx; + var endIdx = outIdx + maxBytesToWrite - 1; + for (var i = 0; i < str.length; ++i) { + var u = str.charCodeAt(i); + if (u >= 55296 && u <= 57343) { + var u1 = str.charCodeAt(++i); + u = 65536 + ((u & 1023) << 10) | u1 & 1023 + } + if (u <= 127) { + if (outIdx >= endIdx) break; + heap[outIdx++] = u + } else if (u <= 2047) { + if (outIdx + 1 >= endIdx) break; + heap[outIdx++] = 192 | u >> 6; + heap[outIdx++] = 128 | u & 63 + } else if (u <= 65535) { + if (outIdx + 2 >= endIdx) break; + heap[outIdx++] = 224 | u >> 12; + heap[outIdx++] = 128 | u >> 6 & 63; + heap[outIdx++] = 128 | u & 63 + } else { + if (outIdx + 3 >= endIdx) break; + if (u >= 2097152) warnOnce("Invalid Unicode code point 0x" + u.toString(16) + " encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF)."); + heap[outIdx++] = 240 | u >> 18; + heap[outIdx++] = 128 | u >> 12 & 63; + heap[outIdx++] = 128 | u >> 6 & 63; + heap[outIdx++] = 128 | u & 63 + } + } + heap[outIdx] = 0; + return outIdx - startIdx + } + + function stringToUTF8(str, outPtr, maxBytesToWrite) { + assert(typeof maxBytesToWrite == "number", "stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"); + return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite) + } + + function lengthBytesUTF8(str) { + var len = 0; + for (var i = 0; i < str.length; ++i) { + var u = str.charCodeAt(i); + if (u >= 55296 && u <= 57343) u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; + if (u <= 127) ++len; + else if (u <= 2047) len += 2; + else if (u <= 65535) len += 3; + else len += 4 + } + return len + } + + function writeArrayToMemory(array, buffer) { + assert(array.length >= 0, "writeArrayToMemory array must have a length (should be an array or typed array)"); + HEAP8.set(array, buffer) + } + var WASM_PAGE_SIZE = 65536; + var buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; + + function updateGlobalBufferAndViews(buf) { + buffer = buf; + Module["HEAP8"] = HEAP8 = new Int8Array(buf); + Module["HEAP16"] = HEAP16 = new Int16Array(buf); + Module["HEAP32"] = HEAP32 = new Int32Array(buf); + Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); + Module["HEAPU16"] = HEAPU16 = new Uint16Array(buf); + Module["HEAPU32"] = HEAPU32 = new Uint32Array(buf); + Module["HEAPF32"] = HEAPF32 = new Float32Array(buf); + Module["HEAPF64"] = HEAPF64 = new Float64Array(buf) + } + var STACK_BASE = 5255808, + STACKTOP = STACK_BASE, + STACK_MAX = 12928, + DYNAMIC_BASE = 5255808, + DYNAMICTOP_PTR = 12e3; + assert(STACK_BASE % 16 === 0, "stack must start aligned"); + assert(DYNAMIC_BASE % 16 === 0, "heap must start aligned"); + if (ENVIRONMENT_IS_PTHREAD) { + STACK_MAX = STACKTOP = STACK_MAX = 2147483647 + } + var TOTAL_STACK = 5242880; + if (Module["TOTAL_STACK"]) assert(TOTAL_STACK === Module["TOTAL_STACK"], "the stack size can no longer be determined at runtime"); + var INITIAL_INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 1073741824; + if (!Object.getOwnPropertyDescriptor(Module, "INITIAL_MEMORY")) Object.defineProperty(Module, "INITIAL_MEMORY", { + configurable: true, + get: function () { + abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY") + } + }); + assert(INITIAL_INITIAL_MEMORY >= TOTAL_STACK, "INITIAL_MEMORY should be larger than TOTAL_STACK, was " + INITIAL_INITIAL_MEMORY + "! (TOTAL_STACK=" + TOTAL_STACK + ")"); + assert(typeof Int32Array !== "undefined" && typeof Float64Array !== "undefined" && Int32Array.prototype.subarray !== undefined && Int32Array.prototype.set !== undefined, "JS engine does not provide full typed array support"); + if (ENVIRONMENT_IS_PTHREAD) { + wasmMemory = Module["wasmMemory"]; + buffer = Module["buffer"] + } else { + if (Module["wasmMemory"]) { + wasmMemory = Module["wasmMemory"] + } else { + wasmMemory = new WebAssembly.Memory({ + "initial": INITIAL_INITIAL_MEMORY / WASM_PAGE_SIZE, + "maximum": INITIAL_INITIAL_MEMORY / WASM_PAGE_SIZE, + "shared": true + }); + if (!(wasmMemory.buffer instanceof SharedArrayBuffer)) { + err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"); + if (ENVIRONMENT_IS_NODE) { + console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)") + } + throw Error("bad memory") + } + } + } + if (wasmMemory) { + buffer = wasmMemory.buffer + } + INITIAL_INITIAL_MEMORY = buffer.byteLength; + assert(INITIAL_INITIAL_MEMORY % WASM_PAGE_SIZE === 0); + updateGlobalBufferAndViews(buffer); + if (!ENVIRONMENT_IS_PTHREAD) { + HEAP32[DYNAMICTOP_PTR >> 2] = DYNAMIC_BASE + } + + function writeStackCookie() { + assert((STACK_MAX & 3) == 0); + HEAPU32[(STACK_MAX >> 2) + 1] = 34821223; + HEAPU32[(STACK_MAX >> 2) + 2] = 2310721022; + HEAP32[0] = 1668509029 + } + + function checkStackCookie() { + var cookie1 = HEAPU32[(STACK_MAX >> 2) + 1]; + var cookie2 = HEAPU32[(STACK_MAX >> 2) + 2]; + if (cookie1 != 34821223 || cookie2 != 2310721022) { + abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x" + cookie2.toString(16) + " " + cookie1.toString(16)) + } + if (HEAP32[0] !== 1668509029) abort("Runtime error: The application has corrupted its heap memory area (address zero)!") + } + + function abortStackOverflow(allocSize) { + abort("Stack overflow! Attempted to allocate " + allocSize + " bytes on the stack, but stack has only " + (STACK_MAX - stackSave() + allocSize) + " bytes available!") + }(function () { + var h16 = new Int16Array(1); + var h8 = new Int8Array(h16.buffer); + h16[0] = 25459; + if (h8[0] !== 115 || h8[1] !== 99) throw "Runtime error: expected the system to be little-endian!" + })(); + + function callRuntimeCallbacks(callbacks) { + while (callbacks.length > 0) { + var callback = callbacks.shift(); + if (typeof callback == "function") { + callback(Module); + continue + } + var func = callback.func; + if (typeof func === "number") { + if (callback.arg === undefined) { + Module["dynCall_v"](func) + } else { + Module["dynCall_vi"](func, callback.arg) + } + } else { + func(callback.arg === undefined ? null : callback.arg) + } + } + } + var __ATPRERUN__ = []; + var __ATINIT__ = []; + var __ATMAIN__ = []; + var __ATEXIT__ = []; + var __ATPOSTRUN__ = []; + var runtimeInitialized = false; + var runtimeExited = false; + if (ENVIRONMENT_IS_PTHREAD) runtimeInitialized = true; + + function preRun() { + if (ENVIRONMENT_IS_PTHREAD) return; + if (Module["preRun"]) { + if (typeof Module["preRun"] == "function") Module["preRun"] = [Module["preRun"]]; + while (Module["preRun"].length) { + addOnPreRun(Module["preRun"].shift()) + } + } + callRuntimeCallbacks(__ATPRERUN__) + } + + function initRuntime() { + checkStackCookie(); + assert(!runtimeInitialized); + runtimeInitialized = true; + callRuntimeCallbacks(__ATINIT__) + } + + function preMain() { + checkStackCookie(); + if (ENVIRONMENT_IS_PTHREAD) return; + callRuntimeCallbacks(__ATMAIN__) + } + + function postRun() { + checkStackCookie(); + if (ENVIRONMENT_IS_PTHREAD) return; + if (Module["postRun"]) { + if (typeof Module["postRun"] == "function") Module["postRun"] = [Module["postRun"]]; + while (Module["postRun"].length) { + addOnPostRun(Module["postRun"].shift()) + } + } + callRuntimeCallbacks(__ATPOSTRUN__) + } + + function addOnPreRun(cb) { + __ATPRERUN__.unshift(cb) + } + + function addOnPostRun(cb) { + __ATPOSTRUN__.unshift(cb) + } + assert(Math.imul, "This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + assert(Math.fround, "This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + assert(Math.clz32, "This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + assert(Math.trunc, "This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + var Math_ceil = Math.ceil; + var Math_floor = Math.floor; + var runDependencies = 0; + var runDependencyWatcher = null; + var dependenciesFulfilled = null; + var runDependencyTracking = {}; + + function addRunDependency(id) { + assert(!ENVIRONMENT_IS_PTHREAD, "addRunDependency cannot be used in a pthread worker"); + runDependencies++; + if (Module["monitorRunDependencies"]) { + Module["monitorRunDependencies"](runDependencies) + } + if (id) { + assert(!runDependencyTracking[id]); + runDependencyTracking[id] = 1; + if (runDependencyWatcher === null && typeof setInterval !== "undefined") { + runDependencyWatcher = setInterval(function () { + if (ABORT) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null; + return + } + var shown = false; + for (var dep in runDependencyTracking) { + if (!shown) { + shown = true; + err("still waiting on run dependencies:") + } + err("dependency: " + dep) + } + if (shown) { + err("(end of list)") + } + }, 1e4) + } + } else { + err("warning: run dependency added without ID") + } + } + + function removeRunDependency(id) { + runDependencies--; + if (Module["monitorRunDependencies"]) { + Module["monitorRunDependencies"](runDependencies) + } + if (id) { + assert(runDependencyTracking[id]); + delete runDependencyTracking[id] + } else { + err("warning: run dependency removed without ID") + } + if (runDependencies == 0) { + if (runDependencyWatcher !== null) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null + } + if (dependenciesFulfilled) { + var callback = dependenciesFulfilled; + dependenciesFulfilled = null; + callback() + } + } + } + Module["preloadedImages"] = {}; + Module["preloadedAudios"] = {}; + + function abort(what) { + if (Module["onAbort"]) { + Module["onAbort"](what) + } + if (ENVIRONMENT_IS_PTHREAD) console.error("Pthread aborting at " + (new Error).stack); + what += ""; + out(what); + err(what); + ABORT = true; + EXITSTATUS = 1; + var output = "abort(" + what + ") at " + stackTrace(); + what = output; + throw new WebAssembly.RuntimeError(what) + } + var FS = { + error: function () { + abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1") + }, + init: function () { + FS.error() + }, + createDataFile: function () { + FS.error() + }, + createPreloadedFile: function () { + FS.error() + }, + createLazyFile: function () { + FS.error() + }, + open: function () { + FS.error() + }, + mkdev: function () { + FS.error() + }, + registerDevice: function () { + FS.error() + }, + analyzePath: function () { + FS.error() + }, + loadFilesFromDB: function () { + FS.error() + }, + ErrnoError: function ErrnoError() { + FS.error() + } + }; + Module["FS_createDataFile"] = FS.createDataFile; + Module["FS_createPreloadedFile"] = FS.createPreloadedFile; + + function hasPrefix(str, prefix) { + return String.prototype.startsWith ? str.startsWith(prefix) : str.indexOf(prefix) === 0 + } + var dataURIPrefix = "data:application/octet-stream;base64,"; + + function isDataURI(filename) { + return hasPrefix(filename, dataURIPrefix) + } + var fileURIPrefix = "file://"; + + function isFileURI(filename) { + return hasPrefix(filename, fileURIPrefix) + } + var wasmBinaryFile = "tfjs-backend-wasm.wasm"; + if (!isDataURI(wasmBinaryFile)) { + wasmBinaryFile = locateFile(wasmBinaryFile) + } + + function getBinary() { + try { + if (wasmBinary) { + return new Uint8Array(wasmBinary) + } + if (readBinary) { + return readBinary(wasmBinaryFile) + } else { + throw "both async and sync fetching of the wasm failed" + } + } catch (err) { + abort(err) + } + } + + function getBinaryPromise() { + if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) && typeof fetch === "function" && !isFileURI(wasmBinaryFile)) { + return fetch(wasmBinaryFile, { + credentials: "same-origin" + }).then(function (response) { + if (!response["ok"]) { + throw "failed to load wasm binary file at '" + wasmBinaryFile + "'" + } + return response["arrayBuffer"]() + }).catch(function () { + return getBinary() + }) + } + return new Promise(function (resolve, reject) { + resolve(getBinary()) + }) + } + + function createWasm() { + var info = { + "env": asmLibraryArg, + "wasi_snapshot_preview1": asmLibraryArg + }; + + function receiveInstance(instance, module) { + var exports = instance.exports; + Module["asm"] = exports; + wasmModule = module; + if (!ENVIRONMENT_IS_PTHREAD) { + var numWorkersToLoad = PThread.unusedWorkers.length; + PThread.unusedWorkers.forEach(function (w) { + PThread.loadWasmModuleToWorker(w, function () { + if (!--numWorkersToLoad) removeRunDependency("wasm-instantiate") + }) + }) + } + } + if (!ENVIRONMENT_IS_PTHREAD) { + addRunDependency("wasm-instantiate") + } + var trueModule = Module; + + function receiveInstantiatedSource(output) { + assert(Module === trueModule, "the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"); + trueModule = null; + receiveInstance(output["instance"], output["module"]) + } + + function instantiateArrayBuffer(receiver) { + return getBinaryPromise().then(function (binary) { + return WebAssembly.instantiate(binary, info) + }).then(receiver, function (reason) { + err("failed to asynchronously prepare wasm: " + reason); + abort(reason) + }) + } + + function instantiateAsync() { + if (!wasmBinary && typeof WebAssembly.instantiateStreaming === "function" && !isDataURI(wasmBinaryFile) && !isFileURI(wasmBinaryFile) && typeof fetch === "function") { + fetch(wasmBinaryFile, { + credentials: "same-origin" + }).then(function (response) { + var result = WebAssembly.instantiateStreaming(response, info); + return result.then(receiveInstantiatedSource, function (reason) { + err("wasm streaming compile failed: " + reason); + err("falling back to ArrayBuffer instantiation"); + instantiateArrayBuffer(receiveInstantiatedSource) + }) + }) + } else { + return instantiateArrayBuffer(receiveInstantiatedSource) + } + } + if (Module["instantiateWasm"]) { + try { + var exports = Module["instantiateWasm"](info, receiveInstance); + return exports + } catch (e) { + err("Module.instantiateWasm callback failed with error: " + e); + return false + } + } + instantiateAsync(); + return {} + } + var ASM_CONSTS = {}; + + function initPthreadsJS() { + PThread.initRuntime() + } + if (!ENVIRONMENT_IS_PTHREAD) __ATINIT__.push({ + func: function () { + ___wasm_call_ctors() + } + }); + + function demangle(func) { + warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"); + return func + } + + function demangleAll(text) { + var regex = /\b_Z[\w\d_]+/g; + return text.replace(regex, function (x) { + var y = demangle(x); + return x === y ? x : y + " [" + x + "]" + }) + } + var __pthread_ptr = 0; + var __pthread_is_main_runtime_thread = 0; + var __pthread_is_main_browser_thread = 0; + + function __register_pthread_ptr(pthreadPtr, isMainBrowserThread, isMainRuntimeThread) { + pthreadPtr = pthreadPtr | 0; + isMainBrowserThread = isMainBrowserThread | 0; + isMainRuntimeThread = isMainRuntimeThread | 0; + __pthread_ptr = pthreadPtr; + __pthread_is_main_browser_thread = isMainBrowserThread; + __pthread_is_main_runtime_thread = isMainRuntimeThread + } + Module["__register_pthread_ptr"] = __register_pthread_ptr; + var ERRNO_CODES = { + EPERM: 63, + ENOENT: 44, + ESRCH: 71, + EINTR: 27, + EIO: 29, + ENXIO: 60, + E2BIG: 1, + ENOEXEC: 45, + EBADF: 8, + ECHILD: 12, + EAGAIN: 6, + EWOULDBLOCK: 6, + ENOMEM: 48, + EACCES: 2, + EFAULT: 21, + ENOTBLK: 105, + EBUSY: 10, + EEXIST: 20, + EXDEV: 75, + ENODEV: 43, + ENOTDIR: 54, + EISDIR: 31, + EINVAL: 28, + ENFILE: 41, + EMFILE: 33, + ENOTTY: 59, + ETXTBSY: 74, + EFBIG: 22, + ENOSPC: 51, + ESPIPE: 70, + EROFS: 69, + EMLINK: 34, + EPIPE: 64, + EDOM: 18, + ERANGE: 68, + ENOMSG: 49, + EIDRM: 24, + ECHRNG: 106, + EL2NSYNC: 156, + EL3HLT: 107, + EL3RST: 108, + ELNRNG: 109, + EUNATCH: 110, + ENOCSI: 111, + EL2HLT: 112, + EDEADLK: 16, + ENOLCK: 46, + EBADE: 113, + EBADR: 114, + EXFULL: 115, + ENOANO: 104, + EBADRQC: 103, + EBADSLT: 102, + EDEADLOCK: 16, + EBFONT: 101, + ENOSTR: 100, + ENODATA: 116, + ETIME: 117, + ENOSR: 118, + ENONET: 119, + ENOPKG: 120, + EREMOTE: 121, + ENOLINK: 47, + EADV: 122, + ESRMNT: 123, + ECOMM: 124, + EPROTO: 65, + EMULTIHOP: 36, + EDOTDOT: 125, + EBADMSG: 9, + ENOTUNIQ: 126, + EBADFD: 127, + EREMCHG: 128, + ELIBACC: 129, + ELIBBAD: 130, + ELIBSCN: 131, + ELIBMAX: 132, + ELIBEXEC: 133, + ENOSYS: 52, + ENOTEMPTY: 55, + ENAMETOOLONG: 37, + ELOOP: 32, + EOPNOTSUPP: 138, + EPFNOSUPPORT: 139, + ECONNRESET: 15, + ENOBUFS: 42, + EAFNOSUPPORT: 5, + EPROTOTYPE: 67, + ENOTSOCK: 57, + ENOPROTOOPT: 50, + ESHUTDOWN: 140, + ECONNREFUSED: 14, + EADDRINUSE: 3, + ECONNABORTED: 13, + ENETUNREACH: 40, + ENETDOWN: 38, + ETIMEDOUT: 73, + EHOSTDOWN: 142, + EHOSTUNREACH: 23, + EINPROGRESS: 26, + EALREADY: 7, + EDESTADDRREQ: 17, + EMSGSIZE: 35, + EPROTONOSUPPORT: 66, + ESOCKTNOSUPPORT: 137, + EADDRNOTAVAIL: 4, + ENETRESET: 39, + EISCONN: 30, + ENOTCONN: 53, + ETOOMANYREFS: 141, + EUSERS: 136, + EDQUOT: 19, + ESTALE: 72, + ENOTSUP: 138, + ENOMEDIUM: 148, + EILSEQ: 25, + EOVERFLOW: 61, + ECANCELED: 11, + ENOTRECOVERABLE: 56, + EOWNERDEAD: 62, + ESTRPIPE: 135 + }; + var __main_thread_futex_wait_address = 12912; + + function _emscripten_futex_wake(addr, count) { + if (addr <= 0 || addr > HEAP8.length || addr & 3 != 0 || count < 0) return -28; + if (count == 0) return 0; + if (count >= 2147483647) count = Infinity; + var mainThreadWaitAddress = Atomics.load(HEAP32, __main_thread_futex_wait_address >> 2); + var mainThreadWoken = 0; + if (mainThreadWaitAddress == addr) { + var loadedAddr = Atomics.compareExchange(HEAP32, __main_thread_futex_wait_address >> 2, mainThreadWaitAddress, 0); + if (loadedAddr == mainThreadWaitAddress) { + --count; + mainThreadWoken = 1; + if (count <= 0) return 1 + } + } + var ret = Atomics.notify(HEAP32, addr >> 2, count); + if (ret >= 0) return ret + mainThreadWoken; + throw "Atomics.notify returned an unexpected value " + ret + } + Module["_emscripten_futex_wake"] = _emscripten_futex_wake; + + function __kill_thread(pthread_ptr) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _kill_thread() can only ever be called from main application thread!"; + if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _kill_thread!"; + HEAP32[pthread_ptr + 12 >> 2] = 0; + var pthread = PThread.pthreads[pthread_ptr]; + pthread.worker.terminate(); + PThread.freeThreadData(pthread); + PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker), 1); + pthread.worker.pthread = undefined + } + + function __cancel_thread(pthread_ptr) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _cancel_thread() can only ever be called from main application thread!"; + if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _cancel_thread!"; + var pthread = PThread.pthreads[pthread_ptr]; + pthread.worker.postMessage({ + "cmd": "cancel" + }) + } + + function __cleanup_thread(pthread_ptr) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _cleanup_thread() can only ever be called from main application thread!"; + if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _cleanup_thread!"; + HEAP32[pthread_ptr + 12 >> 2] = 0; + var pthread = PThread.pthreads[pthread_ptr]; + if (pthread) { + var worker = pthread.worker; + PThread.returnWorkerToPool(worker) + } + } + var PThread = { + MAIN_THREAD_ID: 1, + mainThreadInfo: { + schedPolicy: 0, + schedPrio: 0 + }, + unusedWorkers: [], + runningWorkers: [], + initRuntime: function () { + __register_pthread_ptr(PThread.mainThreadBlock, !ENVIRONMENT_IS_WORKER, 1); + _emscripten_register_main_browser_thread_id(PThread.mainThreadBlock) + }, + initMainThreadBlock: function () { + assert(!ENVIRONMENT_IS_PTHREAD); + var pthreadPoolSize = 8; + for (var i = 0; i < pthreadPoolSize; ++i) { + PThread.allocateUnusedWorker() + } + PThread.mainThreadBlock = 12160; + for (var i = 0; i < 232 / 4; ++i) HEAPU32[PThread.mainThreadBlock / 4 + i] = 0; + HEAP32[PThread.mainThreadBlock + 12 >> 2] = PThread.mainThreadBlock; + var headPtr = PThread.mainThreadBlock + 156; + HEAP32[headPtr >> 2] = headPtr; + var tlsMemory = 12400; + for (var i = 0; i < 128; ++i) HEAPU32[tlsMemory / 4 + i] = 0; + Atomics.store(HEAPU32, PThread.mainThreadBlock + 104 >> 2, tlsMemory); + Atomics.store(HEAPU32, PThread.mainThreadBlock + 40 >> 2, PThread.mainThreadBlock); + Atomics.store(HEAPU32, PThread.mainThreadBlock + 44 >> 2, 42) + }, + initWorker: function () {}, + pthreads: {}, + exitHandlers: null, + setThreadStatus: function () {}, + runExitHandlers: function () { + if (PThread.exitHandlers !== null) { + while (PThread.exitHandlers.length > 0) { + PThread.exitHandlers.pop()() + } + PThread.exitHandlers = null + } + if (ENVIRONMENT_IS_PTHREAD && threadInfoStruct) ___pthread_tsd_run_dtors() + }, + threadExit: function (exitCode) { + var tb = _pthread_self(); + if (tb) { + err("Pthread 0x" + tb.toString(16) + " exited."); + Atomics.store(HEAPU32, tb + 4 >> 2, exitCode); + Atomics.store(HEAPU32, tb + 0 >> 2, 1); + Atomics.store(HEAPU32, tb + 60 >> 2, 1); + Atomics.store(HEAPU32, tb + 64 >> 2, 0); + PThread.runExitHandlers(); + _emscripten_futex_wake(tb + 0, 2147483647); + __register_pthread_ptr(0, 0, 0); + threadInfoStruct = 0; + if (ENVIRONMENT_IS_PTHREAD) { + postMessage({ + "cmd": "exit" + }) + } + } + }, + threadCancel: function () { + PThread.runExitHandlers(); + Atomics.store(HEAPU32, threadInfoStruct + 4 >> 2, -1); + Atomics.store(HEAPU32, threadInfoStruct + 0 >> 2, 1); + _emscripten_futex_wake(threadInfoStruct + 0, 2147483647); + threadInfoStruct = selfThreadId = 0; + __register_pthread_ptr(0, 0, 0); + postMessage({ + "cmd": "cancelDone" + }) + }, + terminateAllThreads: function () { + for (var t in PThread.pthreads) { + var pthread = PThread.pthreads[t]; + if (pthread && pthread.worker) { + PThread.returnWorkerToPool(pthread.worker) + } + } + PThread.pthreads = {}; + for (var i = 0; i < PThread.unusedWorkers.length; ++i) { + var worker = PThread.unusedWorkers[i]; + assert(!worker.pthread); + worker.terminate() + } + PThread.unusedWorkers = []; + for (var i = 0; i < PThread.runningWorkers.length; ++i) { + var worker = PThread.runningWorkers[i]; + var pthread = worker.pthread; + assert(pthread, "This Worker should have a pthread it is executing"); + PThread.freeThreadData(pthread); + worker.terminate() + } + PThread.runningWorkers = [] + }, + freeThreadData: function (pthread) { + if (!pthread) return; + if (pthread.threadInfoStruct) { + var tlsMemory = HEAP32[pthread.threadInfoStruct + 104 >> 2]; + HEAP32[pthread.threadInfoStruct + 104 >> 2] = 0; + _free(tlsMemory); + _free(pthread.threadInfoStruct) + } + pthread.threadInfoStruct = 0; + if (pthread.allocatedOwnStack && pthread.stackBase) _free(pthread.stackBase); + pthread.stackBase = 0; + if (pthread.worker) pthread.worker.pthread = null + }, + returnWorkerToPool: function (worker) { + delete PThread.pthreads[worker.pthread.thread]; + PThread.unusedWorkers.push(worker); + PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker), 1); + PThread.freeThreadData(worker.pthread); + worker.pthread = undefined + }, + receiveObjectTransfer: function (data) {}, + loadWasmModuleToWorker: function (worker, onFinishedLoading) { + worker.onmessage = function (e) { + var d = e["data"]; + var cmd = d["cmd"]; + if (worker.pthread) PThread.currentProxiedOperationCallerThread = worker.pthread.threadInfoStruct; + if (d["targetThread"] && d["targetThread"] != _pthread_self()) { + var thread = PThread.pthreads[d.targetThread]; + if (thread) { + thread.worker.postMessage(e.data, d["transferList"]) + } else { + console.error('Internal error! Worker sent a message "' + cmd + '" to target pthread ' + d["targetThread"] + ", but that thread no longer exists!") + } + PThread.currentProxiedOperationCallerThread = undefined; + return + } + if (cmd === "processQueuedMainThreadWork") { + _emscripten_main_thread_process_queued_calls() + } else if (cmd === "spawnThread") { + __spawn_thread(e.data) + } else if (cmd === "cleanupThread") { + __cleanup_thread(d["thread"]) + } else if (cmd === "killThread") { + __kill_thread(d["thread"]) + } else if (cmd === "cancelThread") { + __cancel_thread(d["thread"]) + } else if (cmd === "loaded") { + worker.loaded = true; + if (onFinishedLoading) onFinishedLoading(worker); + if (worker.runPthread) { + worker.runPthread(); + delete worker.runPthread + } + } else if (cmd === "print") { + out("Thread " + d["threadId"] + ": " + d["text"]) + } else if (cmd === "printErr") { + err("Thread " + d["threadId"] + ": " + d["text"]) + } else if (cmd === "alert") { + alert("Thread " + d["threadId"] + ": " + d["text"]) + } else if (cmd === "exit") { + var detached = worker.pthread && Atomics.load(HEAPU32, worker.pthread.thread + 68 >> 2); + if (detached) { + PThread.returnWorkerToPool(worker) + } + } else if (cmd === "cancelDone") { + PThread.returnWorkerToPool(worker) + } else if (cmd === "objectTransfer") { + PThread.receiveObjectTransfer(e.data) + } else if (e.data.target === "setimmediate") { + worker.postMessage(e.data) + } else { + err("worker sent an unknown command " + cmd) + } + PThread.currentProxiedOperationCallerThread = undefined + }; + worker.onerror = function (e) { + err("pthread sent an error! " + e.filename + ":" + e.lineno + ": " + e.message) + }; + if (ENVIRONMENT_IS_NODE) { + worker.on("message", function (data) { + worker.onmessage({ + data: data + }) + }); + worker.on("error", function (data) { + worker.onerror(data) + }); + worker.on("exit", function (data) { + console.log("worker exited - TODO: update the worker queue?") + }) + } + assert(wasmMemory instanceof WebAssembly.Memory, "WebAssembly memory should have been loaded by now!"); + assert(wasmModule instanceof WebAssembly.Module, "WebAssembly Module should have been loaded by now!"); + worker.postMessage({ + "cmd": "load", + "urlOrBlob": Module["mainScriptUrlOrBlob"] || _scriptDir, + "wasmMemory": wasmMemory, + "wasmModule": wasmModule, + "DYNAMIC_BASE": DYNAMIC_BASE, + "DYNAMICTOP_PTR": DYNAMICTOP_PTR + }) + }, + allocateUnusedWorker: function () { + var pthreadMainJs = locateFile("tfjs-backend-wasm.worker.js"); + PThread.unusedWorkers.push(new Worker(pthreadMainJs)) + }, + getNewWorker: function () { + if (PThread.unusedWorkers.length == 0) { + PThread.allocateUnusedWorker(); + PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0]) + } + if (PThread.unusedWorkers.length > 0) return PThread.unusedWorkers.pop(); + else return null + }, + busySpinWait: function (msecs) { + var t = performance.now() + msecs; + while (performance.now() < t) {} + } + }; + + function establishStackSpace(stackTop, stackMax) { + STACK_BASE = STACKTOP = stackTop; + STACK_MAX = stackMax; + ___set_stack_limit(STACK_MAX); + writeStackCookie(); + stackRestore(stackTop) + } + Module["establishStackSpace"] = establishStackSpace; + + function getNoExitRuntime() { + return noExitRuntime + } + Module["getNoExitRuntime"] = getNoExitRuntime; + + function jsStackTrace() { + var err = new Error; + if (!err.stack) { + try { + throw new Error + } catch (e) { + err = e + } + if (!err.stack) { + return "(no stack trace available)" + } + } + return err.stack.toString() + } + + function stackTrace() { + var js = jsStackTrace(); + if (Module["extraStackTrace"]) js += "\n" + Module["extraStackTrace"](); + return demangleAll(js) + } + + function ___assert_fail(condition, filename, line, func) { + abort("Assertion failed: " + UTF8ToString(condition) + ", at: " + [filename ? UTF8ToString(filename) : "unknown filename", line, func ? UTF8ToString(func) : "unknown function"]) + } + var _emscripten_get_now; + if (ENVIRONMENT_IS_NODE) { + _emscripten_get_now = function () { + var t = process["hrtime"](); + return t[0] * 1e3 + t[1] / 1e6 + } + } else if (ENVIRONMENT_IS_PTHREAD) { + _emscripten_get_now = function () { + return performance.now() - Module["__performance_now_clock_drift"] + } + } else if (typeof dateNow !== "undefined") { + _emscripten_get_now = dateNow + } else _emscripten_get_now = function () { + return performance.now() + }; + + function setErrNo(value) { + HEAP32[___errno_location() >> 2] = value; + return value + } + + function _atexit(func, arg) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(1, 1, func, arg); + warnOnce("atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)"); + __ATEXIT__.unshift({ + func: func, + arg: arg + }) + } + + function ___handle_stack_overflow() { + abort("stack overflow") + } + + function __emscripten_notify_thread_queue(targetThreadId, mainThreadId) { + if (targetThreadId == mainThreadId) { + postMessage({ + "cmd": "processQueuedMainThreadWork" + }) + } else if (ENVIRONMENT_IS_PTHREAD) { + postMessage({ + "targetThread": targetThreadId, + "cmd": "processThreadQueue" + }) + } else { + var pthread = PThread.pthreads[targetThreadId]; + var worker = pthread && pthread.worker; + if (!worker) { + err("Cannot send message to thread with ID " + targetThreadId + ", unknown thread ID!"); + return + } + worker.postMessage({ + "cmd": "processThreadQueue" + }) + } + return 1 + } + + function _abort() { + abort() + } + + function _emscripten_conditional_set_current_thread_status(expectedStatus, newStatus) { + expectedStatus = expectedStatus | 0; + newStatus = newStatus | 0 + } + + function _emscripten_futex_wait(addr, val, timeout) { + if (addr <= 0 || addr > HEAP8.length || addr & 3 != 0) return -28; + if (ENVIRONMENT_IS_WORKER) { + var ret = Atomics.wait(HEAP32, addr >> 2, val, timeout); + if (ret === "timed-out") return -73; + if (ret === "not-equal") return -6; + if (ret === "ok") return 0; + throw "Atomics.wait returned an unexpected value " + ret + } else { + var loadedVal = Atomics.load(HEAP32, addr >> 2); + if (val != loadedVal) return -6; + var tNow = performance.now(); + var tEnd = tNow + timeout; + Atomics.store(HEAP32, __main_thread_futex_wait_address >> 2, addr); + var ourWaitAddress = addr; + while (addr == ourWaitAddress) { + tNow = performance.now(); + if (tNow > tEnd) { + return -73 + } + _emscripten_main_thread_process_queued_calls(); + addr = Atomics.load(HEAP32, __main_thread_futex_wait_address >> 2) + } + return 0 + } + } + + function _emscripten_is_main_browser_thread() { + return __pthread_is_main_browser_thread | 0 + } + + function _emscripten_is_main_runtime_thread() { + return __pthread_is_main_runtime_thread | 0 + } + + function _emscripten_memcpy_big(dest, src, num) { + HEAPU8.copyWithin(dest, src, src + num) + } + + function _emscripten_proxy_to_main_thread_js(index, sync) { + var numCallArgs = arguments.length - 2; + if (numCallArgs > 20 - 1) throw "emscripten_proxy_to_main_thread_js: Too many arguments " + numCallArgs + " to proxied function idx=" + index + ", maximum supported is " + (20 - 1) + "!"; + var stack = stackSave(); + var args = stackAlloc(numCallArgs * 8); + var b = args >> 3; + for (var i = 0; i < numCallArgs; i++) { + HEAPF64[b + i] = arguments[2 + i] + } + var ret = _emscripten_run_in_main_runtime_thread_js(index, numCallArgs, args, sync); + stackRestore(stack); + return ret + } + var _emscripten_receive_on_main_thread_js_callArgs = []; + + function readAsmConstArgs(sigPtr, buf) { + if (!readAsmConstArgs.array) { + readAsmConstArgs.array = [] + } + var args = readAsmConstArgs.array; + args.length = 0; + var ch; + while (ch = HEAPU8[sigPtr++]) { + if (ch === 100 || ch === 102) { + buf = buf + 7 & ~7; + args.push(HEAPF64[buf >> 3]); + buf += 8 + } else if (ch === 105) { + buf = buf + 3 & ~3; + args.push(HEAP32[buf >> 2]); + buf += 4 + } else abort("unexpected char in asm const signature " + ch) + } + return args + } + + function _emscripten_receive_on_main_thread_js(index, numCallArgs, args) { + _emscripten_receive_on_main_thread_js_callArgs.length = numCallArgs; + var b = args >> 3; + for (var i = 0; i < numCallArgs; i++) { + _emscripten_receive_on_main_thread_js_callArgs[i] = HEAPF64[b + i] + } + var isEmAsmConst = index < 0; + var func = !isEmAsmConst ? proxiedFunctionTable[index] : ASM_CONSTS[-index - 1]; + if (isEmAsmConst) { + var sigPtr = _emscripten_receive_on_main_thread_js_callArgs[1]; + var varargPtr = _emscripten_receive_on_main_thread_js_callArgs[2]; + var constArgs = readAsmConstArgs(sigPtr, varargPtr); + return func.apply(null, constArgs) + } + assert(func.length == numCallArgs, "Call args mismatch in emscripten_receive_on_main_thread_js"); + return func.apply(null, _emscripten_receive_on_main_thread_js_callArgs) + } + + function abortOnCannotGrowMemory(requestedSize) { + abort("Cannot enlarge memory arrays to size " + requestedSize + " bytes (OOM). Either (1) compile with -s INITIAL_MEMORY=X with X higher than the current value " + HEAP8.length + ", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ") + } + + function _emscripten_resize_heap(requestedSize) { + abortOnCannotGrowMemory(requestedSize) + } + var JSEvents = { + keyEvent: 0, + mouseEvent: 0, + wheelEvent: 0, + uiEvent: 0, + focusEvent: 0, + deviceOrientationEvent: 0, + deviceMotionEvent: 0, + fullscreenChangeEvent: 0, + pointerlockChangeEvent: 0, + visibilityChangeEvent: 0, + touchEvent: 0, + previousFullscreenElement: null, + previousScreenX: null, + previousScreenY: null, + removeEventListenersRegistered: false, + removeAllEventListeners: function () { + for (var i = JSEvents.eventHandlers.length - 1; i >= 0; --i) { + JSEvents._removeHandler(i) + } + JSEvents.eventHandlers = []; + JSEvents.deferredCalls = [] + }, + registerRemoveEventListeners: function () { + if (!JSEvents.removeEventListenersRegistered) { + __ATEXIT__.push(JSEvents.removeAllEventListeners); + JSEvents.removeEventListenersRegistered = true + } + }, + deferredCalls: [], + deferCall: function (targetFunction, precedence, argsList) { + function arraysHaveEqualContent(arrA, arrB) { + if (arrA.length != arrB.length) return false; + for (var i in arrA) { + if (arrA[i] != arrB[i]) return false + } + return true + } + for (var i in JSEvents.deferredCalls) { + var call = JSEvents.deferredCalls[i]; + if (call.targetFunction == targetFunction && arraysHaveEqualContent(call.argsList, argsList)) { + return + } + } + JSEvents.deferredCalls.push({ + targetFunction: targetFunction, + precedence: precedence, + argsList: argsList + }); + JSEvents.deferredCalls.sort(function (x, y) { + return x.precedence < y.precedence + }) + }, + removeDeferredCalls: function (targetFunction) { + for (var i = 0; i < JSEvents.deferredCalls.length; ++i) { + if (JSEvents.deferredCalls[i].targetFunction == targetFunction) { + JSEvents.deferredCalls.splice(i, 1); + --i + } + } + }, + canPerformEventHandlerRequests: function () { + return JSEvents.inEventHandler && JSEvents.currentEventHandler.allowsDeferredCalls + }, + runDeferredCalls: function () { + if (!JSEvents.canPerformEventHandlerRequests()) { + return + } + for (var i = 0; i < JSEvents.deferredCalls.length; ++i) { + var call = JSEvents.deferredCalls[i]; + JSEvents.deferredCalls.splice(i, 1); + --i; + call.targetFunction.apply(null, call.argsList) + } + }, + inEventHandler: 0, + currentEventHandler: null, + eventHandlers: [], + removeAllHandlersOnTarget: function (target, eventTypeString) { + for (var i = 0; i < JSEvents.eventHandlers.length; ++i) { + if (JSEvents.eventHandlers[i].target == target && (!eventTypeString || eventTypeString == JSEvents.eventHandlers[i].eventTypeString)) { + JSEvents._removeHandler(i--) + } + } + }, + _removeHandler: function (i) { + var h = JSEvents.eventHandlers[i]; + h.target.removeEventListener(h.eventTypeString, h.eventListenerFunc, h.useCapture); + JSEvents.eventHandlers.splice(i, 1) + }, + registerOrRemoveHandler: function (eventHandler) { + var jsEventHandler = function jsEventHandler(event) { + ++JSEvents.inEventHandler; + JSEvents.currentEventHandler = eventHandler; + JSEvents.runDeferredCalls(); + eventHandler.handlerFunc(event); + JSEvents.runDeferredCalls(); + --JSEvents.inEventHandler + }; + if (eventHandler.callbackfunc) { + eventHandler.eventListenerFunc = jsEventHandler; + eventHandler.target.addEventListener(eventHandler.eventTypeString, jsEventHandler, eventHandler.useCapture); + JSEvents.eventHandlers.push(eventHandler); + JSEvents.registerRemoveEventListeners() + } else { + for (var i = 0; i < JSEvents.eventHandlers.length; ++i) { + if (JSEvents.eventHandlers[i].target == eventHandler.target && JSEvents.eventHandlers[i].eventTypeString == eventHandler.eventTypeString) { + JSEvents._removeHandler(i--) + } + } + } + }, + queueEventHandlerOnThread_iiii: function (targetThread, eventHandlerFunc, eventTypeId, eventData, userData) { + var stackTop = stackSave(); + var varargs = stackAlloc(12); + HEAP32[varargs >> 2] = eventTypeId; + HEAP32[varargs + 4 >> 2] = eventData; + HEAP32[varargs + 8 >> 2] = userData; + _emscripten_async_queue_on_thread_(targetThread, 637534208, eventHandlerFunc, eventData, varargs); + stackRestore(stackTop) + }, + getTargetThreadForEventCallback: function (targetThread) { + switch (targetThread) { + case 1: + return 0; + case 2: + return PThread.currentProxiedOperationCallerThread; + default: + return targetThread + } + }, + getNodeNameForTarget: function (target) { + if (!target) return ""; + if (target == window) return "#window"; + if (target == screen) return "#screen"; + return target && target.nodeName ? target.nodeName : "" + }, + fullscreenEnabled: function () { + return document.fullscreenEnabled || document.webkitFullscreenEnabled + } + }; + + function stringToNewUTF8(jsString) { + var length = lengthBytesUTF8(jsString) + 1; + var cString = _malloc(length); + stringToUTF8(jsString, cString, length); + return cString + } + + function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread, targetCanvas, width, height) { + var stackTop = stackSave(); + var varargs = stackAlloc(12); + var targetCanvasPtr = 0; + if (targetCanvas) { + targetCanvasPtr = stringToNewUTF8(targetCanvas) + } + HEAP32[varargs >> 2] = targetCanvasPtr; + HEAP32[varargs + 4 >> 2] = width; + HEAP32[varargs + 8 >> 2] = height; + _emscripten_async_queue_on_thread_(targetThread, 657457152, 0, targetCanvasPtr, varargs); + stackRestore(stackTop) + } + + function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread, targetCanvas, width, height) { + targetCanvas = targetCanvas ? UTF8ToString(targetCanvas) : ""; + _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread, targetCanvas, width, height) + } + + function __maybeCStringToJsString(cString) { + return cString === cString + 0 ? UTF8ToString(cString) : cString + } + var __specialEventTargets = [0, typeof document !== "undefined" ? document : 0, typeof window !== "undefined" ? window : 0]; + + function __findEventTarget(target) { + var domElement = __specialEventTargets[target] || (typeof document !== "undefined" ? document.querySelector(__maybeCStringToJsString(target)) : undefined); + return domElement + } + + function __findCanvasEventTarget(target) { + return __findEventTarget(target) + } + + function _emscripten_set_canvas_element_size_calling_thread(target, width, height) { + var canvas = __findCanvasEventTarget(target); + if (!canvas) return -4; + if (canvas.canvasSharedPtr) { + HEAP32[canvas.canvasSharedPtr >> 2] = width; + HEAP32[canvas.canvasSharedPtr + 4 >> 2] = height + } + if (canvas.offscreenCanvas || !canvas.controlTransferredOffscreen) { + if (canvas.offscreenCanvas) canvas = canvas.offscreenCanvas; + var autoResizeViewport = false; + if (canvas.GLctxObject && canvas.GLctxObject.GLctx) { + var prevViewport = canvas.GLctxObject.GLctx.getParameter(2978); + autoResizeViewport = prevViewport[0] === 0 && prevViewport[1] === 0 && prevViewport[2] === canvas.width && prevViewport[3] === canvas.height + } + canvas.width = width; + canvas.height = height; + if (autoResizeViewport) { + canvas.GLctxObject.GLctx.viewport(0, 0, width, height) + } + } else if (canvas.canvasSharedPtr) { + var targetThread = HEAP32[canvas.canvasSharedPtr + 8 >> 2]; + _emscripten_set_offscreencanvas_size_on_target_thread(targetThread, target, width, height); + return 1 + } else { + return -4 + } + return 0 + } + + function _emscripten_set_canvas_element_size_main_thread(target, width, height) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(2, 1, target, width, height); + return _emscripten_set_canvas_element_size_calling_thread(target, width, height) + } + + function _emscripten_set_canvas_element_size(target, width, height) { + var canvas = __findCanvasEventTarget(target); + if (canvas) { + return _emscripten_set_canvas_element_size_calling_thread(target, width, height) + } else { + return _emscripten_set_canvas_element_size_main_thread(target, width, height) + } + } + + function _emscripten_set_current_thread_status(newStatus) { + newStatus = newStatus | 0 + } + + function __webgl_acquireInstancedArraysExtension(ctx) { + var ext = ctx.getExtension("ANGLE_instanced_arrays"); + if (ext) { + ctx["vertexAttribDivisor"] = function (index, divisor) { + ext["vertexAttribDivisorANGLE"](index, divisor) + }; + ctx["drawArraysInstanced"] = function (mode, first, count, primcount) { + ext["drawArraysInstancedANGLE"](mode, first, count, primcount) + }; + ctx["drawElementsInstanced"] = function (mode, count, type, indices, primcount) { + ext["drawElementsInstancedANGLE"](mode, count, type, indices, primcount) + } + } + } + + function __webgl_acquireVertexArrayObjectExtension(ctx) { + var ext = ctx.getExtension("OES_vertex_array_object"); + if (ext) { + ctx["createVertexArray"] = function () { + return ext["createVertexArrayOES"]() + }; + ctx["deleteVertexArray"] = function (vao) { + ext["deleteVertexArrayOES"](vao) + }; + ctx["bindVertexArray"] = function (vao) { + ext["bindVertexArrayOES"](vao) + }; + ctx["isVertexArray"] = function (vao) { + return ext["isVertexArrayOES"](vao) + } + } + } + + function __webgl_acquireDrawBuffersExtension(ctx) { + var ext = ctx.getExtension("WEBGL_draw_buffers"); + if (ext) { + ctx["drawBuffers"] = function (n, bufs) { + ext["drawBuffersWEBGL"](n, bufs) + } + } + } + var GL = { + counter: 1, + lastError: 0, + buffers: [], + mappedBuffers: {}, + programs: [], + framebuffers: [], + renderbuffers: [], + textures: [], + uniforms: [], + shaders: [], + vaos: [], + contexts: {}, + currentContext: null, + offscreenCanvases: {}, + timerQueriesEXT: [], + programInfos: {}, + stringCache: {}, + unpackAlignment: 4, + init: function () { + var miniTempFloatBuffer = new Float32Array(GL.MINI_TEMP_BUFFER_SIZE); + for (var i = 0; i < GL.MINI_TEMP_BUFFER_SIZE; i++) { + GL.miniTempBufferFloatViews[i] = miniTempFloatBuffer.subarray(0, i + 1) + } + var miniTempIntBuffer = new Int32Array(GL.MINI_TEMP_BUFFER_SIZE); + for (var i = 0; i < GL.MINI_TEMP_BUFFER_SIZE; i++) { + GL.miniTempBufferIntViews[i] = miniTempIntBuffer.subarray(0, i + 1) + } + }, + recordError: function recordError(errorCode) { + if (!GL.lastError) { + GL.lastError = errorCode + } + }, + getNewId: function (table) { + var ret = GL.counter++; + for (var i = table.length; i < ret; i++) { + table[i] = null + } + return ret + }, + MINI_TEMP_BUFFER_SIZE: 256, + miniTempBufferFloatViews: [0], + miniTempBufferIntViews: [0], + getSource: function (shader, count, string, length) { + var source = ""; + for (var i = 0; i < count; ++i) { + var len = length ? HEAP32[length + i * 4 >> 2] : -1; + source += UTF8ToString(HEAP32[string + i * 4 >> 2], len < 0 ? undefined : len) + } + return source + }, + createContext: function (canvas, webGLContextAttributes) { + var ctx = canvas.getContext("webgl", webGLContextAttributes); + if (!ctx) return 0; + var handle = GL.registerContext(ctx, webGLContextAttributes); + return handle + }, + registerContext: function (ctx, webGLContextAttributes) { + var handle = _malloc(8); + HEAP32[handle + 4 >> 2] = _pthread_self(); + var context = { + handle: handle, + attributes: webGLContextAttributes, + version: webGLContextAttributes.majorVersion, + GLctx: ctx + }; + if (ctx.canvas) ctx.canvas.GLctxObject = context; + GL.contexts[handle] = context; + if (typeof webGLContextAttributes.enableExtensionsByDefault === "undefined" || webGLContextAttributes.enableExtensionsByDefault) { + GL.initExtensions(context) + } + return handle + }, + makeContextCurrent: function (contextHandle) { + GL.currentContext = GL.contexts[contextHandle]; + Module.ctx = GLctx = GL.currentContext && GL.currentContext.GLctx; + return !(contextHandle && !GLctx) + }, + getContext: function (contextHandle) { + return GL.contexts[contextHandle] + }, + deleteContext: function (contextHandle) { + if (GL.currentContext === GL.contexts[contextHandle]) GL.currentContext = null; + if (typeof JSEvents === "object") JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas); + if (GL.contexts[contextHandle] && GL.contexts[contextHandle].GLctx.canvas) GL.contexts[contextHandle].GLctx.canvas.GLctxObject = undefined; + _free(GL.contexts[contextHandle].handle); + GL.contexts[contextHandle] = null + }, + initExtensions: function (context) { + if (!context) context = GL.currentContext; + if (context.initExtensionsDone) return; + context.initExtensionsDone = true; + var GLctx = context.GLctx; + if (context.version < 2) { + __webgl_acquireInstancedArraysExtension(GLctx); + __webgl_acquireVertexArrayObjectExtension(GLctx); + __webgl_acquireDrawBuffersExtension(GLctx) + } + GLctx.disjointTimerQueryExt = GLctx.getExtension("EXT_disjoint_timer_query"); + var automaticallyEnabledExtensions = ["OES_texture_float", "OES_texture_half_float", "OES_standard_derivatives", "OES_vertex_array_object", "WEBGL_compressed_texture_s3tc", "WEBGL_depth_texture", "OES_element_index_uint", "EXT_texture_filter_anisotropic", "EXT_frag_depth", "WEBGL_draw_buffers", "ANGLE_instanced_arrays", "OES_texture_float_linear", "OES_texture_half_float_linear", "EXT_blend_minmax", "EXT_shader_texture_lod", "EXT_texture_norm16", "WEBGL_compressed_texture_pvrtc", "EXT_color_buffer_half_float", "WEBGL_color_buffer_float", "EXT_sRGB", "WEBGL_compressed_texture_etc1", "EXT_disjoint_timer_query", "WEBGL_compressed_texture_etc", "WEBGL_compressed_texture_astc", "EXT_color_buffer_float", "WEBGL_compressed_texture_s3tc_srgb", "EXT_disjoint_timer_query_webgl2", "WEBKIT_WEBGL_compressed_texture_pvrtc"]; + var exts = GLctx.getSupportedExtensions() || []; + exts.forEach(function (ext) { + if (automaticallyEnabledExtensions.indexOf(ext) != -1) { + GLctx.getExtension(ext) + } + }) + }, + populateUniformTable: function (program) { + var p = GL.programs[program]; + var ptable = GL.programInfos[program] = { + uniforms: {}, + maxUniformLength: 0, + maxAttributeLength: -1, + maxUniformBlockNameLength: -1 + }; + var utable = ptable.uniforms; + var numUniforms = GLctx.getProgramParameter(p, 35718); + for (var i = 0; i < numUniforms; ++i) { + var u = GLctx.getActiveUniform(p, i); + var name = u.name; + ptable.maxUniformLength = Math.max(ptable.maxUniformLength, name.length + 1); + if (name.slice(-1) == "]") { + name = name.slice(0, name.lastIndexOf("[")) + } + var loc = GLctx.getUniformLocation(p, name); + if (loc) { + var id = GL.getNewId(GL.uniforms); + utable[name] = [u.size, id]; + GL.uniforms[id] = loc; + for (var j = 1; j < u.size; ++j) { + var n = name + "[" + j + "]"; + loc = GLctx.getUniformLocation(p, n); + id = GL.getNewId(GL.uniforms); + GL.uniforms[id] = loc + } + } + } + } + }; + var __emscripten_webgl_power_preferences = ["default", "low-power", "high-performance"]; + + function _emscripten_webgl_do_create_context(target, attributes) { + assert(attributes); + var contextAttributes = {}; + var a = attributes >> 2; + contextAttributes["alpha"] = !!HEAP32[a + (0 >> 2)]; + contextAttributes["depth"] = !!HEAP32[a + (4 >> 2)]; + contextAttributes["stencil"] = !!HEAP32[a + (8 >> 2)]; + contextAttributes["antialias"] = !!HEAP32[a + (12 >> 2)]; + contextAttributes["premultipliedAlpha"] = !!HEAP32[a + (16 >> 2)]; + contextAttributes["preserveDrawingBuffer"] = !!HEAP32[a + (20 >> 2)]; + var powerPreference = HEAP32[a + (24 >> 2)]; + contextAttributes["powerPreference"] = __emscripten_webgl_power_preferences[powerPreference]; + contextAttributes["failIfMajorPerformanceCaveat"] = !!HEAP32[a + (28 >> 2)]; + contextAttributes.majorVersion = HEAP32[a + (32 >> 2)]; + contextAttributes.minorVersion = HEAP32[a + (36 >> 2)]; + contextAttributes.enableExtensionsByDefault = HEAP32[a + (40 >> 2)]; + contextAttributes.explicitSwapControl = HEAP32[a + (44 >> 2)]; + contextAttributes.proxyContextToMainThread = HEAP32[a + (48 >> 2)]; + contextAttributes.renderViaOffscreenBackBuffer = HEAP32[a + (52 >> 2)]; + var canvas = __findCanvasEventTarget(target); + if (!canvas) { + return 0 + } + if (contextAttributes.explicitSwapControl) { + return 0 + } + var contextHandle = GL.createContext(canvas, contextAttributes); + return contextHandle + } + + function _emscripten_webgl_create_context(a0, a1) { + return _emscripten_webgl_do_create_context(a0, a1) + } + var PATH = { + splitPath: function (filename) { + var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; + return splitPathRe.exec(filename).slice(1) + }, + normalizeArray: function (parts, allowAboveRoot) { + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === ".") { + parts.splice(i, 1) + } else if (last === "..") { + parts.splice(i, 1); + up++ + } else if (up) { + parts.splice(i, 1); + up-- + } + } + if (allowAboveRoot) { + for (; up; up--) { + parts.unshift("..") + } + } + return parts + }, + normalize: function (path) { + var isAbsolute = path.charAt(0) === "/", + trailingSlash = path.substr(-1) === "/"; + path = PATH.normalizeArray(path.split("/").filter(function (p) { + return !!p + }), !isAbsolute).join("/"); + if (!path && !isAbsolute) { + path = "." + } + if (path && trailingSlash) { + path += "/" + } + return (isAbsolute ? "/" : "") + path + }, + dirname: function (path) { + var result = PATH.splitPath(path), + root = result[0], + dir = result[1]; + if (!root && !dir) { + return "." + } + if (dir) { + dir = dir.substr(0, dir.length - 1) + } + return root + dir + }, + basename: function (path) { + if (path === "/") return "/"; + var lastSlash = path.lastIndexOf("/"); + if (lastSlash === -1) return path; + return path.substr(lastSlash + 1) + }, + extname: function (path) { + return PATH.splitPath(path)[3] + }, + join: function () { + var paths = Array.prototype.slice.call(arguments, 0); + return PATH.normalize(paths.join("/")) + }, + join2: function (l, r) { + return PATH.normalize(l + "/" + r) + } + }; + var SYSCALLS = { + mappings: {}, + buffers: [null, [], + [] + ], + printChar: function (stream, curr) { + var buffer = SYSCALLS.buffers[stream]; + assert(buffer); + if (curr === 0 || curr === 10) { + (stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0)); + buffer.length = 0 + } else { + buffer.push(curr) + } + }, + varargs: undefined, + get: function () { + assert(SYSCALLS.varargs != undefined); + SYSCALLS.varargs += 4; + var ret = HEAP32[SYSCALLS.varargs - 4 >> 2]; + return ret + }, + getStr: function (ptr) { + var ret = UTF8ToString(ptr); + return ret + }, + get64: function (low, high) { + if (low >= 0) assert(high === 0); + else assert(high === -1); + return low + } + }; + + function _fd_close(fd) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(3, 1, fd); + abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM"); + return 0 + } + + function _fd_seek(fd, offset_low, offset_high, whence, newOffset) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(4, 1, fd, offset_low, offset_high, whence, newOffset); + abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM") + } + + function _fd_write(fd, iov, iovcnt, pnum) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(5, 1, fd, iov, iovcnt, pnum); + var num = 0; + for (var i = 0; i < iovcnt; i++) { + var ptr = HEAP32[iov + i * 8 >> 2]; + var len = HEAP32[iov + (i * 8 + 4) >> 2]; + for (var j = 0; j < len; j++) { + SYSCALLS.printChar(fd, HEAPU8[ptr + j]) + } + num += len + } + HEAP32[pnum >> 2] = num; + return 0 + } + + function _pthread_cleanup_pop(execute) { + var routine = PThread.exitHandlers.pop(); + if (execute) routine() + } + + function _pthread_cleanup_push(routine, arg) { + if (PThread.exitHandlers === null) { + PThread.exitHandlers = [] + } + PThread.exitHandlers.push(function () { + dynCall_vi(routine, arg) + }) + } + + function __spawn_thread(threadParams) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _spawn_thread() can only ever be called from main application thread!"; + var worker = PThread.getNewWorker(); + if (worker.pthread !== undefined) throw "Internal error!"; + if (!threadParams.pthread_ptr) throw "Internal error, no pthread ptr!"; + PThread.runningWorkers.push(worker); + var tlsMemory = _malloc(128 * 4); + for (var i = 0; i < 128; ++i) { + HEAP32[tlsMemory + i * 4 >> 2] = 0 + } + var stackHigh = threadParams.stackBase + threadParams.stackSize; + var pthread = PThread.pthreads[threadParams.pthread_ptr] = { + worker: worker, + stackBase: threadParams.stackBase, + stackSize: threadParams.stackSize, + allocatedOwnStack: threadParams.allocatedOwnStack, + thread: threadParams.pthread_ptr, + threadInfoStruct: threadParams.pthread_ptr + }; + var tis = pthread.threadInfoStruct >> 2; + Atomics.store(HEAPU32, tis + (0 >> 2), 0); + Atomics.store(HEAPU32, tis + (4 >> 2), 0); + Atomics.store(HEAPU32, tis + (8 >> 2), 0); + Atomics.store(HEAPU32, tis + (68 >> 2), threadParams.detached); + Atomics.store(HEAPU32, tis + (104 >> 2), tlsMemory); + Atomics.store(HEAPU32, tis + (48 >> 2), 0); + Atomics.store(HEAPU32, tis + (40 >> 2), pthread.threadInfoStruct); + Atomics.store(HEAPU32, tis + (44 >> 2), 42); + Atomics.store(HEAPU32, tis + (108 >> 2), threadParams.stackSize); + Atomics.store(HEAPU32, tis + (84 >> 2), threadParams.stackSize); + Atomics.store(HEAPU32, tis + (80 >> 2), stackHigh); + Atomics.store(HEAPU32, tis + (108 + 8 >> 2), stackHigh); + Atomics.store(HEAPU32, tis + (108 + 12 >> 2), threadParams.detached); + Atomics.store(HEAPU32, tis + (108 + 20 >> 2), threadParams.schedPolicy); + Atomics.store(HEAPU32, tis + (108 + 24 >> 2), threadParams.schedPrio); + var global_libc = _emscripten_get_global_libc(); + var global_locale = global_libc + 40; + Atomics.store(HEAPU32, tis + (176 >> 2), global_locale); + worker.pthread = pthread; + var msg = { + "cmd": "run", + "start_routine": threadParams.startRoutine, + "arg": threadParams.arg, + "threadInfoStruct": threadParams.pthread_ptr, + "selfThreadId": threadParams.pthread_ptr, + "parentThreadId": threadParams.parent_pthread_ptr, + "stackBase": threadParams.stackBase, + "stackSize": threadParams.stackSize + }; + worker.runPthread = function () { + msg.time = performance.now(); + worker.postMessage(msg, threadParams.transferList) + }; + if (worker.loaded) { + worker.runPthread(); + delete worker.runPthread + } + } + + function _pthread_getschedparam(thread, policy, schedparam) { + if (!policy && !schedparam) return ERRNO_CODES.EINVAL; + if (!thread) { + err("pthread_getschedparam called with a null thread pointer!"); + return ERRNO_CODES.ESRCH + } + var self = HEAP32[thread + 12 >> 2]; + if (self !== thread) { + err("pthread_getschedparam attempted on thread " + thread + ", which does not point to a valid thread, or does not exist anymore!"); + return ERRNO_CODES.ESRCH + } + var schedPolicy = Atomics.load(HEAPU32, thread + 108 + 20 >> 2); + var schedPrio = Atomics.load(HEAPU32, thread + 108 + 24 >> 2); + if (policy) HEAP32[policy >> 2] = schedPolicy; + if (schedparam) HEAP32[schedparam >> 2] = schedPrio; + return 0 + } + + function _pthread_self() { + return __pthread_ptr | 0 + } + Module["_pthread_self"] = _pthread_self; + + function _pthread_create(pthread_ptr, attr, start_routine, arg) { + if (typeof SharedArrayBuffer === "undefined") { + err("Current environment does not support SharedArrayBuffer, pthreads are not available!"); + return 6 + } + if (!pthread_ptr) { + err("pthread_create called with a null thread pointer!"); + return 28 + } + var transferList = []; + var error = 0; + if (ENVIRONMENT_IS_PTHREAD && (transferList.length === 0 || error)) { + return _emscripten_sync_run_in_main_thread_4(687865856, pthread_ptr, attr, start_routine, arg) + } + if (error) return error; + var stackSize = 0; + var stackBase = 0; + var detached = 0; + var schedPolicy = 0; + var schedPrio = 0; + if (attr) { + stackSize = HEAP32[attr >> 2]; + stackSize += 81920; + stackBase = HEAP32[attr + 8 >> 2]; + detached = HEAP32[attr + 12 >> 2] !== 0; + var inheritSched = HEAP32[attr + 16 >> 2] === 0; + if (inheritSched) { + var prevSchedPolicy = HEAP32[attr + 20 >> 2]; + var prevSchedPrio = HEAP32[attr + 24 >> 2]; + var parentThreadPtr = PThread.currentProxiedOperationCallerThread ? PThread.currentProxiedOperationCallerThread : _pthread_self(); + _pthread_getschedparam(parentThreadPtr, attr + 20, attr + 24); + schedPolicy = HEAP32[attr + 20 >> 2]; + schedPrio = HEAP32[attr + 24 >> 2]; + HEAP32[attr + 20 >> 2] = prevSchedPolicy; + HEAP32[attr + 24 >> 2] = prevSchedPrio + } else { + schedPolicy = HEAP32[attr + 20 >> 2]; + schedPrio = HEAP32[attr + 24 >> 2] + } + } else { + stackSize = 2097152 + } + var allocatedOwnStack = stackBase == 0; + if (allocatedOwnStack) { + stackBase = _memalign(16, stackSize) + } else { + stackBase -= stackSize; + assert(stackBase > 0) + } + var threadInfoStruct = _malloc(232); + for (var i = 0; i < 232 >> 2; ++i) HEAPU32[(threadInfoStruct >> 2) + i] = 0; + HEAP32[pthread_ptr >> 2] = threadInfoStruct; + HEAP32[threadInfoStruct + 12 >> 2] = threadInfoStruct; + var headPtr = threadInfoStruct + 156; + HEAP32[headPtr >> 2] = headPtr; + var threadParams = { + stackBase: stackBase, + stackSize: stackSize, + allocatedOwnStack: allocatedOwnStack, + schedPolicy: schedPolicy, + schedPrio: schedPrio, + detached: detached, + startRoutine: start_routine, + pthread_ptr: threadInfoStruct, + parent_pthread_ptr: _pthread_self(), + arg: arg, + transferList: transferList + }; + if (ENVIRONMENT_IS_PTHREAD) { + threadParams.cmd = "spawnThread"; + postMessage(threadParams, transferList) + } else { + __spawn_thread(threadParams) + } + return 0 + } + + function _roundf(d) { + d = +d; + return d >= +0 ? +Math_floor(d + +.5) : +Math_ceil(d - +.5) + } + + function _sysconf(name) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(6, 1, name); + switch (name) { + case 30: + return 16384; + case 85: + var maxHeapSize = HEAPU8.length; + return maxHeapSize / 16384; + case 132: + case 133: + case 12: + case 137: + case 138: + case 15: + case 235: + case 16: + case 17: + case 18: + case 19: + case 20: + case 149: + case 13: + case 10: + case 236: + case 153: + case 9: + case 21: + case 22: + case 159: + case 154: + case 14: + case 77: + case 78: + case 139: + case 80: + case 81: + case 82: + case 68: + case 67: + case 164: + case 11: + case 29: + case 47: + case 48: + case 95: + case 52: + case 51: + case 46: + case 79: + return 200809; + case 27: + case 246: + case 127: + case 128: + case 23: + case 24: + case 160: + case 161: + case 181: + case 182: + case 242: + case 183: + case 184: + case 243: + case 244: + case 245: + case 165: + case 178: + case 179: + case 49: + case 50: + case 168: + case 169: + case 175: + case 170: + case 171: + case 172: + case 97: + case 76: + case 32: + case 173: + case 35: + return -1; + case 176: + case 177: + case 7: + case 155: + case 8: + case 157: + case 125: + case 126: + case 92: + case 93: + case 129: + case 130: + case 131: + case 94: + case 91: + return 1; + case 74: + case 60: + case 69: + case 70: + case 4: + return 1024; + case 31: + case 42: + case 72: + return 32; + case 87: + case 26: + case 33: + return 2147483647; + case 34: + case 1: + return 47839; + case 38: + case 36: + return 99; + case 43: + case 37: + return 2048; + case 0: + return 2097152; + case 3: + return 65536; + case 28: + return 32768; + case 44: + return 32767; + case 75: + return 16384; + case 39: + return 1e3; + case 89: + return 700; + case 71: + return 256; + case 40: + return 255; + case 2: + return 100; + case 180: + return 64; + case 25: + return 20; + case 5: + return 16; + case 6: + return 6; + case 73: + return 4; + case 84: { + if (typeof navigator === "object") return navigator["hardwareConcurrency"] || 1; + return 1 + } + } + setErrNo(28); + return -1 + } + if (!ENVIRONMENT_IS_PTHREAD) PThread.initMainThreadBlock(); + else PThread.initWorker(); + var GLctx; + GL.init(); + var proxiedFunctionTable = [null, _atexit, _emscripten_set_canvas_element_size_main_thread, _fd_close, _fd_seek, _fd_write, _sysconf]; + var asmLibraryArg = { + "__assert_fail": ___assert_fail, + "__handle_stack_overflow": ___handle_stack_overflow, + "_emscripten_notify_thread_queue": __emscripten_notify_thread_queue, + "abort": _abort, + "emscripten_conditional_set_current_thread_status": _emscripten_conditional_set_current_thread_status, + "emscripten_futex_wait": _emscripten_futex_wait, + "emscripten_futex_wake": _emscripten_futex_wake, + "emscripten_get_now": _emscripten_get_now, + "emscripten_is_main_browser_thread": _emscripten_is_main_browser_thread, + "emscripten_is_main_runtime_thread": _emscripten_is_main_runtime_thread, + "emscripten_memcpy_big": _emscripten_memcpy_big, + "emscripten_receive_on_main_thread_js": _emscripten_receive_on_main_thread_js, + "emscripten_resize_heap": _emscripten_resize_heap, + "emscripten_set_canvas_element_size": _emscripten_set_canvas_element_size, + "emscripten_set_current_thread_status": _emscripten_set_current_thread_status, + "emscripten_webgl_create_context": _emscripten_webgl_create_context, + "fd_close": _fd_close, + "fd_seek": _fd_seek, + "fd_write": _fd_write, + "initPthreadsJS": initPthreadsJS, + "memory": wasmMemory || Module["wasmMemory"], + "pthread_cleanup_pop": _pthread_cleanup_pop, + "pthread_cleanup_push": _pthread_cleanup_push, + "pthread_create": _pthread_create, + "pthread_self": _pthread_self, + "roundf": _roundf, + "sysconf": _sysconf, + "table": wasmTable + }; + var asm = createWasm(); + Module["asm"] = asm; + var ___wasm_call_ctors = Module["___wasm_call_ctors"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__wasm_call_ctors"].apply(null, arguments) + }; + var _init = Module["_init"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["init"].apply(null, arguments) + }; + var _register_tensor = Module["_register_tensor"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["register_tensor"].apply(null, arguments) + }; + var _dispose_data = Module["_dispose_data"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dispose_data"].apply(null, arguments) + }; + var _dispose = Module["_dispose"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dispose"].apply(null, arguments) + }; + var _Abs = Module["_Abs"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Abs"].apply(null, arguments) + }; + var _Add = Module["_Add"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Add"].apply(null, arguments) + }; + var _AddN = Module["_AddN"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["AddN"].apply(null, arguments) + }; + var _ArgMax = Module["_ArgMax"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ArgMax"].apply(null, arguments) + }; + var _AvgPool = Module["_AvgPool"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["AvgPool"].apply(null, arguments) + }; + var _BatchMatMul = Module["_BatchMatMul"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["BatchMatMul"].apply(null, arguments) + }; + var _ClipByValue = Module["_ClipByValue"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ClipByValue"].apply(null, arguments) + }; + var _Conv2D = Module["_Conv2D"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Conv2D"].apply(null, arguments) + }; + var _Cos = Module["_Cos"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Cos"].apply(null, arguments) + }; + var _CropAndResize = Module["_CropAndResize"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["CropAndResize"].apply(null, arguments) + }; + var _DepthwiseConv2dNative = Module["_DepthwiseConv2dNative"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["DepthwiseConv2dNative"].apply(null, arguments) + }; + var _Div = Module["_Div"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Div"].apply(null, arguments) + }; + var _Exp = Module["_Exp"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Exp"].apply(null, arguments) + }; + var _FloorDiv = Module["_FloorDiv"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FloorDiv"].apply(null, arguments) + }; + var _FusedBatchNorm = Module["_FusedBatchNorm"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FusedBatchNorm"].apply(null, arguments) + }; + var _FusedConv2D = Module["_FusedConv2D"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FusedConv2D"].apply(null, arguments) + }; + var _FusedDepthwiseConv2D = Module["_FusedDepthwiseConv2D"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FusedDepthwiseConv2D"].apply(null, arguments) + }; + var _Gather = Module["_Gather"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Gather"].apply(null, arguments) + }; + var _GatherNd = Module["_GatherNd"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["GatherNd"].apply(null, arguments) + }; + var _Greater = Module["_Greater"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Greater"].apply(null, arguments) + }; + var _GreaterEqual = Module["_GreaterEqual"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["GreaterEqual"].apply(null, arguments) + }; + var _Less = Module["_Less"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Less"].apply(null, arguments) + }; + var _LessEqual = Module["_LessEqual"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["LessEqual"].apply(null, arguments) + }; + var _Log = Module["_Log"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Log"].apply(null, arguments) + }; + var _LogicalAnd = Module["_LogicalAnd"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["LogicalAnd"].apply(null, arguments) + }; + var _Max = Module["_Max"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Max"].apply(null, arguments) + }; + var _MaxPool = Module["_MaxPool"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["MaxPool"].apply(null, arguments) + }; + var _Maximum = Module["_Maximum"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Maximum"].apply(null, arguments) + }; + var _Min = Module["_Min"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Min"].apply(null, arguments) + }; + var _Minimum = Module["_Minimum"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Minimum"].apply(null, arguments) + }; + var _Mul = Module["_Mul"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Mul"].apply(null, arguments) + }; + var _Neg = Module["_Neg"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Neg"].apply(null, arguments) + }; + var _NonMaxSuppressionV3 = Module["_NonMaxSuppressionV3"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["NonMaxSuppressionV3"].apply(null, arguments) + }; + var _NonMaxSuppressionV5 = Module["_NonMaxSuppressionV5"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["NonMaxSuppressionV5"].apply(null, arguments) + }; + var _NotEqual = Module["_NotEqual"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["NotEqual"].apply(null, arguments) + }; + var _PadV2 = Module["_PadV2"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["PadV2"].apply(null, arguments) + }; + var _Pow = Module["_Pow"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Pow"].apply(null, arguments) + }; + var _Prelu = Module["_Prelu"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Prelu"].apply(null, arguments) + }; + var _Relu = Module["_Relu"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Relu"].apply(null, arguments) + }; + var _Relu6 = Module["_Relu6"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Relu6"].apply(null, arguments) + }; + var _ResizeBilinear = Module["_ResizeBilinear"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ResizeBilinear"].apply(null, arguments) + }; + var _Rsqrt = Module["_Rsqrt"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Rsqrt"].apply(null, arguments) + }; + var _ScatterNd = Module["_ScatterNd"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ScatterNd"].apply(null, arguments) + }; + var _Sigmoid = Module["_Sigmoid"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sigmoid"].apply(null, arguments) + }; + var _Sin = Module["_Sin"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sin"].apply(null, arguments) + }; + var _Softmax = Module["_Softmax"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Softmax"].apply(null, arguments) + }; + var _Sqrt = Module["_Sqrt"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sqrt"].apply(null, arguments) + }; + var _Square = Module["_Square"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Square"].apply(null, arguments) + }; + var _Sub = Module["_Sub"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sub"].apply(null, arguments) + }; + var _Sum = Module["_Sum"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sum"].apply(null, arguments) + }; + var _Tanh = Module["_Tanh"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Tanh"].apply(null, arguments) + }; + var _Tile = Module["_Tile"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Tile"].apply(null, arguments) + }; + var _Transpose = Module["_Transpose"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Transpose"].apply(null, arguments) + }; + var __FusedMatMul = Module["__FusedMatMul"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["_FusedMatMul"].apply(null, arguments) + }; + var _malloc = Module["_malloc"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["malloc"].apply(null, arguments) + }; + var _free = Module["_free"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["free"].apply(null, arguments) + }; + var ___em_js__initPthreadsJS = Module["___em_js__initPthreadsJS"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__em_js__initPthreadsJS"].apply(null, arguments) + }; + var ___errno_location = Module["___errno_location"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__errno_location"].apply(null, arguments) + }; + var _emscripten_get_global_libc = Module["_emscripten_get_global_libc"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_get_global_libc"].apply(null, arguments) + }; + var _memalign = Module["_memalign"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["memalign"].apply(null, arguments) + }; + var ___pthread_tsd_run_dtors = Module["___pthread_tsd_run_dtors"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__pthread_tsd_run_dtors"].apply(null, arguments) + }; + var _emscripten_main_thread_process_queued_calls = Module["_emscripten_main_thread_process_queued_calls"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null, arguments) + }; + var _emscripten_current_thread_process_queued_calls = Module["_emscripten_current_thread_process_queued_calls"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null, arguments) + }; + var _emscripten_register_main_browser_thread_id = Module["_emscripten_register_main_browser_thread_id"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null, arguments) + }; + var _emscripten_main_browser_thread_id = Module["_emscripten_main_browser_thread_id"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_main_browser_thread_id"].apply(null, arguments) + }; + var _emscripten_async_run_in_main_thread = Module["_emscripten_async_run_in_main_thread"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread = Module["_emscripten_sync_run_in_main_thread"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_0 = Module["_emscripten_sync_run_in_main_thread_0"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_1 = Module["_emscripten_sync_run_in_main_thread_1"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_2 = Module["_emscripten_sync_run_in_main_thread_2"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_xprintf_varargs = Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_3 = Module["_emscripten_sync_run_in_main_thread_3"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_4 = Module["_emscripten_sync_run_in_main_thread_4"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_5 = Module["_emscripten_sync_run_in_main_thread_5"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_6 = Module["_emscripten_sync_run_in_main_thread_6"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_7 = Module["_emscripten_sync_run_in_main_thread_7"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null, arguments) + }; + var _emscripten_run_in_main_runtime_thread_js = Module["_emscripten_run_in_main_runtime_thread_js"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null, arguments) + }; + var _emscripten_async_queue_on_thread_ = Module["_emscripten_async_queue_on_thread_"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null, arguments) + }; + var _emscripten_tls_init = Module["_emscripten_tls_init"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_tls_init"].apply(null, arguments) + }; + var ___set_stack_limit = Module["___set_stack_limit"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__set_stack_limit"].apply(null, arguments) + }; + var stackSave = Module["stackSave"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["stackSave"].apply(null, arguments) + }; + var stackAlloc = Module["stackAlloc"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["stackAlloc"].apply(null, arguments) + }; + var stackRestore = Module["stackRestore"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["stackRestore"].apply(null, arguments) + }; + var dynCall_vi = Module["dynCall_vi"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dynCall_vi"].apply(null, arguments) + }; + var dynCall_v = Module["dynCall_v"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dynCall_v"].apply(null, arguments) + }; + var dynCall_ii = Module["dynCall_ii"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dynCall_ii"].apply(null, arguments) + }; + Module["asm"] = asm; + if (!Object.getOwnPropertyDescriptor(Module, "intArrayFromString")) Module["intArrayFromString"] = function () { + abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "intArrayToString")) Module["intArrayToString"] = function () { + abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "ccall")) Module["ccall"] = function () { + abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + Module["cwrap"] = cwrap; + if (!Object.getOwnPropertyDescriptor(Module, "setValue")) Module["setValue"] = function () { + abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getValue")) Module["getValue"] = function () { + abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "allocate")) Module["allocate"] = function () { + abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getMemory")) Module["getMemory"] = function () { + abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF8ArrayToString")) Module["UTF8ArrayToString"] = function () { + abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF8ToString")) Module["UTF8ToString"] = function () { + abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8Array")) Module["stringToUTF8Array"] = function () { + abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8")) Module["stringToUTF8"] = function () { + abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF8")) Module["lengthBytesUTF8"] = function () { + abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function () { + abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnPreRun")) Module["addOnPreRun"] = function () { + abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnInit")) Module["addOnInit"] = function () { + abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnPreMain")) Module["addOnPreMain"] = function () { + abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnExit")) Module["addOnExit"] = function () { + abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnPostRun")) Module["addOnPostRun"] = function () { + abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeStringToMemory")) Module["writeStringToMemory"] = function () { + abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeArrayToMemory")) Module["writeArrayToMemory"] = function () { + abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeAsciiToMemory")) Module["writeAsciiToMemory"] = function () { + abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addRunDependency")) Module["addRunDependency"] = function () { + abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "removeRunDependency")) Module["removeRunDependency"] = function () { + abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createFolder")) Module["FS_createFolder"] = function () { + abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createPath")) Module["FS_createPath"] = function () { + abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createDataFile")) Module["FS_createDataFile"] = function () { + abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createPreloadedFile")) Module["FS_createPreloadedFile"] = function () { + abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createLazyFile")) Module["FS_createLazyFile"] = function () { + abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createLink")) Module["FS_createLink"] = function () { + abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createDevice")) Module["FS_createDevice"] = function () { + abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_unlink")) Module["FS_unlink"] = function () { + abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "dynamicAlloc")) Module["dynamicAlloc"] = function () { + abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "loadDynamicLibrary")) Module["loadDynamicLibrary"] = function () { + abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "loadWebAssemblyModule")) Module["loadWebAssemblyModule"] = function () { + abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getLEB")) Module["getLEB"] = function () { + abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getFunctionTables")) Module["getFunctionTables"] = function () { + abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "alignFunctionTables")) Module["alignFunctionTables"] = function () { + abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "registerFunctions")) Module["registerFunctions"] = function () { + abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addFunction")) Module["addFunction"] = function () { + abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "removeFunction")) Module["removeFunction"] = function () { + abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getFuncWrapper")) Module["getFuncWrapper"] = function () { + abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "prettyPrint")) Module["prettyPrint"] = function () { + abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "makeBigInt")) Module["makeBigInt"] = function () { + abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "dynCall")) Module["dynCall"] = function () { + abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getCompilerSetting")) Module["getCompilerSetting"] = function () { + abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "print")) Module["print"] = function () { + abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "printErr")) Module["printErr"] = function () { + abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getTempRet0")) Module["getTempRet0"] = function () { + abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "setTempRet0")) Module["setTempRet0"] = function () { + abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "callMain")) Module["callMain"] = function () { + abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "abort")) Module["abort"] = function () { + abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToNewUTF8")) Module["stringToNewUTF8"] = function () { + abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "abortOnCannotGrowMemory")) Module["abortOnCannotGrowMemory"] = function () { + abort("'abortOnCannotGrowMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscripten_realloc_buffer")) Module["emscripten_realloc_buffer"] = function () { + abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "ENV")) Module["ENV"] = function () { + abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "setjmpId")) Module["setjmpId"] = function () { + abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_CODES")) Module["ERRNO_CODES"] = function () { + abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_MESSAGES")) Module["ERRNO_MESSAGES"] = function () { + abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "setErrNo")) Module["setErrNo"] = function () { + abort("'setErrNo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "DNS")) Module["DNS"] = function () { + abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GAI_ERRNO_MESSAGES")) Module["GAI_ERRNO_MESSAGES"] = function () { + abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "Protocols")) Module["Protocols"] = function () { + abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "Sockets")) Module["Sockets"] = function () { + abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UNWIND_CACHE")) Module["UNWIND_CACHE"] = function () { + abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "readAsmConstArgs")) Module["readAsmConstArgs"] = function () { + abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "jstoi_q")) Module["jstoi_q"] = function () { + abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "jstoi_s")) Module["jstoi_s"] = function () { + abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "PATH")) Module["PATH"] = function () { + abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "PATH_FS")) Module["PATH_FS"] = function () { + abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SYSCALLS")) Module["SYSCALLS"] = function () { + abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "syscallMmap2")) Module["syscallMmap2"] = function () { + abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "syscallMunmap")) Module["syscallMunmap"] = function () { + abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "flush_NO_FILESYSTEM")) Module["flush_NO_FILESYSTEM"] = function () { + abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "JSEvents")) Module["JSEvents"] = function () { + abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "demangle")) Module["demangle"] = function () { + abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "demangleAll")) Module["demangleAll"] = function () { + abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "jsStackTrace")) Module["jsStackTrace"] = function () { + abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function () { + abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getEnvStrings")) Module["getEnvStrings"] = function () { + abort("'getEnvStrings' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64")) Module["writeI53ToI64"] = function () { + abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Clamped")) Module["writeI53ToI64Clamped"] = function () { + abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Signaling")) Module["writeI53ToI64Signaling"] = function () { + abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Clamped")) Module["writeI53ToU64Clamped"] = function () { + abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Signaling")) Module["writeI53ToU64Signaling"] = function () { + abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "readI53FromI64")) Module["readI53FromI64"] = function () { + abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "readI53FromU64")) Module["readI53FromU64"] = function () { + abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "convertI32PairToI53")) Module["convertI32PairToI53"] = function () { + abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "convertU32PairToI53")) Module["convertU32PairToI53"] = function () { + abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "Browser")) Module["Browser"] = function () { + abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GL")) Module["GL"] = function () { + abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGet")) Module["emscriptenWebGLGet"] = function () { + abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetTexPixelData")) Module["emscriptenWebGLGetTexPixelData"] = function () { + abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetUniform")) Module["emscriptenWebGLGetUniform"] = function () { + abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetVertexAttrib")) Module["emscriptenWebGLGetVertexAttrib"] = function () { + abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "AL")) Module["AL"] = function () { + abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL_unicode")) Module["SDL_unicode"] = function () { + abort("'SDL_unicode' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL_ttfContext")) Module["SDL_ttfContext"] = function () { + abort("'SDL_ttfContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL_audio")) Module["SDL_audio"] = function () { + abort("'SDL_audio' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL")) Module["SDL"] = function () { + abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL_gfx")) Module["SDL_gfx"] = function () { + abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLUT")) Module["GLUT"] = function () { + abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "EGL")) Module["EGL"] = function () { + abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLFW_Window")) Module["GLFW_Window"] = function () { + abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLFW")) Module["GLFW"] = function () { + abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLEW")) Module["GLEW"] = function () { + abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "IDBStore")) Module["IDBStore"] = function () { + abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "runAndAbortIfError")) Module["runAndAbortIfError"] = function () { + abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + Module["PThread"] = PThread; + if (!Object.getOwnPropertyDescriptor(Module, "establishStackSpace")) Module["establishStackSpace"] = function () { + abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getNoExitRuntime")) Module["getNoExitRuntime"] = function () { + abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "resetPrototype")) Module["resetPrototype"] = function () { + abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "warnOnce")) Module["warnOnce"] = function () { + abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackSave")) Module["stackSave"] = function () { + abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackRestore")) Module["stackRestore"] = function () { + abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackAlloc")) Module["stackAlloc"] = function () { + abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "AsciiToString")) Module["AsciiToString"] = function () { + abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToAscii")) Module["stringToAscii"] = function () { + abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF16ToString")) Module["UTF16ToString"] = function () { + abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF16")) Module["stringToUTF16"] = function () { + abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF16")) Module["lengthBytesUTF16"] = function () { + abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF32ToString")) Module["UTF32ToString"] = function () { + abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF32")) Module["stringToUTF32"] = function () { + abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF32")) Module["lengthBytesUTF32"] = function () { + abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8")) Module["allocateUTF8"] = function () { + abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8OnStack")) Module["allocateUTF8OnStack"] = function () { + abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + Module["writeStackCookie"] = writeStackCookie; + Module["checkStackCookie"] = checkStackCookie; + Module["abortStackOverflow"] = abortStackOverflow; + Module["PThread"] = PThread; + Module["_pthread_self"] = _pthread_self; + Module["wasmMemory"] = wasmMemory; + Module["ExitStatus"] = ExitStatus; + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NORMAL")) Object.defineProperty(Module, "ALLOC_NORMAL", { + configurable: true, + get: function () { + abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_STACK")) Object.defineProperty(Module, "ALLOC_STACK", { + configurable: true, + get: function () { + abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_DYNAMIC")) Object.defineProperty(Module, "ALLOC_DYNAMIC", { + configurable: true, + get: function () { + abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NONE")) Object.defineProperty(Module, "ALLOC_NONE", { + configurable: true, + get: function () { + abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + } + }); + var calledRun; + Module["then"] = function (func) { + if (calledRun) { + func(Module) + } else { + var old = Module["onRuntimeInitialized"]; + Module["onRuntimeInitialized"] = function () { + if (old) old(); + func(Module) + } + } + return Module + }; + + function ExitStatus(status) { + this.name = "ExitStatus"; + this.message = "Program terminated with exit(" + status + ")"; + this.status = status + } + dependenciesFulfilled = function runCaller() { + if (!calledRun) run(); + if (!calledRun) dependenciesFulfilled = runCaller + }; + + function run(args) { + args = args || arguments_; + if (runDependencies > 0) { + return + } + writeStackCookie(); + preRun(); + if (runDependencies > 0) return; + + function doRun() { + if (calledRun) return; + calledRun = true; + Module["calledRun"] = true; + if (ABORT) return; + initRuntime(); + preMain(); + if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"](); + assert(!Module["_main"], 'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'); + postRun() + } + if (Module["setStatus"]) { + Module["setStatus"]("Running..."); + setTimeout(function () { + setTimeout(function () { + Module["setStatus"]("") + }, 1); + doRun() + }, 1) + } else { + doRun() + } + checkStackCookie() + } + Module["run"] = run; + if (Module["preInit"]) { + if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]]; + while (Module["preInit"].length > 0) { + Module["preInit"].pop()() + } + } + if (!ENVIRONMENT_IS_PTHREAD) noExitRuntime = true; + if (!ENVIRONMENT_IS_PTHREAD) run(); + + + return WasmBackendModule + } + ); +})(); +if (typeof exports === 'object' && typeof module === 'object') + module.exports = WasmBackendModule; +else if (typeof define === 'function' && define['amd']) + define([], function () { + return WasmBackendModule; + }); +else if (typeof exports === 'object') + exports["WasmBackendModule"] = WasmBackendModule; diff --git a/tfjs-core/benchmarks/wasm_0_threads/tfjs-backend-wasm.wasm b/tfjs-core/benchmarks/wasm_0_threads/tfjs-backend-wasm.wasm new file mode 100644 index 0000000000000000000000000000000000000000..266fbad98927c96b98a320191d13b32669975e0b GIT binary patch literal 157046 zcmeFa3!Gn7b@#o`Isf}*=0C|K88U&K{~@%))uv;;pZ(wx!j#wXId!YU>5b^Zl)T{+F4_ zM6_=|pSSPx5|VSyzOKFY+UvI0-ha1kYDeIl3l8Kj*&5EwxUB(yqnVkRV8$M9Yl#p0 z&uz_TPp4uO$m!du9v?-^)ORI&v&?e)!)>j#-!03kQ`7O+H_c1Im!XIK!Tzn)t{SeD zN2yM$eB}1;p929&ZJ>Ey+SNwu)ooqgdY$`p**Nwy4ufgGp@V;OGq>M9cW|^VX!q~m zZ*RA$CEmi@^>1(+;D@)(1h;MNncqd<+yuVd))foVd_osG1yj4N{p#1ino)W*|l$E^2Ui>x443GYrCg!o*db>eaqCy#Eq_3N%?Kp@0y(U*~> z$&r1dBey)ebmR6dw@i*skGLKc?`aL~1_szlT+`L~6pi1ocXD!M=X3^uP&B=F$_1*w zwyWq3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5Kur5t3!x^KnTVNY5U8(O9OY(&?j)zO z5oJM0V=S*`VGtDLU(heaGVEOA3?`GLv^19FZB@Z7VS-7)K5{UnbT-(P6gL?U6r|@c z3O}OFbtW^8Hah$7$(crOWj2;pQwv%#{0acTLJnwMI_55lbDNp6R>O_ud_ct?3>t&r zXwX_chlN;(i%+izUF$o297GG*AMGIf!;kr-?}zCp9y9!Rw^ZF41~cJp^u&OTjev

TensorFlow.js Model Benchmark

'use strict'; const state = { - numRuns: 2, - benchmark: 'custom_forward', + numRuns: 15, + benchmark: 'mobilenet_v2', run: (v) => { runBenchmark(); }, From 073969bc5f731f0d00d3bde6c22e74be403c12ac Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Tue, 12 May 2020 09:09:14 -0400 Subject: [PATCH 74/85] add --- tfjs-core/benchmarks/index.html | 1 - tfjs-core/benchmarks/modelConfig.js | 10 ++++++++-- tfjs-core/benchmarks/util.js | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/tfjs-core/benchmarks/index.html b/tfjs-core/benchmarks/index.html index d108ffa314d..bd90f826cc3 100644 --- a/tfjs-core/benchmarks/index.html +++ b/tfjs-core/benchmarks/index.html @@ -228,7 +228,6 @@

TensorFlow.js Model Benchmark

tmp.dispose(); } const dur = performance.now() - start; - console.log(dur); times.push(dur); const memInfo = tf.memory(); const leakedTensors = memInfo.numTensors - tensorsBefore; diff --git a/tfjs-core/benchmarks/modelConfig.js b/tfjs-core/benchmarks/modelConfig.js index 3541b6e48ec..66c10431907 100644 --- a/tfjs-core/benchmarks/modelConfig.js +++ b/tfjs-core/benchmarks/modelConfig.js @@ -122,8 +122,14 @@ const benchmarks = { return tf.loadGraphModel(url); }, predictFunc: () => { - const zeros = tf.zeros([1, 224, 224, 3]); - return model => model.predict(zeros); + const inputShape = [1, 224, 224, 3]; + const inputData = []; + for(let i=0; i<224*224*3; i++) { + inputData.push(Math.random()); + } + const input = tf.tensor4d(inputData, inputShape); + + return model => model.predict(input); } }, 'mesh_128': { diff --git a/tfjs-core/benchmarks/util.js b/tfjs-core/benchmarks/util.js index 125ddcaa2d4..b2bf4589198 100644 --- a/tfjs-core/benchmarks/util.js +++ b/tfjs-core/benchmarks/util.js @@ -15,6 +15,20 @@ * ============================================================================= */ +Math.random = (function() { + var seed = 0x2F6E2B1; + return function() { + // Robert Jenkins’ 32 bit integer hash function + seed = ((seed + 0x7ED55D16) + (seed << 12)) & 0xFFFFFFFF; + seed = ((seed ^ 0xC761C23C) ^ (seed >>> 19)) & 0xFFFFFFFF; + seed = ((seed + 0x165667B1) + (seed << 5)) & 0xFFFFFFFF; + seed = ((seed + 0xD3A2646C) ^ (seed << 9)) & 0xFFFFFFFF; + seed = ((seed + 0xFD7046C5) + (seed << 3)) & 0xFFFFFFFF; + seed = ((seed ^ 0xB55A4F09) ^ (seed >>> 16)) & 0xFFFFFFFF; + return (seed & 0xFFFFFFF) / 0x10000000; + }; +}()); + function printTime(elapsed) { return elapsed.toFixed(1) + ' ms'; } From 091e5cb04f0ccf2c27e95fef554c50bf3c234323 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Tue, 12 May 2020 11:56:02 -0400 Subject: [PATCH 75/85] update build --- tfjs-backend-wasm/src/backend_wasm.ts | 71 ++- tfjs-backend-wasm/src/cc/BUILD | 7 +- tfjs-backend-wasm/src/cc/backend.cc | 2 +- tfjs-backend-wasm/src/kernels/Conv2D.ts | 22 +- .../src/kernels/DepthwiseConv2dNative.ts | 12 +- tfjs-core/benchmarks/index.html | 1 + tfjs-core/benchmarks/tf-backend-wasm.js | 432 ++++++++++-------- tfjs-core/benchmarks/tfjs-backend-wasm.js | 2 +- tfjs-core/benchmarks/tfjs-backend-wasm.wasm | Bin 158031 -> 158033 bytes 9 files changed, 347 insertions(+), 202 deletions(-) diff --git a/tfjs-backend-wasm/src/backend_wasm.ts b/tfjs-backend-wasm/src/backend_wasm.ts index fdf57505551..2ecc22e66fb 100644 --- a/tfjs-backend-wasm/src/backend_wasm.ts +++ b/tfjs-backend-wasm/src/backend_wasm.ts @@ -203,24 +203,71 @@ export async function init(): Promise<{wasm: BackendWasmModule}> { return new Promise((resolve, reject) => { const factoryConfig: WasmFactoryConfig = {}; - const locateFile = (path: string, prefix: string) => { - if (path.endsWith('.worker.js')) { - const response = - 'var threadInfoStruct=0;var selfThreadId=0;var parentThreadId=0;var Module={};function assert(condition,text){if(!condition)abort("Assertion failed: "+text)}function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:selfThreadId})}var out=function(){throw"out() is not defined in worker.js."};var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);Module["wasmModule"]=null;receiveInstance(instance);return instance.exports};this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["DYNAMIC_BASE"]=e.data.DYNAMIC_BASE;Module["DYNAMICTOP_PTR"]=e.data.DYNAMICTOP_PTR;Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}Module=WasmBackendModule(Module);postMessage({"cmd":"loaded"})}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;threadInfoStruct=e.data.threadInfoStruct;Module["__register_pthread_ptr"](threadInfoStruct,0,0);selfThreadId=e.data.selfThreadId;parentThreadId=e.data.parentThreadId;var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;assert(threadInfoStruct);assert(selfThreadId);assert(parentThreadId);assert(top!=0);assert(max!=0);assert(top>max);Module["establishStackSpace"](top,max);Module["_emscripten_tls_init"]();Module["writeStackCookie"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].setThreadStatus(Module["_pthread_self"](),1);try{var result=Module["dynCall_ii"](e.data.start_routine,e.data.arg);Module["checkStackCookie"]();if(!Module["getNoExitRuntime"]())Module["PThread"].threadExit(result)}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){Atomics.store(Module["HEAPU32"],threadInfoStruct+4>>2,ex instanceof Module["ExitStatus"]?ex.status:-2);Atomics.store(Module["HEAPU32"],threadInfoStruct+0>>2,1);if(typeof Module["_emscripten_futex_wake"]!=="function"){err("Thread Initialisation failed.");throw ex}Module["_emscripten_futex_wake"](threadInfoStruct+0,2147483647);if(!(ex instanceof Module["ExitStatus"]))throw ex}else{err("Pthread 0x"+threadInfoStruct.toString(16)+" completed its pthread main entry point with an unwind, keeping the pthread worker alive for asynchronous operation.")}}}else if(e.data.cmd==="cancel"){if(threadInfoStruct){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(threadInfoStruct){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}}'; - const blob = new Blob([response], {type: 'application/javascript'}); - return URL.createObjectURL(blob); - } - return prefix + path; - }; - - factoryConfig.locateFile = locateFile; + // const locateFile = (path: string, prefix: string) => { + // if (path.endsWith('.worker.js')) { + // const response = + // 'var threadInfoStruct=0;var selfThreadId=0;var + // parentThreadId=0;var Module={};function + // assert(condition,text){if(!condition)abort("Assertion failed: + // "+text)}function threadPrintErr(){var + // text=Array.prototype.slice.call(arguments).join(" + // ");console.error(text)}function threadAlert(){var + // text=Array.prototype.slice.call(arguments).join(" + // ");postMessage({cmd:"alert",text:text,threadId:selfThreadId})}var + // out=function(){throw"out() is not defined in worker.js."};var + // err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var + // instance=new + // WebAssembly.Instance(Module["wasmModule"],info);Module["wasmModule"]=null;receiveInstance(instance);return + // instance.exports};this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["DYNAMIC_BASE"]=e.data.DYNAMIC_BASE;Module["DYNAMICTOP_PTR"]=e.data.DYNAMICTOP_PTR;Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof + // e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var + // objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}Module=WasmBackendModule(Module);postMessage({"cmd":"loaded"})}else + // if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else + // if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;threadInfoStruct=e.data.threadInfoStruct;Module["__register_pthread_ptr"](threadInfoStruct,0,0);selfThreadId=e.data.selfThreadId;parentThreadId=e.data.parentThreadId;var + // max=e.data.stackBase;var + // top=e.data.stackBase+e.data.stackSize;assert(threadInfoStruct);assert(selfThreadId);assert(parentThreadId);assert(top!=0);assert(max!=0);assert(top>max);Module["establishStackSpace"](top,max);Module["_emscripten_tls_init"]();Module["writeStackCookie"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].setThreadStatus(Module["_pthread_self"](),1);try{var + // result=Module["dynCall_ii"](e.data.start_routine,e.data.arg);Module["checkStackCookie"]();if(!Module["getNoExitRuntime"]())Module["PThread"].threadExit(result)}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else + // if(ex!="unwind"){Atomics.store(Module["HEAPU32"],threadInfoStruct+4>>2,ex + // instanceof + // Module["ExitStatus"]?ex.status:-2);Atomics.store(Module["HEAPU32"],threadInfoStruct+0>>2,1);if(typeof + // Module["_emscripten_futex_wake"]!=="function"){err("Thread + // Initialisation failed.");throw + // ex}Module["_emscripten_futex_wake"](threadInfoStruct+0,2147483647);if(!(ex + // instanceof Module["ExitStatus"]))throw ex}else{err("Pthread + // 0x"+threadInfoStruct.toString(16)+" completed its pthread main + // entry point with an unwind, keeping the pthread worker alive for + // asynchronous operation.")}}}else + // if(e.data.cmd==="cancel"){if(threadInfoStruct){Module["PThread"].threadCancel()}}else + // if(e.data.target==="setimmediate"){}else + // if(e.data.cmd==="processThreadQueue"){if(threadInfoStruct){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js + // received unknown command + // "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() + // captured an uncaught exception: + // "+ex);if(ex.stack)err(ex.stack);throw ex}};if(typeof + // process==="object"&&typeof process.versions==="object"&&typeof + // process.versions.node==="string"){self={location:{href:__filename}};var + // onmessage=this.onmessage;var + // nodeWorkerThreads=require("worker_threads");Worker=nodeWorkerThreads.Worker;var + // parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var + // nodeFS=require("fs");var nodeRead=function(filename){return + // nodeFS.readFileSync(filename,"utf8")};function + // globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof + // performance==="undefined"){performance={now:function(){return + // Date.now()}}}}'; + // const blob = new Blob([response], {type: 'application/javascript'}); + // return URL.createObjectURL(blob); + // } + // return prefix + path; + // }; + + // factoryConfig.locateFile = locateFile; if (wasmPath != null) { factoryConfig.locateFile = (path, prefix) => { if (path.endsWith('.wasm')) { return wasmPath; } - return locateFile(path, prefix); + // return locateFile(path, prefix); + return prefix + path; }; // use wasm instantiateWasm override when system fetch is not available. // For detail references diff --git a/tfjs-backend-wasm/src/cc/BUILD b/tfjs-backend-wasm/src/cc/BUILD index 9ef6ac2ba79..a13301f2d09 100644 --- a/tfjs-backend-wasm/src/cc/BUILD +++ b/tfjs-backend-wasm/src/cc/BUILD @@ -11,6 +11,7 @@ cc_binary( name = "tfjs-backend-wasm.js", srcs = ["backend.cc"] + KERNELS_WITH_KEEPALIVE, linkopts = [ + "-s ALLOW_MEMORY_GROWTH=1", "-s DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=[]", "-s DISABLE_EXCEPTION_CATCHING=1", "-s FILESYSTEM=0", @@ -21,10 +22,10 @@ cc_binary( "-s EXPORT_NAME=WasmBackendModule", "-s MALLOC=emmalloc", "-s USE_PTHREADS=1", - "-s PTHREAD_POOL_SIZE=5", - "-s INITIAL_MEMORY=500Mb", - "-s MAXIMUM_MEMORY=500Mb", + "-s PTHREAD_POOL_SIZE=8", "-s ASSERTIONS=1", + "-s INITIAL_MEMORY=1Gb", + "-s MAXIMUM_MEMORY=1Gb", "-s PROXY_TO_PTHREAD=1", ], deps = [ diff --git a/tfjs-backend-wasm/src/cc/backend.cc b/tfjs-backend-wasm/src/cc/backend.cc index d9e6750a6c7..4011c85490b 100644 --- a/tfjs-backend-wasm/src/cc/backend.cc +++ b/tfjs-backend-wasm/src/cc/backend.cc @@ -49,7 +49,7 @@ TensorInfo &get_tensor_info_out(const size_t tensor_id) { size_t xnn_operator_count = 0; -pthreadpool *threadpool = pthreadpool_create(5); +pthreadpool *threadpool = pthreadpool_create(8); // Registers a disposal callback for a tensor id with a given callback function. void register_disposal_callback(const size_t tensor_id, diff --git a/tfjs-backend-wasm/src/kernels/Conv2D.ts b/tfjs-backend-wasm/src/kernels/Conv2D.ts index 6226ec81ccf..4de0f423a80 100644 --- a/tfjs-backend-wasm/src/kernels/Conv2D.ts +++ b/tfjs-backend-wasm/src/kernels/Conv2D.ts @@ -64,11 +64,27 @@ function conv2d( const xId = backend.dataIdMap.get(x.dataId).id; const filterId = backend.dataIdMap.get(filter.dataId).id; - const {strides, dilations, pad, dimRoundingMode, dataFormat} = attrs; - const $dataFormat = backend_util.convertConv2DDataFormat(dataFormat); + let {strides, dilations, pad} = attrs; + const {dimRoundingMode, dataFormat} = attrs; + + strides = strides == null ? + [(attrs as any).strideWidth, (attrs as any).strideHeight] : + strides; + pad = pad == null ? ((attrs as any).padInfo.type.toLowerCase()) : pad; + dilations = dilations == null ? + [(attrs as any).dilationWidth, (attrs as any).dilationHeight] : + dilations; + + let $dataFormat = ''; + if (dataFormat === 'NHWC' || dataFormat === 'NCHW') { + $dataFormat = backend_util.convertConv2DDataFormat(dataFormat); + } else { + $dataFormat = dataFormat; + } + const convInfo = backend_util.computeConv2DInfo( (x as Tensor4D).shape, (filter as Tensor4D).shape, strides, dilations, - pad, dimRoundingMode, false, $dataFormat); + pad, dimRoundingMode, false, $dataFormat as any); const filterHeight = convInfo.filterHeight; const filterWidth = convInfo.filterWidth; diff --git a/tfjs-backend-wasm/src/kernels/DepthwiseConv2dNative.ts b/tfjs-backend-wasm/src/kernels/DepthwiseConv2dNative.ts index b3294906fc6..aaaf9580d86 100644 --- a/tfjs-backend-wasm/src/kernels/DepthwiseConv2dNative.ts +++ b/tfjs-backend-wasm/src/kernels/DepthwiseConv2dNative.ts @@ -68,7 +68,17 @@ function depthwiseConv2d(args: { const xId = backend.dataIdMap.get(x.dataId).id; const filterId = backend.dataIdMap.get(filter.dataId).id; - const {strides, dilations, pad, dimRoundingMode} = attrs; + let {strides, dilations, pad} = attrs; + + strides = strides == null ? + [(attrs as any).strideWidth, (attrs as any).strideHeight] : + strides; + pad = pad == null ? ((attrs as any).padInfo.type.toLowerCase()) : pad; + dilations = dilations == null ? + [(attrs as any).dilationWidth, (attrs as any).dilationHeight] : + dilations; + + const dimRoundingMode = attrs['dimRoundingMode']; const $dilations = dilations == null ? [1, 1] : dilations; diff --git a/tfjs-core/benchmarks/index.html b/tfjs-core/benchmarks/index.html index bd90f826cc3..2980cbc0d4b 100644 --- a/tfjs-core/benchmarks/index.html +++ b/tfjs-core/benchmarks/index.html @@ -229,6 +229,7 @@

TensorFlow.js Model Benchmark

} const dur = performance.now() - start; times.push(dur); + console.log(dur); const memInfo = tf.memory(); const leakedTensors = memInfo.numTensors - tensorsBefore; numLeakedTensors.push(leakedTensors); diff --git a/tfjs-core/benchmarks/tf-backend-wasm.js b/tfjs-core/benchmarks/tf-backend-wasm.js index d986f8278af..020f2df4b1c 100644 --- a/tfjs-core/benchmarks/tf-backend-wasm.js +++ b/tfjs-core/benchmarks/tf-backend-wasm.js @@ -1,27 +1,27 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tensorflow/tfjs-core'), require('../wasm-out/tfjs-backend-wasm.js')) : - typeof define === 'function' && define.amd ? define(['exports', '@tensorflow/tfjs-core', '../wasm-out/tfjs-backend-wasm.js'], factory) : - (global = global || self, factory((global.tf = global.tf || {}, global.tf.wasm = global.tf.wasm || {}), global.tf, global.WasmBackendModule)); -}(this, (function (exports, tfjsCore, WasmBackendModule) { 'use strict'; - - WasmBackendModule = WasmBackendModule && WasmBackendModule.hasOwnProperty('default') ? WasmBackendModule['default'] : WasmBackendModule; - +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tensorflow/tfjs-core'), require('../wasm-out/tfjs-backend-wasm.js')) : + typeof define === 'function' && define.amd ? define(['exports', '@tensorflow/tfjs-core', '../wasm-out/tfjs-backend-wasm.js'], factory) : + (global = global || self, factory((global.tf = global.tf || {}, global.tf.wasm = global.tf.wasm || {}), global.tf, global.WasmBackendModule)); +}(this, (function (exports, tfjsCore, WasmBackendModule) { 'use strict'; + + WasmBackendModule = WasmBackendModule && WasmBackendModule.hasOwnProperty('default') ? WasmBackendModule['default'] : WasmBackendModule; + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -54,8 +54,8 @@ FusableActivation[FusableActivation["relu"] = 1] = "relu"; FusableActivation[FusableActivation["relu6"] = 2] = "relu6"; FusableActivation[FusableActivation["prelu"] = 3] = "prelu"; - })(FusableActivation || (FusableActivation = {})); - + })(FusableActivation || (FusableActivation = {})); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -130,8 +130,8 @@ backendName: 'wasm', setupFunc: setup, kernelFunc: fusedBatchMatMul - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -167,8 +167,8 @@ return out; } tfjsCore.registerKernel({ kernelName, backendName: 'wasm', setupFunc, kernelFunc }); - } - + } + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -185,8 +185,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Abs'); - + registerUnaryKernel('Abs'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -251,8 +251,8 @@ } } tfjsCore.registerKernel({ kernelName, backendName: 'wasm', setupFunc, kernelFunc }); - } - + } + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -270,8 +270,8 @@ * ============================================================================= */ const supportsFullBroadcast = true; - registerBinaryKernel('Add', supportsFullBroadcast); - + registerBinaryKernel('Add', supportsFullBroadcast); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -315,8 +315,8 @@ backendName: 'wasm', setupFunc, kernelFunc: addn, - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -359,8 +359,8 @@ backendName: 'wasm', kernelFunc: argmax, setupFunc: setup$1 - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -428,8 +428,8 @@ backendName: 'wasm', setupFunc: setup$2, kernelFunc: avgPool - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -484,8 +484,8 @@ backendName: 'wasm', setupFunc: setup$3, kernelFunc: batchMatMul - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -514,8 +514,8 @@ kernelName: 'Cast', backendName: 'wasm', kernelFunc: cast, - }); - + }); + /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -556,8 +556,8 @@ backendName: 'wasm', setupFunc: setup$4, kernelFunc: clip - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -603,8 +603,8 @@ kernelName: 'Concat', backendName: 'wasm', kernelFunc: concat, - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -650,8 +650,22 @@ const { x, filter } = inputs; const xId = backend.dataIdMap.get(x.dataId).id; const filterId = backend.dataIdMap.get(filter.dataId).id; - const { strides, dilations, pad, dimRoundingMode, dataFormat } = attrs; - const $dataFormat = tfjsCore.backend_util.convertConv2DDataFormat(dataFormat); + let { strides, dilations, pad } = attrs; + const { dimRoundingMode, dataFormat } = attrs; + strides = strides == null ? + [attrs.strideWidth, attrs.strideHeight] : + strides; + pad = pad == null ? (attrs.padInfo.type.toLowerCase()) : pad; + dilations = dilations == null ? + [attrs.dilationWidth, attrs.dilationHeight] : + dilations; + let $dataFormat = ''; + if (dataFormat === 'NHWC' || dataFormat === 'NCHW') { + $dataFormat = tfjsCore.backend_util.convertConv2DDataFormat(dataFormat); + } + else { + $dataFormat = dataFormat; + } const convInfo = tfjsCore.backend_util.computeConv2DInfo(x.shape, filter.shape, strides, dilations, pad, dimRoundingMode, false, $dataFormat); const filterHeight = convInfo.filterHeight; const filterWidth = convInfo.filterWidth; @@ -680,8 +694,8 @@ backendName: 'wasm', setupFunc: setup$5, kernelFunc: conv2d - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -698,8 +712,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Cos'); - + registerUnaryKernel('Cos'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -768,8 +782,8 @@ backendName: 'wasm', setupFunc: setup$6, kernelFunc: cropAndResize - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -816,7 +830,15 @@ const { x, filter } = inputs; const xId = backend.dataIdMap.get(x.dataId).id; const filterId = backend.dataIdMap.get(filter.dataId).id; - const { strides, dilations, pad, dimRoundingMode } = attrs; + let { strides, dilations, pad } = attrs; + strides = strides == null ? + [attrs.strideWidth, attrs.strideHeight] : + strides; + pad = pad == null ? (attrs.padInfo.type.toLowerCase()) : pad; + dilations = dilations == null ? + [attrs.dilationWidth, attrs.dilationHeight] : + dilations; + const dimRoundingMode = attrs['dimRoundingMode']; const $dilations = dilations == null ? [1, 1] : dilations; const convInfo = tfjsCore.backend_util.computeConv2DInfo(x.shape, filter.shape, strides, $dilations, pad, dimRoundingMode, true /* depthwise */); const filterHeight = convInfo.filterHeight; @@ -846,8 +868,8 @@ backendName: 'wasm', setupFunc: setup$7, kernelFunc: depthwiseConv2d - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -865,8 +887,8 @@ * ============================================================================= */ const supportsFullBroadcast$1 = false; - registerBinaryKernel('Div', supportsFullBroadcast$1); - + registerBinaryKernel('Div', supportsFullBroadcast$1); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -883,8 +905,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Exp'); - + registerUnaryKernel('Exp'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -902,8 +924,8 @@ * ============================================================================= */ const supportsFullBroadcast$2 = false; - registerBinaryKernel('FloorDiv', supportsFullBroadcast$2); - + registerBinaryKernel('FloorDiv', supportsFullBroadcast$2); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -947,8 +969,8 @@ backendName: 'wasm', setupFunc: setup$8, kernelFunc: fusedBatchNorm - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1049,8 +1071,8 @@ backendName: 'wasm', setupFunc: setup$9, kernelFunc: fusedConv2d - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1152,8 +1174,8 @@ backendName: 'wasm', setupFunc: setup$a, kernelFunc: fusedDepthwiseConv2d - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1209,8 +1231,8 @@ backendName: 'wasm', setupFunc: setup$b, kernelFunc: gather - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1264,8 +1286,8 @@ backendName: 'wasm', setupFunc: setup$c, kernelFunc: gatherNd - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1283,8 +1305,8 @@ * ============================================================================= */ const supportsFullBroadcast$3 = false; - registerBinaryKernel('Greater', supportsFullBroadcast$3, 'bool'); - + registerBinaryKernel('Greater', supportsFullBroadcast$3, 'bool'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1302,8 +1324,8 @@ * ============================================================================= */ const supportsFullBroadcast$4 = false; - registerBinaryKernel('GreaterEqual', supportsFullBroadcast$4, 'bool'); - + registerBinaryKernel('GreaterEqual', supportsFullBroadcast$4, 'bool'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1321,8 +1343,8 @@ * ============================================================================= */ const supportsFullBroadcast$5 = false; - registerBinaryKernel('Less', supportsFullBroadcast$5, 'bool'); - + registerBinaryKernel('Less', supportsFullBroadcast$5, 'bool'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1340,8 +1362,8 @@ * ============================================================================= */ const supportsFullBroadcast$6 = false; - registerBinaryKernel('LessEqual', supportsFullBroadcast$6, 'bool'); - + registerBinaryKernel('LessEqual', supportsFullBroadcast$6, 'bool'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1358,8 +1380,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Log'); - + registerUnaryKernel('Log'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1377,8 +1399,8 @@ * ============================================================================= */ const supportsFullBroadcast$7 = false; - registerBinaryKernel('LogicalAnd', supportsFullBroadcast$7, 'bool'); - + registerBinaryKernel('LogicalAnd', supportsFullBroadcast$7, 'bool'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1417,8 +1439,8 @@ wasmMax(xId, reduceSize, outId); return out; } - tfjsCore.registerKernel({ kernelName: tfjsCore.Max, backendName: 'wasm', setupFunc: setup$d, kernelFunc: max }); - + tfjsCore.registerKernel({ kernelName: tfjsCore.Max, backendName: 'wasm', setupFunc: setup$d, kernelFunc: max }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1436,8 +1458,8 @@ * ============================================================================= */ const supportsFullBroadcast$8 = false; - registerBinaryKernel('Maximum', supportsFullBroadcast$8); - + registerBinaryKernel('Maximum', supportsFullBroadcast$8); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1507,8 +1529,8 @@ backendName: 'wasm', setupFunc: setup$e, kernelFunc: maxPool - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1551,8 +1573,8 @@ backendName: 'wasm', setupFunc: setup$f, kernelFunc: min - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1570,8 +1592,8 @@ * ============================================================================= */ const supportsFullBroadcast$9 = false; - registerBinaryKernel('Minimum', supportsFullBroadcast$9); - + registerBinaryKernel('Minimum', supportsFullBroadcast$9); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1589,8 +1611,8 @@ * ============================================================================= */ const supportsFullBroadcast$a = true; - registerBinaryKernel('Mul', supportsFullBroadcast$a); - + registerBinaryKernel('Mul', supportsFullBroadcast$a); + /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -1607,8 +1629,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Neg'); - + registerUnaryKernel('Neg'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1637,8 +1659,8 @@ // Since the result was allocated on the heap, we have to delete it. backend.wasm._free(resOffset); return { pSelectedIndices, selectedSize, pSelectedScores }; - } - + } + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1684,8 +1706,8 @@ backendName: 'wasm', setupFunc: setup$g, kernelFunc, - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1731,8 +1753,8 @@ backendName: 'wasm', setupFunc: setup$h, kernelFunc: kernelFunc$1, - }); - + }); + /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -1750,8 +1772,8 @@ * ============================================================================= */ const supportsFullBroadcast$b = false; - registerBinaryKernel('NotEqual', supportsFullBroadcast$b, 'bool'); - + registerBinaryKernel('NotEqual', supportsFullBroadcast$b, 'bool'); + /** * @license * Copyright 2020 Google Inc. All Rights Reserved. @@ -1779,8 +1801,8 @@ kernelName: 'OnesLike', backendName: 'wasm', kernelFunc: onesLike, - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1826,8 +1848,8 @@ backendName: 'wasm', kernelFunc: pad, setupFunc: setup$i - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1845,8 +1867,8 @@ * ============================================================================= */ const supportsFullBroadcast$c = false; - registerBinaryKernel('Pow', supportsFullBroadcast$c); - + registerBinaryKernel('Pow', supportsFullBroadcast$c); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1886,8 +1908,8 @@ backendName: 'wasm', setupFunc: setup$j, kernelFunc: prelu - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1904,8 +1926,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Relu'); - + registerUnaryKernel('Relu'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1922,8 +1944,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Relu6'); - + registerUnaryKernel('Relu6'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1948,8 +1970,8 @@ kernelName: 'Reshape', backendName: 'wasm', kernelFunc: reshape, - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2009,8 +2031,8 @@ backendName: 'wasm', setupFunc: setup$k, kernelFunc: resizeBilinear - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2027,8 +2049,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Rsqrt'); - + registerUnaryKernel('Rsqrt'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2082,8 +2104,8 @@ backendName: 'wasm', setupFunc: setup$l, kernelFunc: scatterNd - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2122,8 +2144,8 @@ backendName: 'wasm', setupFunc: setup$m, kernelFunc: sigmoid - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2140,8 +2162,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Sin'); - + registerUnaryKernel('Sin'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2243,8 +2265,8 @@ kernelName: 'Slice', backendName: 'wasm', kernelFunc: slice, - }); - + }); + /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -2289,8 +2311,8 @@ backendName: 'wasm', setupFunc: setup$n, kernelFunc: softmax - }); - + }); + /** * @license * Copyright 2020 Google Inc. All Rights Reserved. @@ -2330,8 +2352,8 @@ return xSlice; }); } - tfjsCore.registerKernel({ kernelName: tfjsCore.SplitV, backendName: 'wasm', kernelFunc: split }); - + tfjsCore.registerKernel({ kernelName: tfjsCore.SplitV, backendName: 'wasm', kernelFunc: split }); + /** * @license * Copyright 2020 Google Inc. All Rights Reserved. @@ -2348,8 +2370,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Sqrt'); - + registerUnaryKernel('Sqrt'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2366,8 +2388,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Square'); - + registerUnaryKernel('Square'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2385,8 +2407,8 @@ * ============================================================================= */ const supportsFullBroadcast$d = true; - registerBinaryKernel('Sub', supportsFullBroadcast$d); - + registerBinaryKernel('Sub', supportsFullBroadcast$d); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2429,8 +2451,8 @@ backendName: 'wasm', setupFunc: setup$o, kernelFunc: sum - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2447,8 +2469,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Tanh'); - + registerUnaryKernel('Tanh'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2497,8 +2519,8 @@ backendName: 'wasm', setupFunc: setup$p, kernelFunc: tile - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2590,8 +2612,8 @@ backendName: 'wasm', kernelFunc: transpose, setupFunc: setup$q, - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2633,8 +2655,8 @@ kernelName: 'Unpack', backendName: 'wasm', kernelFunc: unpack, - }); - + }); + /** * @license * Copyright 2020 Google Inc. All Rights Reserved. @@ -2662,8 +2684,8 @@ kernelName: 'ZerosLike', backendName: 'wasm', kernelFunc: zerosLike, - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2818,21 +2840,69 @@ async function init() { return new Promise((resolve, reject) => { const factoryConfig = {}; - const locateFile = (path, prefix) => { - if (path.endsWith('.worker.js')) { - const response = 'var threadInfoStruct=0;var selfThreadId=0;var parentThreadId=0;var Module={};function assert(condition,text){if(!condition)abort("Assertion failed: "+text)}function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:selfThreadId})}var out=function(){throw"out() is not defined in worker.js."};var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);Module["wasmModule"]=null;receiveInstance(instance);return instance.exports};this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["DYNAMIC_BASE"]=e.data.DYNAMIC_BASE;Module["DYNAMICTOP_PTR"]=e.data.DYNAMICTOP_PTR;Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}Module=WasmBackendModule(Module);postMessage({"cmd":"loaded"})}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;threadInfoStruct=e.data.threadInfoStruct;Module["__register_pthread_ptr"](threadInfoStruct,0,0);selfThreadId=e.data.selfThreadId;parentThreadId=e.data.parentThreadId;var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;assert(threadInfoStruct);assert(selfThreadId);assert(parentThreadId);assert(top!=0);assert(max!=0);assert(top>max);Module["establishStackSpace"](top,max);Module["_emscripten_tls_init"]();Module["writeStackCookie"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].setThreadStatus(Module["_pthread_self"](),1);try{var result=Module["dynCall_ii"](e.data.start_routine,e.data.arg);Module["checkStackCookie"]();if(!Module["getNoExitRuntime"]())Module["PThread"].threadExit(result)}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){Atomics.store(Module["HEAPU32"],threadInfoStruct+4>>2,ex instanceof Module["ExitStatus"]?ex.status:-2);Atomics.store(Module["HEAPU32"],threadInfoStruct+0>>2,1);if(typeof Module["_emscripten_futex_wake"]!=="function"){err("Thread Initialisation failed.");throw ex}Module["_emscripten_futex_wake"](threadInfoStruct+0,2147483647);if(!(ex instanceof Module["ExitStatus"]))throw ex}else{err("Pthread 0x"+threadInfoStruct.toString(16)+" completed its pthread main entry point with an unwind, keeping the pthread worker alive for asynchronous operation.")}}}else if(e.data.cmd==="cancel"){if(threadInfoStruct){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(threadInfoStruct){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}}'; - const blob = new Blob([response], { type: 'application/javascript' }); - return URL.createObjectURL(blob); - } - return prefix + path; - }; - factoryConfig.locateFile = locateFile; + // const locateFile = (path: string, prefix: string) => { + // if (path.endsWith('.worker.js')) { + // const response = + // 'var threadInfoStruct=0;var selfThreadId=0;var + // parentThreadId=0;var Module={};function + // assert(condition,text){if(!condition)abort("Assertion failed: + // "+text)}function threadPrintErr(){var + // text=Array.prototype.slice.call(arguments).join(" + // ");console.error(text)}function threadAlert(){var + // text=Array.prototype.slice.call(arguments).join(" + // ");postMessage({cmd:"alert",text:text,threadId:selfThreadId})}var + // out=function(){throw"out() is not defined in worker.js."};var + // err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var + // instance=new + // WebAssembly.Instance(Module["wasmModule"],info);Module["wasmModule"]=null;receiveInstance(instance);return + // instance.exports};this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["DYNAMIC_BASE"]=e.data.DYNAMIC_BASE;Module["DYNAMICTOP_PTR"]=e.data.DYNAMICTOP_PTR;Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof + // e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var + // objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}Module=WasmBackendModule(Module);postMessage({"cmd":"loaded"})}else + // if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else + // if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;threadInfoStruct=e.data.threadInfoStruct;Module["__register_pthread_ptr"](threadInfoStruct,0,0);selfThreadId=e.data.selfThreadId;parentThreadId=e.data.parentThreadId;var + // max=e.data.stackBase;var + // top=e.data.stackBase+e.data.stackSize;assert(threadInfoStruct);assert(selfThreadId);assert(parentThreadId);assert(top!=0);assert(max!=0);assert(top>max);Module["establishStackSpace"](top,max);Module["_emscripten_tls_init"]();Module["writeStackCookie"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].setThreadStatus(Module["_pthread_self"](),1);try{var + // result=Module["dynCall_ii"](e.data.start_routine,e.data.arg);Module["checkStackCookie"]();if(!Module["getNoExitRuntime"]())Module["PThread"].threadExit(result)}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else + // if(ex!="unwind"){Atomics.store(Module["HEAPU32"],threadInfoStruct+4>>2,ex + // instanceof + // Module["ExitStatus"]?ex.status:-2);Atomics.store(Module["HEAPU32"],threadInfoStruct+0>>2,1);if(typeof + // Module["_emscripten_futex_wake"]!=="function"){err("Thread + // Initialisation failed.");throw + // ex}Module["_emscripten_futex_wake"](threadInfoStruct+0,2147483647);if(!(ex + // instanceof Module["ExitStatus"]))throw ex}else{err("Pthread + // 0x"+threadInfoStruct.toString(16)+" completed its pthread main + // entry point with an unwind, keeping the pthread worker alive for + // asynchronous operation.")}}}else + // if(e.data.cmd==="cancel"){if(threadInfoStruct){Module["PThread"].threadCancel()}}else + // if(e.data.target==="setimmediate"){}else + // if(e.data.cmd==="processThreadQueue"){if(threadInfoStruct){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js + // received unknown command + // "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() + // captured an uncaught exception: + // "+ex);if(ex.stack)err(ex.stack);throw ex}};if(typeof + // process==="object"&&typeof process.versions==="object"&&typeof + // process.versions.node==="string"){self={location:{href:__filename}};var + // onmessage=this.onmessage;var + // nodeWorkerThreads=require("worker_threads");Worker=nodeWorkerThreads.Worker;var + // parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var + // nodeFS=require("fs");var nodeRead=function(filename){return + // nodeFS.readFileSync(filename,"utf8")};function + // globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof + // performance==="undefined"){performance={now:function(){return + // Date.now()}}}}'; + // const blob = new Blob([response], {type: 'application/javascript'}); + // return URL.createObjectURL(blob); + // } + // return prefix + path; + // }; + // factoryConfig.locateFile = locateFile; if (wasmPath != null) { factoryConfig.locateFile = (path, prefix) => { if (path.endsWith('.wasm')) { return wasmPath; } - return locateFile(path, prefix); + // return locateFile(path, prefix); + return prefix + path; }; // use wasm instantiateWasm override when system fetch is not available. // For detail references @@ -2909,17 +2979,17 @@ } wasmPath = path; customFetch = usePlatformFetch; - } - + } + /** @license See the LICENSE file. */ // This code is auto-generated, do not modify this file! - const version = '0.0.0'; - - exports.BackendWasm = BackendWasm; - exports.setWasmPath = setWasmPath; - exports.version_wasm = version; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}))); -//# sourceMappingURL=tf-backend-wasm.js.map + const version = '0.0.0'; + + exports.BackendWasm = BackendWasm; + exports.setWasmPath = setWasmPath; + exports.version_wasm = version; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=tf-backend-wasm.js.map diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.js b/tfjs-core/benchmarks/tfjs-backend-wasm.js index dd9b95c935f..5c2d90bd1cc 100755 --- a/tfjs-core/benchmarks/tfjs-backend-wasm.js +++ b/tfjs-core/benchmarks/tfjs-backend-wasm.js @@ -6,7 +6,7 @@ var WasmBackendModule = (function() { function(WasmBackendModule) { WasmBackendModule = WasmBackendModule || {}; -var Module=typeof WasmBackendModule!=="undefined"?WasmBackendModule:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(Module["ENVIRONMENT"]){throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)")}var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"];DYNAMIC_BASE=Module["DYNAMIC_BASE"];DYNAMICTOP_PTR=Module["DYNAMICTOP_PTR"]}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{throw new Error("environment detection error")}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(!Object.getOwnPropertyDescriptor(Module,"arguments"))Object.defineProperty(Module,"arguments",{configurable:true,get:function(){abort("Module.arguments has been replaced with plain arguments_")}});if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(!Object.getOwnPropertyDescriptor(Module,"thisProgram"))Object.defineProperty(Module,"thisProgram",{configurable:true,get:function(){abort("Module.thisProgram has been replaced with plain thisProgram")}});if(Module["quit"])quit_=Module["quit"];if(!Object.getOwnPropertyDescriptor(Module,"quit"))Object.defineProperty(Module,"quit",{configurable:true,get:function(){abort("Module.quit has been replaced with plain quit_")}});assert(typeof Module["memoryInitializerPrefixURL"]==="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["pthreadMainPrefixURL"]==="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["cdInitializerPrefixURL"]==="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["filePackagePrefixURL"]==="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["read"]==="undefined","Module.read option was removed (modify read_ in JS)");assert(typeof Module["readAsync"]==="undefined","Module.readAsync option was removed (modify readAsync in JS)");assert(typeof Module["readBinary"]==="undefined","Module.readBinary option was removed (modify readBinary in JS)");assert(typeof Module["setWindowTitle"]==="undefined","Module.setWindowTitle option was removed (modify setWindowTitle in JS)");assert(typeof Module["TOTAL_MEMORY"]==="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY");if(!Object.getOwnPropertyDescriptor(Module,"read"))Object.defineProperty(Module,"read",{configurable:true,get:function(){abort("Module.read has been replaced with plain read_")}});if(!Object.getOwnPropertyDescriptor(Module,"readAsync"))Object.defineProperty(Module,"readAsync",{configurable:true,get:function(){abort("Module.readAsync has been replaced with plain readAsync")}});if(!Object.getOwnPropertyDescriptor(Module,"readBinary"))Object.defineProperty(Module,"readBinary",{configurable:true,get:function(){abort("Module.readBinary has been replaced with plain readBinary")}});assert(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER||ENVIRONMENT_IS_NODE,"Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)");var stackSave;var stackRestore;var stackAlloc;stackSave=stackRestore=stackAlloc=function(){abort("cannot use the stack before compiled code is ready to run, and has provided stack access")};function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(!Object.getOwnPropertyDescriptor(Module,"wasmBinary"))Object.defineProperty(Module,"wasmBinary",{configurable:true,get:function(){abort("Module.wasmBinary has been replaced with plain wasmBinary")}});var noExitRuntime;if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(!Object.getOwnPropertyDescriptor(Module,"noExitRuntime"))Object.defineProperty(Module,"noExitRuntime",{configurable:true,get:function(){abort("Module.noExitRuntime has been replaced with plain noExitRuntime")}});if(typeof WebAssembly!=="object"){abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.")}var wasmMemory;var wasmTable=new WebAssembly.Table({"initial":120,"maximum":120+0,"element":"anyfunc"});var wasmModule;var threadInfoStruct=0;var selfThreadId=0;var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string")return UTF8ToString(ret);if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i=endIdx)){var u0=u8Array[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=u8Array[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=u8Array[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{if((u0&248)!=240)warnOnce("Invalid UTF-8 leading byte 0x"+u0.toString(16)+" encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!");u0=(u0&7)<<18|u1<<12|u2<<6|u8Array[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;if(u>=2097152)warnOnce("Invalid Unicode code point 0x"+u.toString(16)+" encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF).");outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");HEAP8.set(array,buffer)}var WASM_PAGE_SIZE=65536;var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var STACK_BASE=5255840,STACKTOP=STACK_BASE,STACK_MAX=12960,DYNAMIC_BASE=5255840,DYNAMICTOP_PTR=12032;assert(STACK_BASE%16===0,"stack must start aligned");assert(DYNAMIC_BASE%16===0,"heap must start aligned");if(ENVIRONMENT_IS_PTHREAD){STACK_MAX=STACKTOP=STACK_MAX=2147483647}var TOTAL_STACK=5242880;if(Module["TOTAL_STACK"])assert(TOTAL_STACK===Module["TOTAL_STACK"],"the stack size can no longer be determined at runtime");var INITIAL_INITIAL_MEMORY=Module["INITIAL_MEMORY"]||524288e3;if(!Object.getOwnPropertyDescriptor(Module,"INITIAL_MEMORY"))Object.defineProperty(Module,"INITIAL_MEMORY",{configurable:true,get:function(){abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY")}});assert(INITIAL_INITIAL_MEMORY>=TOTAL_STACK,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+INITIAL_INITIAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");assert(typeof Int32Array!=="undefined"&&typeof Float64Array!=="undefined"&&Int32Array.prototype.subarray!==undefined&&Int32Array.prototype.set!==undefined,"JS engine does not provide full typed array support");if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,"maximum":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_INITIAL_MEMORY=buffer.byteLength;assert(INITIAL_INITIAL_MEMORY%WASM_PAGE_SIZE===0);updateGlobalBufferAndViews(buffer);if(!ENVIRONMENT_IS_PTHREAD){HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE}function writeStackCookie(){assert((STACK_MAX&3)==0);HEAPU32[(STACK_MAX>>2)+1]=34821223;HEAPU32[(STACK_MAX>>2)+2]=2310721022;HEAP32[0]=1668509029}function checkStackCookie(){var cookie1=HEAPU32[(STACK_MAX>>2)+1];var cookie2=HEAPU32[(STACK_MAX>>2)+2];if(cookie1!=34821223||cookie2!=2310721022){abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+cookie2.toString(16)+" "+cookie1.toString(16))}if(HEAP32[0]!==1668509029)abort("Runtime error: The application has corrupted its heap memory area (address zero)!")}function abortStackOverflow(allocSize){abort("Stack overflow! Attempted to allocate "+allocSize+" bytes on the stack, but stack has only "+(STACK_MAX-stackSave()+allocSize)+" bytes available!")}(function(){var h16=new Int16Array(1);var h8=new Int8Array(h16.buffer);h16[0]=25459;if(h8[0]!==115||h8[1]!==99)throw"Runtime error: expected the system to be little-endian!"})();function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;if(ENVIRONMENT_IS_PTHREAD)runtimeInitialized=true;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){checkStackCookie();assert(!runtimeInitialized);runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATMAIN__)}function postRun(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Math_ceil=Math.ceil;var Math_floor=Math.floor;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!=="undefined"){runDependencyWatcher=setInterval(function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;err("still waiting on run dependencies:")}err("dependency: "+dep)}if(shown){err("(end of list)")}},1e4)}}else{err("warning: run dependency added without ID")}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id]}else{err("warning: run dependency removed without ID")}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";out(what);err(what);ABORT=true;EXITSTATUS=1;var output="abort("+what+") at "+stackTrace();what=output;throw new WebAssembly.RuntimeError(what)}var FS={error:function(){abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1")},init:function(){FS.error()},createDataFile:function(){FS.error()},createPreloadedFile:function(){FS.error()},createLazyFile:function(){FS.error()},open:function(){FS.error()},mkdev:function(){FS.error()},registerDevice:function(){FS.error()},analyzePath:function(){FS.error()},loadFilesFromDB:function(){FS.error()},ErrnoError:function ErrnoError(){FS.error()}};Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}var wasmBinaryFile="tfjs-backend-wasm.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(){try{if(wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(wasmBinaryFile)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary()})}return new Promise(function(resolve,reject){resolve(getBinary())})}function createWasm(){var info={"env":asmLibraryArg,"wasi_snapshot_preview1":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){var numWorkersToLoad=PThread.unusedWorkers.length;PThread.unusedWorkers.forEach(function(w){PThread.loadWasmModuleToWorker(w,function(){if(!--numWorkersToLoad)removeRunDependency("wasm-instantiate")})})}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}var trueModule=Module;function receiveInstantiatedSource(output){assert(Module===trueModule,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");trueModule=null;receiveInstance(output["instance"],output["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&typeof fetch==="function"){fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var ASM_CONSTS={};function initPthreadsJS(){PThread.initRuntime()}if(!ENVIRONMENT_IS_PTHREAD)__ATINIT__.push({func:function(){___wasm_call_ctors()}});function demangle(func){warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return func}function demangleAll(text){var regex=/\b_Z[\w\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"})}var __pthread_ptr=0;var __pthread_is_main_runtime_thread=0;var __pthread_is_main_browser_thread=0;function __register_pthread_ptr(pthreadPtr,isMainBrowserThread,isMainRuntimeThread){pthreadPtr=pthreadPtr|0;isMainBrowserThread=isMainBrowserThread|0;isMainRuntimeThread=isMainRuntimeThread|0;__pthread_ptr=pthreadPtr;__pthread_is_main_browser_thread=isMainBrowserThread;__pthread_is_main_runtime_thread=isMainRuntimeThread}Module["__register_pthread_ptr"]=__register_pthread_ptr;var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var __main_thread_futex_wait_address=12944;function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__main_thread_futex_wait_address>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__main_thread_futex_wait_address>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function __kill_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _kill_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _kill_thread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function __cancel_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cancel_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cancel_thread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function __cleanup_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cleanup_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cleanup_thread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];if(pthread){var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={MAIN_THREAD_ID:1,mainThreadInfo:{schedPolicy:0,schedPrio:0},unusedWorkers:[],runningWorkers:[],initRuntime:function(){__register_pthread_ptr(PThread.mainThreadBlock,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(PThread.mainThreadBlock)},initMainThreadBlock:function(){assert(!ENVIRONMENT_IS_PTHREAD);var pthreadPoolSize=8;for(var i=0;i>2]=PThread.mainThreadBlock;var headPtr=PThread.mainThreadBlock+156;HEAP32[headPtr>>2]=headPtr;var tlsMemory=12432;for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,PThread.mainThreadBlock+104>>2,tlsMemory);Atomics.store(HEAPU32,PThread.mainThreadBlock+40>>2,PThread.mainThreadBlock);Atomics.store(HEAPU32,PThread.mainThreadBlock+44>>2,42)},initWorker:function(){},pthreads:{},exitHandlers:null,setThreadStatus:function(){},runExitHandlers:function(){if(PThread.exitHandlers!==null){while(PThread.exitHandlers.length>0){PThread.exitHandlers.pop()()}PThread.exitHandlers=null}if(ENVIRONMENT_IS_PTHREAD&&threadInfoStruct)___pthread_tsd_run_dtors()},threadExit:function(exitCode){var tb=_pthread_self();if(tb){err("Pthread 0x"+tb.toString(16)+" exited.");Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);Atomics.store(HEAPU32,tb+60>>2,1);Atomics.store(HEAPU32,tb+64>>2,0);PThread.runExitHandlers();_emscripten_futex_wake(tb+0,2147483647);__register_pthread_ptr(0,0,0);threadInfoStruct=0;if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlers();Atomics.store(HEAPU32,threadInfoStruct+4>>2,-1);Atomics.store(HEAPU32,threadInfoStruct+0>>2,1);_emscripten_futex_wake(threadInfoStruct+0,2147483647);threadInfoStruct=selfThreadId=0;__register_pthread_ptr(0,0,0);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+104>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){delete PThread.pthreads[worker.pthread.thread];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined},receiveObjectTransfer:function(data){},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){__spawn_thread(e.data)}else if(cmd==="cleanupThread"){__cleanup_thread(d["thread"])}else if(cmd==="killThread"){__kill_thread(d["thread"])}else if(cmd==="cancelThread"){__cancel_thread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.thread+68>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){console.log("worker exited - TODO: update the worker queue?")})}assert(wasmMemory instanceof WebAssembly.Memory,"WebAssembly memory should have been loaded by now!");assert(wasmModule instanceof WebAssembly.Module,"WebAssembly Module should have been loaded by now!");worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule,"DYNAMIC_BASE":DYNAMIC_BASE,"DYNAMICTOP_PTR":DYNAMICTOP_PTR})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("tfjs-backend-wasm.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}if(PThread.unusedWorkers.length>0)return PThread.unusedWorkers.pop();else return null},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()>2]=value;else err("failed to set errno from JS");return value}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg);warnOnce("atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)");__ATEXIT__.unshift({func:func,arg:arg})}function ___handle_stack_overflow(){abort("stack overflow")}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({cmd:"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({targetThread:targetThreadId,cmd:"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){err("Cannot send message to thread with ID "+targetThreadId+", unknown thread ID!");return}worker.postMessage({cmd:"processThreadQueue"})}return 1}function _abort(){abort()}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){expectedStatus=expectedStatus|0;newStatus=newStatus|0}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(ENVIRONMENT_IS_WORKER){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{var loadedVal=Atomics.load(HEAP32,addr>>2);if(val!=loadedVal)return-6;var tNow=performance.now();var tEnd=tNow+timeout;Atomics.store(HEAP32,__main_thread_futex_wait_address>>2,addr);var ourWaitAddress=addr;while(addr==ourWaitAddress){tNow=performance.now();if(tNow>tEnd){return-73}_emscripten_main_thread_process_queued_calls();addr=Atomics.load(HEAP32,__main_thread_futex_wait_address>>2)}return 0}}function _emscripten_is_main_browser_thread(){return __pthread_is_main_browser_thread|0}function _emscripten_is_main_runtime_thread(){return __pthread_is_main_runtime_thread|0}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;if(numCallArgs>20-1)throw"emscripten_proxy_to_main_thread_js: Too many arguments "+numCallArgs+" to proxied function idx="+index+", maximum supported is "+(20-1)+"!";var stack=stackSave();var args=stackAlloc(numCallArgs*8);var b=args>>3;for(var i=0;i>3]);buf+=8}else if(ch===105){buf=buf+3&~3;args.push(HEAP32[buf>>2]);buf+=4}else abort("unexpected char in asm const signature "+ch)}return args}function _emscripten_receive_on_main_thread_js(index,numCallArgs,args){_emscripten_receive_on_main_thread_js_callArgs.length=numCallArgs;var b=args>>3;for(var i=0;i=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;_emscripten_async_queue_on_thread_(targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;_emscripten_async_queue_on_thread_(targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function __maybeCStringToJsString(cString){return cString===cString+0?UTF8ToString(cString):cString}var __specialEventTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function __findEventTarget(target){var domElement=__specialEventTargets[target]||(typeof document!=="undefined"?document.querySelector(__maybeCStringToJsString(target)):undefined);return domElement}function __findCanvasEventTarget(target){return __findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=__findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=__findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){newStatus=newStatus|0}function _emscripten_set_thread_name(threadId,name){threadId=threadId|0;name=name|0}function __webgl_acquireInstancedArraysExtension(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)}}}function __webgl_acquireVertexArrayObjectExtension(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)}}}function __webgl_acquireDrawBuffersExtension(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)}}}var GL={counter:1,lastError:0,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},currentContext:null,offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,init:function(){var miniTempFloatBuffer=new Float32Array(GL.MINI_TEMP_BUFFER_SIZE);for(var i=0;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;if(context.version<2){__webgl_acquireInstancedArraysExtension(GLctx);__webgl_acquireVertexArrayObjectExtension(GLctx);__webgl_acquireDrawBuffersExtension(GLctx)}GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query");var automaticallyEnabledExtensions=["OES_texture_float","OES_texture_half_float","OES_standard_derivatives","OES_vertex_array_object","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","OES_element_index_uint","EXT_texture_filter_anisotropic","EXT_frag_depth","WEBGL_draw_buffers","ANGLE_instanced_arrays","OES_texture_float_linear","OES_texture_half_float_linear","EXT_blend_minmax","EXT_shader_texture_lod","EXT_texture_norm16","WEBGL_compressed_texture_pvrtc","EXT_color_buffer_half_float","WEBGL_color_buffer_float","EXT_sRGB","WEBGL_compressed_texture_etc1","EXT_disjoint_timer_query","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_astc","EXT_color_buffer_float","WEBGL_compressed_texture_s3tc_srgb","EXT_disjoint_timer_query_webgl2","WEBKIT_WEBGL_compressed_texture_pvrtc"];var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(automaticallyEnabledExtensions.indexOf(ext)!=-1){GLctx.getExtension(ext)}})},populateUniformTable:function(program){var p=GL.programs[program];var ptable=GL.programInfos[program]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1};var utable=ptable.uniforms;var numUniforms=GLctx.getProgramParameter(p,35718);for(var i=0;i>2;contextAttributes["alpha"]=!!HEAP32[a+(0>>2)];contextAttributes["depth"]=!!HEAP32[a+(4>>2)];contextAttributes["stencil"]=!!HEAP32[a+(8>>2)];contextAttributes["antialias"]=!!HEAP32[a+(12>>2)];contextAttributes["premultipliedAlpha"]=!!HEAP32[a+(16>>2)];contextAttributes["preserveDrawingBuffer"]=!!HEAP32[a+(20>>2)];var powerPreference=HEAP32[a+(24>>2)];contextAttributes["powerPreference"]=__emscripten_webgl_power_preferences[powerPreference];contextAttributes["failIfMajorPerformanceCaveat"]=!!HEAP32[a+(28>>2)];contextAttributes.majorVersion=HEAP32[a+(32>>2)];contextAttributes.minorVersion=HEAP32[a+(36>>2)];contextAttributes.enableExtensionsByDefault=HEAP32[a+(40>>2)];contextAttributes.explicitSwapControl=HEAP32[a+(44>>2)];contextAttributes.proxyContextToMainThread=HEAP32[a+(48>>2)];contextAttributes.renderViaOffscreenBackBuffer=HEAP32[a+(52>>2)];var canvas=__findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];assert(buffer);if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:undefined,get:function(){assert(SYSCALLS.varargs!=undefined);SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){if(low>=0)assert(high===0);else assert(high===-1);return low}};function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,fd);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM");return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,fd,offset_low,offset_high,whence,newOffset);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM")}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd,iov,iovcnt,pnum);var num=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}function _pthread_cleanup_pop(execute){var routine=PThread.exitHandlers.pop();if(execute)routine()}function _pthread_cleanup_push(routine,arg){if(PThread.exitHandlers===null){PThread.exitHandlers=[]}PThread.exitHandlers.push(function(){dynCall_vi(routine,arg)})}function __spawn_thread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _spawn_thread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,thread:threadParams.pthread_ptr,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(0>>2),0);Atomics.store(HEAPU32,tis+(4>>2),0);Atomics.store(HEAPU32,tis+(8>>2),0);Atomics.store(HEAPU32,tis+(68>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(104>>2),tlsMemory);Atomics.store(HEAPU32,tis+(48>>2),0);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(44>>2),42);Atomics.store(HEAPU32,tis+(108>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(84>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(80>>2),stackHigh);Atomics.store(HEAPU32,tis+(108+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(108+12>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(108+20>>2),threadParams.schedPolicy);Atomics.store(HEAPU32,tis+(108+24>>2),threadParams.schedPrio);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(176>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"selfThreadId":threadParams.pthread_ptr,"parentThreadId":threadParams.parent_pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}}function _pthread_getschedparam(thread,policy,schedparam){if(!policy&&!schedparam)return ERRNO_CODES.EINVAL;if(!thread){err("pthread_getschedparam called with a null thread pointer!");return ERRNO_CODES.ESRCH}var self=HEAP32[thread+12>>2];if(self!==thread){err("pthread_getschedparam attempted on thread "+thread+", which does not point to a valid thread, or does not exist anymore!");return ERRNO_CODES.ESRCH}var schedPolicy=Atomics.load(HEAPU32,thread+108+20>>2);var schedPrio=Atomics.load(HEAPU32,thread+108+24>>2);if(policy)HEAP32[policy>>2]=schedPolicy;if(schedparam)HEAP32[schedparam>>2]=schedPrio;return 0}function _pthread_self(){return __pthread_ptr|0}Module["_pthread_self"]=_pthread_self;function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;var schedPolicy=0;var schedPrio=0;if(attr){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0;var inheritSched=HEAP32[attr+16>>2]===0;if(inheritSched){var prevSchedPolicy=HEAP32[attr+20>>2];var prevSchedPrio=HEAP32[attr+24>>2];var parentThreadPtr=PThread.currentProxiedOperationCallerThread?PThread.currentProxiedOperationCallerThread:_pthread_self();_pthread_getschedparam(parentThreadPtr,attr+20,attr+24);schedPolicy=HEAP32[attr+20>>2];schedPrio=HEAP32[attr+24>>2];HEAP32[attr+20>>2]=prevSchedPolicy;HEAP32[attr+24>>2]=prevSchedPrio}else{schedPolicy=HEAP32[attr+20>>2];schedPrio=HEAP32[attr+24>>2]}}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(232);for(var i=0;i<232>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+156;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,schedPolicy:schedPolicy,schedPrio:schedPrio,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,parent_pthread_ptr:_pthread_self(),arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList)}else{__spawn_thread(threadParams)}return 0}function _roundf(d){d=+d;return d>=+0?+Math_floor(d+ +.5):+Math_ceil(d-+.5)}function _sysconf(name){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,name);switch(name){case 30:return 16384;case 85:var maxHeapSize=2*1024*1024*1024-65536;maxHeapSize=524288e3;maxHeapSize=HEAPU8.length;return maxHeapSize/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:case 79:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator==="object")return navigator["hardwareConcurrency"]||1;return 1}}___setErrNo(28);return-1}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();else PThread.initWorker();var GLctx;GL.init();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_fd_close,_fd_seek,_fd_write,_sysconf];var asmLibraryArg={"__assert_fail":___assert_fail,"__call_main":___call_main,"__handle_stack_overflow":___handle_stack_overflow,"_emscripten_notify_thread_queue":__emscripten_notify_thread_queue,"abort":_abort,"emscripten_conditional_set_current_thread_status":_emscripten_conditional_set_current_thread_status,"emscripten_futex_wait":_emscripten_futex_wait,"emscripten_futex_wake":_emscripten_futex_wake,"emscripten_get_now":_emscripten_get_now,"emscripten_is_main_browser_thread":_emscripten_is_main_browser_thread,"emscripten_is_main_runtime_thread":_emscripten_is_main_runtime_thread,"emscripten_memcpy_big":_emscripten_memcpy_big,"emscripten_receive_on_main_thread_js":_emscripten_receive_on_main_thread_js,"emscripten_resize_heap":_emscripten_resize_heap,"emscripten_set_canvas_element_size":_emscripten_set_canvas_element_size,"emscripten_set_current_thread_status":_emscripten_set_current_thread_status,"emscripten_set_thread_name":_emscripten_set_thread_name,"emscripten_webgl_create_context":_emscripten_webgl_create_context,"fd_close":_fd_close,"fd_seek":_fd_seek,"fd_write":_fd_write,"initPthreadsJS":initPthreadsJS,"memory":wasmMemory||Module["wasmMemory"],"pthread_cleanup_pop":_pthread_cleanup_pop,"pthread_cleanup_push":_pthread_cleanup_push,"pthread_create":_pthread_create,"pthread_self":_pthread_self,"roundf":_roundf,"table":wasmTable};var asm=createWasm();Module["asm"]=asm;var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__wasm_call_ctors"].apply(null,arguments)};var _init=Module["_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["init"].apply(null,arguments)};var _register_tensor=Module["_register_tensor"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["register_tensor"].apply(null,arguments)};var _dispose_data=Module["_dispose_data"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose_data"].apply(null,arguments)};var _dispose=Module["_dispose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose"].apply(null,arguments)};var _Abs=Module["_Abs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Abs"].apply(null,arguments)};var _Add=Module["_Add"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Add"].apply(null,arguments)};var _AddN=Module["_AddN"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AddN"].apply(null,arguments)};var _ArgMax=Module["_ArgMax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ArgMax"].apply(null,arguments)};var _AvgPool=Module["_AvgPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AvgPool"].apply(null,arguments)};var _BatchMatMul=Module["_BatchMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["BatchMatMul"].apply(null,arguments)};var _ClipByValue=Module["_ClipByValue"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ClipByValue"].apply(null,arguments)};var _Conv2D=Module["_Conv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Conv2D"].apply(null,arguments)};var _Cos=Module["_Cos"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Cos"].apply(null,arguments)};var _CropAndResize=Module["_CropAndResize"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["CropAndResize"].apply(null,arguments)};var _DepthwiseConv2dNative=Module["_DepthwiseConv2dNative"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["DepthwiseConv2dNative"].apply(null,arguments)};var _Div=Module["_Div"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Div"].apply(null,arguments)};var _Exp=Module["_Exp"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Exp"].apply(null,arguments)};var _FloorDiv=Module["_FloorDiv"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FloorDiv"].apply(null,arguments)};var _FusedBatchNorm=Module["_FusedBatchNorm"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedBatchNorm"].apply(null,arguments)};var _FusedConv2D=Module["_FusedConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedConv2D"].apply(null,arguments)};var _FusedDepthwiseConv2D=Module["_FusedDepthwiseConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedDepthwiseConv2D"].apply(null,arguments)};var _Gather=Module["_Gather"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Gather"].apply(null,arguments)};var _GatherNd=Module["_GatherNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GatherNd"].apply(null,arguments)};var _Greater=Module["_Greater"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Greater"].apply(null,arguments)};var _GreaterEqual=Module["_GreaterEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GreaterEqual"].apply(null,arguments)};var _Less=Module["_Less"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Less"].apply(null,arguments)};var _LessEqual=Module["_LessEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LessEqual"].apply(null,arguments)};var _Log=Module["_Log"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Log"].apply(null,arguments)};var _LogicalAnd=Module["_LogicalAnd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LogicalAnd"].apply(null,arguments)};var _Max=Module["_Max"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Max"].apply(null,arguments)};var _MaxPool=Module["_MaxPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["MaxPool"].apply(null,arguments)};var _Maximum=Module["_Maximum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Maximum"].apply(null,arguments)};var _Min=Module["_Min"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Min"].apply(null,arguments)};var _Minimum=Module["_Minimum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Minimum"].apply(null,arguments)};var _Mul=Module["_Mul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Mul"].apply(null,arguments)};var _Neg=Module["_Neg"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Neg"].apply(null,arguments)};var _NonMaxSuppressionV3=Module["_NonMaxSuppressionV3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV3"].apply(null,arguments)};var _NonMaxSuppressionV5=Module["_NonMaxSuppressionV5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV5"].apply(null,arguments)};var _NotEqual=Module["_NotEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NotEqual"].apply(null,arguments)};var _PadV2=Module["_PadV2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["PadV2"].apply(null,arguments)};var _Pow=Module["_Pow"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Pow"].apply(null,arguments)};var _Prelu=Module["_Prelu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Prelu"].apply(null,arguments)};var _Relu=Module["_Relu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu"].apply(null,arguments)};var _Relu6=Module["_Relu6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu6"].apply(null,arguments)};var _ResizeBilinear=Module["_ResizeBilinear"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ResizeBilinear"].apply(null,arguments)};var _Rsqrt=Module["_Rsqrt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Rsqrt"].apply(null,arguments)};var _ScatterNd=Module["_ScatterNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ScatterNd"].apply(null,arguments)};var _Sigmoid=Module["_Sigmoid"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sigmoid"].apply(null,arguments)};var _Sin=Module["_Sin"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sin"].apply(null,arguments)};var _Softmax=Module["_Softmax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Softmax"].apply(null,arguments)};var _Sqrt=Module["_Sqrt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sqrt"].apply(null,arguments)};var _Square=Module["_Square"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Square"].apply(null,arguments)};var _Sub=Module["_Sub"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sub"].apply(null,arguments)};var _Sum=Module["_Sum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sum"].apply(null,arguments)};var _Tanh=Module["_Tanh"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tanh"].apply(null,arguments)};var _Tile=Module["_Tile"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tile"].apply(null,arguments)};var _Transpose=Module["_Transpose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Transpose"].apply(null,arguments)};var __FusedMatMul=Module["__FusedMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_FusedMatMul"].apply(null,arguments)};var _malloc=Module["_malloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["malloc"].apply(null,arguments)};var _free=Module["_free"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["free"].apply(null,arguments)};var ___em_js__initPthreadsJS=Module["___em_js__initPthreadsJS"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__em_js__initPthreadsJS"].apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_get_global_libc"].apply(null,arguments)};var _memalign=Module["_memalign"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["memalign"].apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__pthread_tsd_run_dtors"].apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null,arguments)};var _emscripten_main_browser_thread_id=Module["_emscripten_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_browser_thread_id"].apply(null,arguments)};var _emscripten_async_run_in_main_thread=Module["_emscripten_async_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread=Module["_emscripten_sync_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_0=Module["_emscripten_sync_run_in_main_thread_0"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_1=Module["_emscripten_sync_run_in_main_thread_1"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_2=Module["_emscripten_sync_run_in_main_thread_2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_xprintf_varargs=Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_3=Module["_emscripten_sync_run_in_main_thread_3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_5=Module["_emscripten_sync_run_in_main_thread_5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_6=Module["_emscripten_sync_run_in_main_thread_6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_7=Module["_emscripten_sync_run_in_main_thread_7"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null,arguments)};var _emscripten_async_queue_on_thread_=Module["_emscripten_async_queue_on_thread_"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_tls_init"].apply(null,arguments)};var ___set_stack_limit=Module["___set_stack_limit"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__set_stack_limit"].apply(null,arguments)};var stackSave=Module["stackSave"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackSave"].apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackAlloc"].apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackRestore"].apply(null,arguments)};var dynCall_vi=Module["dynCall_vi"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_vi"].apply(null,arguments)};var dynCall_v=Module["dynCall_v"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_v"].apply(null,arguments)};var dynCall_ii=Module["dynCall_ii"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_ii"].apply(null,arguments)};Module["asm"]=asm;if(!Object.getOwnPropertyDescriptor(Module,"intArrayFromString"))Module["intArrayFromString"]=function(){abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"intArrayToString"))Module["intArrayToString"]=function(){abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ccall"))Module["ccall"]=function(){abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["cwrap"]=cwrap;if(!Object.getOwnPropertyDescriptor(Module,"setValue"))Module["setValue"]=function(){abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getValue"))Module["getValue"]=function(){abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocate"))Module["allocate"]=function(){abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getMemory"))Module["getMemory"]=function(){abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ArrayToString"))Module["UTF8ArrayToString"]=function(){abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ToString"))Module["UTF8ToString"]=function(){abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8Array"))Module["stringToUTF8Array"]=function(){abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8"))Module["stringToUTF8"]=function(){abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF8"))Module["lengthBytesUTF8"]=function(){abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreRun"))Module["addOnPreRun"]=function(){abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnInit"))Module["addOnInit"]=function(){abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreMain"))Module["addOnPreMain"]=function(){abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnExit"))Module["addOnExit"]=function(){abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPostRun"))Module["addOnPostRun"]=function(){abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeStringToMemory"))Module["writeStringToMemory"]=function(){abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeArrayToMemory"))Module["writeArrayToMemory"]=function(){abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeAsciiToMemory"))Module["writeAsciiToMemory"]=function(){abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addRunDependency"))Module["addRunDependency"]=function(){abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"removeRunDependency"))Module["removeRunDependency"]=function(){abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createFolder"))Module["FS_createFolder"]=function(){abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPath"))Module["FS_createPath"]=function(){abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDataFile"))Module["FS_createDataFile"]=function(){abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPreloadedFile"))Module["FS_createPreloadedFile"]=function(){abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLazyFile"))Module["FS_createLazyFile"]=function(){abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLink"))Module["FS_createLink"]=function(){abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDevice"))Module["FS_createDevice"]=function(){abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_unlink"))Module["FS_unlink"]=function(){abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"dynamicAlloc"))Module["dynamicAlloc"]=function(){abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadDynamicLibrary"))Module["loadDynamicLibrary"]=function(){abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadWebAssemblyModule"))Module["loadWebAssemblyModule"]=function(){abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getLEB"))Module["getLEB"]=function(){abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFunctionTables"))Module["getFunctionTables"]=function(){abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"alignFunctionTables"))Module["alignFunctionTables"]=function(){abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"registerFunctions"))Module["registerFunctions"]=function(){abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addFunction"))Module["addFunction"]=function(){abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"removeFunction"))Module["removeFunction"]=function(){abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFuncWrapper"))Module["getFuncWrapper"]=function(){abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"prettyPrint"))Module["prettyPrint"]=function(){abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"makeBigInt"))Module["makeBigInt"]=function(){abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"dynCall"))Module["dynCall"]=function(){abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getCompilerSetting"))Module["getCompilerSetting"]=function(){abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"print"))Module["print"]=function(){abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"printErr"))Module["printErr"]=function(){abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getTempRet0"))Module["getTempRet0"]=function(){abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setTempRet0"))Module["setTempRet0"]=function(){abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"callMain"))Module["callMain"]=function(){abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"abort"))Module["abort"]=function(){abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToNewUTF8"))Module["stringToNewUTF8"]=function(){abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"abortOnCannotGrowMemory"))Module["abortOnCannotGrowMemory"]=function(){abort("'abortOnCannotGrowMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscripten_realloc_buffer"))Module["emscripten_realloc_buffer"]=function(){abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ENV"))Module["ENV"]=function(){abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setjmpId"))Module["setjmpId"]=function(){abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_CODES"))Module["ERRNO_CODES"]=function(){abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_MESSAGES"))Module["ERRNO_MESSAGES"]=function(){abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"DNS"))Module["DNS"]=function(){abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GAI_ERRNO_MESSAGES"))Module["GAI_ERRNO_MESSAGES"]=function(){abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Protocols"))Module["Protocols"]=function(){abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Sockets"))Module["Sockets"]=function(){abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UNWIND_CACHE"))Module["UNWIND_CACHE"]=function(){abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readAsmConstArgs"))Module["readAsmConstArgs"]=function(){abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_q"))Module["jstoi_q"]=function(){abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_s"))Module["jstoi_s"]=function(){abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH"))Module["PATH"]=function(){abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH_FS"))Module["PATH_FS"]=function(){abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SYSCALLS"))Module["SYSCALLS"]=function(){abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMmap2"))Module["syscallMmap2"]=function(){abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMunmap"))Module["syscallMunmap"]=function(){abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"flush_NO_FILESYSTEM"))Module["flush_NO_FILESYSTEM"]=function(){abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"JSEvents"))Module["JSEvents"]=function(){abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangle"))Module["demangle"]=function(){abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangleAll"))Module["demangleAll"]=function(){abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jsStackTrace"))Module["jsStackTrace"]=function(){abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64"))Module["writeI53ToI64"]=function(){abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Clamped"))Module["writeI53ToI64Clamped"]=function(){abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Signaling"))Module["writeI53ToI64Signaling"]=function(){abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Clamped"))Module["writeI53ToU64Clamped"]=function(){abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Signaling"))Module["writeI53ToU64Signaling"]=function(){abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromI64"))Module["readI53FromI64"]=function(){abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromU64"))Module["readI53FromU64"]=function(){abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertI32PairToI53"))Module["convertI32PairToI53"]=function(){abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertU32PairToI53"))Module["convertU32PairToI53"]=function(){abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Browser"))Module["Browser"]=function(){abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GL"))Module["GL"]=function(){abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGet"))Module["emscriptenWebGLGet"]=function(){abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetTexPixelData"))Module["emscriptenWebGLGetTexPixelData"]=function(){abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetUniform"))Module["emscriptenWebGLGetUniform"]=function(){abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetVertexAttrib"))Module["emscriptenWebGLGetVertexAttrib"]=function(){abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AL"))Module["AL"]=function(){abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL"))Module["SDL"]=function(){abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_gfx"))Module["SDL_gfx"]=function(){abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLUT"))Module["GLUT"]=function(){abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"EGL"))Module["EGL"]=function(){abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW_Window"))Module["GLFW_Window"]=function(){abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW"))Module["GLFW"]=function(){abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLEW"))Module["GLEW"]=function(){abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"IDBStore"))Module["IDBStore"]=function(){abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"runAndAbortIfError"))Module["runAndAbortIfError"]=function(){abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["PThread"]=PThread;if(!Object.getOwnPropertyDescriptor(Module,"establishStackSpace"))Module["establishStackSpace"]=function(){abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getNoExitRuntime"))Module["getNoExitRuntime"]=function(){abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"resetPrototype"))Module["resetPrototype"]=function(){abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"warnOnce"))Module["warnOnce"]=function(){abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackSave"))Module["stackSave"]=function(){abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackRestore"))Module["stackRestore"]=function(){abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackAlloc"))Module["stackAlloc"]=function(){abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AsciiToString"))Module["AsciiToString"]=function(){abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToAscii"))Module["stringToAscii"]=function(){abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF16ToString"))Module["UTF16ToString"]=function(){abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF16"))Module["stringToUTF16"]=function(){abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF16"))Module["lengthBytesUTF16"]=function(){abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF32ToString"))Module["UTF32ToString"]=function(){abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF32"))Module["stringToUTF32"]=function(){abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF32"))Module["lengthBytesUTF32"]=function(){abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8"))Module["allocateUTF8"]=function(){abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8OnStack"))Module["allocateUTF8OnStack"]=function(){abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["writeStackCookie"]=writeStackCookie;Module["checkStackCookie"]=checkStackCookie;Module["abortStackOverflow"]=abortStackOverflow;Module["PThread"]=PThread;Module["_pthread_self"]=_pthread_self;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NORMAL"))Object.defineProperty(Module,"ALLOC_NORMAL",{configurable:true,get:function(){abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_STACK"))Object.defineProperty(Module,"ALLOC_STACK",{configurable:true,get:function(){abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_DYNAMIC"))Object.defineProperty(Module,"ALLOC_DYNAMIC",{configurable:true,get:function(){abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NONE"))Object.defineProperty(Module,"ALLOC_NONE",{configurable:true,get:function(){abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});var calledRun;Module["then"]=function(func){if(calledRun){func(Module)}else{var old=Module["onRuntimeInitialized"];Module["onRuntimeInitialized"]=function(){if(old)old();func(Module)}}return Module};function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}writeStackCookie();preRun();if(runDependencies>0)return;function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();assert(!Module["_main"],'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}checkStackCookie()}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}if(!ENVIRONMENT_IS_PTHREAD)noExitRuntime=true;if(!ENVIRONMENT_IS_PTHREAD)run(); +function GROWABLE_HEAP_I8(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAP8}function GROWABLE_HEAP_U8(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPU8}function GROWABLE_HEAP_I32(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAP32}function GROWABLE_HEAP_U32(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPU32}function GROWABLE_HEAP_F64(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPF64}var Module=typeof WasmBackendModule!=="undefined"?WasmBackendModule:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(Module["ENVIRONMENT"]){throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)")}var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"];DYNAMIC_BASE=Module["DYNAMIC_BASE"];DYNAMICTOP_PTR=Module["DYNAMICTOP_PTR"]}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{throw new Error("environment detection error")}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(!Object.getOwnPropertyDescriptor(Module,"arguments"))Object.defineProperty(Module,"arguments",{configurable:true,get:function(){abort("Module.arguments has been replaced with plain arguments_")}});if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(!Object.getOwnPropertyDescriptor(Module,"thisProgram"))Object.defineProperty(Module,"thisProgram",{configurable:true,get:function(){abort("Module.thisProgram has been replaced with plain thisProgram")}});if(Module["quit"])quit_=Module["quit"];if(!Object.getOwnPropertyDescriptor(Module,"quit"))Object.defineProperty(Module,"quit",{configurable:true,get:function(){abort("Module.quit has been replaced with plain quit_")}});assert(typeof Module["memoryInitializerPrefixURL"]==="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["pthreadMainPrefixURL"]==="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["cdInitializerPrefixURL"]==="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["filePackagePrefixURL"]==="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["read"]==="undefined","Module.read option was removed (modify read_ in JS)");assert(typeof Module["readAsync"]==="undefined","Module.readAsync option was removed (modify readAsync in JS)");assert(typeof Module["readBinary"]==="undefined","Module.readBinary option was removed (modify readBinary in JS)");assert(typeof Module["setWindowTitle"]==="undefined","Module.setWindowTitle option was removed (modify setWindowTitle in JS)");assert(typeof Module["TOTAL_MEMORY"]==="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY");if(!Object.getOwnPropertyDescriptor(Module,"read"))Object.defineProperty(Module,"read",{configurable:true,get:function(){abort("Module.read has been replaced with plain read_")}});if(!Object.getOwnPropertyDescriptor(Module,"readAsync"))Object.defineProperty(Module,"readAsync",{configurable:true,get:function(){abort("Module.readAsync has been replaced with plain readAsync")}});if(!Object.getOwnPropertyDescriptor(Module,"readBinary"))Object.defineProperty(Module,"readBinary",{configurable:true,get:function(){abort("Module.readBinary has been replaced with plain readBinary")}});assert(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER||ENVIRONMENT_IS_NODE,"Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)");var stackSave;var stackRestore;var stackAlloc;stackSave=stackRestore=stackAlloc=function(){abort("cannot use the stack before compiled code is ready to run, and has provided stack access")};function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(!Object.getOwnPropertyDescriptor(Module,"wasmBinary"))Object.defineProperty(Module,"wasmBinary",{configurable:true,get:function(){abort("Module.wasmBinary has been replaced with plain wasmBinary")}});var noExitRuntime;if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(!Object.getOwnPropertyDescriptor(Module,"noExitRuntime"))Object.defineProperty(Module,"noExitRuntime",{configurable:true,get:function(){abort("Module.noExitRuntime has been replaced with plain noExitRuntime")}});if(typeof WebAssembly!=="object"){abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.")}var wasmMemory;var wasmTable=new WebAssembly.Table({"initial":120,"maximum":120+0,"element":"anyfunc"});var wasmModule;var threadInfoStruct=0;var selfThreadId=0;var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string")return UTF8ToString(ret);if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i=endIdx)){var u0=u8Array[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=u8Array[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=u8Array[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{if((u0&248)!=240)warnOnce("Invalid UTF-8 leading byte 0x"+u0.toString(16)+" encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!");u0=(u0&7)<<18|u1<<12|u2<<6|u8Array[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(GROWABLE_HEAP_U8(),ptr,maxBytesToRead):""}function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;if(u>=2097152)warnOnce("Invalid Unicode code point 0x"+u.toString(16)+" encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF).");outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,GROWABLE_HEAP_U8(),outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");GROWABLE_HEAP_I8().set(array,buffer)}var WASM_PAGE_SIZE=65536;function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var STACK_BASE=5255840,STACKTOP=STACK_BASE,STACK_MAX=12960,DYNAMIC_BASE=5255840,DYNAMICTOP_PTR=12032;assert(STACK_BASE%16===0,"stack must start aligned");assert(DYNAMIC_BASE%16===0,"heap must start aligned");if(ENVIRONMENT_IS_PTHREAD){STACK_MAX=STACKTOP=STACK_MAX=2147483647}var TOTAL_STACK=5242880;if(Module["TOTAL_STACK"])assert(TOTAL_STACK===Module["TOTAL_STACK"],"the stack size can no longer be determined at runtime");var INITIAL_INITIAL_MEMORY=Module["INITIAL_MEMORY"]||1073741824;if(!Object.getOwnPropertyDescriptor(Module,"INITIAL_MEMORY"))Object.defineProperty(Module,"INITIAL_MEMORY",{configurable:true,get:function(){abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY")}});assert(INITIAL_INITIAL_MEMORY>=TOTAL_STACK,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+INITIAL_INITIAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");assert(typeof Int32Array!=="undefined"&&typeof Float64Array!=="undefined"&&Int32Array.prototype.subarray!==undefined&&Int32Array.prototype.set!==undefined,"JS engine does not provide full typed array support");if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,"maximum":1073741824/WASM_PAGE_SIZE,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_INITIAL_MEMORY=buffer.byteLength;assert(INITIAL_INITIAL_MEMORY%WASM_PAGE_SIZE===0);assert(65536%WASM_PAGE_SIZE===0);updateGlobalBufferAndViews(buffer);if(!ENVIRONMENT_IS_PTHREAD){GROWABLE_HEAP_I32()[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE}function writeStackCookie(){assert((STACK_MAX&3)==0);GROWABLE_HEAP_U32()[(STACK_MAX>>2)+1]=34821223;GROWABLE_HEAP_U32()[(STACK_MAX>>2)+2]=2310721022;GROWABLE_HEAP_I32()[0]=1668509029}function checkStackCookie(){var cookie1=GROWABLE_HEAP_U32()[(STACK_MAX>>2)+1];var cookie2=GROWABLE_HEAP_U32()[(STACK_MAX>>2)+2];if(cookie1!=34821223||cookie2!=2310721022){abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+cookie2.toString(16)+" "+cookie1.toString(16))}if(GROWABLE_HEAP_I32()[0]!==1668509029)abort("Runtime error: The application has corrupted its heap memory area (address zero)!")}function abortStackOverflow(allocSize){abort("Stack overflow! Attempted to allocate "+allocSize+" bytes on the stack, but stack has only "+(STACK_MAX-stackSave()+allocSize)+" bytes available!")}(function(){var h16=new Int16Array(1);var h8=new Int8Array(h16.buffer);h16[0]=25459;if(h8[0]!==115||h8[1]!==99)throw"Runtime error: expected the system to be little-endian!"})();function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;if(ENVIRONMENT_IS_PTHREAD)runtimeInitialized=true;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){checkStackCookie();assert(!runtimeInitialized);runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATMAIN__)}function postRun(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Math_ceil=Math.ceil;var Math_floor=Math.floor;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!=="undefined"){runDependencyWatcher=setInterval(function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;err("still waiting on run dependencies:")}err("dependency: "+dep)}if(shown){err("(end of list)")}},1e4)}}else{err("warning: run dependency added without ID")}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id]}else{err("warning: run dependency removed without ID")}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";out(what);err(what);ABORT=true;EXITSTATUS=1;var output="abort("+what+") at "+stackTrace();what=output;throw new WebAssembly.RuntimeError(what)}var FS={error:function(){abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1")},init:function(){FS.error()},createDataFile:function(){FS.error()},createPreloadedFile:function(){FS.error()},createLazyFile:function(){FS.error()},open:function(){FS.error()},mkdev:function(){FS.error()},registerDevice:function(){FS.error()},analyzePath:function(){FS.error()},loadFilesFromDB:function(){FS.error()},ErrnoError:function ErrnoError(){FS.error()}};Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}var wasmBinaryFile="tfjs-backend-wasm.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(){try{if(wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(wasmBinaryFile)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary()})}return new Promise(function(resolve,reject){resolve(getBinary())})}function createWasm(){var info={"env":asmLibraryArg,"wasi_snapshot_preview1":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){var numWorkersToLoad=PThread.unusedWorkers.length;PThread.unusedWorkers.forEach(function(w){PThread.loadWasmModuleToWorker(w,function(){if(!--numWorkersToLoad)removeRunDependency("wasm-instantiate")})})}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}var trueModule=Module;function receiveInstantiatedSource(output){assert(Module===trueModule,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");trueModule=null;receiveInstance(output["instance"],output["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&typeof fetch==="function"){fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var ASM_CONSTS={};function initPthreadsJS(){PThread.initRuntime()}if(!ENVIRONMENT_IS_PTHREAD)__ATINIT__.push({func:function(){___wasm_call_ctors()}});function demangle(func){warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return func}function demangleAll(text){var regex=/\b_Z[\w\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"})}var __pthread_ptr=0;var __pthread_is_main_runtime_thread=0;var __pthread_is_main_browser_thread=0;function __register_pthread_ptr(pthreadPtr,isMainBrowserThread,isMainRuntimeThread){pthreadPtr=pthreadPtr|0;isMainBrowserThread=isMainBrowserThread|0;isMainRuntimeThread=isMainRuntimeThread|0;__pthread_ptr=pthreadPtr;__pthread_is_main_browser_thread=isMainBrowserThread;__pthread_is_main_runtime_thread=isMainRuntimeThread}Module["__register_pthread_ptr"]=__register_pthread_ptr;var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var __main_thread_futex_wait_address=12944;function _emscripten_futex_wake(addr,count){if(addr<=0||addr>GROWABLE_HEAP_I8().length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(GROWABLE_HEAP_I32(),addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function __kill_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _kill_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _kill_thread!";GROWABLE_HEAP_I32()[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function __cancel_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cancel_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cancel_thread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function __cleanup_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cleanup_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cleanup_thread!";GROWABLE_HEAP_I32()[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];if(pthread){var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={MAIN_THREAD_ID:1,mainThreadInfo:{schedPolicy:0,schedPrio:0},unusedWorkers:[],runningWorkers:[],initRuntime:function(){__register_pthread_ptr(PThread.mainThreadBlock,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(PThread.mainThreadBlock)},initMainThreadBlock:function(){assert(!ENVIRONMENT_IS_PTHREAD);var pthreadPoolSize=8;for(var i=0;i>2]=PThread.mainThreadBlock;var headPtr=PThread.mainThreadBlock+156;GROWABLE_HEAP_I32()[headPtr>>2]=headPtr;var tlsMemory=12432;for(var i=0;i<128;++i)GROWABLE_HEAP_U32()[tlsMemory/4+i]=0;Atomics.store(GROWABLE_HEAP_U32(),PThread.mainThreadBlock+104>>2,tlsMemory);Atomics.store(GROWABLE_HEAP_U32(),PThread.mainThreadBlock+40>>2,PThread.mainThreadBlock);Atomics.store(GROWABLE_HEAP_U32(),PThread.mainThreadBlock+44>>2,42)},initWorker:function(){},pthreads:{},exitHandlers:null,setThreadStatus:function(){},runExitHandlers:function(){if(PThread.exitHandlers!==null){while(PThread.exitHandlers.length>0){PThread.exitHandlers.pop()()}PThread.exitHandlers=null}if(ENVIRONMENT_IS_PTHREAD&&threadInfoStruct)___pthread_tsd_run_dtors()},threadExit:function(exitCode){var tb=_pthread_self();if(tb){err("Pthread 0x"+tb.toString(16)+" exited.");Atomics.store(GROWABLE_HEAP_U32(),tb+4>>2,exitCode);Atomics.store(GROWABLE_HEAP_U32(),tb+0>>2,1);Atomics.store(GROWABLE_HEAP_U32(),tb+60>>2,1);Atomics.store(GROWABLE_HEAP_U32(),tb+64>>2,0);PThread.runExitHandlers();_emscripten_futex_wake(tb+0,2147483647);__register_pthread_ptr(0,0,0);threadInfoStruct=0;if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlers();Atomics.store(GROWABLE_HEAP_U32(),threadInfoStruct+4>>2,-1);Atomics.store(GROWABLE_HEAP_U32(),threadInfoStruct+0>>2,1);_emscripten_futex_wake(threadInfoStruct+0,2147483647);threadInfoStruct=selfThreadId=0;__register_pthread_ptr(0,0,0);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];GROWABLE_HEAP_I32()[pthread.threadInfoStruct+104>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){delete PThread.pthreads[worker.pthread.thread];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined},receiveObjectTransfer:function(data){},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){__spawn_thread(e.data)}else if(cmd==="cleanupThread"){__cleanup_thread(d["thread"])}else if(cmd==="killThread"){__kill_thread(d["thread"])}else if(cmd==="cancelThread"){__cancel_thread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(GROWABLE_HEAP_U32(),worker.pthread.thread+68>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){console.log("worker exited - TODO: update the worker queue?")})}assert(wasmMemory instanceof WebAssembly.Memory,"WebAssembly memory should have been loaded by now!");assert(wasmModule instanceof WebAssembly.Module,"WebAssembly Module should have been loaded by now!");worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule,"DYNAMIC_BASE":DYNAMIC_BASE,"DYNAMICTOP_PTR":DYNAMICTOP_PTR})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("tfjs-backend-wasm.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}if(PThread.unusedWorkers.length>0)return PThread.unusedWorkers.pop();else return null},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()>2]=value;else err("failed to set errno from JS");return value}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg);warnOnce("atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)");__ATEXIT__.unshift({func:func,arg:arg})}function ___handle_stack_overflow(){abort("stack overflow")}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({cmd:"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({targetThread:targetThreadId,cmd:"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){err("Cannot send message to thread with ID "+targetThreadId+", unknown thread ID!");return}worker.postMessage({cmd:"processThreadQueue"})}return 1}function _abort(){abort()}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){expectedStatus=expectedStatus|0;newStatus=newStatus|0}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>GROWABLE_HEAP_I8().length||addr&3!=0)return-28;if(ENVIRONMENT_IS_WORKER){var ret=Atomics.wait(GROWABLE_HEAP_I32(),addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{var loadedVal=Atomics.load(GROWABLE_HEAP_I32(),addr>>2);if(val!=loadedVal)return-6;var tNow=performance.now();var tEnd=tNow+timeout;Atomics.store(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2,addr);var ourWaitAddress=addr;while(addr==ourWaitAddress){tNow=performance.now();if(tNow>tEnd){return-73}_emscripten_main_thread_process_queued_calls();addr=Atomics.load(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2)}return 0}}function _emscripten_is_main_browser_thread(){return __pthread_is_main_browser_thread|0}function _emscripten_is_main_runtime_thread(){return __pthread_is_main_runtime_thread|0}function _emscripten_memcpy_big(dest,src,num){GROWABLE_HEAP_U8().copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;if(numCallArgs>20-1)throw"emscripten_proxy_to_main_thread_js: Too many arguments "+numCallArgs+" to proxied function idx="+index+", maximum supported is "+(20-1)+"!";var stack=stackSave();var args=stackAlloc(numCallArgs*8);var b=args>>3;for(var i=0;i>3]);buf+=8}else if(ch===105){buf=buf+3&~3;args.push(GROWABLE_HEAP_I32()[buf>>2]);buf+=4}else abort("unexpected char in asm const signature "+ch)}return args}function _emscripten_receive_on_main_thread_js(index,numCallArgs,args){_emscripten_receive_on_main_thread_js_callArgs.length=numCallArgs;var b=args>>3;for(var i=0;i>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){console.error("emscripten_realloc_buffer: Attempted to grow heap from "+buffer.byteLength+" bytes to "+size+" bytes, but got error: "+e)}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();if(requestedSize<=oldSize){return false}var PAGE_MULTIPLE=65536;var maxHeapSize=1073741824;if(requestedSize>maxHeapSize){err("Cannot enlarge memory, asked to go up to "+requestedSize+" bytes, but the limit is "+maxHeapSize+" bytes!");return false}var minHeapSize=16777216;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(minHeapSize,requestedSize,overGrownHeapSize),PAGE_MULTIPLE));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}err("Failed to grow the heap from "+oldSize+" bytes to "+newSize+" bytes, not enough memory!");return false}var JSEvents={keyEvent:0,mouseEvent:0,wheelEvent:0,uiEvent:0,focusEvent:0,deviceOrientationEvent:0,deviceMotionEvent:0,fullscreenChangeEvent:0,pointerlockChangeEvent:0,visibilityChangeEvent:0,touchEvent:0,previousFullscreenElement:null,previousScreenX:null,previousScreenY:null,removeEventListenersRegistered:false,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;GROWABLE_HEAP_I32()[varargs+4>>2]=eventData;GROWABLE_HEAP_I32()[varargs+8>>2]=userData;_emscripten_async_queue_on_thread_(targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}GROWABLE_HEAP_I32()[varargs>>2]=targetCanvasPtr;GROWABLE_HEAP_I32()[varargs+4>>2]=width;GROWABLE_HEAP_I32()[varargs+8>>2]=height;_emscripten_async_queue_on_thread_(targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function __maybeCStringToJsString(cString){return cString===cString+0?UTF8ToString(cString):cString}var __specialEventTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function __findEventTarget(target){var domElement=__specialEventTargets[target]||(typeof document!=="undefined"?document.querySelector(__maybeCStringToJsString(target)):undefined);return domElement}function __findCanvasEventTarget(target){return __findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=__findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){GROWABLE_HEAP_I32()[canvas.canvasSharedPtr>>2]=width;GROWABLE_HEAP_I32()[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=GROWABLE_HEAP_I32()[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=__findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){newStatus=newStatus|0}function _emscripten_set_thread_name(threadId,name){threadId=threadId|0;name=name|0}function __webgl_acquireInstancedArraysExtension(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)}}}function __webgl_acquireVertexArrayObjectExtension(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)}}}function __webgl_acquireDrawBuffersExtension(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)}}}var GL={counter:1,lastError:0,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},currentContext:null,offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,init:function(){var miniTempFloatBuffer=new Float32Array(GL.MINI_TEMP_BUFFER_SIZE);for(var i=0;i>2]:-1;source+=UTF8ToString(GROWABLE_HEAP_I32()[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);GROWABLE_HEAP_I32()[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;if(context.version<2){__webgl_acquireInstancedArraysExtension(GLctx);__webgl_acquireVertexArrayObjectExtension(GLctx);__webgl_acquireDrawBuffersExtension(GLctx)}GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query");var automaticallyEnabledExtensions=["OES_texture_float","OES_texture_half_float","OES_standard_derivatives","OES_vertex_array_object","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","OES_element_index_uint","EXT_texture_filter_anisotropic","EXT_frag_depth","WEBGL_draw_buffers","ANGLE_instanced_arrays","OES_texture_float_linear","OES_texture_half_float_linear","EXT_blend_minmax","EXT_shader_texture_lod","EXT_texture_norm16","WEBGL_compressed_texture_pvrtc","EXT_color_buffer_half_float","WEBGL_color_buffer_float","EXT_sRGB","WEBGL_compressed_texture_etc1","EXT_disjoint_timer_query","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_astc","EXT_color_buffer_float","WEBGL_compressed_texture_s3tc_srgb","EXT_disjoint_timer_query_webgl2","WEBKIT_WEBGL_compressed_texture_pvrtc"];var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(automaticallyEnabledExtensions.indexOf(ext)!=-1){GLctx.getExtension(ext)}})},populateUniformTable:function(program){var p=GL.programs[program];var ptable=GL.programInfos[program]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1};var utable=ptable.uniforms;var numUniforms=GLctx.getProgramParameter(p,35718);for(var i=0;i>2;contextAttributes["alpha"]=!!GROWABLE_HEAP_I32()[a+(0>>2)];contextAttributes["depth"]=!!GROWABLE_HEAP_I32()[a+(4>>2)];contextAttributes["stencil"]=!!GROWABLE_HEAP_I32()[a+(8>>2)];contextAttributes["antialias"]=!!GROWABLE_HEAP_I32()[a+(12>>2)];contextAttributes["premultipliedAlpha"]=!!GROWABLE_HEAP_I32()[a+(16>>2)];contextAttributes["preserveDrawingBuffer"]=!!GROWABLE_HEAP_I32()[a+(20>>2)];var powerPreference=GROWABLE_HEAP_I32()[a+(24>>2)];contextAttributes["powerPreference"]=__emscripten_webgl_power_preferences[powerPreference];contextAttributes["failIfMajorPerformanceCaveat"]=!!GROWABLE_HEAP_I32()[a+(28>>2)];contextAttributes.majorVersion=GROWABLE_HEAP_I32()[a+(32>>2)];contextAttributes.minorVersion=GROWABLE_HEAP_I32()[a+(36>>2)];contextAttributes.enableExtensionsByDefault=GROWABLE_HEAP_I32()[a+(40>>2)];contextAttributes.explicitSwapControl=GROWABLE_HEAP_I32()[a+(44>>2)];contextAttributes.proxyContextToMainThread=GROWABLE_HEAP_I32()[a+(48>>2)];contextAttributes.renderViaOffscreenBackBuffer=GROWABLE_HEAP_I32()[a+(52>>2)];var canvas=__findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];assert(buffer);if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:undefined,get:function(){assert(SYSCALLS.varargs!=undefined);SYSCALLS.varargs+=4;var ret=GROWABLE_HEAP_I32()[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){if(low>=0)assert(high===0);else assert(high===-1);return low}};function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,fd);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM");return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,fd,offset_low,offset_high,whence,newOffset);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM")}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd,iov,iovcnt,pnum);var num=0;for(var i=0;i>2];var len=GROWABLE_HEAP_I32()[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}function _pthread_cleanup_pop(execute){var routine=PThread.exitHandlers.pop();if(execute)routine()}function _pthread_cleanup_push(routine,arg){if(PThread.exitHandlers===null){PThread.exitHandlers=[]}PThread.exitHandlers.push(function(){dynCall_vi(routine,arg)})}function __spawn_thread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _spawn_thread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){GROWABLE_HEAP_I32()[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,thread:threadParams.pthread_ptr,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(GROWABLE_HEAP_U32(),tis+(0>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(4>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(8>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(68>>2),threadParams.detached);Atomics.store(GROWABLE_HEAP_U32(),tis+(104>>2),tlsMemory);Atomics.store(GROWABLE_HEAP_U32(),tis+(48>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(40>>2),pthread.threadInfoStruct);Atomics.store(GROWABLE_HEAP_U32(),tis+(44>>2),42);Atomics.store(GROWABLE_HEAP_U32(),tis+(108>>2),threadParams.stackSize);Atomics.store(GROWABLE_HEAP_U32(),tis+(84>>2),threadParams.stackSize);Atomics.store(GROWABLE_HEAP_U32(),tis+(80>>2),stackHigh);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+8>>2),stackHigh);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+12>>2),threadParams.detached);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+20>>2),threadParams.schedPolicy);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+24>>2),threadParams.schedPrio);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(GROWABLE_HEAP_U32(),tis+(176>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"selfThreadId":threadParams.pthread_ptr,"parentThreadId":threadParams.parent_pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}}function _pthread_getschedparam(thread,policy,schedparam){if(!policy&&!schedparam)return ERRNO_CODES.EINVAL;if(!thread){err("pthread_getschedparam called with a null thread pointer!");return ERRNO_CODES.ESRCH}var self=GROWABLE_HEAP_I32()[thread+12>>2];if(self!==thread){err("pthread_getschedparam attempted on thread "+thread+", which does not point to a valid thread, or does not exist anymore!");return ERRNO_CODES.ESRCH}var schedPolicy=Atomics.load(GROWABLE_HEAP_U32(),thread+108+20>>2);var schedPrio=Atomics.load(GROWABLE_HEAP_U32(),thread+108+24>>2);if(policy)GROWABLE_HEAP_I32()[policy>>2]=schedPolicy;if(schedparam)GROWABLE_HEAP_I32()[schedparam>>2]=schedPrio;return 0}function _pthread_self(){return __pthread_ptr|0}Module["_pthread_self"]=_pthread_self;function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;var schedPolicy=0;var schedPrio=0;if(attr){stackSize=GROWABLE_HEAP_I32()[attr>>2];stackSize+=81920;stackBase=GROWABLE_HEAP_I32()[attr+8>>2];detached=GROWABLE_HEAP_I32()[attr+12>>2]!==0;var inheritSched=GROWABLE_HEAP_I32()[attr+16>>2]===0;if(inheritSched){var prevSchedPolicy=GROWABLE_HEAP_I32()[attr+20>>2];var prevSchedPrio=GROWABLE_HEAP_I32()[attr+24>>2];var parentThreadPtr=PThread.currentProxiedOperationCallerThread?PThread.currentProxiedOperationCallerThread:_pthread_self();_pthread_getschedparam(parentThreadPtr,attr+20,attr+24);schedPolicy=GROWABLE_HEAP_I32()[attr+20>>2];schedPrio=GROWABLE_HEAP_I32()[attr+24>>2];GROWABLE_HEAP_I32()[attr+20>>2]=prevSchedPolicy;GROWABLE_HEAP_I32()[attr+24>>2]=prevSchedPrio}else{schedPolicy=GROWABLE_HEAP_I32()[attr+20>>2];schedPrio=GROWABLE_HEAP_I32()[attr+24>>2]}}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(232);for(var i=0;i<232>>2;++i)GROWABLE_HEAP_U32()[(threadInfoStruct>>2)+i]=0;GROWABLE_HEAP_I32()[pthread_ptr>>2]=threadInfoStruct;GROWABLE_HEAP_I32()[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+156;GROWABLE_HEAP_I32()[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,schedPolicy:schedPolicy,schedPrio:schedPrio,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,parent_pthread_ptr:_pthread_self(),arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList)}else{__spawn_thread(threadParams)}return 0}function _roundf(d){d=+d;return d>=+0?+Math_floor(d+ +.5):+Math_ceil(d-+.5)}function _sysconf(name){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,name);switch(name){case 30:return 16384;case 85:var maxHeapSize=2*1024*1024*1024-65536;maxHeapSize=1073741824;return maxHeapSize/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:case 79:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator==="object")return navigator["hardwareConcurrency"]||1;return 1}}___setErrNo(28);return-1}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();else PThread.initWorker();var GLctx;GL.init();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_fd_close,_fd_seek,_fd_write,_sysconf];var asmLibraryArg={"__assert_fail":___assert_fail,"__call_main":___call_main,"__handle_stack_overflow":___handle_stack_overflow,"_emscripten_notify_thread_queue":__emscripten_notify_thread_queue,"abort":_abort,"emscripten_conditional_set_current_thread_status":_emscripten_conditional_set_current_thread_status,"emscripten_futex_wait":_emscripten_futex_wait,"emscripten_futex_wake":_emscripten_futex_wake,"emscripten_get_now":_emscripten_get_now,"emscripten_is_main_browser_thread":_emscripten_is_main_browser_thread,"emscripten_is_main_runtime_thread":_emscripten_is_main_runtime_thread,"emscripten_memcpy_big":_emscripten_memcpy_big,"emscripten_receive_on_main_thread_js":_emscripten_receive_on_main_thread_js,"emscripten_resize_heap":_emscripten_resize_heap,"emscripten_set_canvas_element_size":_emscripten_set_canvas_element_size,"emscripten_set_current_thread_status":_emscripten_set_current_thread_status,"emscripten_set_thread_name":_emscripten_set_thread_name,"emscripten_webgl_create_context":_emscripten_webgl_create_context,"fd_close":_fd_close,"fd_seek":_fd_seek,"fd_write":_fd_write,"initPthreadsJS":initPthreadsJS,"memory":wasmMemory||Module["wasmMemory"],"pthread_cleanup_pop":_pthread_cleanup_pop,"pthread_cleanup_push":_pthread_cleanup_push,"pthread_create":_pthread_create,"pthread_self":_pthread_self,"roundf":_roundf,"table":wasmTable};var asm=createWasm();Module["asm"]=asm;var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__wasm_call_ctors"].apply(null,arguments)};var _init=Module["_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["init"].apply(null,arguments)};var _register_tensor=Module["_register_tensor"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["register_tensor"].apply(null,arguments)};var _dispose_data=Module["_dispose_data"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose_data"].apply(null,arguments)};var _dispose=Module["_dispose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose"].apply(null,arguments)};var _Abs=Module["_Abs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Abs"].apply(null,arguments)};var _Add=Module["_Add"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Add"].apply(null,arguments)};var _AddN=Module["_AddN"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AddN"].apply(null,arguments)};var _ArgMax=Module["_ArgMax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ArgMax"].apply(null,arguments)};var _AvgPool=Module["_AvgPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AvgPool"].apply(null,arguments)};var _BatchMatMul=Module["_BatchMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["BatchMatMul"].apply(null,arguments)};var _ClipByValue=Module["_ClipByValue"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ClipByValue"].apply(null,arguments)};var _Conv2D=Module["_Conv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Conv2D"].apply(null,arguments)};var _Cos=Module["_Cos"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Cos"].apply(null,arguments)};var _CropAndResize=Module["_CropAndResize"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["CropAndResize"].apply(null,arguments)};var _DepthwiseConv2dNative=Module["_DepthwiseConv2dNative"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["DepthwiseConv2dNative"].apply(null,arguments)};var _Div=Module["_Div"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Div"].apply(null,arguments)};var _Exp=Module["_Exp"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Exp"].apply(null,arguments)};var _FloorDiv=Module["_FloorDiv"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FloorDiv"].apply(null,arguments)};var _FusedBatchNorm=Module["_FusedBatchNorm"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedBatchNorm"].apply(null,arguments)};var _FusedConv2D=Module["_FusedConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedConv2D"].apply(null,arguments)};var _FusedDepthwiseConv2D=Module["_FusedDepthwiseConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedDepthwiseConv2D"].apply(null,arguments)};var _Gather=Module["_Gather"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Gather"].apply(null,arguments)};var _GatherNd=Module["_GatherNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GatherNd"].apply(null,arguments)};var _Greater=Module["_Greater"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Greater"].apply(null,arguments)};var _GreaterEqual=Module["_GreaterEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GreaterEqual"].apply(null,arguments)};var _Less=Module["_Less"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Less"].apply(null,arguments)};var _LessEqual=Module["_LessEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LessEqual"].apply(null,arguments)};var _Log=Module["_Log"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Log"].apply(null,arguments)};var _LogicalAnd=Module["_LogicalAnd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LogicalAnd"].apply(null,arguments)};var _Max=Module["_Max"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Max"].apply(null,arguments)};var _MaxPool=Module["_MaxPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["MaxPool"].apply(null,arguments)};var _Maximum=Module["_Maximum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Maximum"].apply(null,arguments)};var _Min=Module["_Min"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Min"].apply(null,arguments)};var _Minimum=Module["_Minimum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Minimum"].apply(null,arguments)};var _Mul=Module["_Mul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Mul"].apply(null,arguments)};var _Neg=Module["_Neg"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Neg"].apply(null,arguments)};var _NonMaxSuppressionV3=Module["_NonMaxSuppressionV3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV3"].apply(null,arguments)};var _NonMaxSuppressionV5=Module["_NonMaxSuppressionV5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV5"].apply(null,arguments)};var _NotEqual=Module["_NotEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NotEqual"].apply(null,arguments)};var _PadV2=Module["_PadV2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["PadV2"].apply(null,arguments)};var _Pow=Module["_Pow"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Pow"].apply(null,arguments)};var _Prelu=Module["_Prelu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Prelu"].apply(null,arguments)};var _Relu=Module["_Relu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu"].apply(null,arguments)};var _Relu6=Module["_Relu6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu6"].apply(null,arguments)};var _ResizeBilinear=Module["_ResizeBilinear"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ResizeBilinear"].apply(null,arguments)};var _Rsqrt=Module["_Rsqrt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Rsqrt"].apply(null,arguments)};var _ScatterNd=Module["_ScatterNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ScatterNd"].apply(null,arguments)};var _Sigmoid=Module["_Sigmoid"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sigmoid"].apply(null,arguments)};var _Sin=Module["_Sin"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sin"].apply(null,arguments)};var _Softmax=Module["_Softmax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Softmax"].apply(null,arguments)};var _Sqrt=Module["_Sqrt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sqrt"].apply(null,arguments)};var _Square=Module["_Square"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Square"].apply(null,arguments)};var _Sub=Module["_Sub"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sub"].apply(null,arguments)};var _Sum=Module["_Sum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sum"].apply(null,arguments)};var _Tanh=Module["_Tanh"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tanh"].apply(null,arguments)};var _Tile=Module["_Tile"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tile"].apply(null,arguments)};var _Transpose=Module["_Transpose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Transpose"].apply(null,arguments)};var __FusedMatMul=Module["__FusedMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_FusedMatMul"].apply(null,arguments)};var _malloc=Module["_malloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["malloc"].apply(null,arguments)};var _free=Module["_free"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["free"].apply(null,arguments)};var ___em_js__initPthreadsJS=Module["___em_js__initPthreadsJS"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__em_js__initPthreadsJS"].apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_get_global_libc"].apply(null,arguments)};var _memalign=Module["_memalign"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["memalign"].apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__pthread_tsd_run_dtors"].apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null,arguments)};var _emscripten_main_browser_thread_id=Module["_emscripten_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_browser_thread_id"].apply(null,arguments)};var _emscripten_async_run_in_main_thread=Module["_emscripten_async_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread=Module["_emscripten_sync_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_0=Module["_emscripten_sync_run_in_main_thread_0"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_1=Module["_emscripten_sync_run_in_main_thread_1"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_2=Module["_emscripten_sync_run_in_main_thread_2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_xprintf_varargs=Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_3=Module["_emscripten_sync_run_in_main_thread_3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_5=Module["_emscripten_sync_run_in_main_thread_5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_6=Module["_emscripten_sync_run_in_main_thread_6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_7=Module["_emscripten_sync_run_in_main_thread_7"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null,arguments)};var _emscripten_async_queue_on_thread_=Module["_emscripten_async_queue_on_thread_"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_tls_init"].apply(null,arguments)};var ___set_stack_limit=Module["___set_stack_limit"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__set_stack_limit"].apply(null,arguments)};var stackSave=Module["stackSave"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackSave"].apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackAlloc"].apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackRestore"].apply(null,arguments)};var dynCall_vi=Module["dynCall_vi"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_vi"].apply(null,arguments)};var dynCall_v=Module["dynCall_v"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_v"].apply(null,arguments)};var dynCall_ii=Module["dynCall_ii"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_ii"].apply(null,arguments)};Module["asm"]=asm;if(!Object.getOwnPropertyDescriptor(Module,"intArrayFromString"))Module["intArrayFromString"]=function(){abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"intArrayToString"))Module["intArrayToString"]=function(){abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ccall"))Module["ccall"]=function(){abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["cwrap"]=cwrap;if(!Object.getOwnPropertyDescriptor(Module,"setValue"))Module["setValue"]=function(){abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getValue"))Module["getValue"]=function(){abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocate"))Module["allocate"]=function(){abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getMemory"))Module["getMemory"]=function(){abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ArrayToString"))Module["UTF8ArrayToString"]=function(){abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ToString"))Module["UTF8ToString"]=function(){abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8Array"))Module["stringToUTF8Array"]=function(){abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8"))Module["stringToUTF8"]=function(){abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF8"))Module["lengthBytesUTF8"]=function(){abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreRun"))Module["addOnPreRun"]=function(){abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnInit"))Module["addOnInit"]=function(){abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreMain"))Module["addOnPreMain"]=function(){abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnExit"))Module["addOnExit"]=function(){abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPostRun"))Module["addOnPostRun"]=function(){abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeStringToMemory"))Module["writeStringToMemory"]=function(){abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeArrayToMemory"))Module["writeArrayToMemory"]=function(){abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeAsciiToMemory"))Module["writeAsciiToMemory"]=function(){abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addRunDependency"))Module["addRunDependency"]=function(){abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"removeRunDependency"))Module["removeRunDependency"]=function(){abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createFolder"))Module["FS_createFolder"]=function(){abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPath"))Module["FS_createPath"]=function(){abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDataFile"))Module["FS_createDataFile"]=function(){abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPreloadedFile"))Module["FS_createPreloadedFile"]=function(){abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLazyFile"))Module["FS_createLazyFile"]=function(){abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLink"))Module["FS_createLink"]=function(){abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDevice"))Module["FS_createDevice"]=function(){abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_unlink"))Module["FS_unlink"]=function(){abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"dynamicAlloc"))Module["dynamicAlloc"]=function(){abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadDynamicLibrary"))Module["loadDynamicLibrary"]=function(){abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadWebAssemblyModule"))Module["loadWebAssemblyModule"]=function(){abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getLEB"))Module["getLEB"]=function(){abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFunctionTables"))Module["getFunctionTables"]=function(){abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"alignFunctionTables"))Module["alignFunctionTables"]=function(){abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"registerFunctions"))Module["registerFunctions"]=function(){abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addFunction"))Module["addFunction"]=function(){abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"removeFunction"))Module["removeFunction"]=function(){abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFuncWrapper"))Module["getFuncWrapper"]=function(){abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"prettyPrint"))Module["prettyPrint"]=function(){abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"makeBigInt"))Module["makeBigInt"]=function(){abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"dynCall"))Module["dynCall"]=function(){abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getCompilerSetting"))Module["getCompilerSetting"]=function(){abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"print"))Module["print"]=function(){abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"printErr"))Module["printErr"]=function(){abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getTempRet0"))Module["getTempRet0"]=function(){abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setTempRet0"))Module["setTempRet0"]=function(){abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"callMain"))Module["callMain"]=function(){abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"abort"))Module["abort"]=function(){abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToNewUTF8"))Module["stringToNewUTF8"]=function(){abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscripten_realloc_buffer"))Module["emscripten_realloc_buffer"]=function(){abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ENV"))Module["ENV"]=function(){abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setjmpId"))Module["setjmpId"]=function(){abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_CODES"))Module["ERRNO_CODES"]=function(){abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_MESSAGES"))Module["ERRNO_MESSAGES"]=function(){abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"DNS"))Module["DNS"]=function(){abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GAI_ERRNO_MESSAGES"))Module["GAI_ERRNO_MESSAGES"]=function(){abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Protocols"))Module["Protocols"]=function(){abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Sockets"))Module["Sockets"]=function(){abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UNWIND_CACHE"))Module["UNWIND_CACHE"]=function(){abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readAsmConstArgs"))Module["readAsmConstArgs"]=function(){abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_q"))Module["jstoi_q"]=function(){abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_s"))Module["jstoi_s"]=function(){abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH"))Module["PATH"]=function(){abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH_FS"))Module["PATH_FS"]=function(){abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SYSCALLS"))Module["SYSCALLS"]=function(){abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMmap2"))Module["syscallMmap2"]=function(){abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMunmap"))Module["syscallMunmap"]=function(){abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"flush_NO_FILESYSTEM"))Module["flush_NO_FILESYSTEM"]=function(){abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"JSEvents"))Module["JSEvents"]=function(){abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangle"))Module["demangle"]=function(){abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangleAll"))Module["demangleAll"]=function(){abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jsStackTrace"))Module["jsStackTrace"]=function(){abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64"))Module["writeI53ToI64"]=function(){abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Clamped"))Module["writeI53ToI64Clamped"]=function(){abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Signaling"))Module["writeI53ToI64Signaling"]=function(){abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Clamped"))Module["writeI53ToU64Clamped"]=function(){abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Signaling"))Module["writeI53ToU64Signaling"]=function(){abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromI64"))Module["readI53FromI64"]=function(){abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromU64"))Module["readI53FromU64"]=function(){abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertI32PairToI53"))Module["convertI32PairToI53"]=function(){abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertU32PairToI53"))Module["convertU32PairToI53"]=function(){abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Browser"))Module["Browser"]=function(){abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GL"))Module["GL"]=function(){abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGet"))Module["emscriptenWebGLGet"]=function(){abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetTexPixelData"))Module["emscriptenWebGLGetTexPixelData"]=function(){abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetUniform"))Module["emscriptenWebGLGetUniform"]=function(){abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetVertexAttrib"))Module["emscriptenWebGLGetVertexAttrib"]=function(){abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AL"))Module["AL"]=function(){abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL"))Module["SDL"]=function(){abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_gfx"))Module["SDL_gfx"]=function(){abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLUT"))Module["GLUT"]=function(){abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"EGL"))Module["EGL"]=function(){abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW_Window"))Module["GLFW_Window"]=function(){abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW"))Module["GLFW"]=function(){abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLEW"))Module["GLEW"]=function(){abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"IDBStore"))Module["IDBStore"]=function(){abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"runAndAbortIfError"))Module["runAndAbortIfError"]=function(){abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["PThread"]=PThread;if(!Object.getOwnPropertyDescriptor(Module,"establishStackSpace"))Module["establishStackSpace"]=function(){abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getNoExitRuntime"))Module["getNoExitRuntime"]=function(){abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"resetPrototype"))Module["resetPrototype"]=function(){abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"warnOnce"))Module["warnOnce"]=function(){abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackSave"))Module["stackSave"]=function(){abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackRestore"))Module["stackRestore"]=function(){abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackAlloc"))Module["stackAlloc"]=function(){abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AsciiToString"))Module["AsciiToString"]=function(){abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToAscii"))Module["stringToAscii"]=function(){abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF16ToString"))Module["UTF16ToString"]=function(){abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF16"))Module["stringToUTF16"]=function(){abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF16"))Module["lengthBytesUTF16"]=function(){abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF32ToString"))Module["UTF32ToString"]=function(){abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF32"))Module["stringToUTF32"]=function(){abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF32"))Module["lengthBytesUTF32"]=function(){abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8"))Module["allocateUTF8"]=function(){abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8OnStack"))Module["allocateUTF8OnStack"]=function(){abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["writeStackCookie"]=writeStackCookie;Module["checkStackCookie"]=checkStackCookie;Module["abortStackOverflow"]=abortStackOverflow;Module["PThread"]=PThread;Module["_pthread_self"]=_pthread_self;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NORMAL"))Object.defineProperty(Module,"ALLOC_NORMAL",{configurable:true,get:function(){abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_STACK"))Object.defineProperty(Module,"ALLOC_STACK",{configurable:true,get:function(){abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_DYNAMIC"))Object.defineProperty(Module,"ALLOC_DYNAMIC",{configurable:true,get:function(){abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NONE"))Object.defineProperty(Module,"ALLOC_NONE",{configurable:true,get:function(){abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});var calledRun;Module["then"]=function(func){if(calledRun){func(Module)}else{var old=Module["onRuntimeInitialized"];Module["onRuntimeInitialized"]=function(){if(old)old();func(Module)}}return Module};function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}writeStackCookie();preRun();if(runDependencies>0)return;function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();assert(!Module["_main"],'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}checkStackCookie()}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}if(!ENVIRONMENT_IS_PTHREAD)noExitRuntime=true;if(!ENVIRONMENT_IS_PTHREAD)run(); return WasmBackendModule diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.wasm b/tfjs-core/benchmarks/tfjs-backend-wasm.wasm index cc25c34ed49e8da0d8bf397266d2136126103aa4..cdd737aebd9db68cddba7185238302652458c7cf 100644 GIT binary patch delta 118 zcmX?qiSyzm&JFXJ7%y+0&*Z?&*3iHRM9q&`w?AfOY^avw6fja^Fk|9zWB@`Q1qNwe z1}Oz54X{81=k&%#MqybFGoVff1qKC1NA{8|1x7Qb9!4OWF-wWjkz@MCMn-W)_UR`Z P8BG~Ew*PNr40sLzdR-n4 delta 146 zcmcb3iSzs=&JFXJ7%y&~&*Z?&a=`9@UGr1c?N3=58>-XT1dNmz%$Rr_8Gw*SfkB#= zK}vy111!+M_Jgfad^X&>%4Y From b42f2810ca4444a19abe9e49d9b822bf80a8fece Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Tue, 12 May 2020 13:29:28 -0400 Subject: [PATCH 76/85] build --- tfjs-backend-wasm/src/cc/BUILD | 2 +- tfjs-backend-wasm/src/cc/backend.cc | 2 +- tfjs-core/benchmarks/index.html | 3 ++- tfjs-core/benchmarks/tfjs-backend-wasm.wasm | Bin 158033 -> 158033 bytes 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tfjs-backend-wasm/src/cc/BUILD b/tfjs-backend-wasm/src/cc/BUILD index a13301f2d09..d3e3b7db96d 100644 --- a/tfjs-backend-wasm/src/cc/BUILD +++ b/tfjs-backend-wasm/src/cc/BUILD @@ -22,7 +22,7 @@ cc_binary( "-s EXPORT_NAME=WasmBackendModule", "-s MALLOC=emmalloc", "-s USE_PTHREADS=1", - "-s PTHREAD_POOL_SIZE=8", + "-s PTHREAD_POOL_SIZE=4", "-s ASSERTIONS=1", "-s INITIAL_MEMORY=1Gb", "-s MAXIMUM_MEMORY=1Gb", diff --git a/tfjs-backend-wasm/src/cc/backend.cc b/tfjs-backend-wasm/src/cc/backend.cc index 4011c85490b..6fef800c321 100644 --- a/tfjs-backend-wasm/src/cc/backend.cc +++ b/tfjs-backend-wasm/src/cc/backend.cc @@ -49,7 +49,7 @@ TensorInfo &get_tensor_info_out(const size_t tensor_id) { size_t xnn_operator_count = 0; -pthreadpool *threadpool = pthreadpool_create(8); +pthreadpool *threadpool = pthreadpool_create(4); // Registers a disposal callback for a tensor id with a given callback function. void register_disposal_callback(const size_t tensor_id, diff --git a/tfjs-core/benchmarks/index.html b/tfjs-core/benchmarks/index.html index 2980cbc0d4b..8bd51bfb1ac 100644 --- a/tfjs-core/benchmarks/index.html +++ b/tfjs-core/benchmarks/index.html @@ -224,7 +224,8 @@

TensorFlow.js Model Benchmark

if (res instanceof tf.Tensor) { const tmp = res; - res = await res.data(); + res.dataSync(); + // res = await res.data(); tmp.dispose(); } const dur = performance.now() - start; diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.wasm b/tfjs-core/benchmarks/tfjs-backend-wasm.wasm index cdd737aebd9db68cddba7185238302652458c7cf..b95af44b8e93f7b03413caa6cf913f8fb7596d12 100644 GIT binary patch delta 127 zcmcb3iSyzm&W0_Fsf}r@0!B&>h0TyUr{lg6u26L4dTtPAn zjx1(O4$KY;3<`{n>?K(WjAl$dj6gPHmJ*{Qi#sm^H&BgAmcThiAkFwsoQVZUGfzL= P$Y{#QvYoMsG2l4>IC~g{ delta 127 zcmcb3iSyzm&W0_Fsf}rz0!B&>h0TyWB{KE|t26L4dTtPAn zjvQu84$KY;3<`{n>?K(WjAl$dj6gPHmJ*{QhdVC=H&BgAmcThiAkFwsoQVZUvrj+W P$Y{#Qv7NDrG2l4>J(C!n From b5f85280e7b1bc1cee7c368ec90e1e64012570b2 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Tue, 12 May 2020 13:30:03 -0400 Subject: [PATCH 77/85] beautify --- tfjs-core/benchmarks/tfjs-backend-wasm.js | 3436 ++++++++++++++++- .../benchmarks/tfjs-backend-wasm.worker.js | 152 +- 2 files changed, 3573 insertions(+), 15 deletions(-) diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.js b/tfjs-core/benchmarks/tfjs-backend-wasm.js index 5c2d90bd1cc..3ade0b1c408 100755 --- a/tfjs-core/benchmarks/tfjs-backend-wasm.js +++ b/tfjs-core/benchmarks/tfjs-backend-wasm.js @@ -1,22 +1,3430 @@ - -var WasmBackendModule = (function() { +var WasmBackendModule = (function () { var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; return ( -function(WasmBackendModule) { - WasmBackendModule = WasmBackendModule || {}; + function (WasmBackendModule) { + WasmBackendModule = WasmBackendModule || {}; + + function GROWABLE_HEAP_I8() { + if (wasmMemory.buffer != buffer) { + updateGlobalBufferAndViews(wasmMemory.buffer) + } + return HEAP8 + } + + function GROWABLE_HEAP_U8() { + if (wasmMemory.buffer != buffer) { + updateGlobalBufferAndViews(wasmMemory.buffer) + } + return HEAPU8 + } + + function GROWABLE_HEAP_I32() { + if (wasmMemory.buffer != buffer) { + updateGlobalBufferAndViews(wasmMemory.buffer) + } + return HEAP32 + } + + function GROWABLE_HEAP_U32() { + if (wasmMemory.buffer != buffer) { + updateGlobalBufferAndViews(wasmMemory.buffer) + } + return HEAPU32 + } + + function GROWABLE_HEAP_F64() { + if (wasmMemory.buffer != buffer) { + updateGlobalBufferAndViews(wasmMemory.buffer) + } + return HEAPF64 + } + var Module = typeof WasmBackendModule !== "undefined" ? WasmBackendModule : {}; + var moduleOverrides = {}; + var key; + for (key in Module) { + if (Module.hasOwnProperty(key)) { + moduleOverrides[key] = Module[key] + } + } + var arguments_ = []; + var thisProgram = "./this.program"; + var quit_ = function (status, toThrow) { + throw toThrow + }; + var ENVIRONMENT_IS_WEB = false; + var ENVIRONMENT_IS_WORKER = false; + var ENVIRONMENT_IS_NODE = false; + var ENVIRONMENT_IS_SHELL = false; + ENVIRONMENT_IS_WEB = typeof window === "object"; + ENVIRONMENT_IS_WORKER = typeof importScripts === "function"; + ENVIRONMENT_IS_NODE = typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string"; + ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER; + if (Module["ENVIRONMENT"]) { + throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)") + } + var ENVIRONMENT_IS_PTHREAD = Module["ENVIRONMENT_IS_PTHREAD"] || false; + if (ENVIRONMENT_IS_PTHREAD) { + buffer = Module["buffer"]; + DYNAMIC_BASE = Module["DYNAMIC_BASE"]; + DYNAMICTOP_PTR = Module["DYNAMICTOP_PTR"] + } + var scriptDirectory = ""; + + function locateFile(path) { + if (Module["locateFile"]) { + return Module["locateFile"](path, scriptDirectory) + } + return scriptDirectory + path + } + var read_, readAsync, readBinary, setWindowTitle; + var nodeFS; + var nodePath; + if (ENVIRONMENT_IS_NODE) { + if (ENVIRONMENT_IS_WORKER) { + scriptDirectory = require("path").dirname(scriptDirectory) + "/" + } else { + scriptDirectory = __dirname + "/" + } + read_ = function shell_read(filename, binary) { + if (!nodeFS) nodeFS = require("fs"); + if (!nodePath) nodePath = require("path"); + filename = nodePath["normalize"](filename); + return nodeFS["readFileSync"](filename, binary ? null : "utf8") + }; + readBinary = function readBinary(filename) { + var ret = read_(filename, true); + if (!ret.buffer) { + ret = new Uint8Array(ret) + } + assert(ret.buffer); + return ret + }; + if (process["argv"].length > 1) { + thisProgram = process["argv"][1].replace(/\\/g, "/") + } + arguments_ = process["argv"].slice(2); + process["on"]("uncaughtException", function (ex) { + if (!(ex instanceof ExitStatus)) { + throw ex + } + }); + process["on"]("unhandledRejection", abort); + quit_ = function (status) { + process["exit"](status) + }; + Module["inspect"] = function () { + return "[Emscripten Module object]" + }; + var nodeWorkerThreads; + try { + nodeWorkerThreads = require("worker_threads") + } catch (e) { + console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'); + throw e + } + Worker = nodeWorkerThreads.Worker + } else if (ENVIRONMENT_IS_SHELL) { + if (typeof read != "undefined") { + read_ = function shell_read(f) { + return read(f) + } + } + readBinary = function readBinary(f) { + var data; + if (typeof readbuffer === "function") { + return new Uint8Array(readbuffer(f)) + } + data = read(f, "binary"); + assert(typeof data === "object"); + return data + }; + if (typeof scriptArgs != "undefined") { + arguments_ = scriptArgs + } else if (typeof arguments != "undefined") { + arguments_ = arguments + } + if (typeof quit === "function") { + quit_ = function (status) { + quit(status) + } + } + if (typeof print !== "undefined") { + if (typeof console === "undefined") console = {}; + console.log = print; + console.warn = console.error = typeof printErr !== "undefined" ? printErr : print + } + } else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { + if (ENVIRONMENT_IS_WORKER) { + scriptDirectory = self.location.href + } else if (document.currentScript) { + scriptDirectory = document.currentScript.src + } + if (_scriptDir) { + scriptDirectory = _scriptDir + } + if (scriptDirectory.indexOf("blob:") !== 0) { + scriptDirectory = scriptDirectory.substr(0, scriptDirectory.lastIndexOf("/") + 1) + } else { + scriptDirectory = "" + } + if (ENVIRONMENT_IS_NODE) { + read_ = function shell_read(filename, binary) { + if (!nodeFS) nodeFS = require("fs"); + if (!nodePath) nodePath = require("path"); + filename = nodePath["normalize"](filename); + return nodeFS["readFileSync"](filename, binary ? null : "utf8") + }; + readBinary = function readBinary(filename) { + var ret = read_(filename, true); + if (!ret.buffer) { + ret = new Uint8Array(ret) + } + assert(ret.buffer); + return ret + } + } else { + read_ = function shell_read(url) { + var xhr = new XMLHttpRequest; + xhr.open("GET", url, false); + xhr.send(null); + return xhr.responseText + }; + if (ENVIRONMENT_IS_WORKER) { + readBinary = function readBinary(url) { + var xhr = new XMLHttpRequest; + xhr.open("GET", url, false); + xhr.responseType = "arraybuffer"; + xhr.send(null); + return new Uint8Array(xhr.response) + } + } + readAsync = function readAsync(url, onload, onerror) { + var xhr = new XMLHttpRequest; + xhr.open("GET", url, true); + xhr.responseType = "arraybuffer"; + xhr.onload = function xhr_onload() { + if (xhr.status == 200 || xhr.status == 0 && xhr.response) { + onload(xhr.response); + return + } + onerror() + }; + xhr.onerror = onerror; + xhr.send(null) + } + } + setWindowTitle = function (title) { + document.title = title + } + } else { + throw new Error("environment detection error") + } + if (ENVIRONMENT_IS_NODE) { + if (typeof performance === "undefined") { + performance = require("perf_hooks").performance + } + } + var out = Module["print"] || console.log.bind(console); + var err = Module["printErr"] || console.warn.bind(console); + for (key in moduleOverrides) { + if (moduleOverrides.hasOwnProperty(key)) { + Module[key] = moduleOverrides[key] + } + } + moduleOverrides = null; + if (Module["arguments"]) arguments_ = Module["arguments"]; + if (!Object.getOwnPropertyDescriptor(Module, "arguments")) Object.defineProperty(Module, "arguments", { + configurable: true, + get: function () { + abort("Module.arguments has been replaced with plain arguments_") + } + }); + if (Module["thisProgram"]) thisProgram = Module["thisProgram"]; + if (!Object.getOwnPropertyDescriptor(Module, "thisProgram")) Object.defineProperty(Module, "thisProgram", { + configurable: true, + get: function () { + abort("Module.thisProgram has been replaced with plain thisProgram") + } + }); + if (Module["quit"]) quit_ = Module["quit"]; + if (!Object.getOwnPropertyDescriptor(Module, "quit")) Object.defineProperty(Module, "quit", { + configurable: true, + get: function () { + abort("Module.quit has been replaced with plain quit_") + } + }); + assert(typeof Module["memoryInitializerPrefixURL"] === "undefined", "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["pthreadMainPrefixURL"] === "undefined", "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["cdInitializerPrefixURL"] === "undefined", "Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["filePackagePrefixURL"] === "undefined", "Module.filePackagePrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["read"] === "undefined", "Module.read option was removed (modify read_ in JS)"); + assert(typeof Module["readAsync"] === "undefined", "Module.readAsync option was removed (modify readAsync in JS)"); + assert(typeof Module["readBinary"] === "undefined", "Module.readBinary option was removed (modify readBinary in JS)"); + assert(typeof Module["setWindowTitle"] === "undefined", "Module.setWindowTitle option was removed (modify setWindowTitle in JS)"); + assert(typeof Module["TOTAL_MEMORY"] === "undefined", "Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"); + if (!Object.getOwnPropertyDescriptor(Module, "read")) Object.defineProperty(Module, "read", { + configurable: true, + get: function () { + abort("Module.read has been replaced with plain read_") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "readAsync")) Object.defineProperty(Module, "readAsync", { + configurable: true, + get: function () { + abort("Module.readAsync has been replaced with plain readAsync") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "readBinary")) Object.defineProperty(Module, "readBinary", { + configurable: true, + get: function () { + abort("Module.readBinary has been replaced with plain readBinary") + } + }); + assert(ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER || ENVIRONMENT_IS_NODE, "Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)"); + var stackSave; + var stackRestore; + var stackAlloc; + stackSave = stackRestore = stackAlloc = function () { + abort("cannot use the stack before compiled code is ready to run, and has provided stack access") + }; + + function warnOnce(text) { + if (!warnOnce.shown) warnOnce.shown = {}; + if (!warnOnce.shown[text]) { + warnOnce.shown[text] = 1; + err(text) + } + } + var Atomics_load = Atomics.load; + var Atomics_store = Atomics.store; + var Atomics_compareExchange = Atomics.compareExchange; + var wasmBinary; + if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"]; + if (!Object.getOwnPropertyDescriptor(Module, "wasmBinary")) Object.defineProperty(Module, "wasmBinary", { + configurable: true, + get: function () { + abort("Module.wasmBinary has been replaced with plain wasmBinary") + } + }); + var noExitRuntime; + if (Module["noExitRuntime"]) noExitRuntime = Module["noExitRuntime"]; + if (!Object.getOwnPropertyDescriptor(Module, "noExitRuntime")) Object.defineProperty(Module, "noExitRuntime", { + configurable: true, + get: function () { + abort("Module.noExitRuntime has been replaced with plain noExitRuntime") + } + }); + if (typeof WebAssembly !== "object") { + abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.") + } + var wasmMemory; + var wasmTable = new WebAssembly.Table({ + "initial": 120, + "maximum": 120 + 0, + "element": "anyfunc" + }); + var wasmModule; + var threadInfoStruct = 0; + var selfThreadId = 0; + var ABORT = false; + var EXITSTATUS = 0; + + function assert(condition, text) { + if (!condition) { + abort("Assertion failed: " + text) + } + } + + function getCFunc(ident) { + var func = Module["_" + ident]; + assert(func, "Cannot call unknown function " + ident + ", make sure it is exported"); + return func + } + + function ccall(ident, returnType, argTypes, args, opts) { + var toC = { + "string": function (str) { + var ret = 0; + if (str !== null && str !== undefined && str !== 0) { + var len = (str.length << 2) + 1; + ret = stackAlloc(len); + stringToUTF8(str, ret, len) + } + return ret + }, + "array": function (arr) { + var ret = stackAlloc(arr.length); + writeArrayToMemory(arr, ret); + return ret + } + }; + + function convertReturnValue(ret) { + if (returnType === "string") return UTF8ToString(ret); + if (returnType === "boolean") return Boolean(ret); + return ret + } + var func = getCFunc(ident); + var cArgs = []; + var stack = 0; + assert(returnType !== "array", 'Return type should not be "array".'); + if (args) { + for (var i = 0; i < args.length; i++) { + var converter = toC[argTypes[i]]; + if (converter) { + if (stack === 0) stack = stackSave(); + cArgs[i] = converter(args[i]) + } else { + cArgs[i] = args[i] + } + } + } + var ret = func.apply(null, cArgs); + ret = convertReturnValue(ret); + if (stack !== 0) stackRestore(stack); + return ret + } + + function cwrap(ident, returnType, argTypes, opts) { + return function () { + return ccall(ident, returnType, argTypes, arguments, opts) + } + } + + function UTF8ArrayToString(u8Array, idx, maxBytesToRead) { + var endIdx = idx + maxBytesToRead; + var str = ""; + while (!(idx >= endIdx)) { + var u0 = u8Array[idx++]; + if (!u0) return str; + if (!(u0 & 128)) { + str += String.fromCharCode(u0); + continue + } + var u1 = u8Array[idx++] & 63; + if ((u0 & 224) == 192) { + str += String.fromCharCode((u0 & 31) << 6 | u1); + continue + } + var u2 = u8Array[idx++] & 63; + if ((u0 & 240) == 224) { + u0 = (u0 & 15) << 12 | u1 << 6 | u2 + } else { + if ((u0 & 248) != 240) warnOnce("Invalid UTF-8 leading byte 0x" + u0.toString(16) + " encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!"); + u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | u8Array[idx++] & 63 + } + if (u0 < 65536) { + str += String.fromCharCode(u0) + } else { + var ch = u0 - 65536; + str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023) + } + } + return str + } + + function UTF8ToString(ptr, maxBytesToRead) { + return ptr ? UTF8ArrayToString(GROWABLE_HEAP_U8(), ptr, maxBytesToRead) : "" + } + + function stringToUTF8Array(str, outU8Array, outIdx, maxBytesToWrite) { + if (!(maxBytesToWrite > 0)) return 0; + var startIdx = outIdx; + var endIdx = outIdx + maxBytesToWrite - 1; + for (var i = 0; i < str.length; ++i) { + var u = str.charCodeAt(i); + if (u >= 55296 && u <= 57343) { + var u1 = str.charCodeAt(++i); + u = 65536 + ((u & 1023) << 10) | u1 & 1023 + } + if (u <= 127) { + if (outIdx >= endIdx) break; + outU8Array[outIdx++] = u + } else if (u <= 2047) { + if (outIdx + 1 >= endIdx) break; + outU8Array[outIdx++] = 192 | u >> 6; + outU8Array[outIdx++] = 128 | u & 63 + } else if (u <= 65535) { + if (outIdx + 2 >= endIdx) break; + outU8Array[outIdx++] = 224 | u >> 12; + outU8Array[outIdx++] = 128 | u >> 6 & 63; + outU8Array[outIdx++] = 128 | u & 63 + } else { + if (outIdx + 3 >= endIdx) break; + if (u >= 2097152) warnOnce("Invalid Unicode code point 0x" + u.toString(16) + " encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF)."); + outU8Array[outIdx++] = 240 | u >> 18; + outU8Array[outIdx++] = 128 | u >> 12 & 63; + outU8Array[outIdx++] = 128 | u >> 6 & 63; + outU8Array[outIdx++] = 128 | u & 63 + } + } + outU8Array[outIdx] = 0; + return outIdx - startIdx + } + + function stringToUTF8(str, outPtr, maxBytesToWrite) { + assert(typeof maxBytesToWrite == "number", "stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"); + return stringToUTF8Array(str, GROWABLE_HEAP_U8(), outPtr, maxBytesToWrite) + } + + function lengthBytesUTF8(str) { + var len = 0; + for (var i = 0; i < str.length; ++i) { + var u = str.charCodeAt(i); + if (u >= 55296 && u <= 57343) u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; + if (u <= 127) ++len; + else if (u <= 2047) len += 2; + else if (u <= 65535) len += 3; + else len += 4 + } + return len + } + + function writeArrayToMemory(array, buffer) { + assert(array.length >= 0, "writeArrayToMemory array must have a length (should be an array or typed array)"); + GROWABLE_HEAP_I8().set(array, buffer) + } + var WASM_PAGE_SIZE = 65536; + + function alignUp(x, multiple) { + if (x % multiple > 0) { + x += multiple - x % multiple + } + return x + } + var buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; + + function updateGlobalBufferAndViews(buf) { + buffer = buf; + Module["HEAP8"] = HEAP8 = new Int8Array(buf); + Module["HEAP16"] = HEAP16 = new Int16Array(buf); + Module["HEAP32"] = HEAP32 = new Int32Array(buf); + Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); + Module["HEAPU16"] = HEAPU16 = new Uint16Array(buf); + Module["HEAPU32"] = HEAPU32 = new Uint32Array(buf); + Module["HEAPF32"] = HEAPF32 = new Float32Array(buf); + Module["HEAPF64"] = HEAPF64 = new Float64Array(buf) + } + var STACK_BASE = 5255840, + STACKTOP = STACK_BASE, + STACK_MAX = 12960, + DYNAMIC_BASE = 5255840, + DYNAMICTOP_PTR = 12032; + assert(STACK_BASE % 16 === 0, "stack must start aligned"); + assert(DYNAMIC_BASE % 16 === 0, "heap must start aligned"); + if (ENVIRONMENT_IS_PTHREAD) { + STACK_MAX = STACKTOP = STACK_MAX = 2147483647 + } + var TOTAL_STACK = 5242880; + if (Module["TOTAL_STACK"]) assert(TOTAL_STACK === Module["TOTAL_STACK"], "the stack size can no longer be determined at runtime"); + var INITIAL_INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 1073741824; + if (!Object.getOwnPropertyDescriptor(Module, "INITIAL_MEMORY")) Object.defineProperty(Module, "INITIAL_MEMORY", { + configurable: true, + get: function () { + abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY") + } + }); + assert(INITIAL_INITIAL_MEMORY >= TOTAL_STACK, "INITIAL_MEMORY should be larger than TOTAL_STACK, was " + INITIAL_INITIAL_MEMORY + "! (TOTAL_STACK=" + TOTAL_STACK + ")"); + assert(typeof Int32Array !== "undefined" && typeof Float64Array !== "undefined" && Int32Array.prototype.subarray !== undefined && Int32Array.prototype.set !== undefined, "JS engine does not provide full typed array support"); + if (ENVIRONMENT_IS_PTHREAD) { + wasmMemory = Module["wasmMemory"]; + buffer = Module["buffer"] + } else { + if (Module["wasmMemory"]) { + wasmMemory = Module["wasmMemory"] + } else { + wasmMemory = new WebAssembly.Memory({ + "initial": INITIAL_INITIAL_MEMORY / WASM_PAGE_SIZE, + "maximum": 1073741824 / WASM_PAGE_SIZE, + "shared": true + }); + if (!(wasmMemory.buffer instanceof SharedArrayBuffer)) { + err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"); + if (ENVIRONMENT_IS_NODE) { + console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)") + } + throw Error("bad memory") + } + } + } + if (wasmMemory) { + buffer = wasmMemory.buffer + } + INITIAL_INITIAL_MEMORY = buffer.byteLength; + assert(INITIAL_INITIAL_MEMORY % WASM_PAGE_SIZE === 0); + assert(65536 % WASM_PAGE_SIZE === 0); + updateGlobalBufferAndViews(buffer); + if (!ENVIRONMENT_IS_PTHREAD) { + GROWABLE_HEAP_I32()[DYNAMICTOP_PTR >> 2] = DYNAMIC_BASE + } + + function writeStackCookie() { + assert((STACK_MAX & 3) == 0); + GROWABLE_HEAP_U32()[(STACK_MAX >> 2) + 1] = 34821223; + GROWABLE_HEAP_U32()[(STACK_MAX >> 2) + 2] = 2310721022; + GROWABLE_HEAP_I32()[0] = 1668509029 + } + + function checkStackCookie() { + var cookie1 = GROWABLE_HEAP_U32()[(STACK_MAX >> 2) + 1]; + var cookie2 = GROWABLE_HEAP_U32()[(STACK_MAX >> 2) + 2]; + if (cookie1 != 34821223 || cookie2 != 2310721022) { + abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x" + cookie2.toString(16) + " " + cookie1.toString(16)) + } + if (GROWABLE_HEAP_I32()[0] !== 1668509029) abort("Runtime error: The application has corrupted its heap memory area (address zero)!") + } + + function abortStackOverflow(allocSize) { + abort("Stack overflow! Attempted to allocate " + allocSize + " bytes on the stack, but stack has only " + (STACK_MAX - stackSave() + allocSize) + " bytes available!") + }(function () { + var h16 = new Int16Array(1); + var h8 = new Int8Array(h16.buffer); + h16[0] = 25459; + if (h8[0] !== 115 || h8[1] !== 99) throw "Runtime error: expected the system to be little-endian!" + })(); + + function callRuntimeCallbacks(callbacks) { + while (callbacks.length > 0) { + var callback = callbacks.shift(); + if (typeof callback == "function") { + callback(); + continue + } + var func = callback.func; + if (typeof func === "number") { + if (callback.arg === undefined) { + Module["dynCall_v"](func) + } else { + Module["dynCall_vi"](func, callback.arg) + } + } else { + func(callback.arg === undefined ? null : callback.arg) + } + } + } + var __ATPRERUN__ = []; + var __ATINIT__ = []; + var __ATMAIN__ = []; + var __ATEXIT__ = []; + var __ATPOSTRUN__ = []; + var runtimeInitialized = false; + var runtimeExited = false; + if (ENVIRONMENT_IS_PTHREAD) runtimeInitialized = true; + + function preRun() { + if (ENVIRONMENT_IS_PTHREAD) return; + if (Module["preRun"]) { + if (typeof Module["preRun"] == "function") Module["preRun"] = [Module["preRun"]]; + while (Module["preRun"].length) { + addOnPreRun(Module["preRun"].shift()) + } + } + callRuntimeCallbacks(__ATPRERUN__) + } + + function initRuntime() { + checkStackCookie(); + assert(!runtimeInitialized); + runtimeInitialized = true; + callRuntimeCallbacks(__ATINIT__) + } + + function preMain() { + checkStackCookie(); + if (ENVIRONMENT_IS_PTHREAD) return; + callRuntimeCallbacks(__ATMAIN__) + } + + function postRun() { + checkStackCookie(); + if (ENVIRONMENT_IS_PTHREAD) return; + if (Module["postRun"]) { + if (typeof Module["postRun"] == "function") Module["postRun"] = [Module["postRun"]]; + while (Module["postRun"].length) { + addOnPostRun(Module["postRun"].shift()) + } + } + callRuntimeCallbacks(__ATPOSTRUN__) + } + + function addOnPreRun(cb) { + __ATPRERUN__.unshift(cb) + } + + function addOnPostRun(cb) { + __ATPOSTRUN__.unshift(cb) + } + assert(Math.imul, "This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + assert(Math.fround, "This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + assert(Math.clz32, "This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + assert(Math.trunc, "This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + var Math_ceil = Math.ceil; + var Math_floor = Math.floor; + var runDependencies = 0; + var runDependencyWatcher = null; + var dependenciesFulfilled = null; + var runDependencyTracking = {}; + + function addRunDependency(id) { + assert(!ENVIRONMENT_IS_PTHREAD, "addRunDependency cannot be used in a pthread worker"); + runDependencies++; + if (Module["monitorRunDependencies"]) { + Module["monitorRunDependencies"](runDependencies) + } + if (id) { + assert(!runDependencyTracking[id]); + runDependencyTracking[id] = 1; + if (runDependencyWatcher === null && typeof setInterval !== "undefined") { + runDependencyWatcher = setInterval(function () { + if (ABORT) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null; + return + } + var shown = false; + for (var dep in runDependencyTracking) { + if (!shown) { + shown = true; + err("still waiting on run dependencies:") + } + err("dependency: " + dep) + } + if (shown) { + err("(end of list)") + } + }, 1e4) + } + } else { + err("warning: run dependency added without ID") + } + } + + function removeRunDependency(id) { + runDependencies--; + if (Module["monitorRunDependencies"]) { + Module["monitorRunDependencies"](runDependencies) + } + if (id) { + assert(runDependencyTracking[id]); + delete runDependencyTracking[id] + } else { + err("warning: run dependency removed without ID") + } + if (runDependencies == 0) { + if (runDependencyWatcher !== null) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null + } + if (dependenciesFulfilled) { + var callback = dependenciesFulfilled; + dependenciesFulfilled = null; + callback() + } + } + } + Module["preloadedImages"] = {}; + Module["preloadedAudios"] = {}; + + function abort(what) { + if (Module["onAbort"]) { + Module["onAbort"](what) + } + if (ENVIRONMENT_IS_PTHREAD) console.error("Pthread aborting at " + (new Error).stack); + what += ""; + out(what); + err(what); + ABORT = true; + EXITSTATUS = 1; + var output = "abort(" + what + ") at " + stackTrace(); + what = output; + throw new WebAssembly.RuntimeError(what) + } + var FS = { + error: function () { + abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1") + }, + init: function () { + FS.error() + }, + createDataFile: function () { + FS.error() + }, + createPreloadedFile: function () { + FS.error() + }, + createLazyFile: function () { + FS.error() + }, + open: function () { + FS.error() + }, + mkdev: function () { + FS.error() + }, + registerDevice: function () { + FS.error() + }, + analyzePath: function () { + FS.error() + }, + loadFilesFromDB: function () { + FS.error() + }, + ErrnoError: function ErrnoError() { + FS.error() + } + }; + Module["FS_createDataFile"] = FS.createDataFile; + Module["FS_createPreloadedFile"] = FS.createPreloadedFile; + var dataURIPrefix = "data:application/octet-stream;base64,"; + + function isDataURI(filename) { + return String.prototype.startsWith ? filename.startsWith(dataURIPrefix) : filename.indexOf(dataURIPrefix) === 0 + } + var wasmBinaryFile = "tfjs-backend-wasm.wasm"; + if (!isDataURI(wasmBinaryFile)) { + wasmBinaryFile = locateFile(wasmBinaryFile) + } + + function getBinary() { + try { + if (wasmBinary) { + return new Uint8Array(wasmBinary) + } + if (readBinary) { + return readBinary(wasmBinaryFile) + } else { + throw "both async and sync fetching of the wasm failed" + } + } catch (err) { + abort(err) + } + } + + function getBinaryPromise() { + if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) && typeof fetch === "function") { + return fetch(wasmBinaryFile, { + credentials: "same-origin" + }).then(function (response) { + if (!response["ok"]) { + throw "failed to load wasm binary file at '" + wasmBinaryFile + "'" + } + return response["arrayBuffer"]() + }).catch(function () { + return getBinary() + }) + } + return new Promise(function (resolve, reject) { + resolve(getBinary()) + }) + } + + function createWasm() { + var info = { + "env": asmLibraryArg, + "wasi_snapshot_preview1": asmLibraryArg + }; + + function receiveInstance(instance, module) { + var exports = instance.exports; + Module["asm"] = exports; + wasmModule = module; + if (!ENVIRONMENT_IS_PTHREAD) { + var numWorkersToLoad = PThread.unusedWorkers.length; + PThread.unusedWorkers.forEach(function (w) { + PThread.loadWasmModuleToWorker(w, function () { + if (!--numWorkersToLoad) removeRunDependency("wasm-instantiate") + }) + }) + } + } + if (!ENVIRONMENT_IS_PTHREAD) { + addRunDependency("wasm-instantiate") + } + var trueModule = Module; + + function receiveInstantiatedSource(output) { + assert(Module === trueModule, "the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"); + trueModule = null; + receiveInstance(output["instance"], output["module"]) + } + + function instantiateArrayBuffer(receiver) { + return getBinaryPromise().then(function (binary) { + return WebAssembly.instantiate(binary, info) + }).then(receiver, function (reason) { + err("failed to asynchronously prepare wasm: " + reason); + abort(reason) + }) + } + + function instantiateAsync() { + if (!wasmBinary && typeof WebAssembly.instantiateStreaming === "function" && !isDataURI(wasmBinaryFile) && typeof fetch === "function") { + fetch(wasmBinaryFile, { + credentials: "same-origin" + }).then(function (response) { + var result = WebAssembly.instantiateStreaming(response, info); + return result.then(receiveInstantiatedSource, function (reason) { + err("wasm streaming compile failed: " + reason); + err("falling back to ArrayBuffer instantiation"); + instantiateArrayBuffer(receiveInstantiatedSource) + }) + }) + } else { + return instantiateArrayBuffer(receiveInstantiatedSource) + } + } + if (Module["instantiateWasm"]) { + try { + var exports = Module["instantiateWasm"](info, receiveInstance); + return exports + } catch (e) { + err("Module.instantiateWasm callback failed with error: " + e); + return false + } + } + instantiateAsync(); + return {} + } + var ASM_CONSTS = {}; + + function initPthreadsJS() { + PThread.initRuntime() + } + if (!ENVIRONMENT_IS_PTHREAD) __ATINIT__.push({ + func: function () { + ___wasm_call_ctors() + } + }); + + function demangle(func) { + warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"); + return func + } + + function demangleAll(text) { + var regex = /\b_Z[\w\d_]+/g; + return text.replace(regex, function (x) { + var y = demangle(x); + return x === y ? x : y + " [" + x + "]" + }) + } + var __pthread_ptr = 0; + var __pthread_is_main_runtime_thread = 0; + var __pthread_is_main_browser_thread = 0; + + function __register_pthread_ptr(pthreadPtr, isMainBrowserThread, isMainRuntimeThread) { + pthreadPtr = pthreadPtr | 0; + isMainBrowserThread = isMainBrowserThread | 0; + isMainRuntimeThread = isMainRuntimeThread | 0; + __pthread_ptr = pthreadPtr; + __pthread_is_main_browser_thread = isMainBrowserThread; + __pthread_is_main_runtime_thread = isMainRuntimeThread + } + Module["__register_pthread_ptr"] = __register_pthread_ptr; + var ERRNO_CODES = { + EPERM: 63, + ENOENT: 44, + ESRCH: 71, + EINTR: 27, + EIO: 29, + ENXIO: 60, + E2BIG: 1, + ENOEXEC: 45, + EBADF: 8, + ECHILD: 12, + EAGAIN: 6, + EWOULDBLOCK: 6, + ENOMEM: 48, + EACCES: 2, + EFAULT: 21, + ENOTBLK: 105, + EBUSY: 10, + EEXIST: 20, + EXDEV: 75, + ENODEV: 43, + ENOTDIR: 54, + EISDIR: 31, + EINVAL: 28, + ENFILE: 41, + EMFILE: 33, + ENOTTY: 59, + ETXTBSY: 74, + EFBIG: 22, + ENOSPC: 51, + ESPIPE: 70, + EROFS: 69, + EMLINK: 34, + EPIPE: 64, + EDOM: 18, + ERANGE: 68, + ENOMSG: 49, + EIDRM: 24, + ECHRNG: 106, + EL2NSYNC: 156, + EL3HLT: 107, + EL3RST: 108, + ELNRNG: 109, + EUNATCH: 110, + ENOCSI: 111, + EL2HLT: 112, + EDEADLK: 16, + ENOLCK: 46, + EBADE: 113, + EBADR: 114, + EXFULL: 115, + ENOANO: 104, + EBADRQC: 103, + EBADSLT: 102, + EDEADLOCK: 16, + EBFONT: 101, + ENOSTR: 100, + ENODATA: 116, + ETIME: 117, + ENOSR: 118, + ENONET: 119, + ENOPKG: 120, + EREMOTE: 121, + ENOLINK: 47, + EADV: 122, + ESRMNT: 123, + ECOMM: 124, + EPROTO: 65, + EMULTIHOP: 36, + EDOTDOT: 125, + EBADMSG: 9, + ENOTUNIQ: 126, + EBADFD: 127, + EREMCHG: 128, + ELIBACC: 129, + ELIBBAD: 130, + ELIBSCN: 131, + ELIBMAX: 132, + ELIBEXEC: 133, + ENOSYS: 52, + ENOTEMPTY: 55, + ENAMETOOLONG: 37, + ELOOP: 32, + EOPNOTSUPP: 138, + EPFNOSUPPORT: 139, + ECONNRESET: 15, + ENOBUFS: 42, + EAFNOSUPPORT: 5, + EPROTOTYPE: 67, + ENOTSOCK: 57, + ENOPROTOOPT: 50, + ESHUTDOWN: 140, + ECONNREFUSED: 14, + EADDRINUSE: 3, + ECONNABORTED: 13, + ENETUNREACH: 40, + ENETDOWN: 38, + ETIMEDOUT: 73, + EHOSTDOWN: 142, + EHOSTUNREACH: 23, + EINPROGRESS: 26, + EALREADY: 7, + EDESTADDRREQ: 17, + EMSGSIZE: 35, + EPROTONOSUPPORT: 66, + ESOCKTNOSUPPORT: 137, + EADDRNOTAVAIL: 4, + ENETRESET: 39, + EISCONN: 30, + ENOTCONN: 53, + ETOOMANYREFS: 141, + EUSERS: 136, + EDQUOT: 19, + ESTALE: 72, + ENOTSUP: 138, + ENOMEDIUM: 148, + EILSEQ: 25, + EOVERFLOW: 61, + ECANCELED: 11, + ENOTRECOVERABLE: 56, + EOWNERDEAD: 62, + ESTRPIPE: 135 + }; + var __main_thread_futex_wait_address = 12944; + + function _emscripten_futex_wake(addr, count) { + if (addr <= 0 || addr > GROWABLE_HEAP_I8().length || addr & 3 != 0 || count < 0) return -28; + if (count == 0) return 0; + if (count >= 2147483647) count = Infinity; + var mainThreadWaitAddress = Atomics.load(GROWABLE_HEAP_I32(), __main_thread_futex_wait_address >> 2); + var mainThreadWoken = 0; + if (mainThreadWaitAddress == addr) { + var loadedAddr = Atomics.compareExchange(GROWABLE_HEAP_I32(), __main_thread_futex_wait_address >> 2, mainThreadWaitAddress, 0); + if (loadedAddr == mainThreadWaitAddress) { + --count; + mainThreadWoken = 1; + if (count <= 0) return 1 + } + } + var ret = Atomics.notify(GROWABLE_HEAP_I32(), addr >> 2, count); + if (ret >= 0) return ret + mainThreadWoken; + throw "Atomics.notify returned an unexpected value " + ret + } + Module["_emscripten_futex_wake"] = _emscripten_futex_wake; + + function __kill_thread(pthread_ptr) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _kill_thread() can only ever be called from main application thread!"; + if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _kill_thread!"; + GROWABLE_HEAP_I32()[pthread_ptr + 12 >> 2] = 0; + var pthread = PThread.pthreads[pthread_ptr]; + pthread.worker.terminate(); + PThread.freeThreadData(pthread); + PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker), 1); + pthread.worker.pthread = undefined + } + + function __cancel_thread(pthread_ptr) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _cancel_thread() can only ever be called from main application thread!"; + if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _cancel_thread!"; + var pthread = PThread.pthreads[pthread_ptr]; + pthread.worker.postMessage({ + "cmd": "cancel" + }) + } + + function __cleanup_thread(pthread_ptr) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _cleanup_thread() can only ever be called from main application thread!"; + if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _cleanup_thread!"; + GROWABLE_HEAP_I32()[pthread_ptr + 12 >> 2] = 0; + var pthread = PThread.pthreads[pthread_ptr]; + if (pthread) { + var worker = pthread.worker; + PThread.returnWorkerToPool(worker) + } + } + var PThread = { + MAIN_THREAD_ID: 1, + mainThreadInfo: { + schedPolicy: 0, + schedPrio: 0 + }, + unusedWorkers: [], + runningWorkers: [], + initRuntime: function () { + __register_pthread_ptr(PThread.mainThreadBlock, !ENVIRONMENT_IS_WORKER, 1); + _emscripten_register_main_browser_thread_id(PThread.mainThreadBlock) + }, + initMainThreadBlock: function () { + assert(!ENVIRONMENT_IS_PTHREAD); + var pthreadPoolSize = 8; + for (var i = 0; i < pthreadPoolSize; ++i) { + PThread.allocateUnusedWorker() + } + PThread.mainThreadBlock = 12192; + for (var i = 0; i < 232 / 4; ++i) GROWABLE_HEAP_U32()[PThread.mainThreadBlock / 4 + i] = 0; + GROWABLE_HEAP_I32()[PThread.mainThreadBlock + 12 >> 2] = PThread.mainThreadBlock; + var headPtr = PThread.mainThreadBlock + 156; + GROWABLE_HEAP_I32()[headPtr >> 2] = headPtr; + var tlsMemory = 12432; + for (var i = 0; i < 128; ++i) GROWABLE_HEAP_U32()[tlsMemory / 4 + i] = 0; + Atomics.store(GROWABLE_HEAP_U32(), PThread.mainThreadBlock + 104 >> 2, tlsMemory); + Atomics.store(GROWABLE_HEAP_U32(), PThread.mainThreadBlock + 40 >> 2, PThread.mainThreadBlock); + Atomics.store(GROWABLE_HEAP_U32(), PThread.mainThreadBlock + 44 >> 2, 42) + }, + initWorker: function () {}, + pthreads: {}, + exitHandlers: null, + setThreadStatus: function () {}, + runExitHandlers: function () { + if (PThread.exitHandlers !== null) { + while (PThread.exitHandlers.length > 0) { + PThread.exitHandlers.pop()() + } + PThread.exitHandlers = null + } + if (ENVIRONMENT_IS_PTHREAD && threadInfoStruct) ___pthread_tsd_run_dtors() + }, + threadExit: function (exitCode) { + var tb = _pthread_self(); + if (tb) { + err("Pthread 0x" + tb.toString(16) + " exited."); + Atomics.store(GROWABLE_HEAP_U32(), tb + 4 >> 2, exitCode); + Atomics.store(GROWABLE_HEAP_U32(), tb + 0 >> 2, 1); + Atomics.store(GROWABLE_HEAP_U32(), tb + 60 >> 2, 1); + Atomics.store(GROWABLE_HEAP_U32(), tb + 64 >> 2, 0); + PThread.runExitHandlers(); + _emscripten_futex_wake(tb + 0, 2147483647); + __register_pthread_ptr(0, 0, 0); + threadInfoStruct = 0; + if (ENVIRONMENT_IS_PTHREAD) { + postMessage({ + "cmd": "exit" + }) + } + } + }, + threadCancel: function () { + PThread.runExitHandlers(); + Atomics.store(GROWABLE_HEAP_U32(), threadInfoStruct + 4 >> 2, -1); + Atomics.store(GROWABLE_HEAP_U32(), threadInfoStruct + 0 >> 2, 1); + _emscripten_futex_wake(threadInfoStruct + 0, 2147483647); + threadInfoStruct = selfThreadId = 0; + __register_pthread_ptr(0, 0, 0); + postMessage({ + "cmd": "cancelDone" + }) + }, + terminateAllThreads: function () { + for (var t in PThread.pthreads) { + var pthread = PThread.pthreads[t]; + if (pthread && pthread.worker) { + PThread.returnWorkerToPool(pthread.worker) + } + } + PThread.pthreads = {}; + for (var i = 0; i < PThread.unusedWorkers.length; ++i) { + var worker = PThread.unusedWorkers[i]; + assert(!worker.pthread); + worker.terminate() + } + PThread.unusedWorkers = []; + for (var i = 0; i < PThread.runningWorkers.length; ++i) { + var worker = PThread.runningWorkers[i]; + var pthread = worker.pthread; + assert(pthread, "This Worker should have a pthread it is executing"); + PThread.freeThreadData(pthread); + worker.terminate() + } + PThread.runningWorkers = [] + }, + freeThreadData: function (pthread) { + if (!pthread) return; + if (pthread.threadInfoStruct) { + var tlsMemory = GROWABLE_HEAP_I32()[pthread.threadInfoStruct + 104 >> 2]; + GROWABLE_HEAP_I32()[pthread.threadInfoStruct + 104 >> 2] = 0; + _free(tlsMemory); + _free(pthread.threadInfoStruct) + } + pthread.threadInfoStruct = 0; + if (pthread.allocatedOwnStack && pthread.stackBase) _free(pthread.stackBase); + pthread.stackBase = 0; + if (pthread.worker) pthread.worker.pthread = null + }, + returnWorkerToPool: function (worker) { + delete PThread.pthreads[worker.pthread.thread]; + PThread.unusedWorkers.push(worker); + PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker), 1); + PThread.freeThreadData(worker.pthread); + worker.pthread = undefined + }, + receiveObjectTransfer: function (data) {}, + loadWasmModuleToWorker: function (worker, onFinishedLoading) { + worker.onmessage = function (e) { + var d = e["data"]; + var cmd = d["cmd"]; + if (worker.pthread) PThread.currentProxiedOperationCallerThread = worker.pthread.threadInfoStruct; + if (d["targetThread"] && d["targetThread"] != _pthread_self()) { + var thread = PThread.pthreads[d.targetThread]; + if (thread) { + thread.worker.postMessage(e.data, d["transferList"]) + } else { + console.error('Internal error! Worker sent a message "' + cmd + '" to target pthread ' + d["targetThread"] + ", but that thread no longer exists!") + } + PThread.currentProxiedOperationCallerThread = undefined; + return + } + if (cmd === "processQueuedMainThreadWork") { + _emscripten_main_thread_process_queued_calls() + } else if (cmd === "spawnThread") { + __spawn_thread(e.data) + } else if (cmd === "cleanupThread") { + __cleanup_thread(d["thread"]) + } else if (cmd === "killThread") { + __kill_thread(d["thread"]) + } else if (cmd === "cancelThread") { + __cancel_thread(d["thread"]) + } else if (cmd === "loaded") { + worker.loaded = true; + if (onFinishedLoading) onFinishedLoading(worker); + if (worker.runPthread) { + worker.runPthread(); + delete worker.runPthread + } + } else if (cmd === "print") { + out("Thread " + d["threadId"] + ": " + d["text"]) + } else if (cmd === "printErr") { + err("Thread " + d["threadId"] + ": " + d["text"]) + } else if (cmd === "alert") { + alert("Thread " + d["threadId"] + ": " + d["text"]) + } else if (cmd === "exit") { + var detached = worker.pthread && Atomics.load(GROWABLE_HEAP_U32(), worker.pthread.thread + 68 >> 2); + if (detached) { + PThread.returnWorkerToPool(worker) + } + } else if (cmd === "cancelDone") { + PThread.returnWorkerToPool(worker) + } else if (cmd === "objectTransfer") { + PThread.receiveObjectTransfer(e.data) + } else if (e.data.target === "setimmediate") { + worker.postMessage(e.data) + } else { + err("worker sent an unknown command " + cmd) + } + PThread.currentProxiedOperationCallerThread = undefined + }; + worker.onerror = function (e) { + err("pthread sent an error! " + e.filename + ":" + e.lineno + ": " + e.message) + }; + if (ENVIRONMENT_IS_NODE) { + worker.on("message", function (data) { + worker.onmessage({ + data: data + }) + }); + worker.on("error", function (data) { + worker.onerror(data) + }); + worker.on("exit", function (data) { + console.log("worker exited - TODO: update the worker queue?") + }) + } + assert(wasmMemory instanceof WebAssembly.Memory, "WebAssembly memory should have been loaded by now!"); + assert(wasmModule instanceof WebAssembly.Module, "WebAssembly Module should have been loaded by now!"); + worker.postMessage({ + "cmd": "load", + "urlOrBlob": Module["mainScriptUrlOrBlob"] || _scriptDir, + "wasmMemory": wasmMemory, + "wasmModule": wasmModule, + "DYNAMIC_BASE": DYNAMIC_BASE, + "DYNAMICTOP_PTR": DYNAMICTOP_PTR + }) + }, + allocateUnusedWorker: function () { + var pthreadMainJs = locateFile("tfjs-backend-wasm.worker.js"); + PThread.unusedWorkers.push(new Worker(pthreadMainJs)) + }, + getNewWorker: function () { + if (PThread.unusedWorkers.length == 0) { + PThread.allocateUnusedWorker(); + PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0]) + } + if (PThread.unusedWorkers.length > 0) return PThread.unusedWorkers.pop(); + else return null + }, + busySpinWait: function (msecs) { + var t = performance.now() + msecs; + while (performance.now() < t) {} + } + }; + + function establishStackSpace(stackTop, stackMax) { + STACK_BASE = STACKTOP = stackTop; + STACK_MAX = stackMax; + ___set_stack_limit(STACK_MAX); + writeStackCookie(); + stackRestore(stackTop) + } + Module["establishStackSpace"] = establishStackSpace; + + function getNoExitRuntime() { + return noExitRuntime + } + Module["getNoExitRuntime"] = getNoExitRuntime; + + function jsStackTrace() { + var err = new Error; + if (!err.stack) { + try { + throw new Error + } catch (e) { + err = e + } + if (!err.stack) { + return "(no stack trace available)" + } + } + return err.stack.toString() + } + + function stackTrace() { + var js = jsStackTrace(); + if (Module["extraStackTrace"]) js += "\n" + Module["extraStackTrace"](); + return demangleAll(js) + } + + function ___assert_fail(condition, filename, line, func) { + abort("Assertion failed: " + UTF8ToString(condition) + ", at: " + [filename ? UTF8ToString(filename) : "unknown filename", line, func ? UTF8ToString(func) : "unknown function"]) + } + + function ___call_main(argc, argv) { + var returnCode = _main(argc, argv); + out("Proxied main thread 0x" + _pthread_self().toString(16) + " finished with return code " + returnCode + ". EXIT_RUNTIME=0 set, so keeping main thread alive for asynchronous event operations.") + } + var _emscripten_get_now; + if (ENVIRONMENT_IS_NODE) { + _emscripten_get_now = function () { + var t = process["hrtime"](); + return t[0] * 1e3 + t[1] / 1e6 + } + } else if (ENVIRONMENT_IS_PTHREAD) { + _emscripten_get_now = function () { + return performance.now() - Module["__performance_now_clock_drift"] + } + } else if (typeof dateNow !== "undefined") { + _emscripten_get_now = dateNow + } else _emscripten_get_now = function () { + return performance.now() + }; + + function ___setErrNo(value) { + if (Module["___errno_location"]) GROWABLE_HEAP_I32()[Module["___errno_location"]() >> 2] = value; + else err("failed to set errno from JS"); + return value + } + + function _atexit(func, arg) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(1, 1, func, arg); + warnOnce("atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)"); + __ATEXIT__.unshift({ + func: func, + arg: arg + }) + } + + function ___handle_stack_overflow() { + abort("stack overflow") + } + + function __emscripten_notify_thread_queue(targetThreadId, mainThreadId) { + if (targetThreadId == mainThreadId) { + postMessage({ + cmd: "processQueuedMainThreadWork" + }) + } else if (ENVIRONMENT_IS_PTHREAD) { + postMessage({ + targetThread: targetThreadId, + cmd: "processThreadQueue" + }) + } else { + var pthread = PThread.pthreads[targetThreadId]; + var worker = pthread && pthread.worker; + if (!worker) { + err("Cannot send message to thread with ID " + targetThreadId + ", unknown thread ID!"); + return + } + worker.postMessage({ + cmd: "processThreadQueue" + }) + } + return 1 + } + + function _abort() { + abort() + } + + function _emscripten_conditional_set_current_thread_status(expectedStatus, newStatus) { + expectedStatus = expectedStatus | 0; + newStatus = newStatus | 0 + } + + function _emscripten_futex_wait(addr, val, timeout) { + if (addr <= 0 || addr > GROWABLE_HEAP_I8().length || addr & 3 != 0) return -28; + if (ENVIRONMENT_IS_WORKER) { + var ret = Atomics.wait(GROWABLE_HEAP_I32(), addr >> 2, val, timeout); + if (ret === "timed-out") return -73; + if (ret === "not-equal") return -6; + if (ret === "ok") return 0; + throw "Atomics.wait returned an unexpected value " + ret + } else { + var loadedVal = Atomics.load(GROWABLE_HEAP_I32(), addr >> 2); + if (val != loadedVal) return -6; + var tNow = performance.now(); + var tEnd = tNow + timeout; + Atomics.store(GROWABLE_HEAP_I32(), __main_thread_futex_wait_address >> 2, addr); + var ourWaitAddress = addr; + while (addr == ourWaitAddress) { + tNow = performance.now(); + if (tNow > tEnd) { + return -73 + } + _emscripten_main_thread_process_queued_calls(); + addr = Atomics.load(GROWABLE_HEAP_I32(), __main_thread_futex_wait_address >> 2) + } + return 0 + } + } + + function _emscripten_is_main_browser_thread() { + return __pthread_is_main_browser_thread | 0 + } + + function _emscripten_is_main_runtime_thread() { + return __pthread_is_main_runtime_thread | 0 + } + + function _emscripten_memcpy_big(dest, src, num) { + GROWABLE_HEAP_U8().copyWithin(dest, src, src + num) + } + + function _emscripten_proxy_to_main_thread_js(index, sync) { + var numCallArgs = arguments.length - 2; + if (numCallArgs > 20 - 1) throw "emscripten_proxy_to_main_thread_js: Too many arguments " + numCallArgs + " to proxied function idx=" + index + ", maximum supported is " + (20 - 1) + "!"; + var stack = stackSave(); + var args = stackAlloc(numCallArgs * 8); + var b = args >> 3; + for (var i = 0; i < numCallArgs; i++) { + GROWABLE_HEAP_F64()[b + i] = arguments[2 + i] + } + var ret = _emscripten_run_in_main_runtime_thread_js(index, numCallArgs, args, sync); + stackRestore(stack); + return ret + } + var _emscripten_receive_on_main_thread_js_callArgs = []; + + function readAsmConstArgs(sigPtr, buf) { + if (!readAsmConstArgs.array) { + readAsmConstArgs.array = [] + } + var args = readAsmConstArgs.array; + args.length = 0; + var ch; + while (ch = GROWABLE_HEAP_U8()[sigPtr++]) { + if (ch === 100 || ch === 102) { + buf = buf + 7 & ~7; + args.push(GROWABLE_HEAP_F64()[buf >> 3]); + buf += 8 + } else if (ch === 105) { + buf = buf + 3 & ~3; + args.push(GROWABLE_HEAP_I32()[buf >> 2]); + buf += 4 + } else abort("unexpected char in asm const signature " + ch) + } + return args + } + + function _emscripten_receive_on_main_thread_js(index, numCallArgs, args) { + _emscripten_receive_on_main_thread_js_callArgs.length = numCallArgs; + var b = args >> 3; + for (var i = 0; i < numCallArgs; i++) { + _emscripten_receive_on_main_thread_js_callArgs[i] = GROWABLE_HEAP_F64()[b + i] + } + var isEmAsmConst = index < 0; + var func = !isEmAsmConst ? proxiedFunctionTable[index] : ASM_CONSTS[-index - 1]; + if (isEmAsmConst) { + var sigPtr = _emscripten_receive_on_main_thread_js_callArgs[1]; + var varargPtr = _emscripten_receive_on_main_thread_js_callArgs[2]; + var constArgs = readAsmConstArgs(sigPtr, varargPtr); + return func.apply(null, constArgs) + } + assert(func.length == numCallArgs, "Call args mismatch in emscripten_receive_on_main_thread_js"); + return func.apply(null, _emscripten_receive_on_main_thread_js_callArgs) + } + + function _emscripten_get_heap_size() { + return GROWABLE_HEAP_U8().length + } + + function emscripten_realloc_buffer(size) { + try { + wasmMemory.grow(size - buffer.byteLength + 65535 >> 16); + updateGlobalBufferAndViews(wasmMemory.buffer); + return 1 + } catch (e) { + console.error("emscripten_realloc_buffer: Attempted to grow heap from " + buffer.byteLength + " bytes to " + size + " bytes, but got error: " + e) + } + } + + function _emscripten_resize_heap(requestedSize) { + var oldSize = _emscripten_get_heap_size(); + if (requestedSize <= oldSize) { + return false + } + var PAGE_MULTIPLE = 65536; + var maxHeapSize = 1073741824; + if (requestedSize > maxHeapSize) { + err("Cannot enlarge memory, asked to go up to " + requestedSize + " bytes, but the limit is " + maxHeapSize + " bytes!"); + return false + } + var minHeapSize = 16777216; + for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { + var overGrownHeapSize = oldSize * (1 + .2 / cutDown); + overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296); + var newSize = Math.min(maxHeapSize, alignUp(Math.max(minHeapSize, requestedSize, overGrownHeapSize), PAGE_MULTIPLE)); + var replacement = emscripten_realloc_buffer(newSize); + if (replacement) { + return true + } + } + err("Failed to grow the heap from " + oldSize + " bytes to " + newSize + " bytes, not enough memory!"); + return false + } + var JSEvents = { + keyEvent: 0, + mouseEvent: 0, + wheelEvent: 0, + uiEvent: 0, + focusEvent: 0, + deviceOrientationEvent: 0, + deviceMotionEvent: 0, + fullscreenChangeEvent: 0, + pointerlockChangeEvent: 0, + visibilityChangeEvent: 0, + touchEvent: 0, + previousFullscreenElement: null, + previousScreenX: null, + previousScreenY: null, + removeEventListenersRegistered: false, + removeAllEventListeners: function () { + for (var i = JSEvents.eventHandlers.length - 1; i >= 0; --i) { + JSEvents._removeHandler(i) + } + JSEvents.eventHandlers = []; + JSEvents.deferredCalls = [] + }, + registerRemoveEventListeners: function () { + if (!JSEvents.removeEventListenersRegistered) { + __ATEXIT__.push(JSEvents.removeAllEventListeners); + JSEvents.removeEventListenersRegistered = true + } + }, + deferredCalls: [], + deferCall: function (targetFunction, precedence, argsList) { + function arraysHaveEqualContent(arrA, arrB) { + if (arrA.length != arrB.length) return false; + for (var i in arrA) { + if (arrA[i] != arrB[i]) return false + } + return true + } + for (var i in JSEvents.deferredCalls) { + var call = JSEvents.deferredCalls[i]; + if (call.targetFunction == targetFunction && arraysHaveEqualContent(call.argsList, argsList)) { + return + } + } + JSEvents.deferredCalls.push({ + targetFunction: targetFunction, + precedence: precedence, + argsList: argsList + }); + JSEvents.deferredCalls.sort(function (x, y) { + return x.precedence < y.precedence + }) + }, + removeDeferredCalls: function (targetFunction) { + for (var i = 0; i < JSEvents.deferredCalls.length; ++i) { + if (JSEvents.deferredCalls[i].targetFunction == targetFunction) { + JSEvents.deferredCalls.splice(i, 1); + --i + } + } + }, + canPerformEventHandlerRequests: function () { + return JSEvents.inEventHandler && JSEvents.currentEventHandler.allowsDeferredCalls + }, + runDeferredCalls: function () { + if (!JSEvents.canPerformEventHandlerRequests()) { + return + } + for (var i = 0; i < JSEvents.deferredCalls.length; ++i) { + var call = JSEvents.deferredCalls[i]; + JSEvents.deferredCalls.splice(i, 1); + --i; + call.targetFunction.apply(null, call.argsList) + } + }, + inEventHandler: 0, + currentEventHandler: null, + eventHandlers: [], + removeAllHandlersOnTarget: function (target, eventTypeString) { + for (var i = 0; i < JSEvents.eventHandlers.length; ++i) { + if (JSEvents.eventHandlers[i].target == target && (!eventTypeString || eventTypeString == JSEvents.eventHandlers[i].eventTypeString)) { + JSEvents._removeHandler(i--) + } + } + }, + _removeHandler: function (i) { + var h = JSEvents.eventHandlers[i]; + h.target.removeEventListener(h.eventTypeString, h.eventListenerFunc, h.useCapture); + JSEvents.eventHandlers.splice(i, 1) + }, + registerOrRemoveHandler: function (eventHandler) { + var jsEventHandler = function jsEventHandler(event) { + ++JSEvents.inEventHandler; + JSEvents.currentEventHandler = eventHandler; + JSEvents.runDeferredCalls(); + eventHandler.handlerFunc(event); + JSEvents.runDeferredCalls(); + --JSEvents.inEventHandler + }; + if (eventHandler.callbackfunc) { + eventHandler.eventListenerFunc = jsEventHandler; + eventHandler.target.addEventListener(eventHandler.eventTypeString, jsEventHandler, eventHandler.useCapture); + JSEvents.eventHandlers.push(eventHandler); + JSEvents.registerRemoveEventListeners() + } else { + for (var i = 0; i < JSEvents.eventHandlers.length; ++i) { + if (JSEvents.eventHandlers[i].target == eventHandler.target && JSEvents.eventHandlers[i].eventTypeString == eventHandler.eventTypeString) { + JSEvents._removeHandler(i--) + } + } + } + }, + queueEventHandlerOnThread_iiii: function (targetThread, eventHandlerFunc, eventTypeId, eventData, userData) { + var stackTop = stackSave(); + var varargs = stackAlloc(12); + GROWABLE_HEAP_I32()[varargs >> 2] = eventTypeId; + GROWABLE_HEAP_I32()[varargs + 4 >> 2] = eventData; + GROWABLE_HEAP_I32()[varargs + 8 >> 2] = userData; + _emscripten_async_queue_on_thread_(targetThread, 637534208, eventHandlerFunc, eventData, varargs); + stackRestore(stackTop) + }, + getTargetThreadForEventCallback: function (targetThread) { + switch (targetThread) { + case 1: + return 0; + case 2: + return PThread.currentProxiedOperationCallerThread; + default: + return targetThread + } + }, + getNodeNameForTarget: function (target) { + if (!target) return ""; + if (target == window) return "#window"; + if (target == screen) return "#screen"; + return target && target.nodeName ? target.nodeName : "" + }, + fullscreenEnabled: function () { + return document.fullscreenEnabled || document.webkitFullscreenEnabled + } + }; + + function stringToNewUTF8(jsString) { + var length = lengthBytesUTF8(jsString) + 1; + var cString = _malloc(length); + stringToUTF8(jsString, cString, length); + return cString + } + + function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread, targetCanvas, width, height) { + var stackTop = stackSave(); + var varargs = stackAlloc(12); + var targetCanvasPtr = 0; + if (targetCanvas) { + targetCanvasPtr = stringToNewUTF8(targetCanvas) + } + GROWABLE_HEAP_I32()[varargs >> 2] = targetCanvasPtr; + GROWABLE_HEAP_I32()[varargs + 4 >> 2] = width; + GROWABLE_HEAP_I32()[varargs + 8 >> 2] = height; + _emscripten_async_queue_on_thread_(targetThread, 657457152, 0, targetCanvasPtr, varargs); + stackRestore(stackTop) + } + + function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread, targetCanvas, width, height) { + targetCanvas = targetCanvas ? UTF8ToString(targetCanvas) : ""; + _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread, targetCanvas, width, height) + } + + function __maybeCStringToJsString(cString) { + return cString === cString + 0 ? UTF8ToString(cString) : cString + } + var __specialEventTargets = [0, typeof document !== "undefined" ? document : 0, typeof window !== "undefined" ? window : 0]; + + function __findEventTarget(target) { + var domElement = __specialEventTargets[target] || (typeof document !== "undefined" ? document.querySelector(__maybeCStringToJsString(target)) : undefined); + return domElement + } + + function __findCanvasEventTarget(target) { + return __findEventTarget(target) + } + + function _emscripten_set_canvas_element_size_calling_thread(target, width, height) { + var canvas = __findCanvasEventTarget(target); + if (!canvas) return -4; + if (canvas.canvasSharedPtr) { + GROWABLE_HEAP_I32()[canvas.canvasSharedPtr >> 2] = width; + GROWABLE_HEAP_I32()[canvas.canvasSharedPtr + 4 >> 2] = height + } + if (canvas.offscreenCanvas || !canvas.controlTransferredOffscreen) { + if (canvas.offscreenCanvas) canvas = canvas.offscreenCanvas; + var autoResizeViewport = false; + if (canvas.GLctxObject && canvas.GLctxObject.GLctx) { + var prevViewport = canvas.GLctxObject.GLctx.getParameter(2978); + autoResizeViewport = prevViewport[0] === 0 && prevViewport[1] === 0 && prevViewport[2] === canvas.width && prevViewport[3] === canvas.height + } + canvas.width = width; + canvas.height = height; + if (autoResizeViewport) { + canvas.GLctxObject.GLctx.viewport(0, 0, width, height) + } + } else if (canvas.canvasSharedPtr) { + var targetThread = GROWABLE_HEAP_I32()[canvas.canvasSharedPtr + 8 >> 2]; + _emscripten_set_offscreencanvas_size_on_target_thread(targetThread, target, width, height); + return 1 + } else { + return -4 + } + return 0 + } + + function _emscripten_set_canvas_element_size_main_thread(target, width, height) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(2, 1, target, width, height); + return _emscripten_set_canvas_element_size_calling_thread(target, width, height) + } + + function _emscripten_set_canvas_element_size(target, width, height) { + var canvas = __findCanvasEventTarget(target); + if (canvas) { + return _emscripten_set_canvas_element_size_calling_thread(target, width, height) + } else { + return _emscripten_set_canvas_element_size_main_thread(target, width, height) + } + } + + function _emscripten_set_current_thread_status(newStatus) { + newStatus = newStatus | 0 + } + + function _emscripten_set_thread_name(threadId, name) { + threadId = threadId | 0; + name = name | 0 + } + + function __webgl_acquireInstancedArraysExtension(ctx) { + var ext = ctx.getExtension("ANGLE_instanced_arrays"); + if (ext) { + ctx["vertexAttribDivisor"] = function (index, divisor) { + ext["vertexAttribDivisorANGLE"](index, divisor) + }; + ctx["drawArraysInstanced"] = function (mode, first, count, primcount) { + ext["drawArraysInstancedANGLE"](mode, first, count, primcount) + }; + ctx["drawElementsInstanced"] = function (mode, count, type, indices, primcount) { + ext["drawElementsInstancedANGLE"](mode, count, type, indices, primcount) + } + } + } + + function __webgl_acquireVertexArrayObjectExtension(ctx) { + var ext = ctx.getExtension("OES_vertex_array_object"); + if (ext) { + ctx["createVertexArray"] = function () { + return ext["createVertexArrayOES"]() + }; + ctx["deleteVertexArray"] = function (vao) { + ext["deleteVertexArrayOES"](vao) + }; + ctx["bindVertexArray"] = function (vao) { + ext["bindVertexArrayOES"](vao) + }; + ctx["isVertexArray"] = function (vao) { + return ext["isVertexArrayOES"](vao) + } + } + } + + function __webgl_acquireDrawBuffersExtension(ctx) { + var ext = ctx.getExtension("WEBGL_draw_buffers"); + if (ext) { + ctx["drawBuffers"] = function (n, bufs) { + ext["drawBuffersWEBGL"](n, bufs) + } + } + } + var GL = { + counter: 1, + lastError: 0, + buffers: [], + mappedBuffers: {}, + programs: [], + framebuffers: [], + renderbuffers: [], + textures: [], + uniforms: [], + shaders: [], + vaos: [], + contexts: {}, + currentContext: null, + offscreenCanvases: {}, + timerQueriesEXT: [], + programInfos: {}, + stringCache: {}, + unpackAlignment: 4, + init: function () { + var miniTempFloatBuffer = new Float32Array(GL.MINI_TEMP_BUFFER_SIZE); + for (var i = 0; i < GL.MINI_TEMP_BUFFER_SIZE; i++) { + GL.miniTempBufferFloatViews[i] = miniTempFloatBuffer.subarray(0, i + 1) + } + var miniTempIntBuffer = new Int32Array(GL.MINI_TEMP_BUFFER_SIZE); + for (var i = 0; i < GL.MINI_TEMP_BUFFER_SIZE; i++) { + GL.miniTempBufferIntViews[i] = miniTempIntBuffer.subarray(0, i + 1) + } + }, + recordError: function recordError(errorCode) { + if (!GL.lastError) { + GL.lastError = errorCode + } + }, + getNewId: function (table) { + var ret = GL.counter++; + for (var i = table.length; i < ret; i++) { + table[i] = null + } + return ret + }, + MINI_TEMP_BUFFER_SIZE: 256, + miniTempBufferFloatViews: [0], + miniTempBufferIntViews: [0], + getSource: function (shader, count, string, length) { + var source = ""; + for (var i = 0; i < count; ++i) { + var len = length ? GROWABLE_HEAP_I32()[length + i * 4 >> 2] : -1; + source += UTF8ToString(GROWABLE_HEAP_I32()[string + i * 4 >> 2], len < 0 ? undefined : len) + } + return source + }, + createContext: function (canvas, webGLContextAttributes) { + var ctx = canvas.getContext("webgl", webGLContextAttributes); + if (!ctx) return 0; + var handle = GL.registerContext(ctx, webGLContextAttributes); + return handle + }, + registerContext: function (ctx, webGLContextAttributes) { + var handle = _malloc(8); + GROWABLE_HEAP_I32()[handle + 4 >> 2] = _pthread_self(); + var context = { + handle: handle, + attributes: webGLContextAttributes, + version: webGLContextAttributes.majorVersion, + GLctx: ctx + }; + if (ctx.canvas) ctx.canvas.GLctxObject = context; + GL.contexts[handle] = context; + if (typeof webGLContextAttributes.enableExtensionsByDefault === "undefined" || webGLContextAttributes.enableExtensionsByDefault) { + GL.initExtensions(context) + } + return handle + }, + makeContextCurrent: function (contextHandle) { + GL.currentContext = GL.contexts[contextHandle]; + Module.ctx = GLctx = GL.currentContext && GL.currentContext.GLctx; + return !(contextHandle && !GLctx) + }, + getContext: function (contextHandle) { + return GL.contexts[contextHandle] + }, + deleteContext: function (contextHandle) { + if (GL.currentContext === GL.contexts[contextHandle]) GL.currentContext = null; + if (typeof JSEvents === "object") JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas); + if (GL.contexts[contextHandle] && GL.contexts[contextHandle].GLctx.canvas) GL.contexts[contextHandle].GLctx.canvas.GLctxObject = undefined; + _free(GL.contexts[contextHandle].handle); + GL.contexts[contextHandle] = null + }, + initExtensions: function (context) { + if (!context) context = GL.currentContext; + if (context.initExtensionsDone) return; + context.initExtensionsDone = true; + var GLctx = context.GLctx; + if (context.version < 2) { + __webgl_acquireInstancedArraysExtension(GLctx); + __webgl_acquireVertexArrayObjectExtension(GLctx); + __webgl_acquireDrawBuffersExtension(GLctx) + } + GLctx.disjointTimerQueryExt = GLctx.getExtension("EXT_disjoint_timer_query"); + var automaticallyEnabledExtensions = ["OES_texture_float", "OES_texture_half_float", "OES_standard_derivatives", "OES_vertex_array_object", "WEBGL_compressed_texture_s3tc", "WEBGL_depth_texture", "OES_element_index_uint", "EXT_texture_filter_anisotropic", "EXT_frag_depth", "WEBGL_draw_buffers", "ANGLE_instanced_arrays", "OES_texture_float_linear", "OES_texture_half_float_linear", "EXT_blend_minmax", "EXT_shader_texture_lod", "EXT_texture_norm16", "WEBGL_compressed_texture_pvrtc", "EXT_color_buffer_half_float", "WEBGL_color_buffer_float", "EXT_sRGB", "WEBGL_compressed_texture_etc1", "EXT_disjoint_timer_query", "WEBGL_compressed_texture_etc", "WEBGL_compressed_texture_astc", "EXT_color_buffer_float", "WEBGL_compressed_texture_s3tc_srgb", "EXT_disjoint_timer_query_webgl2", "WEBKIT_WEBGL_compressed_texture_pvrtc"]; + var exts = GLctx.getSupportedExtensions() || []; + exts.forEach(function (ext) { + if (automaticallyEnabledExtensions.indexOf(ext) != -1) { + GLctx.getExtension(ext) + } + }) + }, + populateUniformTable: function (program) { + var p = GL.programs[program]; + var ptable = GL.programInfos[program] = { + uniforms: {}, + maxUniformLength: 0, + maxAttributeLength: -1, + maxUniformBlockNameLength: -1 + }; + var utable = ptable.uniforms; + var numUniforms = GLctx.getProgramParameter(p, 35718); + for (var i = 0; i < numUniforms; ++i) { + var u = GLctx.getActiveUniform(p, i); + var name = u.name; + ptable.maxUniformLength = Math.max(ptable.maxUniformLength, name.length + 1); + if (name.slice(-1) == "]") { + name = name.slice(0, name.lastIndexOf("[")) + } + var loc = GLctx.getUniformLocation(p, name); + if (loc) { + var id = GL.getNewId(GL.uniforms); + utable[name] = [u.size, id]; + GL.uniforms[id] = loc; + for (var j = 1; j < u.size; ++j) { + var n = name + "[" + j + "]"; + loc = GLctx.getUniformLocation(p, n); + id = GL.getNewId(GL.uniforms); + GL.uniforms[id] = loc + } + } + } + } + }; + var __emscripten_webgl_power_preferences = ["default", "low-power", "high-performance"]; + + function _emscripten_webgl_do_create_context(target, attributes) { + assert(attributes); + var contextAttributes = {}; + var a = attributes >> 2; + contextAttributes["alpha"] = !!GROWABLE_HEAP_I32()[a + (0 >> 2)]; + contextAttributes["depth"] = !!GROWABLE_HEAP_I32()[a + (4 >> 2)]; + contextAttributes["stencil"] = !!GROWABLE_HEAP_I32()[a + (8 >> 2)]; + contextAttributes["antialias"] = !!GROWABLE_HEAP_I32()[a + (12 >> 2)]; + contextAttributes["premultipliedAlpha"] = !!GROWABLE_HEAP_I32()[a + (16 >> 2)]; + contextAttributes["preserveDrawingBuffer"] = !!GROWABLE_HEAP_I32()[a + (20 >> 2)]; + var powerPreference = GROWABLE_HEAP_I32()[a + (24 >> 2)]; + contextAttributes["powerPreference"] = __emscripten_webgl_power_preferences[powerPreference]; + contextAttributes["failIfMajorPerformanceCaveat"] = !!GROWABLE_HEAP_I32()[a + (28 >> 2)]; + contextAttributes.majorVersion = GROWABLE_HEAP_I32()[a + (32 >> 2)]; + contextAttributes.minorVersion = GROWABLE_HEAP_I32()[a + (36 >> 2)]; + contextAttributes.enableExtensionsByDefault = GROWABLE_HEAP_I32()[a + (40 >> 2)]; + contextAttributes.explicitSwapControl = GROWABLE_HEAP_I32()[a + (44 >> 2)]; + contextAttributes.proxyContextToMainThread = GROWABLE_HEAP_I32()[a + (48 >> 2)]; + contextAttributes.renderViaOffscreenBackBuffer = GROWABLE_HEAP_I32()[a + (52 >> 2)]; + var canvas = __findCanvasEventTarget(target); + if (!canvas) { + return 0 + } + if (contextAttributes.explicitSwapControl) { + return 0 + } + var contextHandle = GL.createContext(canvas, contextAttributes); + return contextHandle + } + + function _emscripten_webgl_create_context(a0, a1) { + return _emscripten_webgl_do_create_context(a0, a1) + } + var PATH = { + splitPath: function (filename) { + var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; + return splitPathRe.exec(filename).slice(1) + }, + normalizeArray: function (parts, allowAboveRoot) { + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === ".") { + parts.splice(i, 1) + } else if (last === "..") { + parts.splice(i, 1); + up++ + } else if (up) { + parts.splice(i, 1); + up-- + } + } + if (allowAboveRoot) { + for (; up; up--) { + parts.unshift("..") + } + } + return parts + }, + normalize: function (path) { + var isAbsolute = path.charAt(0) === "/", + trailingSlash = path.substr(-1) === "/"; + path = PATH.normalizeArray(path.split("/").filter(function (p) { + return !!p + }), !isAbsolute).join("/"); + if (!path && !isAbsolute) { + path = "." + } + if (path && trailingSlash) { + path += "/" + } + return (isAbsolute ? "/" : "") + path + }, + dirname: function (path) { + var result = PATH.splitPath(path), + root = result[0], + dir = result[1]; + if (!root && !dir) { + return "." + } + if (dir) { + dir = dir.substr(0, dir.length - 1) + } + return root + dir + }, + basename: function (path) { + if (path === "/") return "/"; + var lastSlash = path.lastIndexOf("/"); + if (lastSlash === -1) return path; + return path.substr(lastSlash + 1) + }, + extname: function (path) { + return PATH.splitPath(path)[3] + }, + join: function () { + var paths = Array.prototype.slice.call(arguments, 0); + return PATH.normalize(paths.join("/")) + }, + join2: function (l, r) { + return PATH.normalize(l + "/" + r) + } + }; + var SYSCALLS = { + mappings: {}, + buffers: [null, [], + [] + ], + printChar: function (stream, curr) { + var buffer = SYSCALLS.buffers[stream]; + assert(buffer); + if (curr === 0 || curr === 10) { + (stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0)); + buffer.length = 0 + } else { + buffer.push(curr) + } + }, + varargs: undefined, + get: function () { + assert(SYSCALLS.varargs != undefined); + SYSCALLS.varargs += 4; + var ret = GROWABLE_HEAP_I32()[SYSCALLS.varargs - 4 >> 2]; + return ret + }, + getStr: function (ptr) { + var ret = UTF8ToString(ptr); + return ret + }, + get64: function (low, high) { + if (low >= 0) assert(high === 0); + else assert(high === -1); + return low + } + }; + + function _fd_close(fd) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(3, 1, fd); + abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM"); + return 0 + } + + function _fd_seek(fd, offset_low, offset_high, whence, newOffset) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(4, 1, fd, offset_low, offset_high, whence, newOffset); + abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM") + } + + function _fd_write(fd, iov, iovcnt, pnum) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(5, 1, fd, iov, iovcnt, pnum); + var num = 0; + for (var i = 0; i < iovcnt; i++) { + var ptr = GROWABLE_HEAP_I32()[iov + i * 8 >> 2]; + var len = GROWABLE_HEAP_I32()[iov + (i * 8 + 4) >> 2]; + for (var j = 0; j < len; j++) { + SYSCALLS.printChar(fd, GROWABLE_HEAP_U8()[ptr + j]) + } + num += len + } + GROWABLE_HEAP_I32()[pnum >> 2] = num; + return 0 + } + + function _pthread_cleanup_pop(execute) { + var routine = PThread.exitHandlers.pop(); + if (execute) routine() + } + + function _pthread_cleanup_push(routine, arg) { + if (PThread.exitHandlers === null) { + PThread.exitHandlers = [] + } + PThread.exitHandlers.push(function () { + dynCall_vi(routine, arg) + }) + } + + function __spawn_thread(threadParams) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _spawn_thread() can only ever be called from main application thread!"; + var worker = PThread.getNewWorker(); + if (worker.pthread !== undefined) throw "Internal error!"; + if (!threadParams.pthread_ptr) throw "Internal error, no pthread ptr!"; + PThread.runningWorkers.push(worker); + var tlsMemory = _malloc(128 * 4); + for (var i = 0; i < 128; ++i) { + GROWABLE_HEAP_I32()[tlsMemory + i * 4 >> 2] = 0 + } + var stackHigh = threadParams.stackBase + threadParams.stackSize; + var pthread = PThread.pthreads[threadParams.pthread_ptr] = { + worker: worker, + stackBase: threadParams.stackBase, + stackSize: threadParams.stackSize, + allocatedOwnStack: threadParams.allocatedOwnStack, + thread: threadParams.pthread_ptr, + threadInfoStruct: threadParams.pthread_ptr + }; + var tis = pthread.threadInfoStruct >> 2; + Atomics.store(GROWABLE_HEAP_U32(), tis + (0 >> 2), 0); + Atomics.store(GROWABLE_HEAP_U32(), tis + (4 >> 2), 0); + Atomics.store(GROWABLE_HEAP_U32(), tis + (8 >> 2), 0); + Atomics.store(GROWABLE_HEAP_U32(), tis + (68 >> 2), threadParams.detached); + Atomics.store(GROWABLE_HEAP_U32(), tis + (104 >> 2), tlsMemory); + Atomics.store(GROWABLE_HEAP_U32(), tis + (48 >> 2), 0); + Atomics.store(GROWABLE_HEAP_U32(), tis + (40 >> 2), pthread.threadInfoStruct); + Atomics.store(GROWABLE_HEAP_U32(), tis + (44 >> 2), 42); + Atomics.store(GROWABLE_HEAP_U32(), tis + (108 >> 2), threadParams.stackSize); + Atomics.store(GROWABLE_HEAP_U32(), tis + (84 >> 2), threadParams.stackSize); + Atomics.store(GROWABLE_HEAP_U32(), tis + (80 >> 2), stackHigh); + Atomics.store(GROWABLE_HEAP_U32(), tis + (108 + 8 >> 2), stackHigh); + Atomics.store(GROWABLE_HEAP_U32(), tis + (108 + 12 >> 2), threadParams.detached); + Atomics.store(GROWABLE_HEAP_U32(), tis + (108 + 20 >> 2), threadParams.schedPolicy); + Atomics.store(GROWABLE_HEAP_U32(), tis + (108 + 24 >> 2), threadParams.schedPrio); + var global_libc = _emscripten_get_global_libc(); + var global_locale = global_libc + 40; + Atomics.store(GROWABLE_HEAP_U32(), tis + (176 >> 2), global_locale); + worker.pthread = pthread; + var msg = { + "cmd": "run", + "start_routine": threadParams.startRoutine, + "arg": threadParams.arg, + "threadInfoStruct": threadParams.pthread_ptr, + "selfThreadId": threadParams.pthread_ptr, + "parentThreadId": threadParams.parent_pthread_ptr, + "stackBase": threadParams.stackBase, + "stackSize": threadParams.stackSize + }; + worker.runPthread = function () { + msg.time = performance.now(); + worker.postMessage(msg, threadParams.transferList) + }; + if (worker.loaded) { + worker.runPthread(); + delete worker.runPthread + } + } + + function _pthread_getschedparam(thread, policy, schedparam) { + if (!policy && !schedparam) return ERRNO_CODES.EINVAL; + if (!thread) { + err("pthread_getschedparam called with a null thread pointer!"); + return ERRNO_CODES.ESRCH + } + var self = GROWABLE_HEAP_I32()[thread + 12 >> 2]; + if (self !== thread) { + err("pthread_getschedparam attempted on thread " + thread + ", which does not point to a valid thread, or does not exist anymore!"); + return ERRNO_CODES.ESRCH + } + var schedPolicy = Atomics.load(GROWABLE_HEAP_U32(), thread + 108 + 20 >> 2); + var schedPrio = Atomics.load(GROWABLE_HEAP_U32(), thread + 108 + 24 >> 2); + if (policy) GROWABLE_HEAP_I32()[policy >> 2] = schedPolicy; + if (schedparam) GROWABLE_HEAP_I32()[schedparam >> 2] = schedPrio; + return 0 + } + + function _pthread_self() { + return __pthread_ptr | 0 + } + Module["_pthread_self"] = _pthread_self; + + function _pthread_create(pthread_ptr, attr, start_routine, arg) { + if (typeof SharedArrayBuffer === "undefined") { + err("Current environment does not support SharedArrayBuffer, pthreads are not available!"); + return 6 + } + if (!pthread_ptr) { + err("pthread_create called with a null thread pointer!"); + return 28 + } + var transferList = []; + var error = 0; + if (ENVIRONMENT_IS_PTHREAD && (transferList.length === 0 || error)) { + return _emscripten_sync_run_in_main_thread_4(687865856, pthread_ptr, attr, start_routine, arg) + } + if (error) return error; + var stackSize = 0; + var stackBase = 0; + var detached = 0; + var schedPolicy = 0; + var schedPrio = 0; + if (attr) { + stackSize = GROWABLE_HEAP_I32()[attr >> 2]; + stackSize += 81920; + stackBase = GROWABLE_HEAP_I32()[attr + 8 >> 2]; + detached = GROWABLE_HEAP_I32()[attr + 12 >> 2] !== 0; + var inheritSched = GROWABLE_HEAP_I32()[attr + 16 >> 2] === 0; + if (inheritSched) { + var prevSchedPolicy = GROWABLE_HEAP_I32()[attr + 20 >> 2]; + var prevSchedPrio = GROWABLE_HEAP_I32()[attr + 24 >> 2]; + var parentThreadPtr = PThread.currentProxiedOperationCallerThread ? PThread.currentProxiedOperationCallerThread : _pthread_self(); + _pthread_getschedparam(parentThreadPtr, attr + 20, attr + 24); + schedPolicy = GROWABLE_HEAP_I32()[attr + 20 >> 2]; + schedPrio = GROWABLE_HEAP_I32()[attr + 24 >> 2]; + GROWABLE_HEAP_I32()[attr + 20 >> 2] = prevSchedPolicy; + GROWABLE_HEAP_I32()[attr + 24 >> 2] = prevSchedPrio + } else { + schedPolicy = GROWABLE_HEAP_I32()[attr + 20 >> 2]; + schedPrio = GROWABLE_HEAP_I32()[attr + 24 >> 2] + } + } else { + stackSize = 2097152 + } + var allocatedOwnStack = stackBase == 0; + if (allocatedOwnStack) { + stackBase = _memalign(16, stackSize) + } else { + stackBase -= stackSize; + assert(stackBase > 0) + } + var threadInfoStruct = _malloc(232); + for (var i = 0; i < 232 >> 2; ++i) GROWABLE_HEAP_U32()[(threadInfoStruct >> 2) + i] = 0; + GROWABLE_HEAP_I32()[pthread_ptr >> 2] = threadInfoStruct; + GROWABLE_HEAP_I32()[threadInfoStruct + 12 >> 2] = threadInfoStruct; + var headPtr = threadInfoStruct + 156; + GROWABLE_HEAP_I32()[headPtr >> 2] = headPtr; + var threadParams = { + stackBase: stackBase, + stackSize: stackSize, + allocatedOwnStack: allocatedOwnStack, + schedPolicy: schedPolicy, + schedPrio: schedPrio, + detached: detached, + startRoutine: start_routine, + pthread_ptr: threadInfoStruct, + parent_pthread_ptr: _pthread_self(), + arg: arg, + transferList: transferList + }; + if (ENVIRONMENT_IS_PTHREAD) { + threadParams.cmd = "spawnThread"; + postMessage(threadParams, transferList) + } else { + __spawn_thread(threadParams) + } + return 0 + } + + function _roundf(d) { + d = +d; + return d >= +0 ? +Math_floor(d + +.5) : +Math_ceil(d - +.5) + } + + function _sysconf(name) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(6, 1, name); + switch (name) { + case 30: + return 16384; + case 85: + var maxHeapSize = 2 * 1024 * 1024 * 1024 - 65536; + maxHeapSize = 1073741824; + return maxHeapSize / 16384; + case 132: + case 133: + case 12: + case 137: + case 138: + case 15: + case 235: + case 16: + case 17: + case 18: + case 19: + case 20: + case 149: + case 13: + case 10: + case 236: + case 153: + case 9: + case 21: + case 22: + case 159: + case 154: + case 14: + case 77: + case 78: + case 139: + case 80: + case 81: + case 82: + case 68: + case 67: + case 164: + case 11: + case 29: + case 47: + case 48: + case 95: + case 52: + case 51: + case 46: + case 79: + return 200809; + case 27: + case 246: + case 127: + case 128: + case 23: + case 24: + case 160: + case 161: + case 181: + case 182: + case 242: + case 183: + case 184: + case 243: + case 244: + case 245: + case 165: + case 178: + case 179: + case 49: + case 50: + case 168: + case 169: + case 175: + case 170: + case 171: + case 172: + case 97: + case 76: + case 32: + case 173: + case 35: + return -1; + case 176: + case 177: + case 7: + case 155: + case 8: + case 157: + case 125: + case 126: + case 92: + case 93: + case 129: + case 130: + case 131: + case 94: + case 91: + return 1; + case 74: + case 60: + case 69: + case 70: + case 4: + return 1024; + case 31: + case 42: + case 72: + return 32; + case 87: + case 26: + case 33: + return 2147483647; + case 34: + case 1: + return 47839; + case 38: + case 36: + return 99; + case 43: + case 37: + return 2048; + case 0: + return 2097152; + case 3: + return 65536; + case 28: + return 32768; + case 44: + return 32767; + case 75: + return 16384; + case 39: + return 1e3; + case 89: + return 700; + case 71: + return 256; + case 40: + return 255; + case 2: + return 100; + case 180: + return 64; + case 25: + return 20; + case 5: + return 16; + case 6: + return 6; + case 73: + return 4; + case 84: { + if (typeof navigator === "object") return navigator["hardwareConcurrency"] || 1; + return 1 + } + } + ___setErrNo(28); + return -1 + } + if (!ENVIRONMENT_IS_PTHREAD) PThread.initMainThreadBlock(); + else PThread.initWorker(); + var GLctx; + GL.init(); + var proxiedFunctionTable = [null, _atexit, _emscripten_set_canvas_element_size_main_thread, _fd_close, _fd_seek, _fd_write, _sysconf]; + var asmLibraryArg = { + "__assert_fail": ___assert_fail, + "__call_main": ___call_main, + "__handle_stack_overflow": ___handle_stack_overflow, + "_emscripten_notify_thread_queue": __emscripten_notify_thread_queue, + "abort": _abort, + "emscripten_conditional_set_current_thread_status": _emscripten_conditional_set_current_thread_status, + "emscripten_futex_wait": _emscripten_futex_wait, + "emscripten_futex_wake": _emscripten_futex_wake, + "emscripten_get_now": _emscripten_get_now, + "emscripten_is_main_browser_thread": _emscripten_is_main_browser_thread, + "emscripten_is_main_runtime_thread": _emscripten_is_main_runtime_thread, + "emscripten_memcpy_big": _emscripten_memcpy_big, + "emscripten_receive_on_main_thread_js": _emscripten_receive_on_main_thread_js, + "emscripten_resize_heap": _emscripten_resize_heap, + "emscripten_set_canvas_element_size": _emscripten_set_canvas_element_size, + "emscripten_set_current_thread_status": _emscripten_set_current_thread_status, + "emscripten_set_thread_name": _emscripten_set_thread_name, + "emscripten_webgl_create_context": _emscripten_webgl_create_context, + "fd_close": _fd_close, + "fd_seek": _fd_seek, + "fd_write": _fd_write, + "initPthreadsJS": initPthreadsJS, + "memory": wasmMemory || Module["wasmMemory"], + "pthread_cleanup_pop": _pthread_cleanup_pop, + "pthread_cleanup_push": _pthread_cleanup_push, + "pthread_create": _pthread_create, + "pthread_self": _pthread_self, + "roundf": _roundf, + "table": wasmTable + }; + var asm = createWasm(); + Module["asm"] = asm; + var ___wasm_call_ctors = Module["___wasm_call_ctors"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__wasm_call_ctors"].apply(null, arguments) + }; + var _init = Module["_init"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["init"].apply(null, arguments) + }; + var _register_tensor = Module["_register_tensor"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["register_tensor"].apply(null, arguments) + }; + var _dispose_data = Module["_dispose_data"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dispose_data"].apply(null, arguments) + }; + var _dispose = Module["_dispose"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dispose"].apply(null, arguments) + }; + var _Abs = Module["_Abs"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Abs"].apply(null, arguments) + }; + var _Add = Module["_Add"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Add"].apply(null, arguments) + }; + var _AddN = Module["_AddN"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["AddN"].apply(null, arguments) + }; + var _ArgMax = Module["_ArgMax"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ArgMax"].apply(null, arguments) + }; + var _AvgPool = Module["_AvgPool"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["AvgPool"].apply(null, arguments) + }; + var _BatchMatMul = Module["_BatchMatMul"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["BatchMatMul"].apply(null, arguments) + }; + var _ClipByValue = Module["_ClipByValue"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ClipByValue"].apply(null, arguments) + }; + var _Conv2D = Module["_Conv2D"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Conv2D"].apply(null, arguments) + }; + var _Cos = Module["_Cos"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Cos"].apply(null, arguments) + }; + var _CropAndResize = Module["_CropAndResize"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["CropAndResize"].apply(null, arguments) + }; + var _DepthwiseConv2dNative = Module["_DepthwiseConv2dNative"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["DepthwiseConv2dNative"].apply(null, arguments) + }; + var _Div = Module["_Div"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Div"].apply(null, arguments) + }; + var _Exp = Module["_Exp"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Exp"].apply(null, arguments) + }; + var _FloorDiv = Module["_FloorDiv"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FloorDiv"].apply(null, arguments) + }; + var _FusedBatchNorm = Module["_FusedBatchNorm"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FusedBatchNorm"].apply(null, arguments) + }; + var _FusedConv2D = Module["_FusedConv2D"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FusedConv2D"].apply(null, arguments) + }; + var _FusedDepthwiseConv2D = Module["_FusedDepthwiseConv2D"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FusedDepthwiseConv2D"].apply(null, arguments) + }; + var _Gather = Module["_Gather"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Gather"].apply(null, arguments) + }; + var _GatherNd = Module["_GatherNd"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["GatherNd"].apply(null, arguments) + }; + var _Greater = Module["_Greater"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Greater"].apply(null, arguments) + }; + var _GreaterEqual = Module["_GreaterEqual"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["GreaterEqual"].apply(null, arguments) + }; + var _Less = Module["_Less"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Less"].apply(null, arguments) + }; + var _LessEqual = Module["_LessEqual"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["LessEqual"].apply(null, arguments) + }; + var _Log = Module["_Log"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Log"].apply(null, arguments) + }; + var _LogicalAnd = Module["_LogicalAnd"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["LogicalAnd"].apply(null, arguments) + }; + var _Max = Module["_Max"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Max"].apply(null, arguments) + }; + var _MaxPool = Module["_MaxPool"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["MaxPool"].apply(null, arguments) + }; + var _Maximum = Module["_Maximum"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Maximum"].apply(null, arguments) + }; + var _Min = Module["_Min"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Min"].apply(null, arguments) + }; + var _Minimum = Module["_Minimum"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Minimum"].apply(null, arguments) + }; + var _Mul = Module["_Mul"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Mul"].apply(null, arguments) + }; + var _Neg = Module["_Neg"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Neg"].apply(null, arguments) + }; + var _NonMaxSuppressionV3 = Module["_NonMaxSuppressionV3"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["NonMaxSuppressionV3"].apply(null, arguments) + }; + var _NonMaxSuppressionV5 = Module["_NonMaxSuppressionV5"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["NonMaxSuppressionV5"].apply(null, arguments) + }; + var _NotEqual = Module["_NotEqual"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["NotEqual"].apply(null, arguments) + }; + var _PadV2 = Module["_PadV2"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["PadV2"].apply(null, arguments) + }; + var _Pow = Module["_Pow"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Pow"].apply(null, arguments) + }; + var _Prelu = Module["_Prelu"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Prelu"].apply(null, arguments) + }; + var _Relu = Module["_Relu"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Relu"].apply(null, arguments) + }; + var _Relu6 = Module["_Relu6"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Relu6"].apply(null, arguments) + }; + var _ResizeBilinear = Module["_ResizeBilinear"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ResizeBilinear"].apply(null, arguments) + }; + var _Rsqrt = Module["_Rsqrt"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Rsqrt"].apply(null, arguments) + }; + var _ScatterNd = Module["_ScatterNd"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ScatterNd"].apply(null, arguments) + }; + var _Sigmoid = Module["_Sigmoid"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sigmoid"].apply(null, arguments) + }; + var _Sin = Module["_Sin"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sin"].apply(null, arguments) + }; + var _Softmax = Module["_Softmax"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Softmax"].apply(null, arguments) + }; + var _Sqrt = Module["_Sqrt"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sqrt"].apply(null, arguments) + }; + var _Square = Module["_Square"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Square"].apply(null, arguments) + }; + var _Sub = Module["_Sub"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sub"].apply(null, arguments) + }; + var _Sum = Module["_Sum"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sum"].apply(null, arguments) + }; + var _Tanh = Module["_Tanh"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Tanh"].apply(null, arguments) + }; + var _Tile = Module["_Tile"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Tile"].apply(null, arguments) + }; + var _Transpose = Module["_Transpose"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Transpose"].apply(null, arguments) + }; + var __FusedMatMul = Module["__FusedMatMul"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["_FusedMatMul"].apply(null, arguments) + }; + var _malloc = Module["_malloc"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["malloc"].apply(null, arguments) + }; + var _free = Module["_free"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["free"].apply(null, arguments) + }; + var ___em_js__initPthreadsJS = Module["___em_js__initPthreadsJS"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__em_js__initPthreadsJS"].apply(null, arguments) + }; + var _emscripten_get_global_libc = Module["_emscripten_get_global_libc"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_get_global_libc"].apply(null, arguments) + }; + var _memalign = Module["_memalign"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["memalign"].apply(null, arguments) + }; + var ___pthread_tsd_run_dtors = Module["___pthread_tsd_run_dtors"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__pthread_tsd_run_dtors"].apply(null, arguments) + }; + var _emscripten_main_thread_process_queued_calls = Module["_emscripten_main_thread_process_queued_calls"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null, arguments) + }; + var _emscripten_current_thread_process_queued_calls = Module["_emscripten_current_thread_process_queued_calls"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null, arguments) + }; + var _emscripten_register_main_browser_thread_id = Module["_emscripten_register_main_browser_thread_id"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null, arguments) + }; + var _emscripten_main_browser_thread_id = Module["_emscripten_main_browser_thread_id"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_main_browser_thread_id"].apply(null, arguments) + }; + var _emscripten_async_run_in_main_thread = Module["_emscripten_async_run_in_main_thread"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread = Module["_emscripten_sync_run_in_main_thread"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_0 = Module["_emscripten_sync_run_in_main_thread_0"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_1 = Module["_emscripten_sync_run_in_main_thread_1"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_2 = Module["_emscripten_sync_run_in_main_thread_2"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_xprintf_varargs = Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_3 = Module["_emscripten_sync_run_in_main_thread_3"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_4 = Module["_emscripten_sync_run_in_main_thread_4"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_5 = Module["_emscripten_sync_run_in_main_thread_5"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_6 = Module["_emscripten_sync_run_in_main_thread_6"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_7 = Module["_emscripten_sync_run_in_main_thread_7"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null, arguments) + }; + var _emscripten_run_in_main_runtime_thread_js = Module["_emscripten_run_in_main_runtime_thread_js"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null, arguments) + }; + var _emscripten_async_queue_on_thread_ = Module["_emscripten_async_queue_on_thread_"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null, arguments) + }; + var _emscripten_tls_init = Module["_emscripten_tls_init"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_tls_init"].apply(null, arguments) + }; + var ___set_stack_limit = Module["___set_stack_limit"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__set_stack_limit"].apply(null, arguments) + }; + var stackSave = Module["stackSave"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["stackSave"].apply(null, arguments) + }; + var stackAlloc = Module["stackAlloc"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["stackAlloc"].apply(null, arguments) + }; + var stackRestore = Module["stackRestore"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["stackRestore"].apply(null, arguments) + }; + var dynCall_vi = Module["dynCall_vi"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dynCall_vi"].apply(null, arguments) + }; + var dynCall_v = Module["dynCall_v"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dynCall_v"].apply(null, arguments) + }; + var dynCall_ii = Module["dynCall_ii"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dynCall_ii"].apply(null, arguments) + }; + Module["asm"] = asm; + if (!Object.getOwnPropertyDescriptor(Module, "intArrayFromString")) Module["intArrayFromString"] = function () { + abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "intArrayToString")) Module["intArrayToString"] = function () { + abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "ccall")) Module["ccall"] = function () { + abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + Module["cwrap"] = cwrap; + if (!Object.getOwnPropertyDescriptor(Module, "setValue")) Module["setValue"] = function () { + abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getValue")) Module["getValue"] = function () { + abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "allocate")) Module["allocate"] = function () { + abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getMemory")) Module["getMemory"] = function () { + abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF8ArrayToString")) Module["UTF8ArrayToString"] = function () { + abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF8ToString")) Module["UTF8ToString"] = function () { + abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8Array")) Module["stringToUTF8Array"] = function () { + abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8")) Module["stringToUTF8"] = function () { + abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF8")) Module["lengthBytesUTF8"] = function () { + abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function () { + abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnPreRun")) Module["addOnPreRun"] = function () { + abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnInit")) Module["addOnInit"] = function () { + abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnPreMain")) Module["addOnPreMain"] = function () { + abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnExit")) Module["addOnExit"] = function () { + abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnPostRun")) Module["addOnPostRun"] = function () { + abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeStringToMemory")) Module["writeStringToMemory"] = function () { + abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeArrayToMemory")) Module["writeArrayToMemory"] = function () { + abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeAsciiToMemory")) Module["writeAsciiToMemory"] = function () { + abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addRunDependency")) Module["addRunDependency"] = function () { + abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "removeRunDependency")) Module["removeRunDependency"] = function () { + abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createFolder")) Module["FS_createFolder"] = function () { + abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createPath")) Module["FS_createPath"] = function () { + abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createDataFile")) Module["FS_createDataFile"] = function () { + abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createPreloadedFile")) Module["FS_createPreloadedFile"] = function () { + abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createLazyFile")) Module["FS_createLazyFile"] = function () { + abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createLink")) Module["FS_createLink"] = function () { + abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createDevice")) Module["FS_createDevice"] = function () { + abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_unlink")) Module["FS_unlink"] = function () { + abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "dynamicAlloc")) Module["dynamicAlloc"] = function () { + abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "loadDynamicLibrary")) Module["loadDynamicLibrary"] = function () { + abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "loadWebAssemblyModule")) Module["loadWebAssemblyModule"] = function () { + abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getLEB")) Module["getLEB"] = function () { + abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getFunctionTables")) Module["getFunctionTables"] = function () { + abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "alignFunctionTables")) Module["alignFunctionTables"] = function () { + abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "registerFunctions")) Module["registerFunctions"] = function () { + abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addFunction")) Module["addFunction"] = function () { + abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "removeFunction")) Module["removeFunction"] = function () { + abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getFuncWrapper")) Module["getFuncWrapper"] = function () { + abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "prettyPrint")) Module["prettyPrint"] = function () { + abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "makeBigInt")) Module["makeBigInt"] = function () { + abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "dynCall")) Module["dynCall"] = function () { + abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getCompilerSetting")) Module["getCompilerSetting"] = function () { + abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "print")) Module["print"] = function () { + abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "printErr")) Module["printErr"] = function () { + abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getTempRet0")) Module["getTempRet0"] = function () { + abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "setTempRet0")) Module["setTempRet0"] = function () { + abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "callMain")) Module["callMain"] = function () { + abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "abort")) Module["abort"] = function () { + abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToNewUTF8")) Module["stringToNewUTF8"] = function () { + abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscripten_realloc_buffer")) Module["emscripten_realloc_buffer"] = function () { + abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "ENV")) Module["ENV"] = function () { + abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "setjmpId")) Module["setjmpId"] = function () { + abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_CODES")) Module["ERRNO_CODES"] = function () { + abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_MESSAGES")) Module["ERRNO_MESSAGES"] = function () { + abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "DNS")) Module["DNS"] = function () { + abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GAI_ERRNO_MESSAGES")) Module["GAI_ERRNO_MESSAGES"] = function () { + abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "Protocols")) Module["Protocols"] = function () { + abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "Sockets")) Module["Sockets"] = function () { + abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UNWIND_CACHE")) Module["UNWIND_CACHE"] = function () { + abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "readAsmConstArgs")) Module["readAsmConstArgs"] = function () { + abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "jstoi_q")) Module["jstoi_q"] = function () { + abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "jstoi_s")) Module["jstoi_s"] = function () { + abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "PATH")) Module["PATH"] = function () { + abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "PATH_FS")) Module["PATH_FS"] = function () { + abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SYSCALLS")) Module["SYSCALLS"] = function () { + abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "syscallMmap2")) Module["syscallMmap2"] = function () { + abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "syscallMunmap")) Module["syscallMunmap"] = function () { + abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "flush_NO_FILESYSTEM")) Module["flush_NO_FILESYSTEM"] = function () { + abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "JSEvents")) Module["JSEvents"] = function () { + abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "demangle")) Module["demangle"] = function () { + abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "demangleAll")) Module["demangleAll"] = function () { + abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "jsStackTrace")) Module["jsStackTrace"] = function () { + abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function () { + abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64")) Module["writeI53ToI64"] = function () { + abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Clamped")) Module["writeI53ToI64Clamped"] = function () { + abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Signaling")) Module["writeI53ToI64Signaling"] = function () { + abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Clamped")) Module["writeI53ToU64Clamped"] = function () { + abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Signaling")) Module["writeI53ToU64Signaling"] = function () { + abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "readI53FromI64")) Module["readI53FromI64"] = function () { + abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "readI53FromU64")) Module["readI53FromU64"] = function () { + abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "convertI32PairToI53")) Module["convertI32PairToI53"] = function () { + abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "convertU32PairToI53")) Module["convertU32PairToI53"] = function () { + abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "Browser")) Module["Browser"] = function () { + abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GL")) Module["GL"] = function () { + abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGet")) Module["emscriptenWebGLGet"] = function () { + abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetTexPixelData")) Module["emscriptenWebGLGetTexPixelData"] = function () { + abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetUniform")) Module["emscriptenWebGLGetUniform"] = function () { + abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetVertexAttrib")) Module["emscriptenWebGLGetVertexAttrib"] = function () { + abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "AL")) Module["AL"] = function () { + abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL")) Module["SDL"] = function () { + abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL_gfx")) Module["SDL_gfx"] = function () { + abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLUT")) Module["GLUT"] = function () { + abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "EGL")) Module["EGL"] = function () { + abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLFW_Window")) Module["GLFW_Window"] = function () { + abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLFW")) Module["GLFW"] = function () { + abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLEW")) Module["GLEW"] = function () { + abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "IDBStore")) Module["IDBStore"] = function () { + abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "runAndAbortIfError")) Module["runAndAbortIfError"] = function () { + abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + Module["PThread"] = PThread; + if (!Object.getOwnPropertyDescriptor(Module, "establishStackSpace")) Module["establishStackSpace"] = function () { + abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getNoExitRuntime")) Module["getNoExitRuntime"] = function () { + abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "resetPrototype")) Module["resetPrototype"] = function () { + abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "warnOnce")) Module["warnOnce"] = function () { + abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackSave")) Module["stackSave"] = function () { + abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackRestore")) Module["stackRestore"] = function () { + abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackAlloc")) Module["stackAlloc"] = function () { + abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "AsciiToString")) Module["AsciiToString"] = function () { + abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToAscii")) Module["stringToAscii"] = function () { + abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF16ToString")) Module["UTF16ToString"] = function () { + abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF16")) Module["stringToUTF16"] = function () { + abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF16")) Module["lengthBytesUTF16"] = function () { + abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF32ToString")) Module["UTF32ToString"] = function () { + abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF32")) Module["stringToUTF32"] = function () { + abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF32")) Module["lengthBytesUTF32"] = function () { + abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8")) Module["allocateUTF8"] = function () { + abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8OnStack")) Module["allocateUTF8OnStack"] = function () { + abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + Module["writeStackCookie"] = writeStackCookie; + Module["checkStackCookie"] = checkStackCookie; + Module["abortStackOverflow"] = abortStackOverflow; + Module["PThread"] = PThread; + Module["_pthread_self"] = _pthread_self; + Module["wasmMemory"] = wasmMemory; + Module["ExitStatus"] = ExitStatus; + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NORMAL")) Object.defineProperty(Module, "ALLOC_NORMAL", { + configurable: true, + get: function () { + abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_STACK")) Object.defineProperty(Module, "ALLOC_STACK", { + configurable: true, + get: function () { + abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_DYNAMIC")) Object.defineProperty(Module, "ALLOC_DYNAMIC", { + configurable: true, + get: function () { + abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NONE")) Object.defineProperty(Module, "ALLOC_NONE", { + configurable: true, + get: function () { + abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + } + }); + var calledRun; + Module["then"] = function (func) { + if (calledRun) { + func(Module) + } else { + var old = Module["onRuntimeInitialized"]; + Module["onRuntimeInitialized"] = function () { + if (old) old(); + func(Module) + } + } + return Module + }; + + function ExitStatus(status) { + this.name = "ExitStatus"; + this.message = "Program terminated with exit(" + status + ")"; + this.status = status + } + dependenciesFulfilled = function runCaller() { + if (!calledRun) run(); + if (!calledRun) dependenciesFulfilled = runCaller + }; + + function run(args) { + args = args || arguments_; + if (runDependencies > 0) { + return + } + writeStackCookie(); + preRun(); + if (runDependencies > 0) return; -function GROWABLE_HEAP_I8(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAP8}function GROWABLE_HEAP_U8(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPU8}function GROWABLE_HEAP_I32(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAP32}function GROWABLE_HEAP_U32(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPU32}function GROWABLE_HEAP_F64(){if(wasmMemory.buffer!=buffer){updateGlobalBufferAndViews(wasmMemory.buffer)}return HEAPF64}var Module=typeof WasmBackendModule!=="undefined"?WasmBackendModule:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(Module["ENVIRONMENT"]){throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)")}var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"];DYNAMIC_BASE=Module["DYNAMIC_BASE"];DYNAMICTOP_PTR=Module["DYNAMICTOP_PTR"]}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{throw new Error("environment detection error")}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(!Object.getOwnPropertyDescriptor(Module,"arguments"))Object.defineProperty(Module,"arguments",{configurable:true,get:function(){abort("Module.arguments has been replaced with plain arguments_")}});if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(!Object.getOwnPropertyDescriptor(Module,"thisProgram"))Object.defineProperty(Module,"thisProgram",{configurable:true,get:function(){abort("Module.thisProgram has been replaced with plain thisProgram")}});if(Module["quit"])quit_=Module["quit"];if(!Object.getOwnPropertyDescriptor(Module,"quit"))Object.defineProperty(Module,"quit",{configurable:true,get:function(){abort("Module.quit has been replaced with plain quit_")}});assert(typeof Module["memoryInitializerPrefixURL"]==="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["pthreadMainPrefixURL"]==="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["cdInitializerPrefixURL"]==="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["filePackagePrefixURL"]==="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["read"]==="undefined","Module.read option was removed (modify read_ in JS)");assert(typeof Module["readAsync"]==="undefined","Module.readAsync option was removed (modify readAsync in JS)");assert(typeof Module["readBinary"]==="undefined","Module.readBinary option was removed (modify readBinary in JS)");assert(typeof Module["setWindowTitle"]==="undefined","Module.setWindowTitle option was removed (modify setWindowTitle in JS)");assert(typeof Module["TOTAL_MEMORY"]==="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY");if(!Object.getOwnPropertyDescriptor(Module,"read"))Object.defineProperty(Module,"read",{configurable:true,get:function(){abort("Module.read has been replaced with plain read_")}});if(!Object.getOwnPropertyDescriptor(Module,"readAsync"))Object.defineProperty(Module,"readAsync",{configurable:true,get:function(){abort("Module.readAsync has been replaced with plain readAsync")}});if(!Object.getOwnPropertyDescriptor(Module,"readBinary"))Object.defineProperty(Module,"readBinary",{configurable:true,get:function(){abort("Module.readBinary has been replaced with plain readBinary")}});assert(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER||ENVIRONMENT_IS_NODE,"Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)");var stackSave;var stackRestore;var stackAlloc;stackSave=stackRestore=stackAlloc=function(){abort("cannot use the stack before compiled code is ready to run, and has provided stack access")};function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(!Object.getOwnPropertyDescriptor(Module,"wasmBinary"))Object.defineProperty(Module,"wasmBinary",{configurable:true,get:function(){abort("Module.wasmBinary has been replaced with plain wasmBinary")}});var noExitRuntime;if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(!Object.getOwnPropertyDescriptor(Module,"noExitRuntime"))Object.defineProperty(Module,"noExitRuntime",{configurable:true,get:function(){abort("Module.noExitRuntime has been replaced with plain noExitRuntime")}});if(typeof WebAssembly!=="object"){abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.")}var wasmMemory;var wasmTable=new WebAssembly.Table({"initial":120,"maximum":120+0,"element":"anyfunc"});var wasmModule;var threadInfoStruct=0;var selfThreadId=0;var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string")return UTF8ToString(ret);if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i=endIdx)){var u0=u8Array[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=u8Array[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=u8Array[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{if((u0&248)!=240)warnOnce("Invalid UTF-8 leading byte 0x"+u0.toString(16)+" encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!");u0=(u0&7)<<18|u1<<12|u2<<6|u8Array[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(GROWABLE_HEAP_U8(),ptr,maxBytesToRead):""}function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;if(u>=2097152)warnOnce("Invalid Unicode code point 0x"+u.toString(16)+" encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF).");outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,GROWABLE_HEAP_U8(),outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");GROWABLE_HEAP_I8().set(array,buffer)}var WASM_PAGE_SIZE=65536;function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var STACK_BASE=5255840,STACKTOP=STACK_BASE,STACK_MAX=12960,DYNAMIC_BASE=5255840,DYNAMICTOP_PTR=12032;assert(STACK_BASE%16===0,"stack must start aligned");assert(DYNAMIC_BASE%16===0,"heap must start aligned");if(ENVIRONMENT_IS_PTHREAD){STACK_MAX=STACKTOP=STACK_MAX=2147483647}var TOTAL_STACK=5242880;if(Module["TOTAL_STACK"])assert(TOTAL_STACK===Module["TOTAL_STACK"],"the stack size can no longer be determined at runtime");var INITIAL_INITIAL_MEMORY=Module["INITIAL_MEMORY"]||1073741824;if(!Object.getOwnPropertyDescriptor(Module,"INITIAL_MEMORY"))Object.defineProperty(Module,"INITIAL_MEMORY",{configurable:true,get:function(){abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY")}});assert(INITIAL_INITIAL_MEMORY>=TOTAL_STACK,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+INITIAL_INITIAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");assert(typeof Int32Array!=="undefined"&&typeof Float64Array!=="undefined"&&Int32Array.prototype.subarray!==undefined&&Int32Array.prototype.set!==undefined,"JS engine does not provide full typed array support");if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,"maximum":1073741824/WASM_PAGE_SIZE,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_INITIAL_MEMORY=buffer.byteLength;assert(INITIAL_INITIAL_MEMORY%WASM_PAGE_SIZE===0);assert(65536%WASM_PAGE_SIZE===0);updateGlobalBufferAndViews(buffer);if(!ENVIRONMENT_IS_PTHREAD){GROWABLE_HEAP_I32()[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE}function writeStackCookie(){assert((STACK_MAX&3)==0);GROWABLE_HEAP_U32()[(STACK_MAX>>2)+1]=34821223;GROWABLE_HEAP_U32()[(STACK_MAX>>2)+2]=2310721022;GROWABLE_HEAP_I32()[0]=1668509029}function checkStackCookie(){var cookie1=GROWABLE_HEAP_U32()[(STACK_MAX>>2)+1];var cookie2=GROWABLE_HEAP_U32()[(STACK_MAX>>2)+2];if(cookie1!=34821223||cookie2!=2310721022){abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+cookie2.toString(16)+" "+cookie1.toString(16))}if(GROWABLE_HEAP_I32()[0]!==1668509029)abort("Runtime error: The application has corrupted its heap memory area (address zero)!")}function abortStackOverflow(allocSize){abort("Stack overflow! Attempted to allocate "+allocSize+" bytes on the stack, but stack has only "+(STACK_MAX-stackSave()+allocSize)+" bytes available!")}(function(){var h16=new Int16Array(1);var h8=new Int8Array(h16.buffer);h16[0]=25459;if(h8[0]!==115||h8[1]!==99)throw"Runtime error: expected the system to be little-endian!"})();function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;if(ENVIRONMENT_IS_PTHREAD)runtimeInitialized=true;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){checkStackCookie();assert(!runtimeInitialized);runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATMAIN__)}function postRun(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Math_ceil=Math.ceil;var Math_floor=Math.floor;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!=="undefined"){runDependencyWatcher=setInterval(function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;err("still waiting on run dependencies:")}err("dependency: "+dep)}if(shown){err("(end of list)")}},1e4)}}else{err("warning: run dependency added without ID")}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id]}else{err("warning: run dependency removed without ID")}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";out(what);err(what);ABORT=true;EXITSTATUS=1;var output="abort("+what+") at "+stackTrace();what=output;throw new WebAssembly.RuntimeError(what)}var FS={error:function(){abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1")},init:function(){FS.error()},createDataFile:function(){FS.error()},createPreloadedFile:function(){FS.error()},createLazyFile:function(){FS.error()},open:function(){FS.error()},mkdev:function(){FS.error()},registerDevice:function(){FS.error()},analyzePath:function(){FS.error()},loadFilesFromDB:function(){FS.error()},ErrnoError:function ErrnoError(){FS.error()}};Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}var wasmBinaryFile="tfjs-backend-wasm.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(){try{if(wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(wasmBinaryFile)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary()})}return new Promise(function(resolve,reject){resolve(getBinary())})}function createWasm(){var info={"env":asmLibraryArg,"wasi_snapshot_preview1":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){var numWorkersToLoad=PThread.unusedWorkers.length;PThread.unusedWorkers.forEach(function(w){PThread.loadWasmModuleToWorker(w,function(){if(!--numWorkersToLoad)removeRunDependency("wasm-instantiate")})})}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}var trueModule=Module;function receiveInstantiatedSource(output){assert(Module===trueModule,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");trueModule=null;receiveInstance(output["instance"],output["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&typeof fetch==="function"){fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var ASM_CONSTS={};function initPthreadsJS(){PThread.initRuntime()}if(!ENVIRONMENT_IS_PTHREAD)__ATINIT__.push({func:function(){___wasm_call_ctors()}});function demangle(func){warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return func}function demangleAll(text){var regex=/\b_Z[\w\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"})}var __pthread_ptr=0;var __pthread_is_main_runtime_thread=0;var __pthread_is_main_browser_thread=0;function __register_pthread_ptr(pthreadPtr,isMainBrowserThread,isMainRuntimeThread){pthreadPtr=pthreadPtr|0;isMainBrowserThread=isMainBrowserThread|0;isMainRuntimeThread=isMainRuntimeThread|0;__pthread_ptr=pthreadPtr;__pthread_is_main_browser_thread=isMainBrowserThread;__pthread_is_main_runtime_thread=isMainRuntimeThread}Module["__register_pthread_ptr"]=__register_pthread_ptr;var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var __main_thread_futex_wait_address=12944;function _emscripten_futex_wake(addr,count){if(addr<=0||addr>GROWABLE_HEAP_I8().length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(GROWABLE_HEAP_I32(),addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function __kill_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _kill_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _kill_thread!";GROWABLE_HEAP_I32()[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function __cancel_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cancel_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cancel_thread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function __cleanup_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cleanup_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cleanup_thread!";GROWABLE_HEAP_I32()[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];if(pthread){var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={MAIN_THREAD_ID:1,mainThreadInfo:{schedPolicy:0,schedPrio:0},unusedWorkers:[],runningWorkers:[],initRuntime:function(){__register_pthread_ptr(PThread.mainThreadBlock,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(PThread.mainThreadBlock)},initMainThreadBlock:function(){assert(!ENVIRONMENT_IS_PTHREAD);var pthreadPoolSize=8;for(var i=0;i>2]=PThread.mainThreadBlock;var headPtr=PThread.mainThreadBlock+156;GROWABLE_HEAP_I32()[headPtr>>2]=headPtr;var tlsMemory=12432;for(var i=0;i<128;++i)GROWABLE_HEAP_U32()[tlsMemory/4+i]=0;Atomics.store(GROWABLE_HEAP_U32(),PThread.mainThreadBlock+104>>2,tlsMemory);Atomics.store(GROWABLE_HEAP_U32(),PThread.mainThreadBlock+40>>2,PThread.mainThreadBlock);Atomics.store(GROWABLE_HEAP_U32(),PThread.mainThreadBlock+44>>2,42)},initWorker:function(){},pthreads:{},exitHandlers:null,setThreadStatus:function(){},runExitHandlers:function(){if(PThread.exitHandlers!==null){while(PThread.exitHandlers.length>0){PThread.exitHandlers.pop()()}PThread.exitHandlers=null}if(ENVIRONMENT_IS_PTHREAD&&threadInfoStruct)___pthread_tsd_run_dtors()},threadExit:function(exitCode){var tb=_pthread_self();if(tb){err("Pthread 0x"+tb.toString(16)+" exited.");Atomics.store(GROWABLE_HEAP_U32(),tb+4>>2,exitCode);Atomics.store(GROWABLE_HEAP_U32(),tb+0>>2,1);Atomics.store(GROWABLE_HEAP_U32(),tb+60>>2,1);Atomics.store(GROWABLE_HEAP_U32(),tb+64>>2,0);PThread.runExitHandlers();_emscripten_futex_wake(tb+0,2147483647);__register_pthread_ptr(0,0,0);threadInfoStruct=0;if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlers();Atomics.store(GROWABLE_HEAP_U32(),threadInfoStruct+4>>2,-1);Atomics.store(GROWABLE_HEAP_U32(),threadInfoStruct+0>>2,1);_emscripten_futex_wake(threadInfoStruct+0,2147483647);threadInfoStruct=selfThreadId=0;__register_pthread_ptr(0,0,0);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];GROWABLE_HEAP_I32()[pthread.threadInfoStruct+104>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){delete PThread.pthreads[worker.pthread.thread];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined},receiveObjectTransfer:function(data){},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){__spawn_thread(e.data)}else if(cmd==="cleanupThread"){__cleanup_thread(d["thread"])}else if(cmd==="killThread"){__kill_thread(d["thread"])}else if(cmd==="cancelThread"){__cancel_thread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(GROWABLE_HEAP_U32(),worker.pthread.thread+68>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){console.log("worker exited - TODO: update the worker queue?")})}assert(wasmMemory instanceof WebAssembly.Memory,"WebAssembly memory should have been loaded by now!");assert(wasmModule instanceof WebAssembly.Module,"WebAssembly Module should have been loaded by now!");worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule,"DYNAMIC_BASE":DYNAMIC_BASE,"DYNAMICTOP_PTR":DYNAMICTOP_PTR})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("tfjs-backend-wasm.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}if(PThread.unusedWorkers.length>0)return PThread.unusedWorkers.pop();else return null},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()>2]=value;else err("failed to set errno from JS");return value}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg);warnOnce("atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)");__ATEXIT__.unshift({func:func,arg:arg})}function ___handle_stack_overflow(){abort("stack overflow")}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({cmd:"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({targetThread:targetThreadId,cmd:"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){err("Cannot send message to thread with ID "+targetThreadId+", unknown thread ID!");return}worker.postMessage({cmd:"processThreadQueue"})}return 1}function _abort(){abort()}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){expectedStatus=expectedStatus|0;newStatus=newStatus|0}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>GROWABLE_HEAP_I8().length||addr&3!=0)return-28;if(ENVIRONMENT_IS_WORKER){var ret=Atomics.wait(GROWABLE_HEAP_I32(),addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{var loadedVal=Atomics.load(GROWABLE_HEAP_I32(),addr>>2);if(val!=loadedVal)return-6;var tNow=performance.now();var tEnd=tNow+timeout;Atomics.store(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2,addr);var ourWaitAddress=addr;while(addr==ourWaitAddress){tNow=performance.now();if(tNow>tEnd){return-73}_emscripten_main_thread_process_queued_calls();addr=Atomics.load(GROWABLE_HEAP_I32(),__main_thread_futex_wait_address>>2)}return 0}}function _emscripten_is_main_browser_thread(){return __pthread_is_main_browser_thread|0}function _emscripten_is_main_runtime_thread(){return __pthread_is_main_runtime_thread|0}function _emscripten_memcpy_big(dest,src,num){GROWABLE_HEAP_U8().copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;if(numCallArgs>20-1)throw"emscripten_proxy_to_main_thread_js: Too many arguments "+numCallArgs+" to proxied function idx="+index+", maximum supported is "+(20-1)+"!";var stack=stackSave();var args=stackAlloc(numCallArgs*8);var b=args>>3;for(var i=0;i>3]);buf+=8}else if(ch===105){buf=buf+3&~3;args.push(GROWABLE_HEAP_I32()[buf>>2]);buf+=4}else abort("unexpected char in asm const signature "+ch)}return args}function _emscripten_receive_on_main_thread_js(index,numCallArgs,args){_emscripten_receive_on_main_thread_js_callArgs.length=numCallArgs;var b=args>>3;for(var i=0;i>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){console.error("emscripten_realloc_buffer: Attempted to grow heap from "+buffer.byteLength+" bytes to "+size+" bytes, but got error: "+e)}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();if(requestedSize<=oldSize){return false}var PAGE_MULTIPLE=65536;var maxHeapSize=1073741824;if(requestedSize>maxHeapSize){err("Cannot enlarge memory, asked to go up to "+requestedSize+" bytes, but the limit is "+maxHeapSize+" bytes!");return false}var minHeapSize=16777216;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(minHeapSize,requestedSize,overGrownHeapSize),PAGE_MULTIPLE));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}err("Failed to grow the heap from "+oldSize+" bytes to "+newSize+" bytes, not enough memory!");return false}var JSEvents={keyEvent:0,mouseEvent:0,wheelEvent:0,uiEvent:0,focusEvent:0,deviceOrientationEvent:0,deviceMotionEvent:0,fullscreenChangeEvent:0,pointerlockChangeEvent:0,visibilityChangeEvent:0,touchEvent:0,previousFullscreenElement:null,previousScreenX:null,previousScreenY:null,removeEventListenersRegistered:false,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;GROWABLE_HEAP_I32()[varargs+4>>2]=eventData;GROWABLE_HEAP_I32()[varargs+8>>2]=userData;_emscripten_async_queue_on_thread_(targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}GROWABLE_HEAP_I32()[varargs>>2]=targetCanvasPtr;GROWABLE_HEAP_I32()[varargs+4>>2]=width;GROWABLE_HEAP_I32()[varargs+8>>2]=height;_emscripten_async_queue_on_thread_(targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function __maybeCStringToJsString(cString){return cString===cString+0?UTF8ToString(cString):cString}var __specialEventTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function __findEventTarget(target){var domElement=__specialEventTargets[target]||(typeof document!=="undefined"?document.querySelector(__maybeCStringToJsString(target)):undefined);return domElement}function __findCanvasEventTarget(target){return __findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=__findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){GROWABLE_HEAP_I32()[canvas.canvasSharedPtr>>2]=width;GROWABLE_HEAP_I32()[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=GROWABLE_HEAP_I32()[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=__findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){newStatus=newStatus|0}function _emscripten_set_thread_name(threadId,name){threadId=threadId|0;name=name|0}function __webgl_acquireInstancedArraysExtension(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)}}}function __webgl_acquireVertexArrayObjectExtension(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)}}}function __webgl_acquireDrawBuffersExtension(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)}}}var GL={counter:1,lastError:0,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},currentContext:null,offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,init:function(){var miniTempFloatBuffer=new Float32Array(GL.MINI_TEMP_BUFFER_SIZE);for(var i=0;i>2]:-1;source+=UTF8ToString(GROWABLE_HEAP_I32()[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);GROWABLE_HEAP_I32()[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;if(context.version<2){__webgl_acquireInstancedArraysExtension(GLctx);__webgl_acquireVertexArrayObjectExtension(GLctx);__webgl_acquireDrawBuffersExtension(GLctx)}GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query");var automaticallyEnabledExtensions=["OES_texture_float","OES_texture_half_float","OES_standard_derivatives","OES_vertex_array_object","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","OES_element_index_uint","EXT_texture_filter_anisotropic","EXT_frag_depth","WEBGL_draw_buffers","ANGLE_instanced_arrays","OES_texture_float_linear","OES_texture_half_float_linear","EXT_blend_minmax","EXT_shader_texture_lod","EXT_texture_norm16","WEBGL_compressed_texture_pvrtc","EXT_color_buffer_half_float","WEBGL_color_buffer_float","EXT_sRGB","WEBGL_compressed_texture_etc1","EXT_disjoint_timer_query","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_astc","EXT_color_buffer_float","WEBGL_compressed_texture_s3tc_srgb","EXT_disjoint_timer_query_webgl2","WEBKIT_WEBGL_compressed_texture_pvrtc"];var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(automaticallyEnabledExtensions.indexOf(ext)!=-1){GLctx.getExtension(ext)}})},populateUniformTable:function(program){var p=GL.programs[program];var ptable=GL.programInfos[program]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1};var utable=ptable.uniforms;var numUniforms=GLctx.getProgramParameter(p,35718);for(var i=0;i>2;contextAttributes["alpha"]=!!GROWABLE_HEAP_I32()[a+(0>>2)];contextAttributes["depth"]=!!GROWABLE_HEAP_I32()[a+(4>>2)];contextAttributes["stencil"]=!!GROWABLE_HEAP_I32()[a+(8>>2)];contextAttributes["antialias"]=!!GROWABLE_HEAP_I32()[a+(12>>2)];contextAttributes["premultipliedAlpha"]=!!GROWABLE_HEAP_I32()[a+(16>>2)];contextAttributes["preserveDrawingBuffer"]=!!GROWABLE_HEAP_I32()[a+(20>>2)];var powerPreference=GROWABLE_HEAP_I32()[a+(24>>2)];contextAttributes["powerPreference"]=__emscripten_webgl_power_preferences[powerPreference];contextAttributes["failIfMajorPerformanceCaveat"]=!!GROWABLE_HEAP_I32()[a+(28>>2)];contextAttributes.majorVersion=GROWABLE_HEAP_I32()[a+(32>>2)];contextAttributes.minorVersion=GROWABLE_HEAP_I32()[a+(36>>2)];contextAttributes.enableExtensionsByDefault=GROWABLE_HEAP_I32()[a+(40>>2)];contextAttributes.explicitSwapControl=GROWABLE_HEAP_I32()[a+(44>>2)];contextAttributes.proxyContextToMainThread=GROWABLE_HEAP_I32()[a+(48>>2)];contextAttributes.renderViaOffscreenBackBuffer=GROWABLE_HEAP_I32()[a+(52>>2)];var canvas=__findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];assert(buffer);if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:undefined,get:function(){assert(SYSCALLS.varargs!=undefined);SYSCALLS.varargs+=4;var ret=GROWABLE_HEAP_I32()[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){if(low>=0)assert(high===0);else assert(high===-1);return low}};function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,fd);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM");return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,fd,offset_low,offset_high,whence,newOffset);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM")}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd,iov,iovcnt,pnum);var num=0;for(var i=0;i>2];var len=GROWABLE_HEAP_I32()[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}function _pthread_cleanup_pop(execute){var routine=PThread.exitHandlers.pop();if(execute)routine()}function _pthread_cleanup_push(routine,arg){if(PThread.exitHandlers===null){PThread.exitHandlers=[]}PThread.exitHandlers.push(function(){dynCall_vi(routine,arg)})}function __spawn_thread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _spawn_thread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){GROWABLE_HEAP_I32()[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,thread:threadParams.pthread_ptr,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(GROWABLE_HEAP_U32(),tis+(0>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(4>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(8>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(68>>2),threadParams.detached);Atomics.store(GROWABLE_HEAP_U32(),tis+(104>>2),tlsMemory);Atomics.store(GROWABLE_HEAP_U32(),tis+(48>>2),0);Atomics.store(GROWABLE_HEAP_U32(),tis+(40>>2),pthread.threadInfoStruct);Atomics.store(GROWABLE_HEAP_U32(),tis+(44>>2),42);Atomics.store(GROWABLE_HEAP_U32(),tis+(108>>2),threadParams.stackSize);Atomics.store(GROWABLE_HEAP_U32(),tis+(84>>2),threadParams.stackSize);Atomics.store(GROWABLE_HEAP_U32(),tis+(80>>2),stackHigh);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+8>>2),stackHigh);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+12>>2),threadParams.detached);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+20>>2),threadParams.schedPolicy);Atomics.store(GROWABLE_HEAP_U32(),tis+(108+24>>2),threadParams.schedPrio);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(GROWABLE_HEAP_U32(),tis+(176>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"selfThreadId":threadParams.pthread_ptr,"parentThreadId":threadParams.parent_pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}}function _pthread_getschedparam(thread,policy,schedparam){if(!policy&&!schedparam)return ERRNO_CODES.EINVAL;if(!thread){err("pthread_getschedparam called with a null thread pointer!");return ERRNO_CODES.ESRCH}var self=GROWABLE_HEAP_I32()[thread+12>>2];if(self!==thread){err("pthread_getschedparam attempted on thread "+thread+", which does not point to a valid thread, or does not exist anymore!");return ERRNO_CODES.ESRCH}var schedPolicy=Atomics.load(GROWABLE_HEAP_U32(),thread+108+20>>2);var schedPrio=Atomics.load(GROWABLE_HEAP_U32(),thread+108+24>>2);if(policy)GROWABLE_HEAP_I32()[policy>>2]=schedPolicy;if(schedparam)GROWABLE_HEAP_I32()[schedparam>>2]=schedPrio;return 0}function _pthread_self(){return __pthread_ptr|0}Module["_pthread_self"]=_pthread_self;function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;var schedPolicy=0;var schedPrio=0;if(attr){stackSize=GROWABLE_HEAP_I32()[attr>>2];stackSize+=81920;stackBase=GROWABLE_HEAP_I32()[attr+8>>2];detached=GROWABLE_HEAP_I32()[attr+12>>2]!==0;var inheritSched=GROWABLE_HEAP_I32()[attr+16>>2]===0;if(inheritSched){var prevSchedPolicy=GROWABLE_HEAP_I32()[attr+20>>2];var prevSchedPrio=GROWABLE_HEAP_I32()[attr+24>>2];var parentThreadPtr=PThread.currentProxiedOperationCallerThread?PThread.currentProxiedOperationCallerThread:_pthread_self();_pthread_getschedparam(parentThreadPtr,attr+20,attr+24);schedPolicy=GROWABLE_HEAP_I32()[attr+20>>2];schedPrio=GROWABLE_HEAP_I32()[attr+24>>2];GROWABLE_HEAP_I32()[attr+20>>2]=prevSchedPolicy;GROWABLE_HEAP_I32()[attr+24>>2]=prevSchedPrio}else{schedPolicy=GROWABLE_HEAP_I32()[attr+20>>2];schedPrio=GROWABLE_HEAP_I32()[attr+24>>2]}}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(232);for(var i=0;i<232>>2;++i)GROWABLE_HEAP_U32()[(threadInfoStruct>>2)+i]=0;GROWABLE_HEAP_I32()[pthread_ptr>>2]=threadInfoStruct;GROWABLE_HEAP_I32()[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+156;GROWABLE_HEAP_I32()[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,schedPolicy:schedPolicy,schedPrio:schedPrio,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,parent_pthread_ptr:_pthread_self(),arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList)}else{__spawn_thread(threadParams)}return 0}function _roundf(d){d=+d;return d>=+0?+Math_floor(d+ +.5):+Math_ceil(d-+.5)}function _sysconf(name){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,name);switch(name){case 30:return 16384;case 85:var maxHeapSize=2*1024*1024*1024-65536;maxHeapSize=1073741824;return maxHeapSize/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:case 79:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator==="object")return navigator["hardwareConcurrency"]||1;return 1}}___setErrNo(28);return-1}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();else PThread.initWorker();var GLctx;GL.init();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_fd_close,_fd_seek,_fd_write,_sysconf];var asmLibraryArg={"__assert_fail":___assert_fail,"__call_main":___call_main,"__handle_stack_overflow":___handle_stack_overflow,"_emscripten_notify_thread_queue":__emscripten_notify_thread_queue,"abort":_abort,"emscripten_conditional_set_current_thread_status":_emscripten_conditional_set_current_thread_status,"emscripten_futex_wait":_emscripten_futex_wait,"emscripten_futex_wake":_emscripten_futex_wake,"emscripten_get_now":_emscripten_get_now,"emscripten_is_main_browser_thread":_emscripten_is_main_browser_thread,"emscripten_is_main_runtime_thread":_emscripten_is_main_runtime_thread,"emscripten_memcpy_big":_emscripten_memcpy_big,"emscripten_receive_on_main_thread_js":_emscripten_receive_on_main_thread_js,"emscripten_resize_heap":_emscripten_resize_heap,"emscripten_set_canvas_element_size":_emscripten_set_canvas_element_size,"emscripten_set_current_thread_status":_emscripten_set_current_thread_status,"emscripten_set_thread_name":_emscripten_set_thread_name,"emscripten_webgl_create_context":_emscripten_webgl_create_context,"fd_close":_fd_close,"fd_seek":_fd_seek,"fd_write":_fd_write,"initPthreadsJS":initPthreadsJS,"memory":wasmMemory||Module["wasmMemory"],"pthread_cleanup_pop":_pthread_cleanup_pop,"pthread_cleanup_push":_pthread_cleanup_push,"pthread_create":_pthread_create,"pthread_self":_pthread_self,"roundf":_roundf,"table":wasmTable};var asm=createWasm();Module["asm"]=asm;var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__wasm_call_ctors"].apply(null,arguments)};var _init=Module["_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["init"].apply(null,arguments)};var _register_tensor=Module["_register_tensor"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["register_tensor"].apply(null,arguments)};var _dispose_data=Module["_dispose_data"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose_data"].apply(null,arguments)};var _dispose=Module["_dispose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose"].apply(null,arguments)};var _Abs=Module["_Abs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Abs"].apply(null,arguments)};var _Add=Module["_Add"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Add"].apply(null,arguments)};var _AddN=Module["_AddN"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AddN"].apply(null,arguments)};var _ArgMax=Module["_ArgMax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ArgMax"].apply(null,arguments)};var _AvgPool=Module["_AvgPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AvgPool"].apply(null,arguments)};var _BatchMatMul=Module["_BatchMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["BatchMatMul"].apply(null,arguments)};var _ClipByValue=Module["_ClipByValue"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ClipByValue"].apply(null,arguments)};var _Conv2D=Module["_Conv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Conv2D"].apply(null,arguments)};var _Cos=Module["_Cos"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Cos"].apply(null,arguments)};var _CropAndResize=Module["_CropAndResize"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["CropAndResize"].apply(null,arguments)};var _DepthwiseConv2dNative=Module["_DepthwiseConv2dNative"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["DepthwiseConv2dNative"].apply(null,arguments)};var _Div=Module["_Div"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Div"].apply(null,arguments)};var _Exp=Module["_Exp"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Exp"].apply(null,arguments)};var _FloorDiv=Module["_FloorDiv"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FloorDiv"].apply(null,arguments)};var _FusedBatchNorm=Module["_FusedBatchNorm"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedBatchNorm"].apply(null,arguments)};var _FusedConv2D=Module["_FusedConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedConv2D"].apply(null,arguments)};var _FusedDepthwiseConv2D=Module["_FusedDepthwiseConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedDepthwiseConv2D"].apply(null,arguments)};var _Gather=Module["_Gather"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Gather"].apply(null,arguments)};var _GatherNd=Module["_GatherNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GatherNd"].apply(null,arguments)};var _Greater=Module["_Greater"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Greater"].apply(null,arguments)};var _GreaterEqual=Module["_GreaterEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GreaterEqual"].apply(null,arguments)};var _Less=Module["_Less"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Less"].apply(null,arguments)};var _LessEqual=Module["_LessEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LessEqual"].apply(null,arguments)};var _Log=Module["_Log"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Log"].apply(null,arguments)};var _LogicalAnd=Module["_LogicalAnd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LogicalAnd"].apply(null,arguments)};var _Max=Module["_Max"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Max"].apply(null,arguments)};var _MaxPool=Module["_MaxPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["MaxPool"].apply(null,arguments)};var _Maximum=Module["_Maximum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Maximum"].apply(null,arguments)};var _Min=Module["_Min"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Min"].apply(null,arguments)};var _Minimum=Module["_Minimum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Minimum"].apply(null,arguments)};var _Mul=Module["_Mul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Mul"].apply(null,arguments)};var _Neg=Module["_Neg"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Neg"].apply(null,arguments)};var _NonMaxSuppressionV3=Module["_NonMaxSuppressionV3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV3"].apply(null,arguments)};var _NonMaxSuppressionV5=Module["_NonMaxSuppressionV5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV5"].apply(null,arguments)};var _NotEqual=Module["_NotEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NotEqual"].apply(null,arguments)};var _PadV2=Module["_PadV2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["PadV2"].apply(null,arguments)};var _Pow=Module["_Pow"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Pow"].apply(null,arguments)};var _Prelu=Module["_Prelu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Prelu"].apply(null,arguments)};var _Relu=Module["_Relu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu"].apply(null,arguments)};var _Relu6=Module["_Relu6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu6"].apply(null,arguments)};var _ResizeBilinear=Module["_ResizeBilinear"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ResizeBilinear"].apply(null,arguments)};var _Rsqrt=Module["_Rsqrt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Rsqrt"].apply(null,arguments)};var _ScatterNd=Module["_ScatterNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ScatterNd"].apply(null,arguments)};var _Sigmoid=Module["_Sigmoid"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sigmoid"].apply(null,arguments)};var _Sin=Module["_Sin"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sin"].apply(null,arguments)};var _Softmax=Module["_Softmax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Softmax"].apply(null,arguments)};var _Sqrt=Module["_Sqrt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sqrt"].apply(null,arguments)};var _Square=Module["_Square"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Square"].apply(null,arguments)};var _Sub=Module["_Sub"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sub"].apply(null,arguments)};var _Sum=Module["_Sum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sum"].apply(null,arguments)};var _Tanh=Module["_Tanh"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tanh"].apply(null,arguments)};var _Tile=Module["_Tile"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tile"].apply(null,arguments)};var _Transpose=Module["_Transpose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Transpose"].apply(null,arguments)};var __FusedMatMul=Module["__FusedMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_FusedMatMul"].apply(null,arguments)};var _malloc=Module["_malloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["malloc"].apply(null,arguments)};var _free=Module["_free"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["free"].apply(null,arguments)};var ___em_js__initPthreadsJS=Module["___em_js__initPthreadsJS"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__em_js__initPthreadsJS"].apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_get_global_libc"].apply(null,arguments)};var _memalign=Module["_memalign"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["memalign"].apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__pthread_tsd_run_dtors"].apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null,arguments)};var _emscripten_main_browser_thread_id=Module["_emscripten_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_browser_thread_id"].apply(null,arguments)};var _emscripten_async_run_in_main_thread=Module["_emscripten_async_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread=Module["_emscripten_sync_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_0=Module["_emscripten_sync_run_in_main_thread_0"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_1=Module["_emscripten_sync_run_in_main_thread_1"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_2=Module["_emscripten_sync_run_in_main_thread_2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_xprintf_varargs=Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_3=Module["_emscripten_sync_run_in_main_thread_3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_5=Module["_emscripten_sync_run_in_main_thread_5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_6=Module["_emscripten_sync_run_in_main_thread_6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_7=Module["_emscripten_sync_run_in_main_thread_7"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null,arguments)};var _emscripten_async_queue_on_thread_=Module["_emscripten_async_queue_on_thread_"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_tls_init"].apply(null,arguments)};var ___set_stack_limit=Module["___set_stack_limit"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__set_stack_limit"].apply(null,arguments)};var stackSave=Module["stackSave"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackSave"].apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackAlloc"].apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackRestore"].apply(null,arguments)};var dynCall_vi=Module["dynCall_vi"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_vi"].apply(null,arguments)};var dynCall_v=Module["dynCall_v"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_v"].apply(null,arguments)};var dynCall_ii=Module["dynCall_ii"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_ii"].apply(null,arguments)};Module["asm"]=asm;if(!Object.getOwnPropertyDescriptor(Module,"intArrayFromString"))Module["intArrayFromString"]=function(){abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"intArrayToString"))Module["intArrayToString"]=function(){abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ccall"))Module["ccall"]=function(){abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["cwrap"]=cwrap;if(!Object.getOwnPropertyDescriptor(Module,"setValue"))Module["setValue"]=function(){abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getValue"))Module["getValue"]=function(){abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocate"))Module["allocate"]=function(){abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getMemory"))Module["getMemory"]=function(){abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ArrayToString"))Module["UTF8ArrayToString"]=function(){abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ToString"))Module["UTF8ToString"]=function(){abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8Array"))Module["stringToUTF8Array"]=function(){abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8"))Module["stringToUTF8"]=function(){abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF8"))Module["lengthBytesUTF8"]=function(){abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreRun"))Module["addOnPreRun"]=function(){abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnInit"))Module["addOnInit"]=function(){abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreMain"))Module["addOnPreMain"]=function(){abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnExit"))Module["addOnExit"]=function(){abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPostRun"))Module["addOnPostRun"]=function(){abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeStringToMemory"))Module["writeStringToMemory"]=function(){abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeArrayToMemory"))Module["writeArrayToMemory"]=function(){abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeAsciiToMemory"))Module["writeAsciiToMemory"]=function(){abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addRunDependency"))Module["addRunDependency"]=function(){abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"removeRunDependency"))Module["removeRunDependency"]=function(){abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createFolder"))Module["FS_createFolder"]=function(){abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPath"))Module["FS_createPath"]=function(){abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDataFile"))Module["FS_createDataFile"]=function(){abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPreloadedFile"))Module["FS_createPreloadedFile"]=function(){abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLazyFile"))Module["FS_createLazyFile"]=function(){abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLink"))Module["FS_createLink"]=function(){abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDevice"))Module["FS_createDevice"]=function(){abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_unlink"))Module["FS_unlink"]=function(){abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"dynamicAlloc"))Module["dynamicAlloc"]=function(){abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadDynamicLibrary"))Module["loadDynamicLibrary"]=function(){abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadWebAssemblyModule"))Module["loadWebAssemblyModule"]=function(){abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getLEB"))Module["getLEB"]=function(){abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFunctionTables"))Module["getFunctionTables"]=function(){abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"alignFunctionTables"))Module["alignFunctionTables"]=function(){abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"registerFunctions"))Module["registerFunctions"]=function(){abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addFunction"))Module["addFunction"]=function(){abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"removeFunction"))Module["removeFunction"]=function(){abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFuncWrapper"))Module["getFuncWrapper"]=function(){abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"prettyPrint"))Module["prettyPrint"]=function(){abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"makeBigInt"))Module["makeBigInt"]=function(){abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"dynCall"))Module["dynCall"]=function(){abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getCompilerSetting"))Module["getCompilerSetting"]=function(){abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"print"))Module["print"]=function(){abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"printErr"))Module["printErr"]=function(){abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getTempRet0"))Module["getTempRet0"]=function(){abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setTempRet0"))Module["setTempRet0"]=function(){abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"callMain"))Module["callMain"]=function(){abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"abort"))Module["abort"]=function(){abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToNewUTF8"))Module["stringToNewUTF8"]=function(){abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscripten_realloc_buffer"))Module["emscripten_realloc_buffer"]=function(){abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ENV"))Module["ENV"]=function(){abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setjmpId"))Module["setjmpId"]=function(){abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_CODES"))Module["ERRNO_CODES"]=function(){abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_MESSAGES"))Module["ERRNO_MESSAGES"]=function(){abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"DNS"))Module["DNS"]=function(){abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GAI_ERRNO_MESSAGES"))Module["GAI_ERRNO_MESSAGES"]=function(){abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Protocols"))Module["Protocols"]=function(){abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Sockets"))Module["Sockets"]=function(){abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UNWIND_CACHE"))Module["UNWIND_CACHE"]=function(){abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readAsmConstArgs"))Module["readAsmConstArgs"]=function(){abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_q"))Module["jstoi_q"]=function(){abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_s"))Module["jstoi_s"]=function(){abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH"))Module["PATH"]=function(){abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH_FS"))Module["PATH_FS"]=function(){abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SYSCALLS"))Module["SYSCALLS"]=function(){abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMmap2"))Module["syscallMmap2"]=function(){abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMunmap"))Module["syscallMunmap"]=function(){abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"flush_NO_FILESYSTEM"))Module["flush_NO_FILESYSTEM"]=function(){abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"JSEvents"))Module["JSEvents"]=function(){abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangle"))Module["demangle"]=function(){abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangleAll"))Module["demangleAll"]=function(){abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jsStackTrace"))Module["jsStackTrace"]=function(){abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64"))Module["writeI53ToI64"]=function(){abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Clamped"))Module["writeI53ToI64Clamped"]=function(){abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Signaling"))Module["writeI53ToI64Signaling"]=function(){abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Clamped"))Module["writeI53ToU64Clamped"]=function(){abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Signaling"))Module["writeI53ToU64Signaling"]=function(){abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromI64"))Module["readI53FromI64"]=function(){abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromU64"))Module["readI53FromU64"]=function(){abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertI32PairToI53"))Module["convertI32PairToI53"]=function(){abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertU32PairToI53"))Module["convertU32PairToI53"]=function(){abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Browser"))Module["Browser"]=function(){abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GL"))Module["GL"]=function(){abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGet"))Module["emscriptenWebGLGet"]=function(){abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetTexPixelData"))Module["emscriptenWebGLGetTexPixelData"]=function(){abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetUniform"))Module["emscriptenWebGLGetUniform"]=function(){abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetVertexAttrib"))Module["emscriptenWebGLGetVertexAttrib"]=function(){abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AL"))Module["AL"]=function(){abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL"))Module["SDL"]=function(){abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_gfx"))Module["SDL_gfx"]=function(){abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLUT"))Module["GLUT"]=function(){abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"EGL"))Module["EGL"]=function(){abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW_Window"))Module["GLFW_Window"]=function(){abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW"))Module["GLFW"]=function(){abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLEW"))Module["GLEW"]=function(){abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"IDBStore"))Module["IDBStore"]=function(){abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"runAndAbortIfError"))Module["runAndAbortIfError"]=function(){abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["PThread"]=PThread;if(!Object.getOwnPropertyDescriptor(Module,"establishStackSpace"))Module["establishStackSpace"]=function(){abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getNoExitRuntime"))Module["getNoExitRuntime"]=function(){abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"resetPrototype"))Module["resetPrototype"]=function(){abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"warnOnce"))Module["warnOnce"]=function(){abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackSave"))Module["stackSave"]=function(){abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackRestore"))Module["stackRestore"]=function(){abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackAlloc"))Module["stackAlloc"]=function(){abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AsciiToString"))Module["AsciiToString"]=function(){abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToAscii"))Module["stringToAscii"]=function(){abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF16ToString"))Module["UTF16ToString"]=function(){abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF16"))Module["stringToUTF16"]=function(){abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF16"))Module["lengthBytesUTF16"]=function(){abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF32ToString"))Module["UTF32ToString"]=function(){abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF32"))Module["stringToUTF32"]=function(){abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF32"))Module["lengthBytesUTF32"]=function(){abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8"))Module["allocateUTF8"]=function(){abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8OnStack"))Module["allocateUTF8OnStack"]=function(){abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["writeStackCookie"]=writeStackCookie;Module["checkStackCookie"]=checkStackCookie;Module["abortStackOverflow"]=abortStackOverflow;Module["PThread"]=PThread;Module["_pthread_self"]=_pthread_self;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NORMAL"))Object.defineProperty(Module,"ALLOC_NORMAL",{configurable:true,get:function(){abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_STACK"))Object.defineProperty(Module,"ALLOC_STACK",{configurable:true,get:function(){abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_DYNAMIC"))Object.defineProperty(Module,"ALLOC_DYNAMIC",{configurable:true,get:function(){abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NONE"))Object.defineProperty(Module,"ALLOC_NONE",{configurable:true,get:function(){abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});var calledRun;Module["then"]=function(func){if(calledRun){func(Module)}else{var old=Module["onRuntimeInitialized"];Module["onRuntimeInitialized"]=function(){if(old)old();func(Module)}}return Module};function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}writeStackCookie();preRun();if(runDependencies>0)return;function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();assert(!Module["_main"],'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}checkStackCookie()}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}if(!ENVIRONMENT_IS_PTHREAD)noExitRuntime=true;if(!ENVIRONMENT_IS_PTHREAD)run(); + function doRun() { + if (calledRun) return; + calledRun = true; + Module["calledRun"] = true; + if (ABORT) return; + initRuntime(); + preMain(); + if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"](); + assert(!Module["_main"], 'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'); + postRun() + } + if (Module["setStatus"]) { + Module["setStatus"]("Running..."); + setTimeout(function () { + setTimeout(function () { + Module["setStatus"]("") + }, 1); + doRun() + }, 1) + } else { + doRun() + } + checkStackCookie() + } + Module["run"] = run; + if (Module["preInit"]) { + if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]]; + while (Module["preInit"].length > 0) { + Module["preInit"].pop()() + } + } + if (!ENVIRONMENT_IS_PTHREAD) noExitRuntime = true; + if (!ENVIRONMENT_IS_PTHREAD) run(); - return WasmBackendModule -} -); + return WasmBackendModule + } + ); })(); if (typeof exports === 'object' && typeof module === 'object') - module.exports = WasmBackendModule; - else if (typeof define === 'function' && define['amd']) - define([], function() { return WasmBackendModule; }); - else if (typeof exports === 'object') - exports["WasmBackendModule"] = WasmBackendModule; - \ No newline at end of file + module.exports = WasmBackendModule; +else if (typeof define === 'function' && define['amd']) + define([], function () { + return WasmBackendModule; + }); +else if (typeof exports === 'object') + exports["WasmBackendModule"] = WasmBackendModule; diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js b/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js index 255cb67140c..427a38493f0 100644 --- a/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js +++ b/tfjs-core/benchmarks/tfjs-backend-wasm.worker.js @@ -1 +1,151 @@ -var threadInfoStruct=0;var selfThreadId=0;var parentThreadId=0;var Module={};function assert(condition,text){if(!condition)abort("Assertion failed: "+text)}function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:selfThreadId})}var out=function(){throw"out() is not defined in worker.js."};var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);Module["wasmModule"]=null;receiveInstance(instance);return instance.exports};this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["DYNAMIC_BASE"]=e.data.DYNAMIC_BASE;Module["DYNAMICTOP_PTR"]=e.data.DYNAMICTOP_PTR;Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}Module=WasmBackendModule(Module);postMessage({"cmd":"loaded"})}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;threadInfoStruct=e.data.threadInfoStruct;Module["__register_pthread_ptr"](threadInfoStruct,0,0);selfThreadId=e.data.selfThreadId;parentThreadId=e.data.parentThreadId;var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;assert(threadInfoStruct);assert(selfThreadId);assert(parentThreadId);assert(top!=0);assert(max!=0);assert(top>max);Module["establishStackSpace"](top,max);Module["_emscripten_tls_init"]();Module["writeStackCookie"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].setThreadStatus(Module["_pthread_self"](),1);try{var result=Module["dynCall_ii"](e.data.start_routine,e.data.arg);Module["checkStackCookie"]();if(!Module["getNoExitRuntime"]())Module["PThread"].threadExit(result)}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){Atomics.store(Module["HEAPU32"],threadInfoStruct+4>>2,ex instanceof Module["ExitStatus"]?ex.status:-2);Atomics.store(Module["HEAPU32"],threadInfoStruct+0>>2,1);if(typeof Module["_emscripten_futex_wake"]!=="function"){err("Thread Initialisation failed.");throw ex}Module["_emscripten_futex_wake"](threadInfoStruct+0,2147483647);if(!(ex instanceof Module["ExitStatus"]))throw ex}else{err("Pthread 0x"+threadInfoStruct.toString(16)+" completed its pthread main entry point with an unwind, keeping the pthread worker alive for asynchronous operation.")}}}else if(e.data.cmd==="cancel"){if(threadInfoStruct){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(threadInfoStruct){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} +var threadInfoStruct = 0; +var selfThreadId = 0; +var parentThreadId = 0; +var Module = {}; + +function assert(condition, text) { + if (!condition) abort("Assertion failed: " + text) +} + +function threadPrintErr() { + var text = Array.prototype.slice.call(arguments).join(" "); + console.error(text) +} + +function threadAlert() { + var text = Array.prototype.slice.call(arguments).join(" "); + postMessage({ + cmd: "alert", + text: text, + threadId: selfThreadId + }) +} +var out = function () { + throw "out() is not defined in worker.js." +}; +var err = threadPrintErr; +this.alert = threadAlert; +Module["instantiateWasm"] = function (info, receiveInstance) { + var instance = new WebAssembly.Instance(Module["wasmModule"], info); + Module["wasmModule"] = null; + receiveInstance(instance); + return instance.exports +}; +this.onmessage = function (e) { + try { + if (e.data.cmd === "load") { + Module["DYNAMIC_BASE"] = e.data.DYNAMIC_BASE; + Module["DYNAMICTOP_PTR"] = e.data.DYNAMICTOP_PTR; + Module["wasmModule"] = e.data.wasmModule; + Module["wasmMemory"] = e.data.wasmMemory; + Module["buffer"] = Module["wasmMemory"].buffer; + Module["ENVIRONMENT_IS_PTHREAD"] = true; + if (typeof e.data.urlOrBlob === "string") { + importScripts(e.data.urlOrBlob) + } else { + var objectUrl = URL.createObjectURL(e.data.urlOrBlob); + importScripts(objectUrl); + URL.revokeObjectURL(objectUrl) + } + Module = WasmBackendModule(Module); + postMessage({ + "cmd": "loaded" + }) + } else if (e.data.cmd === "objectTransfer") { + Module["PThread"].receiveObjectTransfer(e.data) + } else if (e.data.cmd === "run") { + Module["__performance_now_clock_drift"] = performance.now() - e.data.time; + threadInfoStruct = e.data.threadInfoStruct; + Module["__register_pthread_ptr"](threadInfoStruct, 0, 0); + selfThreadId = e.data.selfThreadId; + parentThreadId = e.data.parentThreadId; + var max = e.data.stackBase; + var top = e.data.stackBase + e.data.stackSize; + assert(threadInfoStruct); + assert(selfThreadId); + assert(parentThreadId); + assert(top != 0); + assert(max != 0); + assert(top > max); + Module["establishStackSpace"](top, max); + Module["_emscripten_tls_init"](); + Module["writeStackCookie"](); + Module["PThread"].receiveObjectTransfer(e.data); + Module["PThread"].setThreadStatus(Module["_pthread_self"](), 1); + try { + var result = Module["dynCall_ii"](e.data.start_routine, e.data.arg); + Module["checkStackCookie"](); + if (!Module["getNoExitRuntime"]()) Module["PThread"].threadExit(result) + } catch (ex) { + if (ex === "Canceled!") { + Module["PThread"].threadCancel() + } else if (ex != "unwind") { + Atomics.store(Module["HEAPU32"], threadInfoStruct + 4 >> 2, ex instanceof Module["ExitStatus"] ? ex.status : -2); + Atomics.store(Module["HEAPU32"], threadInfoStruct + 0 >> 2, 1); + if (typeof Module["_emscripten_futex_wake"] !== "function") { + err("Thread Initialisation failed."); + throw ex + } + Module["_emscripten_futex_wake"](threadInfoStruct + 0, 2147483647); + if (!(ex instanceof Module["ExitStatus"])) throw ex + } else { + err("Pthread 0x" + threadInfoStruct.toString(16) + " completed its pthread main entry point with an unwind, keeping the pthread worker alive for asynchronous operation.") + } + } + } else if (e.data.cmd === "cancel") { + if (threadInfoStruct) { + Module["PThread"].threadCancel() + } + } else if (e.data.target === "setimmediate") {} else if (e.data.cmd === "processThreadQueue") { + if (threadInfoStruct) { + Module["_emscripten_current_thread_process_queued_calls"]() + } + } else { + err("worker.js received unknown command " + e.data.cmd); + err(e.data) + } + } catch (ex) { + err("worker.js onmessage() captured an uncaught exception: " + ex); + if (ex.stack) err(ex.stack); + throw ex + } +}; +if (typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string") { + self = { + location: { + href: __filename + } + }; + var onmessage = this.onmessage; + var nodeWorkerThreads = require("worker_threads"); + Worker = nodeWorkerThreads.Worker; + var parentPort = nodeWorkerThreads.parentPort; + parentPort.on("message", function (data) { + onmessage({ + data: data + }) + }); + var nodeFS = require("fs"); + var nodeRead = function (filename) { + return nodeFS.readFileSync(filename, "utf8") + }; + + function globalEval(x) { + global.require = require; + global.Module = Module; + eval.call(null, x) + } + importScripts = function (f) { + globalEval(nodeRead(f)) + }; + postMessage = function (msg) { + parentPort.postMessage(msg) + }; + if (typeof performance === "undefined") { + performance = { + now: function () { + return Date.now() + } + } + } +} From ee282544fbf145da5d529b071fd68e1df52938d1 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Wed, 13 May 2020 08:40:16 -0400 Subject: [PATCH 78/85] everything back to normal --- tfjs-backend-wasm/src/kernels/Conv2D.ts | 18 +- .../src/kernels/DepthwiseConv2dNative.ts | 12 +- tfjs-core/benchmarks/index.html | 7 +- tfjs-core/benchmarks/tf-backend-wasm.js | 28 +- tfjs-core/benchmarks/tf-core.es2017.js | 24489 ++++++++++++++++ tfjs-core/benchmarks/tfjs-backend-wasm.js | 3436 +-- .../benchmarks/tfjs-backend-wasm.worker.js | 152 +- 7 files changed, 24514 insertions(+), 3628 deletions(-) create mode 100644 tfjs-core/benchmarks/tf-core.es2017.js diff --git a/tfjs-backend-wasm/src/kernels/Conv2D.ts b/tfjs-backend-wasm/src/kernels/Conv2D.ts index 4de0f423a80..e31219a7991 100644 --- a/tfjs-backend-wasm/src/kernels/Conv2D.ts +++ b/tfjs-backend-wasm/src/kernels/Conv2D.ts @@ -64,23 +64,9 @@ function conv2d( const xId = backend.dataIdMap.get(x.dataId).id; const filterId = backend.dataIdMap.get(filter.dataId).id; - let {strides, dilations, pad} = attrs; - const {dimRoundingMode, dataFormat} = attrs; + const {strides, dilations, pad, dimRoundingMode, dataFormat} = attrs; - strides = strides == null ? - [(attrs as any).strideWidth, (attrs as any).strideHeight] : - strides; - pad = pad == null ? ((attrs as any).padInfo.type.toLowerCase()) : pad; - dilations = dilations == null ? - [(attrs as any).dilationWidth, (attrs as any).dilationHeight] : - dilations; - - let $dataFormat = ''; - if (dataFormat === 'NHWC' || dataFormat === 'NCHW') { - $dataFormat = backend_util.convertConv2DDataFormat(dataFormat); - } else { - $dataFormat = dataFormat; - } + const $dataFormat = backend_util.convertConv2DDataFormat(dataFormat); const convInfo = backend_util.computeConv2DInfo( (x as Tensor4D).shape, (filter as Tensor4D).shape, strides, dilations, diff --git a/tfjs-backend-wasm/src/kernels/DepthwiseConv2dNative.ts b/tfjs-backend-wasm/src/kernels/DepthwiseConv2dNative.ts index aaaf9580d86..b3294906fc6 100644 --- a/tfjs-backend-wasm/src/kernels/DepthwiseConv2dNative.ts +++ b/tfjs-backend-wasm/src/kernels/DepthwiseConv2dNative.ts @@ -68,17 +68,7 @@ function depthwiseConv2d(args: { const xId = backend.dataIdMap.get(x.dataId).id; const filterId = backend.dataIdMap.get(filter.dataId).id; - let {strides, dilations, pad} = attrs; - - strides = strides == null ? - [(attrs as any).strideWidth, (attrs as any).strideHeight] : - strides; - pad = pad == null ? ((attrs as any).padInfo.type.toLowerCase()) : pad; - dilations = dilations == null ? - [(attrs as any).dilationWidth, (attrs as any).dilationHeight] : - dilations; - - const dimRoundingMode = attrs['dimRoundingMode']; + const {strides, dilations, pad, dimRoundingMode} = attrs; const $dilations = dilations == null ? [1, 1] : dilations; diff --git a/tfjs-core/benchmarks/index.html b/tfjs-core/benchmarks/index.html index 8bd51bfb1ac..9d30d400a0d 100644 --- a/tfjs-core/benchmarks/index.html +++ b/tfjs-core/benchmarks/index.html @@ -58,9 +58,10 @@

TensorFlow.js Model Benchmark

- - - + + + diff --git a/tfjs-core/benchmarks/tf-backend-wasm.js b/tfjs-core/benchmarks/tf-backend-wasm.js index 020f2df4b1c..de1137465a8 100644 --- a/tfjs-core/benchmarks/tf-backend-wasm.js +++ b/tfjs-core/benchmarks/tf-backend-wasm.js @@ -650,22 +650,8 @@ const { x, filter } = inputs; const xId = backend.dataIdMap.get(x.dataId).id; const filterId = backend.dataIdMap.get(filter.dataId).id; - let { strides, dilations, pad } = attrs; - const { dimRoundingMode, dataFormat } = attrs; - strides = strides == null ? - [attrs.strideWidth, attrs.strideHeight] : - strides; - pad = pad == null ? (attrs.padInfo.type.toLowerCase()) : pad; - dilations = dilations == null ? - [attrs.dilationWidth, attrs.dilationHeight] : - dilations; - let $dataFormat = ''; - if (dataFormat === 'NHWC' || dataFormat === 'NCHW') { - $dataFormat = tfjsCore.backend_util.convertConv2DDataFormat(dataFormat); - } - else { - $dataFormat = dataFormat; - } + const { strides, dilations, pad, dimRoundingMode, dataFormat } = attrs; + const $dataFormat = tfjsCore.backend_util.convertConv2DDataFormat(dataFormat); const convInfo = tfjsCore.backend_util.computeConv2DInfo(x.shape, filter.shape, strides, dilations, pad, dimRoundingMode, false, $dataFormat); const filterHeight = convInfo.filterHeight; const filterWidth = convInfo.filterWidth; @@ -830,15 +816,7 @@ const { x, filter } = inputs; const xId = backend.dataIdMap.get(x.dataId).id; const filterId = backend.dataIdMap.get(filter.dataId).id; - let { strides, dilations, pad } = attrs; - strides = strides == null ? - [attrs.strideWidth, attrs.strideHeight] : - strides; - pad = pad == null ? (attrs.padInfo.type.toLowerCase()) : pad; - dilations = dilations == null ? - [attrs.dilationWidth, attrs.dilationHeight] : - dilations; - const dimRoundingMode = attrs['dimRoundingMode']; + const { strides, dilations, pad, dimRoundingMode } = attrs; const $dilations = dilations == null ? [1, 1] : dilations; const convInfo = tfjsCore.backend_util.computeConv2DInfo(x.shape, filter.shape, strides, $dilations, pad, dimRoundingMode, true /* depthwise */); const filterHeight = convInfo.filterHeight; diff --git a/tfjs-core/benchmarks/tf-core.es2017.js b/tfjs-core/benchmarks/tf-core.es2017.js new file mode 100644 index 00000000000..ef2282b5eb9 --- /dev/null +++ b/tfjs-core/benchmarks/tf-core.es2017.js @@ -0,0 +1,24489 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = global || self, factory(global.tf = global.tf || {})); +}(this, (function (exports) { 'use strict'; + + /** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + // Expects flags from URL in the format ?tfjsflags=FLAG1:1,FLAG2:true. + const TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags'; + /** + * The environment contains evaluated flags as well as the registered platform. + * This is always used as a global singleton and can be retrieved with + * `tf.env()`. + */ + /** @doc {heading: 'Environment'} */ + class Environment { + // tslint:disable-next-line: no-any + constructor(global) { + this.global = global; + this.flags = {}; + this.flagRegistry = {}; + this.urlFlags = {}; + this.populateURLFlags(); + } + setPlatform(platformName, platform) { + if (this.platform != null) { + console.warn(`Platform ${this.platformName} has already been set. ` + + `Overwriting the platform with ${platform}.`); + } + this.platformName = platformName; + this.platform = platform; + } + registerFlag(flagName, evaluationFn, setHook) { + this.flagRegistry[flagName] = { evaluationFn, setHook }; + // Override the flag value from the URL. This has to happen here because the + // environment is initialized before flags get registered. + if (this.urlFlags[flagName] != null) { + const flagValue = this.urlFlags[flagName]; + console.warn(`Setting feature override from URL ${flagName}: ${flagValue}.`); + this.set(flagName, flagValue); + } + } + get(flagName) { + if (flagName in this.flags) { + return this.flags[flagName]; + } + this.flags[flagName] = this.evaluateFlag(flagName); + return this.flags[flagName]; + } + getNumber(flagName) { + return this.get(flagName); + } + getBool(flagName) { + return this.get(flagName); + } + getFlags() { + return this.flags; + } + // For backwards compatibility. + get features() { + return this.flags; + } + set(flagName, value) { + if (this.flagRegistry[flagName] == null) { + throw new Error(`Cannot set flag ${flagName} as it has not been registered.`); + } + this.flags[flagName] = value; + if (this.flagRegistry[flagName].setHook != null) { + this.flagRegistry[flagName].setHook(value); + } + } + evaluateFlag(flagName) { + if (this.flagRegistry[flagName] == null) { + throw new Error(`Cannot evaluate flag '${flagName}': no evaluation function found.`); + } + return this.flagRegistry[flagName].evaluationFn(); + } + setFlags(flags) { + this.flags = Object.assign({}, flags); + } + reset() { + this.flags = {}; + this.urlFlags = {}; + this.populateURLFlags(); + } + populateURLFlags() { + if (typeof this.global === 'undefined' || + typeof this.global.location === 'undefined' || + typeof this.global.location.search === 'undefined') { + return; + } + const urlParams = getQueryParams(this.global.location.search); + if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) { + const keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(','); + keyValues.forEach(keyValue => { + const [key, value] = keyValue.split(':'); + this.urlFlags[key] = parseValue(key, value); + }); + } + } + } + function getQueryParams(queryString) { + const params = {}; + queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (s, ...t) => { + decodeParam(params, t[0], t[1]); + return t.join('='); + }); + return params; + } + function decodeParam(params, name, value) { + params[decodeURIComponent(name)] = decodeURIComponent(value || ''); + } + function parseValue(flagName, value) { + value = value.toLowerCase(); + if (value === 'true' || value === 'false') { + return value === 'true'; + } + else if (`${+value}` === value) { + return +value; + } + throw new Error(`Could not parse value flag value ${value} for flag ${flagName}.`); + } + /** + * Returns the current environment (a global singleton). + * + * The environment object contains the evaluated feature values as well as the + * active platform. + */ + /** @doc {heading: 'Environment'} */ + function env() { + return exports.ENV; + } + exports.ENV = null; + function setEnvironmentGlobal(environment) { + exports.ENV = environment; + } + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + // Note that the identifier globalNameSpace is scoped to this module, but will + // always resolve to the same global object regardless of how the module is + // resolved. + // tslint:disable-next-line:no-any + let globalNameSpace; + // tslint:disable-next-line:no-any + function getGlobalNamespace() { + if (globalNameSpace == null) { + // tslint:disable-next-line:no-any + let ns; + if (typeof (window) !== 'undefined') { + ns = window; + } + else if (typeof (global) !== 'undefined') { + ns = global; + } + else if (typeof (process) !== 'undefined') { + ns = process; + } + else if (typeof (self) !== 'undefined') { + ns = self; + } + else { + throw new Error('Could not find a global object'); + } + globalNameSpace = ns; + } + return globalNameSpace; + } + // tslint:disable-next-line:no-any + function getGlobalMap() { + const ns = getGlobalNamespace(); + if (ns._tfGlobals == null) { + ns._tfGlobals = new Map(); + } + return ns._tfGlobals; + } + /** + * Returns a globally accessible 'singleton' object. + * + * @param key the name of the object + * @param init a function to initialize to initialize this object + * the first time it is fetched. + */ + function getGlobal(key, init) { + const globalMap = getGlobalMap(); + if (globalMap.has(key)) { + return globalMap.get(key); + } + else { + const singleton = init(); + globalMap.set(key, singleton); + return globalMap.get(key); + } + } + + /** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const kernelRegistry = getGlobal('kernelRegistry', () => new Map()); + const gradRegistry = getGlobal('gradRegistry', () => new Map()); + /** + * Returns the kernel function (code) associated with the provided names. + * + * @param kernelName The official name of the kernel. + * @param backendName The official name of the backend. + */ + function getKernel(kernelName, backendName) { + const key = makeKey(kernelName, backendName); + return kernelRegistry.get(key); + } + /** + * Returns the registered gradient info associated with the provided kernel. + * @param kernelName The official TF kernel name. + */ + function getGradient(kernelName) { + return gradRegistry.get(kernelName); + } + function getKernelsForBackend(backendName) { + const it = kernelRegistry.entries(); + const result = []; + while (true) { + const { done, value } = it.next(); + if (done) { + break; + } + const [key, config] = value; + const [backend,] = key.split('_'); + if (backend === backendName) { + result.push(config); + } + } + return result; + } + /** + * Registers the function (forward pass) for the kernel in a global registry. + * + * @param config A config object with the following properties: + * - `kernelName` The official name of the kernel. + * - `backendName` The official name of the backend. + * - `kernelFunc` The function to run during the forward pass of the kernel. + * - `setupFunc` Optional. Gets called once, after the backend initializes. + * - `disposeFunc` Optional. Gets called once, right before the backend is + * disposed. + */ + function registerKernel(config) { + const { kernelName, backendName } = config; + const key = makeKey(kernelName, backendName); + if (kernelRegistry.has(key)) { + console.warn(`The kernel '${kernelName}' for backend ` + + `'${backendName}' is already registered`); + } + kernelRegistry.set(key, config); + } + /** + * Registers a gradient function for a given kernel in the global registry, + * to be used during the back-propagation of that kernel. + * + * @param config An object with the following properties: + * - `kernelName` The name of the kernel that the gradient function is for. + * - `gradFunc` The function to run during back-propagation. + */ + function registerGradient(config) { + const { kernelName } = config; + if (gradRegistry.has(kernelName)) { + console.warn(`Overriding the gradient for '${kernelName}'`); + } + gradRegistry.set(kernelName, config); + } + /** + * Removes the kernel function from the registry. + * + * @param kernelName The official name of the kernel. + * @param backendName The official name of the backend. + * + */ + function unregisterKernel(kernelName, backendName) { + const key = makeKey(kernelName, backendName); + if (!kernelRegistry.has(key)) { + throw new Error(`The kernel '${kernelName}' for backend ` + + `'${backendName}' is not registered`); + } + kernelRegistry.delete(key); + } + /** Removes the registered gradient from the global registry. */ + function unregisterGradient(kernelName) { + if (!gradRegistry.has(kernelName)) { + throw new Error(`The gradient '${kernelName}' for backend is not registered`); + } + gradRegistry.delete(kernelName); + } + function makeKey(kernelName, backendName) { + return `${backendName}_${kernelName}`; + } + + /** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Shuffles the array in-place using Fisher-Yates algorithm. + * + * ```js + * const a = [1, 2, 3, 4, 5]; + * tf.util.shuffle(a); + * console.log(a); + * ``` + * + * @param array The array to shuffle in-place. + */ + /** @doc {heading: 'Util', namespace: 'util'} */ + // tslint:disable-next-line:no-any + function shuffle(array) { + let counter = array.length; + let temp = 0; + let index = 0; + // While there are elements in the array + while (counter > 0) { + // Pick a random index + index = (Math.random() * counter) | 0; + // Decrease counter by 1 + counter--; + // And swap the last element with it + temp = array[counter]; + array[counter] = array[index]; + array[index] = temp; + } + } + /** Clamps a value to a specified range. */ + function clamp(min, x, max) { + return Math.max(min, Math.min(x, max)); + } + function nearestLargerEven(val) { + return val % 2 === 0 ? val : val + 1; + } + function sum(arr) { + let sum = 0; + for (let i = 0; i < arr.length; i++) { + sum += arr[i]; + } + return sum; + } + /** + * Returns a sample from a uniform [a, b) distribution. + * + * @param a The minimum support (inclusive). + * @param b The maximum support (exclusive). + * @return A pseudorandom number on the half-open interval [a,b). + */ + function randUniform(a, b) { + const r = Math.random(); + return (b * r) + (1 - r) * a; + } + /** Returns the squared Euclidean distance between two vectors. */ + function distSquared(a, b) { + let result = 0; + for (let i = 0; i < a.length; i++) { + const diff = Number(a[i]) - Number(b[i]); + result += diff * diff; + } + return result; + } + /** + * Asserts that the expression is true. Otherwise throws an error with the + * provided message. + * + * ```js + * const x = 2; + * tf.util.assert(x === 2, 'x is not 2'); + * ``` + * + * @param expr The expression to assert (as a boolean). + * @param msg A function that returns the message to report when throwing an + * error. We use a function for performance reasons. + */ + /** @doc {heading: 'Util', namespace: 'util'} */ + function assert(expr, msg) { + if (!expr) { + throw new Error(typeof msg === 'string' ? msg : msg()); + } + } + function assertShapesMatch(shapeA, shapeB, errorMessagePrefix = '') { + assert(arraysEqual(shapeA, shapeB), () => errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`); + } + function assertNonNull(a) { + assert(a != null, () => `The input to the tensor constructor must be a non-null value.`); + } + // NOTE: We explicitly type out what T extends instead of any so that + // util.flatten on a nested array of number doesn't try to infer T as a + // number[][], causing us to explicitly type util.flatten(). + /** + * Flattens an arbitrarily nested array. + * + * ```js + * const a = [[1, 2], [3, 4], [5, [6, [7]]]]; + * const flat = tf.util.flatten(a); + * console.log(flat); + * ``` + * + * @param arr The nested array to flatten. + * @param result The destination array which holds the elements. + * @param skipTypedArray If true, avoids flattening the typed arrays. Defaults + * to false. + */ + /** @doc {heading: 'Util', namespace: 'util'} */ + function flatten(arr, result = [], skipTypedArray = false) { + if (result == null) { + result = []; + } + if (Array.isArray(arr) || isTypedArray(arr) && !skipTypedArray) { + for (let i = 0; i < arr.length; ++i) { + flatten(arr[i], result, skipTypedArray); + } + } + else { + result.push(arr); + } + return result; + } + /** + * Returns the size (number of elements) of the tensor given its shape. + * + * ```js + * const shape = [3, 4, 2]; + * const size = tf.util.sizeFromShape(shape); + * console.log(size); + * ``` + */ + /** @doc {heading: 'Util', namespace: 'util'} */ + function sizeFromShape(shape) { + if (shape.length === 0) { + // Scalar. + return 1; + } + let size = shape[0]; + for (let i = 1; i < shape.length; i++) { + size *= shape[i]; + } + return size; + } + function isScalarShape(shape) { + return shape.length === 0; + } + function arraysEqual(n1, n2) { + if (n1 === n2) { + return true; + } + if (n1 == null || n2 == null) { + return false; + } + if (n1.length !== n2.length) { + return false; + } + for (let i = 0; i < n1.length; i++) { + if (n1[i] !== n2[i]) { + return false; + } + } + return true; + } + function isInt(a) { + return a % 1 === 0; + } + function tanh(x) { + // tslint:disable-next-line:no-any + if (Math.tanh != null) { + // tslint:disable-next-line:no-any + return Math.tanh(x); + } + if (x === Infinity) { + return 1; + } + else if (x === -Infinity) { + return -1; + } + else { + const e2x = Math.exp(2 * x); + return (e2x - 1) / (e2x + 1); + } + } + function sizeToSquarishShape(size) { + const width = Math.ceil(Math.sqrt(size)); + return [width, Math.ceil(size / width)]; + } + /** + * Creates a new array with randomized indicies to a given quantity. + * + * ```js + * const randomTen = tf.util.createShuffledIndices(10); + * console.log(randomTen); + * ``` + * + * @param number Quantity of how many shuffled indicies to create. + */ + /** @doc {heading: 'Util', namespace: 'util'} */ + function createShuffledIndices(n) { + const shuffledIndices = new Uint32Array(n); + for (let i = 0; i < n; ++i) { + shuffledIndices[i] = i; + } + shuffle(shuffledIndices); + return shuffledIndices; + } + function rightPad(a, size) { + if (size <= a.length) { + return a; + } + return a + ' '.repeat(size - a.length); + } + function repeatedTry(checkFn, delayFn = (counter) => 0, maxCounter) { + return new Promise((resolve, reject) => { + let tryCount = 0; + const tryFn = () => { + if (checkFn()) { + resolve(); + return; + } + tryCount++; + const nextBackoff = delayFn(tryCount); + if (maxCounter != null && tryCount >= maxCounter) { + reject(); + return; + } + setTimeout(tryFn, nextBackoff); + }; + tryFn(); + }); + } + /** + * Given the full size of the array and a shape that may contain -1 as the + * implicit dimension, returns the inferred shape where -1 is replaced. + * E.g. For shape=[2, -1, 3] and size=24, it will return [2, 4, 3]. + * + * @param shape The shape, which may contain -1 in some dimension. + * @param size The full size (number of elements) of the array. + * @return The inferred shape where -1 is replaced with the inferred size. + */ + function inferFromImplicitShape(shape, size) { + let shapeProd = 1; + let implicitIdx = -1; + for (let i = 0; i < shape.length; ++i) { + if (shape[i] >= 0) { + shapeProd *= shape[i]; + } + else if (shape[i] === -1) { + if (implicitIdx !== -1) { + throw Error(`Shapes can only have 1 implicit size. ` + + `Found -1 at dim ${implicitIdx} and dim ${i}`); + } + implicitIdx = i; + } + else if (shape[i] < 0) { + throw Error(`Shapes can not be < 0. Found ${shape[i]} at dim ${i}`); + } + } + if (implicitIdx === -1) { + if (size > 0 && size !== shapeProd) { + throw Error(`Size(${size}) must match the product of shape ${shape}`); + } + return shape; + } + if (shapeProd === 0) { + throw Error(`Cannot infer the missing size in [${shape}] when ` + + `there are 0 elements`); + } + if (size % shapeProd !== 0) { + throw Error(`The implicit shape can't be a fractional number. ` + + `Got ${size} / ${shapeProd}`); + } + const newShape = shape.slice(); + newShape[implicitIdx] = size / shapeProd; + return newShape; + } + function parseAxisParam(axis, shape) { + const rank = shape.length; + // Normalize input + axis = axis == null ? shape.map((s, i) => i) : [].concat(axis); + // Check for valid range + assert(axis.every(ax => ax >= -rank && ax < rank), () => `All values in axis param must be in range [-${rank}, ${rank}) but ` + + `got axis ${axis}`); + // Check for only integers + assert(axis.every(ax => isInt(ax)), () => `All values in axis param must be integers but ` + + `got axis ${axis}`); + // Handle negative axis. + return axis.map(a => a < 0 ? rank + a : a); + } + /** Reduces the shape by removing all dimensions of shape 1. */ + function squeezeShape(shape, axis) { + const newShape = []; + const keptDims = []; + const isEmptyArray = axis != null && Array.isArray(axis) && axis.length === 0; + const axes = (axis == null || isEmptyArray) ? + null : + parseAxisParam(axis, shape).sort(); + let j = 0; + for (let i = 0; i < shape.length; ++i) { + if (axes != null) { + if (axes[j] === i && shape[i] !== 1) { + throw new Error(`Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`); + } + if ((axes[j] == null || axes[j] > i) && shape[i] === 1) { + newShape.push(shape[i]); + keptDims.push(i); + } + if (axes[j] <= i) { + j++; + } + } + if (shape[i] !== 1) { + newShape.push(shape[i]); + keptDims.push(i); + } + } + return { newShape, keptDims }; + } + function getTypedArrayFromDType(dtype, size) { + let values = null; + if (dtype == null || dtype === 'float32') { + values = new Float32Array(size); + } + else if (dtype === 'int32') { + values = new Int32Array(size); + } + else if (dtype === 'bool') { + values = new Uint8Array(size); + } + else { + throw new Error(`Unknown data type ${dtype}`); + } + return values; + } + function getArrayFromDType(dtype, size) { + let values = null; + if (dtype == null || dtype === 'float32') { + values = new Float32Array(size); + } + else if (dtype === 'int32') { + values = new Int32Array(size); + } + else if (dtype === 'bool') { + values = new Uint8Array(size); + } + else if (dtype === 'string') { + values = new Array(size); + } + else { + throw new Error(`Unknown data type ${dtype}`); + } + return values; + } + function checkConversionForErrors(vals, dtype) { + for (let i = 0; i < vals.length; i++) { + const num = vals[i]; + if (isNaN(num) || !isFinite(num)) { + throw Error(`A tensor of type ${dtype} being uploaded contains ${num}.`); + } + } + } + /** Returns true if the dtype is valid. */ + function isValidDtype(dtype) { + return dtype === 'bool' || dtype === 'complex64' || dtype === 'float32' || + dtype === 'int32' || dtype === 'string'; + } + /** + * Returns true if the new type can't encode the old type without loss of + * precision. + */ + function hasEncodingLoss(oldType, newType) { + if (newType === 'complex64') { + return false; + } + if (newType === 'float32' && oldType !== 'complex64') { + return false; + } + if (newType === 'int32' && oldType !== 'float32' && oldType !== 'complex64') { + return false; + } + if (newType === 'bool' && oldType === 'bool') { + return false; + } + return true; + } + function isTypedArray(a) { + return a instanceof Float32Array || a instanceof Int32Array || + a instanceof Uint8Array; + } + function bytesPerElement(dtype) { + if (dtype === 'float32' || dtype === 'int32') { + return 4; + } + else if (dtype === 'complex64') { + return 8; + } + else if (dtype === 'bool') { + return 1; + } + else { + throw new Error(`Unknown dtype ${dtype}`); + } + } + /** + * Returns the approximate number of bytes allocated in the string array - 2 + * bytes per character. Computing the exact bytes for a native string in JS is + * not possible since it depends on the encoding of the html page that serves + * the website. + */ + function bytesFromStringArray(arr) { + if (arr == null) { + return 0; + } + let bytes = 0; + arr.forEach(x => bytes += x.length); + return bytes; + } + /** Returns true if the value is a string. */ + function isString(value) { + return typeof value === 'string' || value instanceof String; + } + function isBoolean(value) { + return typeof value === 'boolean'; + } + function isNumber(value) { + return typeof value === 'number'; + } + function inferDtype(values) { + if (Array.isArray(values)) { + return inferDtype(values[0]); + } + if (values instanceof Float32Array) { + return 'float32'; + } + else if (values instanceof Int32Array || values instanceof Uint8Array) { + return 'int32'; + } + else if (isNumber(values)) { + return 'float32'; + } + else if (isString(values)) { + return 'string'; + } + else if (isBoolean(values)) { + return 'bool'; + } + return 'float32'; + } + function isFunction(f) { + return !!(f && f.constructor && f.call && f.apply); + } + function nearestDivisor(size, start) { + for (let i = start; i < size; ++i) { + if (size % i === 0) { + return i; + } + } + return size; + } + function computeStrides(shape) { + const rank = shape.length; + if (rank < 2) { + return []; + } + // Last dimension has implicit stride of 1, thus having D-1 (instead of D) + // strides. + const strides = new Array(rank - 1); + strides[rank - 2] = shape[rank - 1]; + for (let i = rank - 3; i >= 0; --i) { + strides[i] = strides[i + 1] * shape[i + 1]; + } + return strides; + } + function toTypedArray(a, dtype, debugMode) { + if (dtype === 'string') { + throw new Error('Cannot convert a string[] to a TypedArray'); + } + if (Array.isArray(a)) { + a = flatten(a); + } + if (debugMode) { + checkConversionForErrors(a, dtype); + } + if (noConversionNeeded(a, dtype)) { + return a; + } + if (dtype == null || dtype === 'float32' || dtype === 'complex64') { + return new Float32Array(a); + } + else if (dtype === 'int32') { + return new Int32Array(a); + } + else if (dtype === 'bool') { + const bool = new Uint8Array(a.length); + for (let i = 0; i < bool.length; ++i) { + if (Math.round(a[i]) !== 0) { + bool[i] = 1; + } + } + return bool; + } + else { + throw new Error(`Unknown data type ${dtype}`); + } + } + function createNestedArray(offset, shape, a) { + const ret = new Array(); + if (shape.length === 1) { + const d = shape[0]; + for (let i = 0; i < d; i++) { + ret[i] = a[offset + i]; + } + } + else { + const d = shape[0]; + const rest = shape.slice(1); + const len = rest.reduce((acc, c) => acc * c); + for (let i = 0; i < d; i++) { + ret[i] = createNestedArray(offset + i * len, rest, a); + } + } + return ret; + } + // Provide a nested array of TypedArray in given shape. + function toNestedArray(shape, a) { + if (shape.length === 0) { + // Scalar type should return a single number. + return a[0]; + } + const size = shape.reduce((acc, c) => acc * c); + if (size === 0) { + // A tensor with shape zero should be turned into empty list. + return []; + } + if (size !== a.length) { + throw new Error(`[${shape}] does not match the input size.`); + } + return createNestedArray(0, shape, a); + } + function noConversionNeeded(a, dtype) { + return (a instanceof Float32Array && dtype === 'float32') || + (a instanceof Int32Array && dtype === 'int32') || + (a instanceof Uint8Array && dtype === 'bool'); + } + function makeOnesTypedArray(size, dtype) { + const array = makeZerosTypedArray(size, dtype); + for (let i = 0; i < array.length; i++) { + array[i] = 1; + } + return array; + } + function makeZerosTypedArray(size, dtype) { + if (dtype == null || dtype === 'float32' || dtype === 'complex64') { + return new Float32Array(size); + } + else if (dtype === 'int32') { + return new Int32Array(size); + } + else if (dtype === 'bool') { + return new Uint8Array(size); + } + else { + throw new Error(`Unknown data type ${dtype}`); + } + } + /** + * Returns the current high-resolution time in milliseconds relative to an + * arbitrary time in the past. It works across different platforms (node.js, + * browsers). + * + * ```js + * console.log(tf.util.now()); + * ``` + */ + /** @doc {heading: 'Util', namespace: 'util'} */ + function now() { + return env().platform.now(); + } + function assertNonNegativeIntegerDimensions(shape) { + shape.forEach(dimSize => { + assert(Number.isInteger(dimSize) && dimSize >= 0, () => `Tensor must have a shape comprised of positive integers but got ` + + `shape [${shape}].`); + }); + } + /** + * Returns a platform-specific implementation of + * [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). + * + * If `fetch` is defined on the global object (`window`, `process`, etc.), + * `tf.util.fetch` returns that function. + * + * If not, `tf.util.fetch` returns a platform-specific solution. + * + * ```js + * const resource = await tf.util.fetch('https://unpkg.com/@tensorflow/tfjs'); + * // handle response + * ``` + */ + /** @doc {heading: 'Util'} */ + function fetch$1(path, requestInits) { + return env().platform.fetch(path, requestInits); + } + /** + * Encodes the provided string into bytes using the provided encoding scheme. + * + * @param s The string to encode. + * @param encoding The encoding scheme. Defaults to utf-8. + * + */ + /** @doc {heading: 'Util'} */ + function encodeString(s, encoding = 'utf-8') { + encoding = encoding || 'utf-8'; + return env().platform.encode(s, encoding); + } + /** + * Decodes the provided bytes into a string using the provided encoding scheme. + * @param bytes The bytes to decode. + * + * @param encoding The encoding scheme. Defaults to utf-8. + */ + /** @doc {heading: 'Util'} */ + function decodeString(bytes, encoding = 'utf-8') { + encoding = encoding || 'utf-8'; + return env().platform.decode(bytes, encoding); + } + /** + * Computes flat index for a given location (multidimentionsal index) in a + * Tensor/multidimensional array. + * + * @param locs Location in the tensor. + * @param rank Rank of the tensor. + * @param strides Tensor strides. + */ + function locToIndex(locs, rank, strides) { + if (rank === 0) { + return 0; + } + else if (rank === 1) { + return locs[0]; + } + let index = locs[locs.length - 1]; + for (let i = 0; i < locs.length - 1; ++i) { + index += strides[i] * locs[i]; + } + return index; + } + /** + * Computes the location (multidimensional index) in a tensor/multidimentional + * array for a given flat index. + * + * @param index Index in flat array. + * @param rank Rank of tensor. + * @param strides Strides of tensor. + */ + function indexToLoc(index, rank, strides) { + if (rank === 0) { + return []; + } + else if (rank === 1) { + return [index]; + } + const locs = new Array(rank); + for (let i = 0; i < locs.length - 1; ++i) { + locs[i] = Math.floor(index / strides[i]); + index -= locs[i] * strides[i]; + } + locs[locs.length - 1] = index; + return locs; + } + + var util = /*#__PURE__*/Object.freeze({ + __proto__: null, + shuffle: shuffle, + clamp: clamp, + nearestLargerEven: nearestLargerEven, + sum: sum, + randUniform: randUniform, + distSquared: distSquared, + assert: assert, + assertShapesMatch: assertShapesMatch, + assertNonNull: assertNonNull, + flatten: flatten, + sizeFromShape: sizeFromShape, + isScalarShape: isScalarShape, + arraysEqual: arraysEqual, + isInt: isInt, + tanh: tanh, + sizeToSquarishShape: sizeToSquarishShape, + createShuffledIndices: createShuffledIndices, + rightPad: rightPad, + repeatedTry: repeatedTry, + inferFromImplicitShape: inferFromImplicitShape, + parseAxisParam: parseAxisParam, + squeezeShape: squeezeShape, + getTypedArrayFromDType: getTypedArrayFromDType, + getArrayFromDType: getArrayFromDType, + checkConversionForErrors: checkConversionForErrors, + isValidDtype: isValidDtype, + hasEncodingLoss: hasEncodingLoss, + isTypedArray: isTypedArray, + bytesPerElement: bytesPerElement, + bytesFromStringArray: bytesFromStringArray, + isString: isString, + isBoolean: isBoolean, + isNumber: isNumber, + inferDtype: inferDtype, + isFunction: isFunction, + nearestDivisor: nearestDivisor, + computeStrides: computeStrides, + toTypedArray: toTypedArray, + toNestedArray: toNestedArray, + makeOnesTypedArray: makeOnesTypedArray, + makeZerosTypedArray: makeZerosTypedArray, + now: now, + assertNonNegativeIntegerDimensions: assertNonNegativeIntegerDimensions, + fetch: fetch$1, + encodeString: encodeString, + decodeString: decodeString, + locToIndex: locToIndex, + indexToLoc: indexToLoc + }); + + /** + * @license + * Copyright 2018 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + class Profiler { + constructor(backendTimer, logger) { + this.backendTimer = backendTimer; + this.logger = logger; + if (logger == null) { + this.logger = new Logger(); + } + } + profileKernel(kernelName, inputs, f) { + let outputs; + const holdResultWrapperFn = () => { + outputs = f(); + }; + const timer = this.backendTimer.time(holdResultWrapperFn); + outputs.forEach(r => { + // Dangling promise here because we don't want to propagate up + // asynchronicity. + r.data().then(vals => { + checkComputationForErrors(vals, r.dtype, kernelName); + timer.then(timing => { + let extraInfo = ''; + if (timing.getExtraProfileInfo != null) { + extraInfo = timing.getExtraProfileInfo(); + } + this.logger.logKernelProfile(kernelName, r, vals, timing.kernelMs, inputs, extraInfo); + }); + }); + }); + return outputs; + } + } + function checkComputationForErrors(vals, dtype, kernelName) { + if (dtype !== 'float32') { + // Only floating point computations will generate NaN values + return false; + } + for (let i = 0; i < vals.length; i++) { + const num = vals[i]; + if (isNaN(num) || !isFinite(num)) { + // Throwing custom exception so behavior is testable. + console.warn(`Found ${num} in the result of '${kernelName}'`); + return true; + } + } + return false; + } + class Logger { + logKernelProfile(name, result, vals, timeMs, inputs, extraInfo) { + const time = typeof timeMs === 'number' ? rightPad(`${timeMs}ms`, 9) : + timeMs['error']; + const paddedName = rightPad(name, 25); + const rank = result.rank; + const size = result.size; + const shape = rightPad(result.shape.toString(), 14); + let inputShapesDescription = ''; + for (const name in inputs) { + const input = inputs[name]; + // The input might be a non-tensor (e.g HTMLImageElement), in which case + // we claim the output shape as input shape. + const inputShape = input.shape || result.shape; + const inputRank = inputShape.length; + inputShapesDescription += + `${name}: ${inputRank}D ${inputRank > 0 ? inputShape : ''} `; + } + console.log(`%c${paddedName}\t%c${time}\t%c${rank}D ${shape}\t%c${size}\t%c${inputShapesDescription}\t%c${extraInfo}`, 'font-weight:bold', 'color:red', 'color:blue', 'color: orange', 'color: green', 'color: steelblue'); + } + } + + /** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Computes a list of TapeNodes that connect x to y, filtering everything else + * out and preserving the order of the original tape elements. + * + * @param tape The tape elements to filter. + * @param xs The input Tensors. + * @param y The output Tensor. + */ + function getFilteredNodesXToY(tape, xs, y) { + // Forward pass to compute all the nodes and Tensors that are transitively a + // function of x. + const tensorsFromX = {}; + const nodesFromX = {}; + for (let i = 0; i < xs.length; i++) { + tensorsFromX[xs[i].id] = true; + } + for (let i = 0; i < tape.length; i++) { + const node = tape[i]; + const nodeInputs = node.inputs; + for (const inputName in nodeInputs) { + const input = nodeInputs[inputName]; + let anyInputFromX = false; + for (let j = 0; j < xs.length; j++) { + if (tensorsFromX[input.id]) { + node.outputs.forEach(output => tensorsFromX[output.id] = true); + anyInputFromX = true; + nodesFromX[node.id] = true; + break; + } + } + if (anyInputFromX) { + break; + } + } + } + // Backward pass to find all of the nodes and Tensors that lead to y. + const tensorsLeadToY = {}; + tensorsLeadToY[y.id] = true; + const nodesToY = {}; + for (let i = tape.length - 1; i >= 0; i--) { + const node = tape[i]; + const nodeInputs = node.inputs; + // If any of the outputs lead to y, mark all of the inputs as leading to y. + for (let j = 0; j < node.outputs.length; j++) { + if (tensorsLeadToY[node.outputs[j].id]) { + for (const inputName in nodeInputs) { + tensorsLeadToY[nodeInputs[inputName].id] = true; + nodesToY[node.id] = true; + } + break; + } + } + } + // Return the paths that come from x and lead to y. + const filteredTape = []; + for (let i = 0; i < tape.length; i++) { + const node = tape[i]; + if (nodesFromX[node.id] && nodesToY[node.id]) { + // Prune the inputs from the node that aren't a function of x. + const prunedInputs = {}; + for (const inputName in node.inputs) { + const nodeInput = node.inputs[inputName]; + if (tensorsFromX[nodeInput.id]) { + prunedInputs[inputName] = nodeInput; + } + } + // Copy the node and overwrite inputsAndArgs to the pruned version. + const prunedNode = Object.assign({}, node); + prunedNode.inputs = prunedInputs; + prunedNode.outputs = node.outputs; + filteredTape.push(prunedNode); + } + } + return filteredTape; + } + /** + * Backpropagate gradients through the filtered TapeNodes. + * + * @param tensorAccumulatedGradientMap A map of Tensor to its gradient. This map + * is mutated by this method. + * @param filteredTape The filtered TapeNodes to backprop through. + */ + function backpropagateGradients(tensorAccumulatedGradientMap, filteredTape, tidy) { + // Walk the tape backward and keep a map of Tensor to its gradient. + for (let i = filteredTape.length - 1; i >= 0; i--) { + const node = filteredTape[i]; + const dys = []; + node.outputs.forEach(o => { + const gradTensor = tensorAccumulatedGradientMap[o.id]; + if (gradTensor != null) { + dys.push(gradTensor); + } + else { + // This particular output is not in the back-propagation subgraph, so it + // does not affect the final output, thus we put null for its dy. + dys.push(null); + } + }); + if (node.gradient == null) { + throw new Error(`Cannot compute gradient: gradient function not found ` + + `for ${node.kernelName}.`); + } + // Backprop dy through this node and accumulate gradients over the inputs. + const inputGradients = node.gradient(dys); + for (const inputName in node.inputs) { + if (!(inputName in inputGradients)) { + throw new Error(`Cannot backprop through input ${inputName}. ` + + `Available gradients found: ${Object.keys(inputGradients)}.`); + } + // Call the gradient function. + const dx = tidy(() => inputGradients[inputName]()); + if (dx.dtype !== 'float32') { + throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` + + `${inputName} must have 'float32' dtype, but has '${dx.dtype}'`); + } + const x = node.inputs[inputName]; + if (!arraysEqual(dx.shape, x.shape)) { + throw new Error(`Error in gradient for op ${node.kernelName}. The gradient of input ` + + `'${inputName}' has shape '${dx.shape}', which does not match ` + + `the shape of the input '${x.shape}'`); + } + if (tensorAccumulatedGradientMap[x.id] == null) { + tensorAccumulatedGradientMap[x.id] = dx; + } + else { + const curGradient = tensorAccumulatedGradientMap[x.id]; + tensorAccumulatedGradientMap[x.id] = curGradient.add(dx); + curGradient.dispose(); + } + } + } + } + + /** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + // Maximum number of values before we decide to show ellipsis. + const FORMAT_LIMIT_NUM_VALS = 20; + // Number of first and last values to show when displaying a, b,...,y, z. + const FORMAT_NUM_FIRST_LAST_VALS = 3; + // Number of significant digits to show. + const FORMAT_NUM_SIG_DIGITS = 7; + function tensorToString(vals, shape, dtype, verbose) { + const strides = computeStrides(shape); + const padPerCol = computeMaxSizePerColumn(vals, shape, dtype, strides); + const rank = shape.length; + const valsLines = subTensorToString(vals, shape, dtype, strides, padPerCol); + const lines = ['Tensor']; + if (verbose) { + lines.push(` dtype: ${dtype}`); + lines.push(` rank: ${rank}`); + lines.push(` shape: [${shape}]`); + lines.push(` values:`); + } + lines.push(valsLines.map(l => ' ' + l).join('\n')); + return lines.join('\n'); + } + function computeMaxSizePerColumn(vals, shape, dtype, strides) { + const n = sizeFromShape(shape); + const numCols = strides[strides.length - 1]; + const padPerCol = new Array(numCols).fill(0); + const rank = shape.length; + const valuesOrTuples = dtype === 'complex64' ? createComplexTuples(vals) : vals; + if (rank > 1) { + for (let row = 0; row < n / numCols; row++) { + const offset = row * numCols; + for (let j = 0; j < numCols; j++) { + padPerCol[j] = Math.max(padPerCol[j], valToString(valuesOrTuples[offset + j], 0, dtype).length); + } + } + } + return padPerCol; + } + function valToString(val, pad, dtype) { + let valStr; + if (Array.isArray(val)) { + valStr = `${parseFloat(val[0].toFixed(FORMAT_NUM_SIG_DIGITS))} + ` + + `${parseFloat(val[1].toFixed(FORMAT_NUM_SIG_DIGITS))}j`; + } + else if (isString(val)) { + valStr = `'${val}'`; + } + else if (dtype === 'bool') { + valStr = boolNumToString(val); + } + else { + valStr = parseFloat(val.toFixed(FORMAT_NUM_SIG_DIGITS)).toString(); + } + return rightPad(valStr, pad); + } + function boolNumToString(v) { + return v === 0 ? 'false' : 'true'; + } + function subTensorToString(vals, shape, dtype, strides, padPerCol, isLast = true) { + const storagePerElement = dtype === 'complex64' ? 2 : 1; + const size = shape[0]; + const rank = shape.length; + if (rank === 0) { + if (dtype === 'complex64') { + const complexTuple = createComplexTuples(vals); + return [valToString(complexTuple[0], 0, dtype)]; + } + if (dtype === 'bool') { + return [boolNumToString(vals[0])]; + } + return [vals[0].toString()]; + } + if (rank === 1) { + if (size > FORMAT_LIMIT_NUM_VALS) { + const firstValsSize = FORMAT_NUM_FIRST_LAST_VALS * storagePerElement; + let firstVals = Array.from(vals.slice(0, firstValsSize)); + let lastVals = Array.from(vals.slice((size - FORMAT_NUM_FIRST_LAST_VALS) * storagePerElement, size * storagePerElement)); + if (dtype === 'complex64') { + firstVals = createComplexTuples(firstVals); + lastVals = createComplexTuples(lastVals); + } + return [ + '[' + + firstVals.map((x, i) => valToString(x, padPerCol[i], dtype)) + .join(', ') + + ', ..., ' + + lastVals + .map((x, i) => valToString(x, padPerCol[size - FORMAT_NUM_FIRST_LAST_VALS + i], dtype)) + .join(', ') + + ']' + ]; + } + const displayVals = dtype === 'complex64' ? createComplexTuples(vals) : + Array.from(vals); + return [ + '[' + + displayVals.map((x, i) => valToString(x, padPerCol[i], dtype)) + .join(', ') + + ']' + ]; + } + // The array is rank 2 or more. + const subshape = shape.slice(1); + const substrides = strides.slice(1); + const stride = strides[0] * storagePerElement; + const lines = []; + if (size > FORMAT_LIMIT_NUM_VALS) { + for (let i = 0; i < FORMAT_NUM_FIRST_LAST_VALS; i++) { + const start = i * stride; + const end = start + stride; + lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, false /* isLast */)); + } + lines.push('...'); + for (let i = size - FORMAT_NUM_FIRST_LAST_VALS; i < size; i++) { + const start = i * stride; + const end = start + stride; + lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */)); + } + } + else { + for (let i = 0; i < size; i++) { + const start = i * stride; + const end = start + stride; + lines.push(...subTensorToString(vals.slice(start, end), subshape, dtype, substrides, padPerCol, i === size - 1 /* isLast */)); + } + } + const sep = rank === 2 ? ',' : ''; + lines[0] = '[' + lines[0] + sep; + for (let i = 1; i < lines.length - 1; i++) { + lines[i] = ' ' + lines[i] + sep; + } + let newLineSep = ',\n'; + for (let i = 2; i < rank; i++) { + newLineSep += '\n'; + } + lines[lines.length - 1] = + ' ' + lines[lines.length - 1] + ']' + (isLast ? '' : newLineSep); + return lines; + } + function createComplexTuples(vals) { + const complexTuples = []; + for (let i = 0; i < vals.length; i += 2) { + complexTuples.push([vals[i], vals[i + 1]]); + } + return complexTuples; + } + + /** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * A mutable object, similar to `tf.Tensor`, that allows users to set values + * at locations before converting to an immutable `tf.Tensor`. + * + * See `tf.buffer` for creating a tensor buffer. + */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + class TensorBuffer { + constructor(shape, dtype, values) { + this.dtype = dtype; + this.shape = shape.slice(); + this.size = sizeFromShape(shape); + if (values != null) { + const n = values.length; + assert(n === this.size, () => `Length of values '${n}' does not match the size ` + + `inferred by the shape '${this.size}'.`); + } + if (dtype === 'complex64') { + throw new Error(`complex64 dtype TensorBuffers are not supported. Please create ` + + `a TensorBuffer for the real and imaginary parts separately and ` + + `call tf.complex(real, imag).`); + } + this.values = values || getArrayFromDType(dtype, this.size); + this.strides = computeStrides(shape); + } + /** + * Sets a value in the buffer at a given location. + * + * @param value The value to set. + * @param locs The location indices. + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + set(value, ...locs) { + if (locs.length === 0) { + locs = [0]; + } + assert(locs.length === this.rank, () => `The number of provided coordinates (${locs.length}) must ` + + `match the rank (${this.rank})`); + const index = this.locToIndex(locs); + this.values[index] = value; + } + /** + * Returns the value in the buffer at the provided location. + * + * @param locs The location indices. + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + get(...locs) { + if (locs.length === 0) { + locs = [0]; + } + let i = 0; + for (const loc of locs) { + if (loc < 0 || loc >= this.shape[i]) { + const msg = `Requested out of range element at ${locs}. ` + + ` Buffer shape=${this.shape}`; + throw new Error(msg); + } + i++; + } + let index = locs[locs.length - 1]; + for (let i = 0; i < locs.length - 1; ++i) { + index += this.strides[i] * locs[i]; + } + return this.values[index]; + } + locToIndex(locs) { + if (this.rank === 0) { + return 0; + } + else if (this.rank === 1) { + return locs[0]; + } + let index = locs[locs.length - 1]; + for (let i = 0; i < locs.length - 1; ++i) { + index += this.strides[i] * locs[i]; + } + return index; + } + indexToLoc(index) { + if (this.rank === 0) { + return []; + } + else if (this.rank === 1) { + return [index]; + } + const locs = new Array(this.shape.length); + for (let i = 0; i < locs.length - 1; ++i) { + locs[i] = Math.floor(index / this.strides[i]); + index -= locs[i] * this.strides[i]; + } + locs[locs.length - 1] = index; + return locs; + } + get rank() { + return this.shape.length; + } + /** + * Creates an immutable `tf.Tensor` object from the buffer. + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + toTensor() { + return trackerFn().makeTensor(this.values, this.shape, this.dtype); + } + } + // For tracking tensor creation and disposal. + let trackerFn = null; + // Used by chaining methods to call into ops. + let opHandler = null; + /** + * An external consumer can register itself as the tensor tracker. This way + * the Tensor class can notify the tracker for every tensor created and + * disposed. + */ + function setTensorTracker(fn) { + trackerFn = fn; + } + /** + * An external consumer can register itself as the op handler. This way the + * Tensor class can have chaining methods that call into ops via the op + * handler. + */ + function setOpHandler(handler) { + opHandler = handler; + } + /** + * A `tf.Tensor` object represents an immutable, multidimensional array of + * numbers that has a shape and a data type. + * + * See `tf.tensor` for details on how to create a `tf.Tensor`. + */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + class Tensor { + constructor(shape, dtype, dataId, id) { + /** Whether this tensor has been globally kept. */ + this.kept = false; + this.isDisposedInternal = false; + this.shape = shape.slice(); + this.dtype = dtype || 'float32'; + this.size = sizeFromShape(shape); + this.strides = computeStrides(shape); + this.dataId = dataId; + this.id = id; + this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher'); + } + /** Flatten a Tensor to a 1D array. */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + flatten() { + this.throwIfDisposed(); + return this.as1D(); + } + /** Converts a size-1 `tf.Tensor` to a `tf.Scalar`. */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + asScalar() { + this.throwIfDisposed(); + assert(this.size === 1, () => 'The array must have only 1 element.'); + return this.reshape([]); + } + /** Converts a `tf.Tensor` to a `tf.Tensor1D`. */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + as1D() { + this.throwIfDisposed(); + return this.reshape([this.size]); + } + /** + * Converts a `tf.Tensor` to a `tf.Tensor2D`. + * + * @param rows Number of rows in `tf.Tensor2D`. + * @param columns Number of columns in `tf.Tensor2D`. + */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + as2D(rows, columns) { + this.throwIfDisposed(); + return this.reshape([rows, columns]); + } + /** + * Converts a `tf.Tensor` to a `tf.Tensor3D`. + * + * @param rows Number of rows in `tf.Tensor3D`. + * @param columns Number of columns in `tf.Tensor3D`. + * @param depth Depth of `tf.Tensor3D`. + */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + as3D(rows, columns, depth) { + this.throwIfDisposed(); + return this.reshape([rows, columns, depth]); + } + /** + * Converts a `tf.Tensor` to a `tf.Tensor4D`. + * + * @param rows Number of rows in `tf.Tensor4D`. + * @param columns Number of columns in `tf.Tensor4D`. + * @param depth Depth of `tf.Tensor4D`. + * @param depth2 4th dimension of `tf.Tensor4D`. + */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + as4D(rows, columns, depth, depth2) { + this.throwIfDisposed(); + return this.reshape([rows, columns, depth, depth2]); + } + /** + * Converts a `tf.Tensor` to a `tf.Tensor5D`. + * + * @param rows Number of rows in `tf.Tensor5D`. + * @param columns Number of columns in `tf.Tensor5D`. + * @param depth Depth of `tf.Tensor5D`. + * @param depth2 4th dimension of `tf.Tensor5D`. + * @param depth3 5th dimension of 'tf.Tensor5D' + */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + as5D(rows, columns, depth, depth2, depth3) { + this.throwIfDisposed(); + return this.reshape([rows, columns, depth, depth2, depth3]); + } + /** + * Casts a `tf.Tensor` to a specified dtype. + * + * @param dtype Data-type to cast the tensor to. + */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + asType(dtype) { + this.throwIfDisposed(); + return opHandler.cast(this, dtype); + } + get rank() { + return this.shape.length; + } + /** + * Returns a promise of `tf.TensorBuffer` that holds the underlying data. + */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + async buffer() { + const vals = await this.data(); + return opHandler.buffer(this.shape, this.dtype, vals); + } + /** Returns a `tf.TensorBuffer` that holds the underlying data. */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + bufferSync() { + return opHandler.buffer(this.shape, this.dtype, this.dataSync()); + } + /** + * Returns the tensor data as a nested array. The transfer of data is done + * asynchronously. + */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + async array() { + const vals = await this.data(); + return toNestedArray(this.shape, vals); + } + /** + * Returns the tensor data as a nested array. The transfer of data is done + * synchronously. + */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + arraySync() { + return toNestedArray(this.shape, this.dataSync()); + } + /** + * Asynchronously downloads the values from the `tf.Tensor`. Returns a + * promise of `TypedArray` that resolves when the computation has finished. + */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + async data() { + this.throwIfDisposed(); + const data = trackerFn().read(this.dataId); + if (this.dtype === 'string') { + const bytes = await data; + try { + return bytes.map(b => decodeString(b)); + } + catch (_a) { + throw new Error('Failed to decode the string bytes into utf-8. ' + + 'To get the original bytes, call tensor.bytes().'); + } + } + return data; + } + /** + * Synchronously downloads the values from the `tf.Tensor`. This blocks the + * UI thread until the values are ready, which can cause performance issues. + */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + dataSync() { + this.throwIfDisposed(); + const data = trackerFn().readSync(this.dataId); + if (this.dtype === 'string') { + try { + return data.map(b => decodeString(b)); + } + catch (_a) { + throw new Error('Failed to decode the string bytes into utf-8. ' + + 'To get the original bytes, call tensor.bytes().'); + } + } + return data; + } + /** Returns the underlying bytes of the tensor's data. */ + async bytes() { + this.throwIfDisposed(); + const data = await trackerFn().read(this.dataId); + if (this.dtype === 'string') { + return data; + } + else { + return new Uint8Array(data.buffer); + } + } + /** + * Disposes `tf.Tensor` from memory. + */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + dispose() { + if (this.isDisposed) { + return; + } + trackerFn().disposeTensor(this); + this.isDisposedInternal = true; + } + get isDisposed() { + return this.isDisposedInternal; + } + throwIfDisposed() { + if (this.isDisposed) { + throw new Error(`Tensor is disposed.`); + } + } + /** Casts the array to type `float32` */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + toFloat() { + return this.asType('float32'); + } + /** Casts the array to type `int32` */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + toInt() { + return this.asType('int32'); + } + /** Casts the array to type `bool` */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + toBool() { + return this.asType('bool'); + } + /** + * Prints the `tf.Tensor`. See `tf.print` for details. + * + * @param verbose Whether to print verbose information about the tensor, + * including dtype and size. + */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + print(verbose = false) { + return opHandler.print(this, verbose); + } + /** + * Reshapes the tensor into the provided shape. + * See `tf.reshape` for more details. + * + * @param newShape An array of integers defining the output tensor shape. + */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + reshape(newShape) { + this.throwIfDisposed(); + return opHandler.reshape(this, newShape); + } + /** + * Reshapes the tensor into the shape of the provided tensor. + * + * @param x The tensor of required shape. + */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + reshapeAs(x) { + this.throwIfDisposed(); + return this.reshape(x.shape); + } + /** + * Returns a `tf.Tensor` that has expanded rank, by inserting a dimension + * into the tensor's shape. See `tf.expandDims` for details. + * + * @param axis The dimension index at which to insert shape of 1. Defaults to + * 0 (the first dimension). + */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + expandDims(axis = 0) { + return opHandler.expandDims(this, axis); + } + /** + * Returns the cumulative sum of the `tf.Tensor` along `axis`. + * + * @param axis The axis along which to sum. Optional. Defaults to 0. + * @param exclusive Whether to perform exclusive cumulative sum. Defaults to + * false. If set to true then the sum of each tensor entry does not + * include its own value, but only the values previous to it along the + * specified axis. + * @param reverse Whether to sum in the opposite direction. Defaults to + * false. + */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + cumsum(axis = 0, exclusive = false, reverse = false) { + return opHandler.cumsum(this, axis, exclusive, reverse); + } + /** + * Returns a `tf.Tensor` with dimensions of size 1 removed from the shape. + * See `tf.squeeze` for more details. + * + * @param axis A list of numbers. If specified, only squeezes the + * dimensions listed. The dimension index starts at 0. It is an error to + * squeeze a dimension that is not 1. + */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + squeeze(axis) { + this.throwIfDisposed(); + return opHandler.squeeze(this, axis); + } + /** Returns a copy of the tensor. See `tf.clone` for details. */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + clone() { + this.throwIfDisposed(); + return opHandler.clone(this); + } + /** + * Returns a human-readable description of the tensor. Useful for logging. + */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + toString(verbose = false) { + const vals = this.dataSync(); + return tensorToString(vals, this.shape, this.dtype, verbose); + } + // Below is chain API that is not exposed to docs to avoid repetition. To + // expose a method, move it above this comment and add @doc and jsdoc. + gather(indices, axis = 0) { + this.throwIfDisposed(); + return opHandler.gather(this, indices, axis); + } + norm(ord = 'euclidean', axis = null, keepDims = false) { + this.throwIfDisposed(); + return opHandler.norm(this, ord, axis, keepDims); + } + slice(begin, size) { + this.throwIfDisposed(); + return opHandler.slice(this, begin, size); + } + reverse(axis) { + this.throwIfDisposed(); + return opHandler.reverse(this, axis); + } + stack(x, axis = 0) { + return opHandler.stack([this, x], axis); + } + unstack(axis = 0) { + return opHandler.unstack(this, axis); + } + // Reduction ops. + all(axis = null, keepDims = false) { + this.throwIfDisposed(); + return opHandler.all(this, axis, keepDims); + } + any(axis = null, keepDims = false) { + this.throwIfDisposed(); + return opHandler.any(this, axis, keepDims); + } + logSumExp(axis = null, keepDims = false) { + this.throwIfDisposed(); + return opHandler.logSumExp(this, axis, keepDims); + } + sum(axis = null, keepDims = false) { + this.throwIfDisposed(); + return opHandler.sum(this, axis, keepDims); + } + prod(axis = null, keepDims = false) { + this.throwIfDisposed(); + return opHandler.prod(this, axis, keepDims); + } + mean(axis = null, keepDims = false) { + this.throwIfDisposed(); + return opHandler.mean(this, axis, keepDims); + } + min(axis = null, keepDims = false) { + this.throwIfDisposed(); + return opHandler.min(this, axis, keepDims); + } + argMin(axis = null) { + this.throwIfDisposed(); + return opHandler.argMin(this, axis); + } + argMax(axis = null) { + this.throwIfDisposed(); + return opHandler.argMax(this, axis); + } + // Transformations + cast(dtype) { + this.throwIfDisposed(); + return opHandler.cast(this, dtype); + } + // Binary ops. + /** + * @deprecated strict variants of ops have been deprecated + */ + addStrict(x) { + this.throwIfDisposed(); + return opHandler.addStrict(this, x); + } + atan2(x) { + this.throwIfDisposed(); + return opHandler.atan2(this, x); + } + /** + * @deprecated strict variants of ops have been deprecated + */ + subStrict(x) { + this.throwIfDisposed(); + return opHandler.subStrict(this, x); + } + pow(exp) { + this.throwIfDisposed(); + return opHandler.pow(this, exp); + } + /** + * @deprecated strict variants of ops have been deprecated + */ + powStrict(exp) { + this.throwIfDisposed(); + return opHandler.powStrict(this, exp); + } + mul(x) { + this.throwIfDisposed(); + return opHandler.mul(this, x); + } + /** + * @deprecated strict variants of ops have been deprecated + */ + mulStrict(x) { + this.throwIfDisposed(); + return opHandler.mulStrict(this, x); + } + floorDiv(x) { + this.throwIfDisposed(); + return opHandler.floorDiv(this, x); + } + /** + * @deprecated strict variants of ops have been deprecated + */ + divStrict(x) { + this.throwIfDisposed(); + return opHandler.divStrict(this, x); + } + minimum(x) { + this.throwIfDisposed(); + return opHandler.minimum(this, x); + } + /** + * @deprecated strict variants of ops have been deprecated + */ + minimumStrict(x) { + this.throwIfDisposed(); + return opHandler.minimumStrict(this, x); + } + maximum(x) { + this.throwIfDisposed(); + return opHandler.maximum(this, x); + } + /** + * @deprecated strict variants of ops have been deprecated + */ + maximumStrict(x) { + this.throwIfDisposed(); + return opHandler.maximumStrict(this, x); + } + mod(x) { + this.throwIfDisposed(); + return opHandler.mod(this, x); + } + /** + * @deprecated strict variants of ops have been deprecated + */ + modStrict(x) { + this.throwIfDisposed(); + return opHandler.modStrict(this, x); + } + /** + * @deprecated strict variants of ops have been deprecated + */ + squaredDifferenceStrict(x) { + this.throwIfDisposed(); + return opHandler.squaredDifferenceStrict(this, x); + } + // Compare ops. + /** + * @deprecated strict variants of ops have been deprecated + */ + notEqualStrict(x) { + this.throwIfDisposed(); + return opHandler.notEqualStrict(this, x); + } + /** + * @deprecated strict variants of ops have been deprecated + */ + lessStrict(x) { + this.throwIfDisposed(); + return opHandler.lessStrict(this, x); + } + /** + * @deprecated strict variants of ops have been deprecated + */ + equalStrict(x) { + this.throwIfDisposed(); + return opHandler.equalStrict(this, x); + } + /** + * @deprecated strict variants of ops have been deprecated + */ + lessEqualStrict(x) { + this.throwIfDisposed(); + return opHandler.lessEqualStrict(this, x); + } + /** + * @deprecated strict variants of ops have been deprecated + */ + greaterStrict(x) { + this.throwIfDisposed(); + return opHandler.greaterStrict(this, x); + } + /** + * @deprecated strict variants of ops have been deprecated + */ + greaterEqualStrict(x) { + this.throwIfDisposed(); + return opHandler.greaterEqualStrict(this, x); + } + // Compare ops. + logicalAnd(x) { + this.throwIfDisposed(); + return opHandler.logicalAnd(this, x); + } + logicalOr(x) { + this.throwIfDisposed(); + return opHandler.logicalOr(this, x); + } + logicalNot() { + this.throwIfDisposed(); + return opHandler.logicalNot(this); + } + logicalXor(x) { + this.throwIfDisposed(); + return opHandler.logicalXor(this, x); + } + where(condition, x) { + this.throwIfDisposed(); + return opHandler.where(condition, this, x); + } + // Unary ops. + neg() { + this.throwIfDisposed(); + return opHandler.neg(this); + } + ceil() { + this.throwIfDisposed(); + return opHandler.ceil(this); + } + floor() { + this.throwIfDisposed(); + return opHandler.floor(this); + } + sign() { + this.throwIfDisposed(); + return opHandler.sign(this); + } + isNaN() { + this.throwIfDisposed(); + return opHandler.isNaN(this); + } + isInf() { + this.throwIfDisposed(); + return opHandler.isInf(this); + } + isFinite() { + this.throwIfDisposed(); + return opHandler.isFinite(this); + } + exp() { + this.throwIfDisposed(); + return opHandler.exp(this); + } + expm1() { + this.throwIfDisposed(); + return opHandler.expm1(this); + } + log() { + this.throwIfDisposed(); + return opHandler.log(this); + } + log1p() { + this.throwIfDisposed(); + return opHandler.log1p(this); + } + sqrt() { + this.throwIfDisposed(); + return opHandler.sqrt(this); + } + rsqrt() { + this.throwIfDisposed(); + return opHandler.rsqrt(this); + } + square() { + this.throwIfDisposed(); + return opHandler.square(this); + } + reciprocal() { + this.throwIfDisposed(); + return opHandler.reciprocal(this); + } + abs() { + this.throwIfDisposed(); + return opHandler.abs(this); + } + clipByValue(min, max) { + this.throwIfDisposed(); + return opHandler.clipByValue(this, min, max); + } + relu() { + this.throwIfDisposed(); + return opHandler.relu(this); + } + relu6() { + this.throwIfDisposed(); + return opHandler.relu6(this); + } + elu() { + this.throwIfDisposed(); + return opHandler.elu(this); + } + selu() { + this.throwIfDisposed(); + return opHandler.selu(this); + } + leakyRelu(alpha = 0.2) { + this.throwIfDisposed(); + return opHandler.leakyRelu(this, alpha); + } + prelu(alpha) { + this.throwIfDisposed(); + return opHandler.prelu(this, alpha); + } + sigmoid() { + this.throwIfDisposed(); + return opHandler.sigmoid(this); + } + logSigmoid() { + this.throwIfDisposed(); + return opHandler.logSigmoid(this); + } + softplus() { + this.throwIfDisposed(); + return opHandler.softplus(this); + } + zerosLike() { + this.throwIfDisposed(); + return opHandler.zerosLike(this); + } + onesLike() { + this.throwIfDisposed(); + return opHandler.onesLike(this); + } + sin() { + this.throwIfDisposed(); + return opHandler.sin(this); + } + cos() { + this.throwIfDisposed(); + return opHandler.cos(this); + } + tan() { + this.throwIfDisposed(); + return opHandler.tan(this); + } + asin() { + this.throwIfDisposed(); + return opHandler.asin(this); + } + acos() { + this.throwIfDisposed(); + return opHandler.acos(this); + } + atan() { + this.throwIfDisposed(); + return opHandler.atan(this); + } + sinh() { + this.throwIfDisposed(); + return opHandler.sinh(this); + } + cosh() { + this.throwIfDisposed(); + return opHandler.cosh(this); + } + tanh() { + this.throwIfDisposed(); + return opHandler.tanh(this); + } + asinh() { + this.throwIfDisposed(); + return opHandler.asinh(this); + } + acosh() { + this.throwIfDisposed(); + return opHandler.acosh(this); + } + atanh() { + this.throwIfDisposed(); + return opHandler.atanh(this); + } + erf() { + this.throwIfDisposed(); + return opHandler.erf(this); + } + round() { + this.throwIfDisposed(); + return opHandler.round(this); + } + step(alpha = 0.0) { + this.throwIfDisposed(); + return opHandler.step(this, alpha); + } + softmax(dim = -1) { + this.throwIfDisposed(); + return opHandler.softmax(this, dim); + } + logSoftmax(axis = -1) { + this.throwIfDisposed(); + return opHandler.logSoftmax(this, axis); + } + // Image ops. + resizeBilinear(newShape2D, alignCorners = false) { + this.throwIfDisposed(); + return opHandler.image.resizeBilinear(this, newShape2D, alignCorners); + } + resizeNearestNeighbor(newShape2D, alignCorners = false) { + this.throwIfDisposed(); + return opHandler.image.resizeNearestNeighbor(this, newShape2D, alignCorners); + } + // Pooling. + avgPool(filterSize, strides, pad, dimRoundingMode) { + this.throwIfDisposed(); + return opHandler.avgPool(this, filterSize, strides, pad, dimRoundingMode); + } + maxPool(filterSize, strides, pad, dimRoundingMode) { + this.throwIfDisposed(); + return opHandler.maxPool(this, filterSize, strides, pad, dimRoundingMode); + } + pool(windowShape, poolingType, padding, dilationRate, strides) { + this.throwIfDisposed(); + return opHandler.pool(this, windowShape, poolingType, padding, dilationRate, strides); + } + variable(trainable = true, name, dtype) { + this.throwIfDisposed(); + return trackerFn().makeVariable(this, trainable, name, dtype); + } + unsortedSegmentSum(segmentIds, numSegments) { + this.throwIfDisposed(); + return opHandler.unsortedSegmentSum(this, segmentIds, numSegments); + } + batchToSpaceND(blockShape, crops) { + this.throwIfDisposed(); + return opHandler.batchToSpaceND(this, blockShape, crops); + } + spaceToBatchND(blockShape, paddings) { + this.throwIfDisposed(); + return opHandler.spaceToBatchND(this, blockShape, paddings); + } + topk(k = 1, sorted = true) { + this.throwIfDisposed(); + return opHandler.topk(this, k, sorted); + } + stridedSlice(begin, end, strides, beginMask = 0, endMask = 0, ellipsisMask = 0, newAxisMask = 0, shrinkAxisMask = 0) { + this.throwIfDisposed(); + return opHandler.stridedSlice(this, begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask); + } + depthToSpace(blockSize, dataFormat) { + this.throwIfDisposed(); + return opHandler.depthToSpace(this, blockSize, dataFormat); + } + fft() { + this.throwIfDisposed(); + return opHandler.spectral.fft(this); + } + ifft() { + this.throwIfDisposed(); + return opHandler.spectral.ifft(this); + } + rfft() { + this.throwIfDisposed(); + return opHandler.spectral.rfft(this); + } + irfft() { + this.throwIfDisposed(); + return opHandler.spectral.irfft(this); + } + } + Object.defineProperty(Tensor, Symbol.hasInstance, { + value: (instance) => { + return !!instance && instance.dataId != null && instance.shape != null && + instance.dtype != null; + } + }); + /** + * A mutable `tf.Tensor`, useful for persisting state, e.g. for training. + */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + class Variable extends Tensor { + constructor(initialValue, trainable, name, tensorId) { + super(initialValue.shape, initialValue.dtype, initialValue.dataId, tensorId); + this.trainable = trainable; + this.name = name; + } + /** + * Assign a new `tf.Tensor` to this variable. The new `tf.Tensor` must have + * the same shape and dtype as the old `tf.Tensor`. + * + * @param newValue New tensor to be assigned to this variable. + */ + /** @doc {heading: 'Tensors', subheading: 'Classes'} */ + assign(newValue) { + if (newValue.dtype !== this.dtype) { + throw new Error(`dtype of the new value (${newValue.dtype}) and ` + + `previous value (${this.dtype}) must match`); + } + if (!arraysEqual(newValue.shape, this.shape)) { + throw new Error(`shape of the new value (${newValue.shape}) and ` + + `previous value (${this.shape}) must match`); + } + trackerFn().disposeTensor(this); + this.dataId = newValue.dataId; + trackerFn().incRef(this, null /* backend */); + } + dispose() { + trackerFn().disposeVariable(this); + this.isDisposedInternal = true; + } + } + Object.defineProperty(Variable, Symbol.hasInstance, { + value: (instance) => { + return instance instanceof Tensor && instance.assign != null && + instance.assign instanceof Function; + } + }); + + /** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + (function (Rank) { + Rank["R0"] = "R0"; + Rank["R1"] = "R1"; + Rank["R2"] = "R2"; + Rank["R3"] = "R3"; + Rank["R4"] = "R4"; + Rank["R5"] = "R5"; + Rank["R6"] = "R6"; + })(exports.Rank || (exports.Rank = {})); + // Looks for upcasting types. Used, for example, in operations with mixed dtype + // inputs. + var UpcastInt32AndMap; + (function (UpcastInt32AndMap) { + UpcastInt32AndMap["float32"] = "float32"; + UpcastInt32AndMap["int32"] = "int32"; + UpcastInt32AndMap["bool"] = "int32"; + UpcastInt32AndMap["complex64"] = "complex64"; + })(UpcastInt32AndMap || (UpcastInt32AndMap = {})); + var UpcastBoolAndMap; + (function (UpcastBoolAndMap) { + UpcastBoolAndMap["float32"] = "float32"; + UpcastBoolAndMap["int32"] = "int32"; + UpcastBoolAndMap["bool"] = "bool"; + UpcastBoolAndMap["complex64"] = "complex64"; + })(UpcastBoolAndMap || (UpcastBoolAndMap = {})); + var UpcastFloat32AndMap; + (function (UpcastFloat32AndMap) { + UpcastFloat32AndMap["float32"] = "float32"; + UpcastFloat32AndMap["int32"] = "float32"; + UpcastFloat32AndMap["bool"] = "float32"; + UpcastFloat32AndMap["complex64"] = "complex64"; + })(UpcastFloat32AndMap || (UpcastFloat32AndMap = {})); + var UpcastComplex64AndMap; + (function (UpcastComplex64AndMap) { + UpcastComplex64AndMap["float32"] = "complex64"; + UpcastComplex64AndMap["int32"] = "complex64"; + UpcastComplex64AndMap["bool"] = "complex64"; + UpcastComplex64AndMap["complex64"] = "complex64"; + })(UpcastComplex64AndMap || (UpcastComplex64AndMap = {})); + const upcastTypeMap = { + 'float32': UpcastFloat32AndMap, + 'int32': UpcastInt32AndMap, + 'bool': UpcastBoolAndMap, + 'complex64': UpcastComplex64AndMap + }; + function upcastType(typeA, typeB) { + if (typeA === 'string' || typeB === 'string') { + if (typeA === 'string' && typeB === 'string') { + return 'string'; + } + throw new Error(`Can not upcast ${typeA} with ${typeB}`); + } + return upcastTypeMap[typeA][typeB]; + } + /** Returns the output type after summation. */ + function sumOutType(type) { + return upcastType(type, 'int32'); + } + + /** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + function makeTypesMatch(a, b) { + if (a.dtype === b.dtype) { + return [a, b]; + } + const dtype = upcastType(a.dtype, b.dtype); + return [a.cast(dtype), b.cast(dtype)]; + } + function assertTypesMatch(a, b) { + assert(a.dtype === b.dtype, () => `The dtypes of the first(${a.dtype}) and` + + ` second(${b.dtype}) input must match`); + } + function isTensorInList(tensor, tensorList) { + return tensorList.some(x => x.id === tensor.id); + } + /** + * Extracts any `Tensor`s found within the provided object. + * + * @param container an object that may be a `Tensor` or may directly contain + * `Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. In general it + * is safe to pass any object here, except that `Promise`s are not + * supported. + * @returns An array of `Tensors` found within the passed object. If the + * argument is simply a `Tensor', a list containing that `Tensor` is + * returned. If the object is not a `Tensor` or does not + * contain `Tensors`, an empty list is returned. + */ + function getTensorsInContainer(result) { + const list = []; + const seen = new Set(); + walkTensorContainer(result, list, seen); + return list; + } + function walkTensorContainer(container, list, seen) { + if (container == null) { + return; + } + if (container instanceof Tensor) { + list.push(container); + return; + } + if (!isIterable(container)) { + return; + } + // Iteration over keys works also for arrays. + const iterable = container; + for (const k in iterable) { + const val = iterable[k]; + if (!seen.has(val)) { + seen.add(val); + walkTensorContainer(val, list, seen); + } + } + } + // tslint:disable-next-line:no-any + function isIterable(obj) { + return Array.isArray(obj) || typeof obj === 'object'; + } + + var tensor_util = /*#__PURE__*/Object.freeze({ + __proto__: null, + makeTypesMatch: makeTypesMatch, + assertTypesMatch: assertTypesMatch, + isTensorInList: isTensorInList, + getTensorsInContainer: getTensorsInContainer + }); + + /** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + class EngineState { + constructor() { + // Public since optimizers will use it. + this.registeredVariables = {}; + this.nextTapeNodeId = 0; + this.numBytes = 0; + this.numTensors = 0; + this.numStringTensors = 0; + this.numDataBuffers = 0; + // Number of nested tf.grad() statements when computing higher-order + // gradients. E.g. `1` for first-order gradients and `2` for second-order + // gradients. Used to track if the tape should be removed after a backprop. + this.gradientDepth = 0; + // Number of nested kernel calls. When kernel depth is greater than 1, we turn + // off the tape. + this.kernelDepth = 0; + this.scopeStack = []; + /** + * Keeps track of the number of data moves during a kernel execution. We + * maintain a stack since kernels can call other kernels, recursively. + */ + this.numDataMovesStack = []; + this.nextScopeId = 0; + this.tensorInfo = new WeakMap(); + this.profiling = false; + this.activeProfile = { newBytes: 0, newTensors: 0, peakBytes: 0, kernels: [], result: null }; + } + dispose() { + for (const variableName in this.registeredVariables) { + this.registeredVariables[variableName].dispose(); + } + } + } + class Engine { + constructor(ENV) { + this.ENV = ENV; + this.registry = {}; + this.registryFactory = {}; + this.pendingBackendInitId = 0; + this.state = new EngineState(); + } + async ready() { + if (this.pendingBackendInit != null) { + return this.pendingBackendInit.then(() => { }); + } + if (this.backendInstance != null) { + return; + } + const sortedBackends = this.getSortedBackends(); + for (let i = 0; i < sortedBackends.length; i++) { + const backendName = sortedBackends[i]; + const success = await this.initializeBackend(backendName).success; + if (success) { + await this.setBackend(backendName); + return; + } + } + throw new Error(`Could not initialize any backends, all backend initializations ` + + `failed.`); + } + get backend() { + if (this.pendingBackendInit != null) { + throw new Error(`Backend '${this.backendName}' has not yet been initialized. Make ` + + `sure to await tf.ready() or await tf.setBackend() before calling ` + + `other methods`); + } + if (this.backendInstance == null) { + const { name, asyncInit } = this.initializeBackendsAndReturnBest(); + if (asyncInit) { + throw new Error(`The highest priority backend '${name}' has not yet been ` + + `initialized. Make sure to await tf.ready() or ` + + `await tf.setBackend() before calling other methods`); + } + this.setBackend(name); + } + return this.backendInstance; + } + backendNames() { + return Object.keys(this.registryFactory); + } + findBackend(backendName) { + if (!(backendName in this.registry)) { + // If the backend hasn't been initialized but we have a registry entry for + // it, initialize it and return it. + if (backendName in this.registryFactory) { + const { asyncInit } = this.initializeBackend(backendName); + if (asyncInit) { + // Backend is not ready yet. + return null; + } + } + else { + return null; + } + } + return this.registry[backendName]; + } + findBackendFactory(backendName) { + if (!(backendName in this.registryFactory)) { + return null; + } + return this.registryFactory[backendName].factory; + } + registerBackend(backendName, factory, priority = 1) { + if (backendName in this.registryFactory) { + console.warn(`${backendName} backend was already registered. ` + + `Reusing existing backend factory.`); + return false; + } + this.registryFactory[backendName] = { factory, priority }; + return true; + } + async setBackend(backendName) { + if (this.registryFactory[backendName] == null) { + throw new Error(`Backend name '${backendName}' not found in registry`); + } + this.backendName = backendName; + if (this.registry[backendName] == null) { + this.backendInstance = null; + const { success, asyncInit } = this.initializeBackend(backendName); + const result = asyncInit ? await success : success; + if (!result) { + return false; + } + } + this.backendInstance = this.registry[backendName]; + this.setupRegisteredKernels(); + // Reset the profiler. + this.profiler = new Profiler(this.backendInstance); + return true; + } + setupRegisteredKernels() { + const kernels = getKernelsForBackend(this.backendName); + kernels.forEach(kernel => { + if (kernel.setupFunc != null) { + kernel.setupFunc(this.backendInstance); + } + }); + } + disposeRegisteredKernels(backendName) { + const kernels = getKernelsForBackend(backendName); + kernels.forEach(kernel => { + if (kernel.disposeFunc != null) { + kernel.disposeFunc(this.registry[backendName]); + } + }); + } + /** + * Initializes a backend by looking up the backend name in the factory + * registry and calling the factory method. Returns a boolean representing + * whether the initialization of the backend suceeded. Throws an error if + * there is no backend in the factory registry. + */ + initializeBackend(backendName) { + const registryFactoryEntry = this.registryFactory[backendName]; + if (registryFactoryEntry == null) { + throw new Error(`Cannot initialize backend ${backendName}, no registration found.`); + } + try { + const backend = registryFactoryEntry.factory(); + // Test if the factory returns a promise. + if (Promise.resolve(backend) === backend) { + const promiseId = ++this.pendingBackendInitId; + const success = backend + .then(backendInstance => { + // Outdated promise. Another backend was set in the meantime. + if (promiseId < this.pendingBackendInitId) { + return false; + } + this.registry[backendName] = backendInstance; + this.pendingBackendInit = null; + return true; + }) + .catch(err => { + // Outdated promise. Another backend was set in the meantime. + if (promiseId < this.pendingBackendInitId) { + return false; + } + this.pendingBackendInit = null; + console.warn(`Initialization of backend ${backendName} failed`); + console.warn(err.stack || err.message); + return false; + }); + this.pendingBackendInit = success; + return { success, asyncInit: true }; + } + else { + this.registry[backendName] = backend; + return { success: true, asyncInit: false }; + } + } + catch (err) { + console.warn(`Initialization of backend ${backendName} failed`); + console.warn(err.stack || err.message); + return { success: false, asyncInit: false }; + } + } + removeBackend(backendName) { + if (!(backendName in this.registryFactory)) { + throw new Error(`${backendName} backend not found in registry`); + } + if (this.backendName === backendName && this.pendingBackendInit != null) { + // There is a pending promise of the backend we want to remove. Make it + // obsolete. + this.pendingBackendInitId++; + } + if (backendName in this.registry) { + this.disposeRegisteredKernels(backendName); + this.registry[backendName].dispose(); + delete this.registry[backendName]; + } + delete this.registryFactory[backendName]; + // Unset the backend if it is active. + if (this.backendName === backendName) { + this.pendingBackendInit = null; + this.backendName = null; + this.backendInstance = null; + } + } + getSortedBackends() { + if (Object.keys(this.registryFactory).length === 0) { + throw new Error('No backend found in registry.'); + } + return Object.keys(this.registryFactory).sort((a, b) => { + // Highest priority comes first. + return this.registryFactory[b].priority - + this.registryFactory[a].priority; + }); + } + initializeBackendsAndReturnBest() { + const sortedBackends = this.getSortedBackends(); + for (let i = 0; i < sortedBackends.length; i++) { + const backendName = sortedBackends[i]; + const { success, asyncInit } = this.initializeBackend(backendName); + if (asyncInit || success) { + return { name: backendName, asyncInit }; + } + } + throw new Error(`Could not initialize any backends, all backend initializations ` + + `failed.`); + } + moveData(backend, dataId) { + const info = this.state.tensorInfo.get(dataId); + const srcBackend = info.backend; + const values = this.readSync(dataId); + // Delete the tensor from the old backend and move it to the new + // backend. + srcBackend.disposeData(dataId); + info.backend = backend; + backend.move(dataId, values, info.shape, info.dtype); + if (this.shouldCheckForMemLeaks()) { + // Track the number of moves during a kernel execution to correctly + // detect memory leaks. + this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]++; + } + } + tidy(nameOrFn, fn) { + let name = null; + if (fn == null) { + // Called with only 1 argument. + if (typeof nameOrFn !== 'function') { + throw new Error('Please provide a function to tidy()'); + } + fn = nameOrFn; + } + else { + // Called with 2 arguments. + if (typeof nameOrFn !== 'string' && !(nameOrFn instanceof String)) { + throw new Error('When calling with two arguments, the first argument ' + + 'to tidy() must be a string'); + } + if (typeof fn !== 'function') { + throw new Error('When calling with two arguments, the 2nd argument ' + + 'to tidy() must be a function'); + } + name = nameOrFn; + // TODO(nsthorat,smilkov): Do operation logging and performance + // profiling. + } + let result; + return this.scopedRun(() => this.startScope(name), () => this.endScope(result), () => { + result = fn(); + if (result instanceof Promise) { + console.error('Cannot return a Promise inside of tidy.'); + } + return result; + }); + } + scopedRun(start, end, f) { + start(); + try { + const res = f(); + end(); + return res; + } + catch (ex) { + end(); + throw ex; + } + } + nextTensorId() { + return Engine.nextTensorId++; + } + nextVariableId() { + return Engine.nextVariableId++; + } + /** + * This method is called instead of the public-facing tensor.clone() when + * saving a tensor for backwards pass. It makes sure to add the clone + * operation to the tape regardless of being called inside a kernel + * execution. + * + * This method will go away once all kernels are modularized since we won't + * need to turn off the tape inside runKernel(). + */ + clone(x) { + const y = this.makeTensorFromDataId(x.dataId, x.shape, x.dtype); + const inputs = { x }; + const grad = (dy) => ({ x: () => dy.toFloat() }); + const saved = []; + this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {}); + return y; + } + /** + * Execute a kernel with the given name and return the output tensor. + * + * @param kernelName The name of the kernel to execute. + * @param inputs A map of input names to tensors. + * @param attrs A map of attribute names to their values. An attribute is a + * primitive (non-tensor) input to the kernel. + * @param inputsToSave A list of tensors, inputs to save for the backprop + * computation. + * @param outputsToSave A list of booleans, specifying which output to save + * for the backprop computation. These are booleans since the output + * tensors are not visible to the user. + */ + runKernel(kernelName, inputs, attrs, inputsToSave, outputsToSave) { + const forwardFunc = null; + const backwardsFunc = null; + // Call runKernel as a stop-gap until we modularize all kernels. + // Once we modularize all kernels, we will remove the existing + // `runKernelFunc`. + return this.runKernelFunc(forwardFunc, inputs, backwardsFunc, kernelName, attrs, inputsToSave, outputsToSave); + } + shouldCheckForMemLeaks() { + return this.ENV.getBool('IS_TEST'); + } + checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos) { + const numDataIdsAfter = this.backend.numDataIds(); + // Count the number of data ids associated with the result of the kernel. + let numOutputDataIds = 0; + outInfos.forEach(info => { + // Complex numbers allocate 3 data ids, one for 'real', one for + // 'imaginary', and one for the container that holds the former two. + numOutputDataIds += (info.dtype === 'complex64' ? 3 : 1); + }); + // Account for the number of moves during kernel execution. A "data move" + // can happen in the middle of a kernel execution, placing a new (key,value) + // pair in the data storage. Since data moves have net zero effect (we + // always remove the data from the old backend), we have to cancel them out + // when detecting memory leaks. + const numMoves = this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]; + const dataIdsLeaked = numDataIdsAfter - numDataIdsBefore - numOutputDataIds - numMoves; + if (dataIdsLeaked > 0) { + throw new Error(`Backend '${this.backendName}' has an internal memory leak ` + + `(${dataIdsLeaked} data ids) after running '${kernelName}'`); + } + } + /** + * @deprecated Use `runKernel` for newly added kernels. Keep using this method + * only for kernels that are not yet fully modularized. + */ + runKernelFunc(forwardFunc, inputs, backwardsFunc, kernelName, attrs, inputsToSave, outputsToSave) { + let outputs; + let saved = []; + const isTapeOn = this.isTapeOn(); + if (kernelName == null) { + kernelName = + this.state.activeScope != null ? this.state.activeScope.name : ''; + } + const startingBytecount = this.state.numBytes; + const startingNumTensors = this.state.numTensors; + if (this.shouldCheckForMemLeaks()) { + this.state.numDataMovesStack.push(0); + } + let kernelFunc; + const kernel = getKernel(kernelName, this.backendName); + let out; + if (kernel != null) { + kernelFunc = () => { + const numDataIdsBefore = this.backend.numDataIds(); + out = kernel.kernelFunc({ inputs, attrs, backend: this.backend }); + const outInfos = Array.isArray(out) ? out : [out]; + if (this.shouldCheckForMemLeaks()) { + this.checkKernelForMemLeak(kernelName, numDataIdsBefore, outInfos); + } + const outTensors = outInfos.map(({ dataId, shape, dtype }) => this.makeTensorFromDataId(dataId, shape, dtype)); + // Save the inputs and outputs. + // Do not save unless we are recording to the tape. Otherwise it would + // cause a mem leak since we would never run backprop, which disposes + // the kept tensors. + if (isTapeOn) { + let tensorsToSave = this.getTensorsForGradient(kernelName, inputs, outTensors); + if (tensorsToSave == null) { + // Fallback for ops that call runKernelFunc and pass in + // inputsToSave and outputsToSave. Currently this is the set of ops + // with kernel support in the WASM backend. Once those ops and + // respective gradients are modularised we can remove this path. + if (outputsToSave == null) { + outputsToSave = []; + } + const outsToSave = outTensors.filter((_, i) => outputsToSave[i]); + tensorsToSave = (inputsToSave || []).slice().concat(outsToSave); + } + saved = this.saveTensorsForBackwardMode(tensorsToSave); + } + return outTensors; + }; + } + else { + const saveFunc = (tensors) => { + // Do not save unless we are recording to the tape. Otherwise it would + // cause a mem leak since we would never run backprop, which disposes + // the kept tensors. + if (!isTapeOn) { + return; + } + saved = tensors.map(tensor => this.keep(this.clone(tensor))); + }; + kernelFunc = () => { + const numDataIdsBefore = this.backend.numDataIds(); + out = this.tidy(() => forwardFunc(this.backend, saveFunc)); + const outs = (Array.isArray(out) ? out : [out]); + if (this.shouldCheckForMemLeaks()) { + this.checkKernelForMemLeak(kernelName, numDataIdsBefore, outs); + } + return outs; + }; + } + // Stop recording to a tape when running a kernel. + this.scopedRun(() => this.state.kernelDepth++, () => this.state.kernelDepth--, () => { + if (!this.ENV.getBool('DEBUG')) { + outputs = kernelFunc(); + } + else { + outputs = this.profiler.profileKernel(kernelName, inputs, () => kernelFunc()); + } + }); + if (isTapeOn) { + this.addTapeNode(kernelName, inputs, outputs, backwardsFunc, saved, attrs); + } + if (this.state.profiling) { + this.state.activeProfile.kernels.push({ + name: kernelName, + bytesAdded: this.state.numBytes - startingBytecount, + totalBytesSnapshot: this.state.numBytes, + tensorsAdded: this.state.numTensors - startingNumTensors, + totalTensorsSnapshot: this.state.numTensors, + inputShapes: Object.keys(inputs).map(key => inputs[key].shape), + outputShapes: outputs.map(item => item.shape) + }); + } + return (Array.isArray(out) ? outputs : outputs[0]); + } + /** + * Saves tensors used in forward mode for use in backward mode. + * + * @param tensors the list of tensors to save. + */ + saveTensorsForBackwardMode(tensors) { + const saved = tensors.map(tensor => this.keep(this.clone(tensor))); + return saved; + } + /** + * Returns a list of tensors to save for a given gradient calculation. + * + * Returns undefined if their is no registered gradient for this kernel in the + * gradient registry. + * + * @param kernelName name of kernel to look up gradient for. + * @param inputs a map of input tensors. + * @param outputs an array of output tensors from forward mode of kernel. + */ + getTensorsForGradient(kernelName, inputs, outputs) { + const gradConfig = getGradient(kernelName); + if (gradConfig != null) { + const inputsToSave = gradConfig.inputsToSave || []; + const outputsToSave = gradConfig.outputsToSave || []; + // If saveAllInputs is true, all inputs will be saved. Otherwise, inputs + // specified in inputsToSave will be saved. + let inputTensorsToSave; + if (gradConfig.saveAllInputs) { + assert(Array.isArray(inputs), () => 'saveAllInputs is true, expected inputs to be an array.'); + inputTensorsToSave = Object.keys(inputs).map((key) => inputs[key]); + } + else { + inputTensorsToSave = inputsToSave.map((inputName) => inputs[inputName]); + } + const outputTensorsToSave = outputs.filter((_, i) => outputsToSave[i]); + return inputTensorsToSave.concat(outputTensorsToSave); + } + // TODO(yassogba) throw exception here once all runkernelFunc calls with + // inputsToSave/outputsToSave are removed + return null; + } + /** + * Internal method used by public APIs for tensor creation. Makes a new + * tensor with the provided shape, dtype and values. It always + * creates a new data id and writes the values to the underlying backend. + */ + makeTensor(values, shape, dtype, backend) { + if (values == null) { + throw new Error('Values passed to engine.makeTensor() are null'); + } + dtype = dtype || 'float32'; + backend = backend || this.backend; + let backendVals = values; + if (dtype === 'string' && isString(values[0])) { + backendVals = values.map(d => encodeString(d)); + } + const dataId = backend.write(backendVals, shape, dtype); + const t = new Tensor(shape, dtype, dataId, this.nextTensorId()); + this.incRef(t, backend); + // Count bytes for string tensors. + if (dtype === 'string') { + const info = this.state.tensorInfo.get(dataId); + const newBytes = bytesFromStringArray(backendVals); + this.state.numBytes += newBytes - info.bytes; + info.bytes = newBytes; + } + return t; + } + /** + * Internal method used by backends. Makes a new tensor + * that is a wrapper around an existing data id. It doesn't create + * a new data id, only increments the ref count used in memory tracking. + */ + makeTensorFromDataId(dataId, shape, dtype, backend) { + dtype = dtype || 'float32'; + const t = new Tensor(shape, dtype, dataId, this.nextTensorId()); + this.incRef(t, backend); + return t; + } + makeVariable(initialValue, trainable = true, name, dtype) { + name = name || this.nextVariableId().toString(); + if (dtype != null && dtype !== initialValue.dtype) { + initialValue = initialValue.asType(dtype); + } + const v = new Variable(initialValue, trainable, name, this.nextTensorId()); + if (this.state.registeredVariables[v.name] != null) { + throw new Error(`Variable with name ${v.name} was already registered`); + } + this.state.registeredVariables[v.name] = v; + this.incRef(v, this.backend); + return v; + } + incRef(a, backend) { + const refCount = this.state.tensorInfo.has(a.dataId) ? + this.state.tensorInfo.get(a.dataId).refCount : + 0; + this.state.numTensors++; + if (a.dtype === 'string') { + this.state.numStringTensors++; + } + if (refCount === 0) { + this.state.numDataBuffers++; + // Bytes for complex numbers are counted by their components. Bytes for + // string tensors are counted when writing values. + let bytes = 0; + if (a.dtype !== 'complex64' && a.dtype !== 'string') { + bytes = a.size * bytesPerElement(a.dtype); + } + this.state.tensorInfo.set(a.dataId, { + backend: backend || this.backend, + dtype: a.dtype, + shape: a.shape, + bytes, + refCount: 0 + }); + this.state.numBytes += bytes; + } + this.state.tensorInfo.get(a.dataId).refCount++; + if (!(a instanceof Variable)) { + this.track(a); + } + } + disposeTensor(a) { + if (!this.state.tensorInfo.has(a.dataId)) { + return; + } + this.state.numTensors--; + if (a.dtype === 'string') { + this.state.numStringTensors--; + } + const info = this.state.tensorInfo.get(a.dataId); + const refCount = info.refCount; + if (refCount <= 1) { + // Don't count bytes for complex numbers as they are counted by their + // components. + if (a.dtype !== 'complex64') { + this.state.numBytes -= info.bytes; + } + this.state.numDataBuffers--; + info.backend.disposeData(a.dataId); + this.state.tensorInfo.delete(a.dataId); + } + else { + this.state.tensorInfo.get(a.dataId).refCount--; + } + // TODO(nsthorat): Construct an error and save the stack trace for + // debugging when in debug mode. Creating a stack trace is too expensive + // to do unconditionally. + } + disposeVariables() { + for (const varName in this.state.registeredVariables) { + const v = this.state.registeredVariables[varName]; + this.disposeVariable(v); + } + } + disposeVariable(v) { + this.disposeTensor(v); + if (this.state.registeredVariables[v.name] != null) { + delete this.state.registeredVariables[v.name]; + } + } + memory() { + const info = this.backend.memory(); + info.numTensors = this.state.numTensors; + info.numDataBuffers = this.state.numDataBuffers; + info.numBytes = this.state.numBytes; + if (this.state.numStringTensors > 0) { + info.unreliable = true; + if (info.reasons == null) { + info.reasons = []; + } + info.reasons.push('Memory usage by string tensors is approximate ' + + '(2 bytes per character)'); + } + return info; + } + async profile(query) { + this.state.profiling = true; + const startBytes = this.state.numBytes; + const startNumTensors = this.state.numTensors; + this.state.activeProfile.kernels = []; + this.state.activeProfile.result = query(); + this.state.profiling = false; + this.state.activeProfile.peakBytes = Math.max(...this.state.activeProfile.kernels.map(d => d.totalBytesSnapshot)); + this.state.activeProfile.newBytes = this.state.numBytes - startBytes; + this.state.activeProfile.newTensors = + this.state.numTensors - startNumTensors; + return this.state.activeProfile; + } + isTapeOn() { + return this.state.gradientDepth > 0 && this.state.kernelDepth === 0; + } + addTapeNode(kernelName, inputs, outputs, gradientsFunc, saved, attrs) { + const tapeNode = { id: this.state.nextTapeNodeId++, kernelName, inputs, outputs, saved }; + const gradConfig = getGradient(kernelName); + if (gradConfig != null) { + gradientsFunc = gradConfig.gradFunc; + } + if (gradientsFunc != null) { + tapeNode.gradient = (dys) => { + // TODO(smilkov): To optimize back-prop, pass dys that are not used in + // the backprop graph to the user as null instead of zeros + dys = dys.map((dy, i) => { + if (dy == null) { + const output = outputs[i]; + const vals = makeZerosTypedArray(output.size, output.dtype); + return this.makeTensor(vals, output.shape, output.dtype); + } + return dy; + }); + // Grad functions of ops with single outputs expect a dy, while ops + // with multiple outputs expect dys (array of dy). + return gradientsFunc(dys.length > 1 ? dys : dys[0], saved, attrs); + }; + } + this.state.activeTape.push(tapeNode); + } + keep(result) { + result.kept = true; + return result; + } + startTape() { + if (this.state.gradientDepth === 0) { + this.state.activeTape = []; + } + this.state.gradientDepth++; + } + endTape() { + this.state.gradientDepth--; + } + /** + * Start a scope. Use this with endScope() to achieve the same functionality + * as scope() without the need for a function closure. + */ + startScope(name) { + const scopeInfo = { + track: [], + name: 'unnamed scope', + id: this.state.nextScopeId++ + }; + if (name) { + scopeInfo.name = name; + } + this.state.scopeStack.push(scopeInfo); + this.state.activeScope = scopeInfo; + } + /** + * End a scope. Use this with startScope() to achieve the same functionality + * as scope() without the need for a function closure. + */ + endScope(result) { + const tensorsToTrackInParent = getTensorsInContainer(result); + const tensorsToTrackInParentSet = new Set(tensorsToTrackInParent.map(t => t.id)); + // Dispose the arrays tracked in this scope. + for (let i = 0; i < this.state.activeScope.track.length; i++) { + const tensor = this.state.activeScope.track[i]; + if (!tensor.kept && !tensorsToTrackInParentSet.has(tensor.id)) { + tensor.dispose(); + } + } + const oldScope = this.state.scopeStack.pop(); + this.state.activeScope = this.state.scopeStack.length === 0 ? + null : + this.state.scopeStack[this.state.scopeStack.length - 1]; + // Track the current result in the parent scope. + tensorsToTrackInParent.forEach(tensor => { + // Only track the tensor if was allocated in the inner scope and is not + // globally kept. + if (!tensor.kept && tensor.scopeId === oldScope.id) { + this.track(tensor); + } + }); + } + /** + * Returns gradients of `f` with respect to each of the `xs`. The gradients + * returned are of the same length as `xs`, but some might be null if `f` + * was not a function of that `x`. It also takes optional dy to multiply the + * gradient, which defaults to `1`. + */ + gradients(f, xs, dy, allowNoGradients = false) { + assert(xs.length > 0, () => 'gradients() received an empty list of xs.'); + if (dy != null && dy.dtype !== 'float32') { + throw new Error(`dy must have 'float32' dtype, but has '${dy.dtype}'`); + } + const y = this.scopedRun(() => this.startTape(), () => this.endTape(), () => this.tidy('forward', f)); + assert(y instanceof Tensor, () => 'The result y returned by f() must be a tensor.'); + // Filter out the nodes that don't connect x => y. + const filteredTape = getFilteredNodesXToY(this.state.activeTape, xs, y); + if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) { + throw new Error('Cannot compute gradient of y=f(x) with respect to x. Make sure ' + + 'that the f you passed encloses all operations that lead from x ' + + 'to y.'); + } + return this.tidy('backward', () => { + const accumulatedGradientMap = {}; + accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy; + // Backprop gradients through the filtered nodes. + backpropagateGradients(accumulatedGradientMap, filteredTape, + // Pass the tidy function to avoid circular dep with `tape.ts`. + f => this.tidy(f)); + const grads = xs.map(x => accumulatedGradientMap[x.id]); + if (this.state.gradientDepth === 0) { + // This means that we are not computing higher-order gradients + // and can clean up the tape. + this.state.activeTape.forEach(node => { + for (const tensor of node.saved) { + tensor.dispose(); + } + }); + this.state.activeTape = null; + } + return { value: y, grads }; + }); + } + customGrad(f) { + assert(isFunction(f), () => 'The f passed in customGrad(f) must be a function.'); + return (...inputs) => { + assert(inputs.every(t => t instanceof Tensor), () => 'The args passed in customGrad(f)(x1, x2,...) must all be ' + + 'tensors'); + let res; + const inputMap = {}; + inputs.forEach((input, i) => { + inputMap[i] = input; + }); + return this.runKernelFunc((_, save) => { + res = f(...[...inputs, save]); + assert(res.value instanceof Tensor, () => 'The function f passed in customGrad(f) must return an ' + + 'object where `obj.value` is a tensor'); + assert(isFunction(res.gradFunc), () => 'The function f passed in customGrad(f) must return an ' + + 'object where `obj.gradFunc` is a function.'); + return res.value; + }, inputMap, (dy, saved) => { + const gradRes = res.gradFunc(dy, saved); + const grads = Array.isArray(gradRes) ? gradRes : [gradRes]; + assert(grads.length === inputs.length, () => 'The function f passed in customGrad(f) must return an ' + + 'object where `obj.gradFunc` is a function that returns ' + + 'the same number of tensors as inputs passed to f(...).'); + assert(grads.every(t => t instanceof Tensor), () => 'The function f passed in customGrad(f) must return an ' + + 'object where `obj.gradFunc` is a function that returns ' + + 'a list of only tensors.'); + const gradMap = {}; + grads.forEach((grad, i) => { + gradMap[i] = () => grad; + }); + return gradMap; + }); + }; + } + readSync(dataId) { + // Route the read to the correct backend. + const info = this.state.tensorInfo.get(dataId); + return info.backend.readSync(dataId); + } + read(dataId) { + // Route the read to the correct backend. + const info = this.state.tensorInfo.get(dataId); + return info.backend.read(dataId); + } + async time(query) { + const start = now(); + const timingInfo = await this.backend.time(query); + timingInfo.wallMs = now() - start; + return timingInfo; + } + /** + * Tracks a Tensor in the current scope to be automatically cleaned up + * when the current scope ends, and returns the value. + * + * @param result The Tensor to track in the current scope. + */ + track(result) { + if (this.state.activeScope != null) { + result.scopeId = this.state.activeScope.id; + this.state.activeScope.track.push(result); + } + return result; + } + get registeredVariables() { + return this.state.registeredVariables; + } + /** + * Resets the engine state. Removes all backends but does not remove + * registered backend factories. + */ + reset() { + // Make any pending promise obsolete. + this.pendingBackendInitId++; + this.state.dispose(); + this.ENV.reset(); + this.state = new EngineState(); + for (const backendName in this.registry) { + this.disposeRegisteredKernels(backendName); + this.registry[backendName].dispose(); + delete this.registry[backendName]; + } + this.backendName = null; + this.backendInstance = null; + this.pendingBackendInit = null; + } + } + Engine.nextTensorId = 0; + Engine.nextVariableId = 0; + function ones(shape) { + const values = makeOnesTypedArray(sizeFromShape(shape), 'float32'); + return ENGINE.makeTensor(values, shape, 'float32'); + } + function getOrMakeEngine() { + const ns = getGlobalNamespace(); + if (ns._tfengine == null) { + const environment = new Environment(ns); + ns._tfengine = new Engine(environment); + } + setEnvironmentGlobal(ns._tfengine.ENV); + // Tell the current tensor interface that the global engine is responsible + // for tracking. + setTensorTracker(() => ns._tfengine); + return ns._tfengine; + } + const ENGINE = getOrMakeEngine(); + + /** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + // tslint:disable-next-line:no-any + function _isNavigatorDefined() { + return typeof navigator !== 'undefined' && navigator != null; + } + function isMobile() { + if (_isNavigatorDefined()) { + // tslint:disable-next-line:no-any + const a = navigator.userAgent || navigator.vendor || window.opera; + // tslint:disable-next-line:max-line-length + return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i + .test(a) || + // tslint:disable-next-line:max-line-length + /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i + .test(a.substr(0, 4)); + } + return false; + } + function isBrowser() { + return (typeof window !== 'undefined' && window.document != null) || + //@ts-ignore + (typeof WorkerGlobalScope !== 'undefined'); + } + + var device_util = /*#__PURE__*/Object.freeze({ + __proto__: null, + isMobile: isMobile, + isBrowser: isBrowser + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const ENV = env(); + /** + * This file contains environment-related flag registrations. + */ + /** Whether to enable debug mode. */ + ENV.registerFlag('DEBUG', () => false, debugValue => { + if (debugValue) { + console.warn('Debugging mode is ON. The output of every math call will ' + + 'be downloaded to CPU and checked for NaNs. ' + + 'This significantly impacts performance.'); + } + }); + /** Whether we are in a browser (as versus, say, node.js) environment. */ + ENV.registerFlag('IS_BROWSER', () => isBrowser()); + /** Whether we are in a browser (as versus, say, node.js) environment. */ + ENV.registerFlag('IS_NODE', () => (typeof process !== 'undefined') && + (typeof process.versions !== 'undefined') && + (typeof process.versions.node !== 'undefined')); + /** Whether this browser is Chrome. */ + ENV.registerFlag('IS_CHROME', () => typeof navigator !== 'undefined' && navigator != null && + navigator.userAgent != null && /Chrome/.test(navigator.userAgent) && + /Google Inc/.test(navigator.vendor)); + /** + * True when the environment is "production" where we disable safety checks + * to gain performance. + */ + ENV.registerFlag('PROD', () => false); + /** + * Whether to do sanity checks when inferring a shape from user-provided + * values, used when creating a new tensor. + */ + ENV.registerFlag('TENSORLIKE_CHECK_SHAPE_CONSISTENCY', () => ENV.getBool('DEBUG')); + /** Whether deprecation warnings are enabled. */ + ENV.registerFlag('DEPRECATION_WARNINGS_ENABLED', () => true); + /** True if running unit tests. */ + ENV.registerFlag('IS_TEST', () => false); + + const Add = 'Add'; + const AddN = 'AddN'; + const BatchMatMul = 'BatchMatMul'; + const BroadcastTo = 'BroadcastTo'; + const Concat = 'Concat'; + const Conv2D = 'Conv2D'; + const Conv2DBackpropFilter = 'Conv2DBackpropFilter'; + const Conv2DBackpropInput = 'Conv2DBackpropInput'; + const Conv3D = 'Conv3D'; + const Conv3DBackpropFilterV2 = 'Conv3DBackpropFilterV2'; + const Conv3DBackpropInputV2 = 'Conv3DBackpropInputV2'; + const DepthwiseConv2dNative = 'DepthwiseConv2dNative'; + const DepthwiseConv2dNativeBackpropFilter = 'DepthwiseConv2dNativeBackpropFilter'; + const DepthwiseConv2dNativeBackpropInput = 'DepthwiseConv2dNativeBackpropInput'; + const Diag = 'Diag'; + const Div = 'Div'; + const Equal = 'Equal'; + const FusedBatchNorm = 'FusedBatchNorm'; + const Greater = 'Greater'; + const GreaterEqual = 'GreaterEqual'; + const Identity = 'Identity'; + const Less = 'Less'; + const LessEqual = 'LessEqual'; + const LRN = 'LRN'; + const LRNBackprop = 'LRNBackprop'; + const MaxPoolWithArgmax = 'MaxPoolWithArgmax'; + const NotEqual = 'NotEqual'; + const NonMaxSuppressionV5 = 'NonMaxSuppressionV5'; + const Max = 'Max'; + const OneHot = 'OneHot'; + const PadV2 = 'PadV2'; + const SplitV = 'SplitV'; + const SquaredDifference = 'SquaredDifference'; + const Square = 'Square'; + const Sub = 'Sub'; + const Tile = 'Tile'; + const Transpose = 'Transpose'; + /** + * TensorFlow.js-only kernels + */ + const FromPixels = 'FromPixels'; + + /** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Returns the dimensions in the input shape that are broadcasted to + * produce the provided output shape. + * + * The returned dimensions are 0-indexed and sorted. An example: + * inShape = [4, 1, 3] + * outShape = [5, 4, 3, 3] + * result = [1]. Dimension 1 (2nd dimension of input) gets broadcasted 1 => 3. + */ + function getBroadcastDims(inShape, outShape) { + const inRank = inShape.length; + const dims = []; + for (let i = 0; i < inRank; i++) { + const dim = inRank - 1 - i; + const a = inShape[dim] || 1; + const b = outShape[outShape.length - 1 - i] || 1; + if (b > 1 && a === 1) { + dims.unshift(dim); + } + } + return dims; + } + /** + * Returns the axes in the output space that should be reduced to produce + * the input space. + */ + function getReductionAxes(inShape, outShape) { + const result = []; + for (let i = 0; i < outShape.length; i++) { + const inDim = inShape[inShape.length - i - 1]; + const outAxis = outShape.length - i - 1; + const outDim = outShape[outAxis]; + if (inDim == null || (inDim === 1 && outDim > 1)) { + result.unshift(outAxis); + } + } + return result; + } + function assertAndGetBroadcastShape(shapeA, shapeB) { + const result = []; + const l = Math.max(shapeA.length, shapeB.length); + for (let i = 0; i < l; i++) { + let a = shapeA[shapeA.length - i - 1]; + if (a == null) { + a = 1; + } + let b = shapeB[shapeB.length - i - 1]; + if (b == null) { + b = 1; + } + if (a === 1) { + result.unshift(b); + } + else if (b === 1) { + result.unshift(a); + } + else if (a !== b) { + const errMsg = `Operands could not be broadcast together with shapes ` + + `${shapeA} and ${shapeB}.`; + throw Error(errMsg); + } + else { + result.unshift(a); + } + } + return result; + } + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const addGradConfig = { + kernelName: Add, + inputsToSave: ['a', 'b'], + gradFunc: (dy, saved) => { + const [a, b] = saved; + const outShape = assertAndGetBroadcastShape(a.shape, b.shape); + const derA = () => { + let res = dy; + const reduceAxes = getReductionAxes(a.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes); + } + return res.reshape(a.shape); + }; + const derB = () => { + let res = dy; + const reduceAxes = getReductionAxes(b.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes); + } + return res.reshape(b.shape); + }; + return { a: derA, b: derB }; + } + }; + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const addNGradConfig = { + kernelName: AddN, + saveAllInputs: true, + gradFunc: (dy, saved) => { + const ders = {}; + saved.forEach((_, i) => { + ders[i] = () => dy.clone(); + }); + return ders; + } + }; + + /** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + function inferShape(val, dtype) { + let firstElem = val; + if (isTypedArray(val)) { + return dtype === 'string' ? [] : [val.length]; + } + if (!Array.isArray(val)) { + return []; // Scalar. + } + const shape = []; + while (Array.isArray(firstElem) || + isTypedArray(firstElem) && dtype !== 'string') { + shape.push(firstElem.length); + firstElem = firstElem[0]; + } + if (Array.isArray(val) && + env().getBool('TENSORLIKE_CHECK_SHAPE_CONSISTENCY')) { + deepAssertShapeConsistency(val, shape, []); + } + return shape; + } + function deepAssertShapeConsistency(val, shape, indices) { + indices = indices || []; + if (!(Array.isArray(val)) && !isTypedArray(val)) { + assert(shape.length === 0, () => `Element arr[${indices.join('][')}] is a primitive, ` + + `but should be an array/TypedArray of ${shape[0]} elements`); + return; + } + assert(shape.length > 0, () => `Element arr[${indices.join('][')}] should be a primitive, ` + + `but is an array of ${val.length} elements`); + assert(val.length === shape[0], () => `Element arr[${indices.join('][')}] should have ${shape[0]} ` + + `elements, but has ${val.length} elements`); + const subShape = shape.slice(1); + for (let i = 0; i < val.length; ++i) { + deepAssertShapeConsistency(val[i], subShape, indices.concat(i)); + } + } + function assertDtype(expectedDtype, actualDType, argName, functionName) { + if (expectedDtype == null) { + return; + } + if (expectedDtype !== 'numeric' && expectedDtype !== actualDType || + expectedDtype === 'numeric' && actualDType === 'string') { + throw new Error(`Argument '${argName}' passed to '${functionName}' must ` + + `be ${expectedDtype} tensor, but got ${actualDType} tensor`); + } + } + function convertToTensor(x, argName, functionName, parseAsDtype = 'numeric') { + if (x instanceof Tensor) { + assertDtype(parseAsDtype, x.dtype, argName, functionName); + return x; + } + let inferredDtype = inferDtype(x); + // If the user expects a bool/int/float, use that info to update the + // inferredDtype when it is not a string. + if (inferredDtype !== 'string' && + ['bool', 'int32', 'float32'].indexOf(parseAsDtype) >= 0) { + inferredDtype = parseAsDtype; + } + assertDtype(parseAsDtype, inferredDtype, argName, functionName); + if ((x == null) || + (!isTypedArray(x) && !Array.isArray(x) && typeof x !== 'number' && + typeof x !== 'boolean' && typeof x !== 'string')) { + const type = x == null ? 'null' : x.constructor.name; + throw new Error(`Argument '${argName}' passed to '${functionName}' must be a ` + + `Tensor or TensorLike, but got '${type}'`); + } + const inferredShape = inferShape(x, inferredDtype); + if (!isTypedArray(x) && !Array.isArray(x)) { + x = [x]; + } + const skipTypedArray = true; + const values = inferredDtype !== 'string' ? + toTypedArray(x, inferredDtype, env().getBool('DEBUG')) : + flatten(x, [], skipTypedArray); + return ENGINE.makeTensor(values, inferredShape, inferredDtype); + } + function convertToTensorArray(arg, argName, functionName, parseAsDtype = 'numeric') { + if (!Array.isArray(arg)) { + throw new Error(`Argument ${argName} passed to ${functionName} must be a ` + + '`Tensor[]` or `TensorLike[]`'); + } + const tensors = arg; + return tensors.map((t, i) => convertToTensor(t, `${argName}[${i}]`, functionName), parseAsDtype); + } + + /** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Returns true if the axis specifies the inner most dimensions of the + * array. + */ + function axesAreInnerMostDims(axes, rank) { + for (let i = 0; i < axes.length; ++i) { + if (axes[axes.length - i - 1] !== rank - 1 - i) { + return false; + } + } + return true; + } + function combineLocations(outputLoc, reduceLoc, axes) { + const rank = outputLoc.length + reduceLoc.length; + const loc = []; + let outIdx = 0; + let reduceIdx = 0; + for (let dim = 0; dim < rank; dim++) { + if (axes.indexOf(dim) === -1) { + loc.push(outputLoc[outIdx++]); + } + else { + loc.push(reduceLoc[reduceIdx++]); + } + } + return loc; + } + function computeOutAndReduceShapes(aShape, axes) { + const outShape = []; + const rank = aShape.length; + for (let dim = 0; dim < rank; dim++) { + if (axes.indexOf(dim) === -1) { + outShape.push(aShape[dim]); + } + } + const reduceShape = axes.map(dim => aShape[dim]); + return [outShape, reduceShape]; + } + function expandShapeToKeepDim(shape, axes) { + const reduceSubShape = axes.map(x => 1); + return combineLocations(shape, reduceSubShape, axes); + } + function assertAxesAreInnerMostDims(msg, axes, rank) { + assert(axesAreInnerMostDims(axes, rank), () => `${msg} supports only inner-most axes for now. ` + + `Got axes ${axes} and rank-${rank} input.`); + } + /** + * Returns the axes permutation to be used with `tf.transpose`, if such + * permutation is necessary. Otherwise it returns null. This method is used by + * operations that operate only on inner-most axes. + */ + function getAxesPermutation(axes, rank) { + if (axesAreInnerMostDims(axes, rank)) { + return null; + } + const result = []; + for (let i = 0; i < rank; ++i) { + if (axes.indexOf(i) === -1) { + result.push(i); + } + } + axes.forEach(axis => result.push(axis)); + return result; + } + /** Returns the axes permutation that undoes the original permutation. */ + function getUndoAxesPermutation(axes) { + return axes.map((axis, i) => [i, axis]) + .sort((a, b) => a[1] - b[1]) + .map(x => x[0]); + } + function getInnerMostAxes(numAxes, rank) { + const res = []; + for (let i = rank - numAxes; i < rank; ++i) { + res.push(i); + } + return res; + } + + /** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + function assertParamsConsistent(shapes, axis) { + const rank = shapes[0].length; + shapes.forEach((shape, i) => { + assert(shape.length === rank, () => `Error in concat${rank}D: rank of tensors[${i}] must be the same ` + + `as the rank of the rest (${rank})`); + }); + assert(axis >= 0 && axis < rank, () => `Error in concat${rank}D: axis must be between 0 and ${rank - 1}.`); + const firstShape = shapes[0]; + shapes.forEach((shape, i) => { + for (let r = 0; r < rank; r++) { + assert((r === axis) || (shape[r] === firstShape[r]), () => `Error in concat${rank}D: Shape of tensors[${i}] (${shape}) ` + + `does not match the shape of the rest (${firstShape}) ` + + `along the non-concatenated axis ${i}.`); + } + }); + } + function computeOutShape(shapes, axis) { + const outputShape = shapes[0].slice(); + for (let i = 1; i < shapes.length; i++) { + outputShape[axis] += shapes[i][axis]; + } + return outputShape; + } + + /** + * @license + * Copyright 2018 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Used for wrapping functions that perform math operations on + * Tensors. The function will be wrapped in a named scope that cleans all + * memory usage after the function is done. + */ + function op(f) { + const keys = Object.keys(f); + if (keys.length !== 1) { + throw new Error(`Please provide an object with a single key ` + + `(operation name) mapping to a function. Got an object with ` + + `${keys.length} keys.`); + } + let opName = keys[0]; + const fn = f[opName]; + // Strip the underscore from the end of the function name. + if (opName.endsWith('_')) { + opName = opName.substring(0, opName.length - 1); + } + // tslint:disable-next-line:no-any + const f2 = (...args) => { + ENGINE.startScope(opName); + try { + const result = fn(...args); + if (result instanceof Promise) { + console.error('Cannot return a Promise inside of tidy.'); + } + ENGINE.endScope(result); + return result; + } + catch (ex) { + ENGINE.endScope(null); + throw ex; + } + }; + Object.defineProperty(f2, 'name', { value: opName, configurable: true }); + // tslint:disable-next-line:no-any + return f2; + } + + /** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Converts two real numbers to a complex number. + * + * Given a tensor `real` representing the real part of a complex number, and a + * tensor `imag` representing the imaginary part of a complex number, this + * operation returns complex numbers elementwise of the form [r0, i0, r1, i1], + * where r represents the real part and i represents the imag part. + * + * The input tensors real and imag must have the same shape. + * + * ```js + * const real = tf.tensor1d([2.25, 3.25]); + * const imag = tf.tensor1d([4.75, 5.75]); + * const complex = tf.complex(real, imag); + * + * complex.print(); + * ``` + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + function complex_(real, imag) { + const $real = convertToTensor(real, 'real', 'complex'); + const $imag = convertToTensor(imag, 'imag', 'complex'); + assertShapesMatch($real.shape, $imag.shape, `real and imag shapes, ${$real.shape} and ${$imag.shape}, ` + + `must match in call to tf.complex().`); + return ENGINE.runKernelFunc(backend => backend.complex($real, $imag), { $real, $imag }); + } + /** + * Returns the real part of a complex (or real) tensor. + * + * Given a tensor input, this operation returns a tensor of type float that is + * the real part of each element in input considered as a complex number. + * + * If the input is real, it simply makes a clone. + * + * ```js + * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]); + * tf.real(x).print(); + * ``` + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + function real_(input) { + const $input = convertToTensor(input, 'input', 'real'); + return ENGINE.runKernelFunc(backend => backend.real($input), { $input }); + } + /** + * Returns the imaginary part of a complex (or real) tensor. + * + * Given a tensor input, this operation returns a tensor of type float that is + * the imaginary part of each element in input considered as a complex number. + * If input is real, a tensor of all zeros is returned. + * + * ```js + * const x = tf.complex([-2.25, 3.25], [4.75, 5.75]); + * tf.imag(x).print(); + * ``` + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + function imag_(input) { + const $input = convertToTensor(input, 'input', 'imag'); + return ENGINE.runKernelFunc(backend => backend.imag($input), { $input }); + } + const complex = op({ complex_ }); + const real = op({ real_ }); + const imag = op({ imag_ }); + + /** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Creates a `tf.Tensor` with the provided values, shape and dtype. + * + * ```js + * // Pass an array of values to create a vector. + * tf.tensor([1, 2, 3, 4]).print(); + * ``` + * + * ```js + * // Pass a nested array of values to make a matrix or a higher + * // dimensional tensor. + * tf.tensor([[1, 2], [3, 4]]).print(); + * ``` + * + * ```js + * // Pass a flat array and specify a shape yourself. + * tf.tensor([1, 2, 3, 4], [2, 2]).print(); + * ``` + * + * @param values The values of the tensor. Can be nested array of numbers, + * or a flat array, or a `TypedArray`. If the values are strings, + * they will be encoded as utf-8 and kept as `Uint8Array[]`. + * @param shape The shape of the tensor. Optional. If not provided, + * it is inferred from `values`. + * @param dtype The data type. + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + function tensor(values, shape, dtype) { + const inferredShape = inferShape(values, dtype); + return makeTensor(values, shape, inferredShape, dtype); + } + /** This is shared code across all tensor creation methods. */ + function makeTensor(values, shape, inferredShape, dtype) { + if (dtype == null) { + dtype = inferDtype(values); + } + if (dtype === 'complex64') { + throw new Error(`Cannot construct a complex64 tensor directly. ` + + `Please use tf.complex(real, imag).`); + } + if (!isTypedArray(values) && !Array.isArray(values) && + typeof values !== 'number' && typeof values !== 'boolean' && + typeof values !== 'string') { + throw new Error('values passed to tensor(values) must be a number/boolean/string or ' + + 'an array of numbers/booleans/strings, or a TypedArray'); + } + if (shape != null) { + assertNonNegativeIntegerDimensions(shape); + const providedSize = sizeFromShape(shape); + const inferredSize = sizeFromShape(inferredShape); + assert(providedSize === inferredSize, () => `Based on the provided shape, [${shape}], the tensor should have ` + + `${providedSize} values but has ${inferredSize}`); + for (let i = 0; i < inferredShape.length; ++i) { + const inferred = inferredShape[i]; + const flatDimsDontMatch = i === inferredShape.length - 1 ? + inferred !== sizeFromShape(shape.slice(i)) : + true; + assert(inferredShape[i] === shape[i] || !flatDimsDontMatch, () => `Error creating a new Tensor. Inferred shape ` + + `(${inferredShape}) does not match the provided ` + + `shape (${shape}). `); + } + } + if (!isTypedArray(values) && !Array.isArray(values)) { + values = [values]; + } + shape = shape || inferredShape; + values = dtype !== 'string' ? + toTypedArray(values, dtype, env().getBool('DEBUG')) : + flatten(values, [], true); + return ENGINE.makeTensor(values, shape, dtype); + } + /** + * Creates rank-0 `tf.Tensor` (scalar) with the provided value and dtype. + * + * The same functionality can be achieved with `tf.tensor`, but in general + * we recommend using `tf.scalar` as it makes the code more readable. + * + * ```js + * tf.scalar(3.14).print(); + * ``` + * + * @param value The value of the scalar. + * @param dtype The data type. + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + function scalar(value, dtype) { + if (((isTypedArray(value) && dtype !== 'string') || Array.isArray(value)) && + dtype !== 'complex64') { + throw new Error('Error creating a new Scalar: value must be a primitive ' + + '(number|boolean|string)'); + } + if (dtype === 'string' && isTypedArray(value) && + !(value instanceof Uint8Array)) { + throw new Error('When making a scalar from encoded string, ' + + 'the value must be `Uint8Array`.'); + } + const shape = []; + const inferredShape = []; + return makeTensor(value, shape, inferredShape, dtype); + } + /** + * Creates rank-1 `tf.Tensor` with the provided values, shape and dtype. + * + * The same functionality can be achieved with `tf.tensor`, but in general + * we recommend using `tf.tensor1d` as it makes the code more readable. + * + * ```js + * tf.tensor1d([1, 2, 3]).print(); + * ``` + * + * @param values The values of the tensor. Can be array of numbers, + * or a `TypedArray`. + * @param dtype The data type. + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + function tensor1d(values, dtype) { + assertNonNull(values); + const inferredShape = inferShape(values, dtype); + if (inferredShape.length !== 1) { + throw new Error('tensor1d() requires values to be a flat/TypedArray'); + } + const shape = null; + return makeTensor(values, shape, inferredShape, dtype); + } + /** + * Creates rank-2 `tf.Tensor` with the provided values, shape and dtype. + * + * The same functionality can be achieved with `tf.tensor`, but in general + * we recommend using `tf.tensor2d` as it makes the code more readable. + * + * ```js + * // Pass a nested array. + * tf.tensor2d([[1, 2], [3, 4]]).print(); + * ``` + * ```js + * // Pass a flat array and specify a shape. + * tf.tensor2d([1, 2, 3, 4], [2, 2]).print(); + * ``` + * + * @param values The values of the tensor. Can be nested array of numbers, + * or a flat array, or a `TypedArray`. + * @param shape The shape of the tensor. If not provided, it is inferred from + * `values`. + * @param dtype The data type. + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + function tensor2d(values, shape, dtype) { + assertNonNull(values); + if (shape != null && shape.length !== 2) { + throw new Error('tensor2d() requires shape to have two numbers'); + } + const inferredShape = inferShape(values, dtype); + if (inferredShape.length !== 2 && inferredShape.length !== 1) { + throw new Error('tensor2d() requires values to be number[][] or flat/TypedArray'); + } + if (inferredShape.length === 1 && shape == null) { + throw new Error('tensor2d() requires shape to be provided when `values` ' + + 'are a flat/TypedArray'); + } + return makeTensor(values, shape, inferredShape, dtype); + } + /** + * Creates rank-3 `tf.Tensor` with the provided values, shape and dtype. + * + * The same functionality can be achieved with `tf.tensor`, but in general + * we recommend using `tf.tensor3d` as it makes the code more readable. + * + * ```js + * // Pass a nested array. + * tf.tensor3d([[[1], [2]], [[3], [4]]]).print(); + * ``` + * ```js + * // Pass a flat array and specify a shape. + * tf.tensor3d([1, 2, 3, 4], [2, 2, 1]).print(); + * ``` + * + * @param values The values of the tensor. Can be nested array of numbers, + * or a flat array, or a `TypedArray`. + * @param shape The shape of the tensor. If not provided, it is inferred from + * `values`. + * @param dtype The data type. + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + function tensor3d(values, shape, dtype) { + assertNonNull(values); + if (shape != null && shape.length !== 3) { + throw new Error('tensor3d() requires shape to have three numbers'); + } + const inferredShape = inferShape(values, dtype); + if (inferredShape.length !== 3 && inferredShape.length !== 1) { + throw new Error('tensor3d() requires values to be number[][][] or flat/TypedArray'); + } + if (inferredShape.length === 1 && shape == null) { + throw new Error('tensor3d() requires shape to be provided when `values` ' + + 'are a flat array'); + } + return makeTensor(values, shape, inferredShape, dtype); + } + /** + * Creates rank-4 `tf.Tensor` with the provided values, shape and dtype. + * + * The same functionality can be achieved with `tf.tensor`, but in general + * we recommend using `tf.tensor4d` as it makes the code more readable. + * + * ```js + * // Pass a nested array. + * tf.tensor4d([[[[1], [2]], [[3], [4]]]]).print(); + * ``` + * ```js + * // Pass a flat array and specify a shape. + * tf.tensor4d([1, 2, 3, 4], [1, 2, 2, 1]).print(); + * ``` + * + * @param values The values of the tensor. Can be nested array of numbers, + * or a flat array, or a `TypedArray`. + * @param shape The shape of the tensor. Optional. If not provided, + * it is inferred from `values`. + * @param dtype The data type. + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + function tensor4d(values, shape, dtype) { + assertNonNull(values); + if (shape != null && shape.length !== 4) { + throw new Error('tensor4d() requires shape to have four numbers'); + } + const inferredShape = inferShape(values, dtype); + if (inferredShape.length !== 4 && inferredShape.length !== 1) { + throw new Error('tensor4d() requires values to be number[][][][] or flat/TypedArray'); + } + if (inferredShape.length === 1 && shape == null) { + throw new Error('tensor4d() requires shape to be provided when `values` ' + + 'are a flat array'); + } + return makeTensor(values, shape, inferredShape, dtype); + } + /** + * Creates rank-5 `tf.Tensor` with the provided values, shape and dtype. + * + * The same functionality can be achieved with `tf.tensor`, but in general + * we recommend using `tf.tensor5d` as it makes the code more readable. + * + * ```js + * // Pass a nested array. + * tf.tensor5d([[[[[1], [2]], [[3], [4]]]]]).print(); + * ``` + * ```js + * // Pass a flat array and specify a shape. + * tf.tensor5d([1, 2, 3, 4, 5, 6, 7, 8], [1, 2, 2, 2, 1]).print(); + * ``` + * + * @param values The values of the tensor. Can be nested array of numbers, + * or a flat array, or a `TypedArray`. + * @param shape The shape of the tensor. Optional. If not provided, + * it is inferred from `values`. + * @param dtype The data type. + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + function tensor5d(values, shape, dtype) { + assertNonNull(values); + if (shape != null && shape.length !== 5) { + throw new Error('tensor5d() requires shape to have five numbers'); + } + const inferredShape = inferShape(values, dtype); + if (inferredShape.length !== 5 && inferredShape.length !== 1) { + throw new Error('tensor5d() requires values to be ' + + 'number[][][][][] or flat/TypedArray'); + } + if (inferredShape.length === 1 && shape == null) { + throw new Error('tensor5d() requires shape to be provided when `values` ' + + 'are a flat array'); + } + return makeTensor(values, shape, inferredShape, dtype); + } + /** + * Creates rank-6 `tf.Tensor` with the provided values, shape and dtype. + * + * The same functionality can be achieved with `tf.tensor`, but in general + * we recommend using `tf.tensor6d` as it makes the code more readable. + * + * ```js + * // Pass a nested array. + * tf.tensor6d([[[[[[1],[2]],[[3],[4]]],[[[5],[6]],[[7],[8]]]]]]).print(); + * ``` + * ```js + * // Pass a flat array and specify a shape. + * tf.tensor6d([1, 2, 3, 4, 5, 6, 7, 8], [1, 1, 2, 2, 2, 1]).print(); + * ``` + * + * @param values The values of the tensor. Can be nested array of numbers, + * or a flat array, or a `TypedArray`. + * @param shape The shape of the tensor. Optional. If not provided, + * it is inferred from `values`. + * @param dtype The data type. + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + function tensor6d(values, shape, dtype) { + assertNonNull(values); + if (shape != null && shape.length !== 6) { + throw new Error('tensor6d() requires shape to have six numbers'); + } + const inferredShape = inferShape(values, dtype); + if (inferredShape.length !== 6 && inferredShape.length !== 1) { + throw new Error('tensor6d() requires values to be number[][][][][][] or ' + + 'flat/TypedArray'); + } + if (inferredShape.length === 1 && shape == null) { + throw new Error('tensor6d() requires shape to be provided when `values` ' + + 'are a flat array'); + } + shape = shape || + inferredShape; + return makeTensor(values, shape, inferredShape, dtype); + } + /** + * Creates a new variable with the provided initial value. + * ```js + * const x = tf.variable(tf.tensor([1, 2, 3])); + * x.assign(tf.tensor([4, 5, 6])); + * + * x.print(); + * ``` + * + * @param initialValue Initial value for the tensor. + * @param trainable If true, optimizers are allowed to update it. + * @param name Name of the variable. Defaults to a unique id. + * @param dtype If set, initialValue will be converted to the given type. + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + function variable(initialValue, trainable = true, name, dtype) { + return ENGINE.makeVariable(initialValue, trainable, name, dtype); + } + /** + * Creates a `tf.Tensor` with all elements set to 1. + * + * ```js + * tf.ones([2, 2]).print(); + * ``` + * + * @param shape An array of integers defining the output tensor shape. + * @param dtype The type of an element in the resulting tensor. Defaults to + * 'float'. + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + function ones$1(shape, dtype = 'float32') { + if (dtype === 'complex64') { + const real = ones$1(shape, 'float32'); + const imag = zeros(shape, 'float32'); + return complex(real, imag); + } + const values = makeOnesTypedArray(sizeFromShape(shape), dtype); + return ENGINE.makeTensor(values, shape, dtype); + } + /** + * Creates a `tf.Tensor` with all elements set to 0. + * + * ```js + * tf.zeros([2, 2]).print(); + * ``` + * + * @param shape An array of integers defining the output tensor shape. + * @param dtype The type of an element in the resulting tensor. Can + * be 'float32', 'int32' or 'bool'. Defaults to 'float'. + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + function zeros(shape, dtype = 'float32') { + if (dtype === 'complex64') { + const real = zeros(shape, 'float32'); + const imag = zeros(shape, 'float32'); + return complex(real, imag); + } + const values = makeZerosTypedArray(sizeFromShape(shape), dtype); + return ENGINE.makeTensor(values, shape, dtype); + } + /** + * Creates a `tf.Tensor` filled with a scalar value. + * + * ```js + * tf.fill([2, 2], 4).print(); + * ``` + * + * @param shape An array of integers defining the output tensor shape. + * @param value The scalar value to fill the tensor with. + * @param dtype The type of an element in the resulting tensor. Defaults to + * 'float'. + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + function fill(shape, value, dtype) { + return ENGINE.runKernelFunc(backend => backend.fill(shape, value, dtype), {}); + } + /** + * Creates a `tf.Tensor` with all elements set to 1 with the same shape as the + * given tensor. + * + * ```js + * const x = tf.tensor([1, 2]); + * tf.onesLike(x).print(); + * ``` + * @param x A tensor. + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + function onesLike_(x) { + const $x = convertToTensor(x, 'x', 'onesLike'); + if ($x.dtype === 'complex64') { + const r = onesLike(real($x)); + const i = zerosLike(imag($x)); + return complex(r, i); + } + const der = (dy, saved) => ({ x: () => zerosLike(dy) }); + return ENGINE.runKernelFunc(backend => backend.onesLike($x), { x: $x }, der, 'OnesLike'); + } + /** + * Creates a `tf.Tensor` with all elements set to 0 with the same shape as the + * given tensor. + * + * ```js + * const x = tf.tensor([1, 2]); + * tf.zerosLike(x).print(); + * ``` + * + * @param x The tensor of required shape. + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + function zerosLike_(x) { + const $x = convertToTensor(x, 'x', 'zerosLike'); + const der = (dy, saved) => ({ x: () => zerosLike(dy) }); + return ENGINE.runKernelFunc(backend => backend.zerosLike($x), { x: $x }, der, 'ZerosLike'); + } + /** + * Return an evenly spaced sequence of numbers over the given interval. + * + * ```js + * tf.linspace(0, 9, 10).print(); + * ``` + * @param start The start value of the sequence. + * @param stop The end value of the sequence. + * @param num The number of values to generate. + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + function linspace(start, stop, num) { + if (num <= 0) { + throw new Error('The number of values should be positive.'); + } + return ENGINE.runKernelFunc(backend => backend.linspace(start, stop, num), {}); + } + /** + * Creates a new `tf.Tensor1D` filled with the numbers in the range provided. + * + * The tensor is a is half-open interval meaning it includes start, but + * excludes stop. Decrementing ranges and negative step values are also + * supported. + * + * ```js + * tf.range(0, 9, 2).print(); + * ``` + * + * @param start An integer start value + * @param stop An integer stop value + * @param step An integer increment (will default to 1 or -1) + * @param dtype The data type of the output tensor. Defaults to 'float32'. + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + function range(start, stop, step = 1, dtype = 'float32') { + if (step === 0) { + throw new Error('Cannot have a step of zero'); + } + const sameStartStop = start === stop; + const increasingRangeNegativeStep = start < stop && step < 0; + const decreasingRangePositiveStep = stop < start && step > 1; + if (sameStartStop || increasingRangeNegativeStep || + decreasingRangePositiveStep) { + return zeros([0], dtype); + } + const numElements = Math.abs(Math.ceil((stop - start) / step)); + const values = makeZerosTypedArray(numElements, dtype); + if (stop < start && step === 1) { + // Auto adjust the step's sign if it hasn't been set + // (or was set to 1) + step = -1; + } + values[0] = start; + for (let i = 1; i < values.length; i++) { + values[i] = values[i - 1] + step; + } + return tensor1d(values, dtype); + } + const onesLike = op({ onesLike_ }); + const zerosLike = op({ zerosLike_ }); + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Concatenates a list of `tf.Tensor`s along a given axis. + * + * The tensors ranks and types must match, and their sizes must match in all + * dimensions except `axis`. + * + * Also available are stricter rank-specific methods that assert that + * `tensors` are of the given rank: + * - `tf.concat1d` + * - `tf.concat2d` + * - `tf.concat3d` + * - `tf.concat4d` + * + * Except `tf.concat1d` (which does not have axis param), all methods have + * same signature as this method. + * + * ```js + * const a = tf.tensor1d([1, 2]); + * const b = tf.tensor1d([3, 4]); + * a.concat(b).print(); // or a.concat(b) + * ``` + * + * ```js + * const a = tf.tensor1d([1, 2]); + * const b = tf.tensor1d([3, 4]); + * const c = tf.tensor1d([5, 6]); + * tf.concat([a, b, c]).print(); + * ``` + * + * ```js + * const a = tf.tensor2d([[1, 2], [10, 20]]); + * const b = tf.tensor2d([[3, 4], [30, 40]]); + * const axis = 1; + * tf.concat([a, b], axis).print(); + * ``` + * @param tensors A list of tensors to concatenate. + * @param axis The axis to concate along. Defaults to 0 (the first dim). + */ + /** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */ + function concat_(tensors, axis = 0) { + assert(tensors.length >= 1, () => 'Pass at least one tensor to concat'); + let $tensors = convertToTensorArray(tensors, 'tensors', 'concat'); + if ($tensors[0].dtype === 'complex64') { + $tensors.forEach(tensor => { + if (tensor.dtype !== 'complex64') { + throw new Error(`Cannot concatenate complex64 tensors with a tensor + with dtype ${tensor.dtype}. `); + } + }); + } + const $axis = parseAxisParam(axis, $tensors[0].shape)[0]; + const outShape = computeOutShape($tensors.map(t => t.shape), $axis); + if (sizeFromShape(outShape) === 0) { + return tensor([], outShape); + } + // Keep only non-empty tensors (ignore tensors with 0 in their shape). + $tensors = $tensors.filter(t => t.size > 0); + if ($tensors.length === 1) { + return $tensors[0]; + } + const shapes = $tensors.map(t => t.shape); + assertParamsConsistent(shapes, $axis); + const forward = (backend, save) => { + const $axis = parseAxisParam(axis, $tensors[0].shape)[0]; + const res = backend.concat($tensors, $axis); + save($tensors); + return res; + }; + const inputs = $tensors; + const attr = { axis }; + return ENGINE.runKernelFunc(forward, inputs, null /* grad */, Concat, attr); + } + const concat = op({ concat_ }); + + /** + * @license + * Copyright 2018 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Reshapes a `tf.Tensor` to a given shape. + * + * Given an input tensor, returns a new tensor with the same values as the + * input tensor with shape `shape`. + * + * If one component of shape is the special value -1, the size of that + * dimension is computed so that the total size remains constant. In + * particular, a shape of [-1] flattens into 1-D. At most one component of + * shape can be -1. + * + * If shape is 1-D or higher, then the operation returns a tensor with shape + * shape filled with the values of tensor. In this case, the number of + * elements implied by shape must be the same as the number of elements in + * tensor. + * + * ```js + * const x = tf.tensor1d([1, 2, 3, 4]); + * x.reshape([2, 2]).print(); + * ``` + * + * @param x The input tensor to be reshaped. + * @param shape An array of integers defining the output tensor shape. + */ + /** @doc {heading: 'Tensors', subheading: 'Transformations'} */ + function reshape_(x, shape) { + const $x = convertToTensor(x, 'x', 'reshape', null); + shape = inferFromImplicitShape(shape, $x.size); + assert($x.size === sizeFromShape(shape), () => 'new shape and old shape must have the same number of elements.'); + const grad = (dy) => { + return { x: () => dy.reshape($x.shape) }; + }; + const attrs = { shape }; + return ENGINE.runKernelFunc(backend => backend.reshape($x, shape), { x: $x }, grad, 'Reshape', attrs); + } + /** + * Removes dimensions of size 1 from the shape of a `tf.Tensor`. + * + * ```js + * const x = tf.tensor([1, 2, 3, 4], [1, 1, 4]); + * x.squeeze().print(); + * ``` + * + * @param x The input tensor to be squeezed. + * @param axis An optional list of numbers. If specified, only + * squeezes the dimensions listed. The dimension index starts at 0. It + * is an error to squeeze a dimension that is not 1. + */ + /** @doc {heading: 'Tensors', subheading: 'Transformations'} */ + function squeeze_(x, axis) { + const $x = convertToTensor(x, 'x', 'squeeze'); + return reshape($x, squeezeShape($x.shape, axis).newShape); + } + /** + * Casts a `tf.Tensor` to a new dtype. + * + * ```js + * const x = tf.tensor1d([1.5, 2.5, 3]); + * tf.cast(x, 'int32').print(); + * ``` + * @param x The input tensor to be casted. + * @param dtype The dtype to cast the input tensor to. + */ + /** @doc {heading: 'Tensors', subheading: 'Transformations'} */ + function cast_(x, dtype) { + const $x = convertToTensor(x, 'x', 'cast'); + // Sanity checks. + if (!isValidDtype(dtype)) { + throw new Error(`Failed to cast to unknown dtype ${dtype}`); + } + if (dtype === 'string' && $x.dtype !== 'string' || + dtype !== 'string' && $x.dtype === 'string') { + throw new Error('Only strings can be casted to strings'); + } + const grad = (dy) => { + return { x: () => dy.clone() }; + }; + const attrs = { dtype }; + return ENGINE.runKernelFunc(backend => backend.cast($x, dtype), { x: $x }, grad, 'Cast', attrs); + } + /** + * Stacks a list of rank-`R` `tf.Tensor`s into one rank-`(R+1)` `tf.Tensor`. + * + * ```js + * const a = tf.tensor1d([1, 2]); + * const b = tf.tensor1d([3, 4]); + * const c = tf.tensor1d([5, 6]); + * tf.stack([a, b, c]).print(); + * ``` + * + * @param tensors A list of tensor objects with the same shape and dtype. + * @param axis The axis to stack along. Defaults to 0 (the first dim). + */ + /** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */ + function stack_(tensors, axis = 0) { + const $tensors = convertToTensorArray(tensors, 'tensors', 'stack'); + assert($tensors.length >= 1, () => 'Pass at least one tensor to tf.stack'); + if ($tensors.length === 1) { + return $tensors[0].expandDims(axis); + } + const rank = $tensors[0].rank; + const shape = $tensors[0].shape; + const dtype = $tensors[0].dtype; + assert(axis <= rank, () => 'Axis must be <= rank of the tensor'); + $tensors.forEach(t => { + assertShapesMatch(shape, t.shape, 'All tensors passed to stack must have matching shapes'); + }); + $tensors.forEach(t => { + assert(dtype === t.dtype, () => 'All tensors passed to stack must have matching dtypes'); + }); + const expandedTensors = $tensors.map(t => t.expandDims(axis)); + return concat(expandedTensors, axis); + } + /** + * This operation reshapes the "batch" dimension 0 into `M + 1` dimensions of + * shape `blockShape + [batch]`, interleaves these blocks back into the grid + * defined by the spatial dimensions `[1, ..., M]`, to obtain a result with + * the same rank as the input. The spatial dimensions of this intermediate + * result are then optionally cropped according to `crops` to produce the + * output. This is the reverse of `tf.spaceToBatchND`. See below for a precise + * description. + * + * ```js + * const x = tf.tensor4d([1, 2, 3, 4], [4, 1, 1, 1]); + * const blockShape = [2, 2]; + * const crops = [[0, 0], [0, 0]]; + * + * x.batchToSpaceND(blockShape, crops).print(); + * ``` + * + * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape + + * remainingShape`, where spatialShape has `M` dimensions. + * @param blockShape A 1-D array. Must have shape `[M]`, all values must + * be >= 1. + * @param crops A 2-D array. Must have shape `[M, 2]`, all values must be >= 0. + * `crops[i] = [cropStart, cropEnd]` specifies the amount to crop from input + * dimension `i + 1`, which corresponds to spatial dimension `i`. It is required + * that `cropStart[i] + cropEnd[i] <= blockShape[i] * inputShape[i + 1]` + * + * This operation is equivalent to the following steps: + * + * 1. Reshape `x` to `reshaped` of shape: `[blockShape[0], ..., + * blockShape[M-1], batch / prod(blockShape), x.shape[1], ..., + * x.shape[N-1]]` + * + * 2. Permute dimensions of `reshaped`to produce `permuted` of shape `[batch / + * prod(blockShape),x.shape[1], blockShape[0], ..., x.shape[M], + * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]` + * + * 3. Reshape `permuted` to produce `reshapedPermuted` of shape `[batch / + * prod(blockShape),x.shape[1] * blockShape[0], ..., x.shape[M] * + * blockShape[M-1],x.shape[M+1], ..., x.shape[N-1]]` + * + * 4. Crop the start and end of dimensions `[1, ..., M]` of `reshapedPermuted` + * according to `crops` to produce the output of shape: `[batch / + * prod(blockShape),x.shape[1] * blockShape[0] - crops[0,0] - crops[0,1], + * ..., x.shape[M] * blockShape[M-1] - crops[M-1,0] - + * crops[M-1,1],x.shape[M+1], ..., x.shape[N-1]]` + */ + /** @doc {heading: 'Tensors', subheading: 'Transformations'} */ + function batchToSpaceND_(x, blockShape, crops) { + const $x = convertToTensor(x, 'x', 'batchToSpaceND'); + const prod = blockShape.reduce((a, b) => a * b); + assert($x.rank >= 1 + blockShape.length, () => `input rank is ${$x.rank} but should be > than blockShape.length ${blockShape.length}`); + assert(crops.length === blockShape.length, () => `crops.length is ${crops.length} but should be equal to blockShape.length ${blockShape.length}`); + assert($x.shape[0] % prod === 0, () => `input tensor batch is ${$x.shape[0]} but is not divisible by the product of ` + + `the elements of blockShape ${blockShape.join(' * ')} === ${prod}`); + const grad = (dy) => { + return { $x: () => dy.spaceToBatchND(blockShape, crops) }; + }; + return ENGINE.runKernelFunc(backend => backend.batchToSpaceND($x, blockShape, crops), { $x }, grad); + } + /** + * This operation divides "spatial" dimensions `[1, ..., M]` of the input into + * a grid of blocks of shape `blockShape`, and interleaves these blocks with + * the "batch" dimension (0) such that in the output, the spatial + * dimensions `[1, ..., M]` correspond to the position within the grid, + * and the batch dimension combines both the position within a spatial block + * and the original batch position. Prior to division into blocks, + * the spatial dimensions of the input are optionally zero padded + * according to `paddings`. See below for a precise description. + * + * ```js + * const x = tf.tensor4d([1, 2, 3, 4], [1, 2, 2, 1]); + * const blockShape = [2, 2]; + * const paddings = [[0, 0], [0, 0]]; + * + * x.spaceToBatchND(blockShape, paddings).print(); + * ``` + * + * @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape + + * remainingShape`, where spatialShape has `M` dimensions. + * @param blockShape A 1-D array. Must have shape `[M]`, all values must + * be >= 1. + * @param paddings A 2-D array. Must have shape `[M, 2]`, all values must be >= + * 0. `paddings[i] = [padStart, padEnd]` specifies the amount to zero-pad + * from input dimension `i + 1`, which corresponds to spatial dimension `i`. It + * is required that + * `(inputShape[i + 1] + padStart + padEnd) % blockShape[i] === 0` + * + * This operation is equivalent to the following steps: + * + * 1. Zero-pad the start and end of dimensions `[1, ..., M]` of the input + * according to `paddings` to produce `padded` of shape paddedShape. + * + * 2. Reshape `padded` to `reshapedPadded` of shape: + * `[batch] + [paddedShape[1] / blockShape[0], blockShape[0], ..., + * paddedShape[M] / blockShape[M-1], blockShape[M-1]] + remainingShape` + * + * 3. Permute dimensions of `reshapedPadded` to produce `permutedReshapedPadded` + * of shape: `blockShape + [batch] + [paddedShape[1] / blockShape[0], ..., + * paddedShape[M] / blockShape[M-1]] + remainingShape` + * + * 4. Reshape `permutedReshapedPadded` to flatten `blockShape` into the + * batch dimension, producing an output tensor of shape: + * `[batch * prod(blockShape)] + [paddedShape[1] / blockShape[0], ..., + * paddedShape[M] / blockShape[M-1]] + remainingShape` + */ + /** @doc {heading: 'Tensors', subheading: 'Transformations'} */ + function spaceToBatchND_(x, blockShape, paddings) { + const $x = convertToTensor(x, 'x', 'spaceToBatchND'); + assert($x.rank >= 1 + blockShape.length, () => `input rank ${$x.rank} should be > than [blockShape] ${blockShape.length}`); + assert(paddings.length === blockShape.length, () => `paddings.shape[0] ${paddings.length} must be equal to [blockShape] ${blockShape.length}`); + assert($x.shape.reduce((a, b, i) => { + if (i > 0 && i <= blockShape.length) { + return a && + ((b + paddings[i - 1][0] + paddings[i - 1][1]) % + blockShape[i - 1] === + 0); + } + return a; + }, true), () => `input spatial dimensions ${$x.shape.slice(1)} with paddings ${paddings.toString()} must be divisible by blockShapes ${blockShape.toString()}`); + const grad = (dy) => { + return { $x: () => dy.batchToSpaceND(blockShape, paddings) }; + }; + return ENGINE.runKernelFunc(backend => backend.spaceToBatchND($x, blockShape, paddings), { $x }, grad); + } + /** + * Unstacks a `tf.Tensor` of rank-`R` into a list of rank-`(R-1)` `tf.Tensor`s. + * + * ```js + * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]); + * + * tf.unstack(a).forEach(tensor => tensor.print()); + * ``` + * + * @param x A tensor object. + * @param axis The axis to unstack along. Defaults to 0 (the first dim). + */ + /** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */ + function unstack_(x, axis = 0) { + axis = axis || 0; + const $x = convertToTensor(x, 'x', 'unstack'); + assert(axis >= -$x.shape.length && axis < $x.shape.length, () => `Axis = ${axis} is not in [-${$x.shape.length}, ${$x.shape.length})`); + if (axis < 0) { + axis += $x.shape.length; + } + const grad = (dy) => { + return { x: () => stack(dy, axis) }; + }; + const attrs = { axis }; + return ENGINE.runKernelFunc(backend => backend.unstack($x, axis), { x: $x }, grad, 'Unpack', attrs); + } + /** + * Computes the cumulative sum of a `tf.Tensor` along `axis`. + * + * ```js + * const x = tf.tensor([1, 2, 3, 4]); + * x.cumsum().print(); + * ``` + * ```js + * const x = tf.tensor([[1, 2], [3, 4]]); + * x.cumsum().print(); + * ``` + * + * @param x The input tensor to be summed. + * @param axis The axis along which to sum. Optional. Defaults to 0. + * @param exclusive Whether to perform exclusive cumulative sum. Optional. + * Defaults to false. If set to true then the sum of each tensor entry + * does not include its own value, but only the values previous to it + * along the specified axis. + * @param reverse Whether to sum in the opposite direction. Optional. + * Defaults to false. + */ + /** @doc {heading: 'Operations', subheading: 'Scan'} */ + function cumsum_(x, axis = 0, exclusive = false, reverse = false) { + const $x = convertToTensor(x, 'x', 'cumsum'); + axis = axis | 0; + const permutation = getAxesPermutation([axis], $x.rank); + let permutedX = $x; + if (permutation != null) { + permutedX = $x.transpose(permutation); + } + const permutedAxis = getInnerMostAxes(1, $x.rank)[0]; + const grad = (dy) => { + return { permutedX: () => dy.cumsum(axis, exclusive, !reverse) }; + }; + let value = ENGINE.runKernelFunc(backend => backend.cumsum(permutedX, permutedAxis, exclusive, reverse), { permutedX }, grad); + if (permutation != null) { + value = value.transpose(permutation); + } + return value; + } + /** + * Returns a `tf.Tensor` that has expanded rank, by inserting a dimension + * into the tensor's shape. + * + * ```js + * const x = tf.tensor1d([1, 2, 3, 4]); + * const axis = 1; + * x.expandDims(axis).print(); + * ``` + * + * @param x The input tensor whose dimensions to be expanded. + * @param axis The dimension index at which to insert shape of `1`. Defaults + * to 0 (the first dimension). + */ + /** @doc {heading: 'Tensors', subheading: 'Transformations'} */ + function expandDims_(x, axis = 0) { + const parseAs = null; + const $x = convertToTensor(x, 'x', 'expandDims', parseAs); + assert(axis <= $x.rank, () => 'Axis must be <= rank of the tensor'); + const newShape = $x.shape.slice(); + if (axis < 0) { + // Negative value is counted from the tail of rank. + assert(-($x.rank + 1) <= axis, () => `Axis must be in the interval [${-($x.rank + 1)}, ${$x.rank}]`); + axis = $x.rank + axis + 1; + } + newShape.splice(axis, 0, 1); + return reshape($x, newShape); + } + /** + * Rearranges data from depth into blocks of spatial data. More specifically, + * this op outputs a copy of the input tensor where values from the `depth` + * dimension are moved in spatial blocks to the `height` and `width` dimensions. + * The attr `blockSize` indicates the input block size and how the data is + * moved. + * + * - Chunks of data of size `blockSize * blockSize` from depth are rearranged + * into non-overlapping blocks of size `blockSize x blockSize` + * + * - The width the output tensor is `inputWidth * blockSize`, whereas the + * height is `inputHeight * blockSize` + * + * - The Y, X coordinates within each block of the output image are determined + * by the high order component of the input channel index + * + * - The depth of the input tensor must be divisible by `blockSize * + * blockSize` + * + * The `dataFormat` attr specifies the layout of the input and output tensors + * with the following options: "NHWC": [ `batch, height, width, channels` ] + * "NCHW": [ `batch, channels, height, width` ] + * + * ```js + * const x = tf.tensor4d([1, 2, 3, 4], [1, 1, 1, 4]); + * const blockSize = 2; + * const dataFormat = "NHWC"; + * + * tf.depthToSpace(x, blockSize, dataFormat).print(); + * ``` + * + * @param x The input tensor of rank 4 + * @param blockSIze An `int` that is `>= 2`. The size of the spatial block + * @param dataFormat An optional string from: "NHWC", "NCHW". Defaults to "NHWC" + */ + /** @doc {heading: 'Tensors', subheading: 'Transformations'} */ + function depthToSpace_(x, blockSize, dataFormat = 'NHWC') { + const $x = convertToTensor(x, 'x', 'depthToSpace'); + const inputHeight = (dataFormat === 'NHWC') ? $x.shape[1] : $x.shape[2]; + const inputWidth = (dataFormat === 'NHWC') ? $x.shape[2] : $x.shape[3]; + const inputDepth = (dataFormat === 'NHWC') ? $x.shape[3] : $x.shape[1]; + assert(inputHeight * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying + ${inputHeight} and ${blockSize} for depthToSpace with input shape + ${$x.shape}`); + assert(inputWidth * blockSize >= 0, () => `Negative dimension size caused by overflow when multiplying + ${inputWidth} and ${blockSize} for depthToSpace with input shape + ${$x.shape}`); + assert((inputDepth % (blockSize * blockSize) === 0), () => `Dimension size must be evenly divisible by ${blockSize * blockSize} but is ${inputDepth} for depthToSpace with input shape ${$x.shape}`); + return ENGINE.runKernelFunc(backend => backend.depthToSpace($x, blockSize, dataFormat), { $x }); + } + /** + * Computes the difference between two lists of numbers. + * + * Given a Tensor `x` and a Tensor `y`, this operation returns a Tensor `out` + * that represents all values that are in `x` but not in `y`. The returned + * Tensor `out` is sorted in the same order that the numbers appear in `x` + * (duplicates are preserved). This operation also returns a Tensor indices that + * represents the position of each out element in `x`. In other words: + * + * `out[i] = x[idx[i]] for i in [0, 1, ..., out.length - 1]` + * + * ```js + * const x = [1, 2, 3, 4, 5, 6]; + * const y = [1, 3, 5]; + * + * const [out, indices] = await tf.setdiff1dAsync(x, y); + * out.print(); // [2, 4, 6] + * indices.print(); // [1, 3, 5] + * ``` + * + * @param x 1-D Tensor. Values to keep. + * @param y 1-D Tensor. Must have the same type as x. Values to exclude in the + * output. + * @returns Promise of Tensor tuple [out, indices]. + * out: Tensor with the same type as x. + * indices: A Tensor of type int32. + */ + /** @doc {heading: 'Tensors', subheading: 'Transformations'} */ + async function setdiff1dAsync_(x, y) { + const $x = convertToTensor(x, 'x', 'setdiff1d'); + const $y = convertToTensor(y, 'y', 'setdiff1d'); + assert($x.dtype === $y.dtype, () => `x and y should have the same dtype, but got x (${$x.dtype}) and y (${$y.dtype}).`); + assert($x.rank === 1, () => `x should be 1D tensor, but got x (${$x.shape}).`); + assert($y.rank === 1, () => `y should be 1D tensor, but got y (${$y.shape}).`); + const xVals = await $x.data(); + const yVals = await $y.data(); + const ySet = new Set(yVals); + let outputSize = 0; + for (let i = 0; i < xVals.length; i++) { + if (!ySet.has(xVals[i])) { + outputSize++; + } + } + const buffer = new TensorBuffer([outputSize], $x.dtype); + const indices = new TensorBuffer([outputSize], 'int32'); + for (let i = 0, p = 0; i < xVals.length; i++) { + if (!ySet.has(xVals[i])) { + buffer.values[p] = xVals[i]; + indices.values[p] = i; + p++; + } + } + return [buffer.toTensor(), indices.toTensor()]; + } + /** + * Creates an empty `tf.TensorBuffer` with the specified `shape` and `dtype`. + * + * The values are stored in CPU as `TypedArray`. Fill the buffer using + * `buffer.set()`, or by modifying directly `buffer.values`. + * + * When done, call `buffer.toTensor()` to get an immutable `tf.Tensor` with + * those values. + * + * ```js + * // Create a buffer and set values at particular indices. + * const buffer = tf.buffer([2, 2]); + * buffer.set(3, 0, 0); + * buffer.set(5, 1, 0); + * + * // Convert the buffer back to a tensor. + * buffer.toTensor().print(); + * ``` + * + * @param shape An array of integers defining the output tensor shape. + * @param dtype The dtype of the buffer. Defaults to 'float32'. + * @param values The values of the buffer as `TypedArray`. Defaults to + * zeros. + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + function buffer(shape, dtype = 'float32', values) { + dtype = dtype || 'float32'; + assertNonNegativeIntegerDimensions(shape); + return new TensorBuffer(shape, dtype, values); + } + /** + * Prints information about the `tf.Tensor` including its data. + * + * ```js + * const verbose = true; + * tf.tensor2d([1, 2, 3, 4], [2, 2]).print(verbose); + * ``` + * @param x The tensor to be printed. + * @param verbose Whether to print verbose information about the ` Tensor`, + * including dtype and size. + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + function print(x, verbose = false) { + console.log(x.toString(verbose)); + } + const batchToSpaceND = op({ batchToSpaceND_ }); + const cast = op({ cast_ }); + const cumsum = op({ cumsum_ }); + const depthToSpace = op({ depthToSpace_ }); + const expandDims = op({ expandDims_ }); + const reshape = op({ reshape_ }); + const spaceToBatchND = op({ spaceToBatchND_ }); + const squeeze = op({ squeeze_ }); + const stack = op({ stack_ }); + const unstack = op({ unstack_ }); + const setdiff1dAsync = setdiff1dAsync_; + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Computes the dot product of two matrices, A * B. These must be matrices. + * + * ```js + * const a = tf.tensor2d([1, 2], [1, 2]); + * const b = tf.tensor2d([1, 2, 3, 4], [2, 2]); + * + * a.matMul(b).print(); // or tf.matMul(a, b) + * ``` + * @param a First matrix in dot product operation. + * @param b Second matrix in dot product operation. + * @param transposeA If true, `a` is transposed before multiplication. + * @param transposeB If true, `b` is transposed before multiplication. + */ + /** @doc {heading: 'Operations', subheading: 'Matrices'} */ + function matMul_(a, b, transposeA = false, transposeB = false) { + let $a = convertToTensor(a, 'a', 'matMul'); + let $b = convertToTensor(b, 'b', 'matMul'); + [$a, $b] = makeTypesMatch($a, $b); + assert($a.rank >= 2 && $b.rank >= 2 && $a.rank === $b.rank, () => `Error in matMul: inputs must have the same rank of at least 2, ` + + `got ranks ${$a.rank} and ${$b.rank}.`); + const innerShapeA = transposeA ? $a.shape[$a.rank - 2] : $a.shape[$a.rank - 1]; + const innerShapeB = transposeB ? $b.shape[$b.rank - 1] : $b.shape[$b.rank - 2]; + const outerShapeA = transposeA ? $a.shape[$a.rank - 1] : $a.shape[$a.rank - 2]; + const outerShapeB = transposeB ? $b.shape[$b.rank - 2] : $b.shape[$b.rank - 1]; + const outerDimsA = $a.shape.slice(0, -2); + const outerDimsB = $b.shape.slice(0, -2); + const batchDimA = sizeFromShape(outerDimsA); + const batchDimB = sizeFromShape(outerDimsB); + assert(arraysEqual(outerDimsA, outerDimsB), () => `Error in matMul: outer dimensions (${outerDimsA}) and (` + + `${outerDimsB}) of Tensors with shapes ${$a.shape} and ` + + `${$b.shape} must match.`); + assert(innerShapeA === innerShapeB, () => `Error in matMul: inner shapes (${innerShapeA}) and (` + + `${innerShapeB}) of Tensors with shapes ${$a.shape} and ` + + `${$b.shape} and transposeA=${transposeA}` + + ` and transposeB=${transposeB} must match.`); + const outShape = $a.shape.slice(0, -2).concat([outerShapeA, outerShapeB]); + const a3D = transposeA ? reshape($a, [batchDimA, innerShapeA, outerShapeA]) : + reshape($a, [batchDimA, outerShapeA, innerShapeA]); + const b3D = transposeB ? reshape($b, [batchDimB, outerShapeB, innerShapeB]) : + reshape($b, [batchDimB, innerShapeB, outerShapeB]); + const forward = (backend, save) => { + save([a3D, b3D]); + return backend.batchMatMul(a3D, b3D, transposeA, transposeB); + }; + const inputs = { a: a3D, b: b3D }; + const attrs = { transposeA, transposeB }; + const res = ENGINE.runKernelFunc(forward, inputs, null /* grad */, BatchMatMul, attrs); + return reshape(res, outShape); + } + const matMul = op({ matMul_ }); + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const batchMatMulGradConfig = { + kernelName: BatchMatMul, + inputsToSave: ['a', 'b'], + gradFunc: (dy, saved, attrs) => { + const [a, b] = saved; + const { transposeA, transposeB } = attrs; + if (!transposeA && !transposeB) { + return { + a: () => matMul(dy, b, false, true), + b: () => matMul(a, dy, true, false) + }; + } + else if (!transposeA && transposeB) { + return { + a: () => matMul(dy, b, false, false), + b: () => matMul(dy, a, true, false) + }; + } + else if (transposeA && !transposeB) { + return { + a: () => matMul(b, dy, false, true), + b: () => matMul(a, dy, false, false) + }; + } + else { + return { + a: () => matMul(b, dy, true, true), + b: () => matMul(dy, a, true, true) + }; + } + } + }; + + /** + * @license + * Copyright 2018 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Provided `f(x)`, returns another function `g(x, dy?)`, which gives the + * gradient of `f(x)` with respect to `x`. + * + * If `dy` is provided, the gradient of `f(x).mul(dy).sum()` with respect to + * `x` is computed instead. `f(x)` must take a single tensor `x` and return a + * single tensor `y`. If `f()` takes multiple inputs, use `tf.grads` instead. + * + * ```js + * // f(x) = x ^ 2 + * const f = x => x.square(); + * // f'(x) = 2x + * const g = tf.grad(f); + * + * const x = tf.tensor1d([2, 3]); + * g(x).print(); + * ``` + * + * ```js + * // f(x) = x ^ 3 + * const f = x => x.pow(tf.scalar(3, 'int32')); + * // f'(x) = 3x ^ 2 + * const g = tf.grad(f); + * // f''(x) = 6x + * const gg = tf.grad(g); + * + * const x = tf.tensor1d([2, 3]); + * gg(x).print(); + * ``` + * + * @param f The function f(x), to compute gradient for. + */ + /** @doc {heading: 'Training', subheading: 'Gradients'} */ + function grad(f) { + assert(isFunction(f), () => 'The f passed in grad(f) must be a function'); + return (x, dy) => { + // x can be of any dtype, thus null as the last argument. + const $x = convertToTensor(x, 'x', 'tf.grad', null); + const $dy = (dy != null) ? convertToTensor(dy, 'dy', 'tf.grad') : null; + return ENGINE.tidy(() => { + const { value, grads } = ENGINE.gradients(() => f($x), [$x], $dy); + if ($dy != null) { + assertShapesMatch(value.shape, $dy.shape, 'The shape of dy passed in grad(f)(x, dy) must match the shape ' + + 'returned by f(x)'); + } + checkGrads(grads); + return grads[0]; + }); + }; + } + /** + * Provided `f(x1, x2,...)`, returns another function `g([x1, x2,...], dy?)`, + * which gives an array of gradients of `f()` with respect to each input + * [`x1`,`x2`,...]. + * + * If `dy` is passed when calling `g()`, the gradient of + * `f(x1,...).mul(dy).sum()` with respect to each input is computed instead. + * The provided `f` must take one or more tensors and return a single tensor + * `y`. If `f()` takes a single input, we recommend using `tf.grad` instead. + * + * ```js + * // f(a, b) = a * b + * const f = (a, b) => a.mul(b); + * // df / da = b, df / db = a + * const g = tf.grads(f); + * + * const a = tf.tensor1d([2, 3]); + * const b = tf.tensor1d([-2, -3]); + * const [da, db] = g([a, b]); + * console.log('da'); + * da.print(); + * console.log('db'); + * db.print(); + * ``` + * + * @param f The function `f(x1, x2,...)` to compute gradients for. + */ + /** @doc {heading: 'Training', subheading: 'Gradients'} */ + function grads(f) { + assert(isFunction(f), () => 'The f passed in grads(f) must be a function'); + return (args, dy) => { + assert(Array.isArray(args), () => 'The args passed in grads(f)(args) must be an array ' + + 'of `Tensor`s or `TensorLike`s'); + // args can be of any dtype, thus null as the last argument. + const $args = convertToTensorArray(args, 'args', 'tf.grads', null); + const $dy = (dy != null) ? convertToTensor(dy, 'dy', 'tf.grads') : null; + return ENGINE.tidy(() => { + const { value, grads } = ENGINE.gradients(() => f(...$args), $args, $dy); + if ($dy != null) { + assertShapesMatch(value.shape, $dy.shape, 'The shape of dy passed in grads(f)([x1,...], dy) must ' + + 'match the shape returned by f([x1,...])'); + } + checkGrads(grads); + return grads; + }); + }; + } + /** + * Like `tf.grad`, but also returns the value of `f()`. Useful when `f()` + * returns a metric you want to show. + * + * The result is a rich object with the following properties: + * - grad: The gradient of `f(x)` w.r.t `x` (result of `tf.grad`). + * - value: The value returned by `f(x)`. + * + * ```js + * // f(x) = x ^ 2 + * const f = x => x.square(); + * // f'(x) = 2x + * const g = tf.valueAndGrad(f); + * + * const x = tf.tensor1d([2, 3]); + * const {value, grad} = g(x); + * + * console.log('value'); + * value.print(); + * console.log('grad'); + * grad.print(); + * ``` + */ + /** @doc {heading: 'Training', subheading: 'Gradients'} */ + function valueAndGrad(f) { + assert(isFunction(f), () => 'The f passed in valueAndGrad(f) must be a function'); + return (x, dy) => { + assert(x instanceof Tensor, () => 'The x passed in valueAndGrad(f)(x) must be a tensor'); + assert(dy == null || dy instanceof Tensor, () => 'The dy passed in valueAndGrad(f)(x, dy) must be a tensor'); + const { grads, value } = ENGINE.gradients(() => f(x), [x], dy); + checkGrads(grads); + return { grad: grads[0], value }; + }; + } + /** + * Like `tf.grads`, but returns also the value of `f()`. Useful when `f()` + * returns a metric you want to show. + * + * The result is a rich object with the following properties: + * - grads: The gradients of `f()` w.r.t each input (result of `tf.grads`). + * - value: The value returned by `f(x)`. + * + * ```js + * // f(a, b) = a * b + * const f = (a, b) => a.mul(b); + * // df/da = b, df/db = a + * const g = tf.valueAndGrads(f); + * + * const a = tf.tensor1d([2, 3]); + * const b = tf.tensor1d([-2, -3]); + * const {value, grads} = g([a, b]); + * + * const [da, db] = grads; + * + * console.log('value'); + * value.print(); + * + * console.log('da'); + * da.print(); + * console.log('db'); + * db.print(); + * ``` + */ + /** @doc {heading: 'Training', subheading: 'Gradients'} */ + function valueAndGrads(f) { + assert(isFunction(f), () => 'The f passed in valueAndGrads(f) must be a function'); + return (args, dy) => { + assert(Array.isArray(args) && args.every(arg => arg instanceof Tensor), () => 'The args passed in valueAndGrads(f)(args) must be array of ' + + 'tensors'); + assert(dy == null || dy instanceof Tensor, () => 'The dy passed in valueAndGrads(f)(args, dy) must be a tensor'); + const res = ENGINE.gradients(() => f(...args), args, dy); + if (dy != null) { + assertShapesMatch(res.value.shape, dy.shape, 'The shape of dy passed in valueAndGrads(f)([x1,...], dy) must ' + + 'match the shape returned by f([x1,...])'); + } + checkGrads(res.grads); + return res; + }; + } + /** + * Computes and returns the gradient of f(x) with respect to the list of + * trainable variables provided by `varList`. If no list is provided, it + * defaults to all trainable variables. + * + * ```js + * const a = tf.variable(tf.tensor1d([3, 4])); + * const b = tf.variable(tf.tensor1d([5, 6])); + * const x = tf.tensor1d([1, 2]); + * + * // f(a, b) = a * x ^ 2 + b * x + * const f = () => a.mul(x.square()).add(b.mul(x)).sum(); + * // df/da = x ^ 2, df/db = x + * const {value, grads} = tf.variableGrads(f); + * + * Object.keys(grads).forEach(varName => grads[varName].print()); + * ``` + * + * @param f The function to execute. f() should return a scalar. + * @param varList The list of variables to compute the gradients with respect + * to. Defaults to all trainable variables. + * @returns An object with the following keys and values: + * - `value`: The value of the function `f`. + * - `grads`: A map from the names of the variables to the gradients. + * If the `varList` argument is provided explicitly and contains a subset of + * non-trainable variables, this map in the return value will contain keys + * that map the names of the non-trainable variables to `null`. + */ + /** @doc {heading: 'Training', subheading: 'Gradients'} */ + function variableGrads(f, varList) { + assert(isFunction(f), () => 'The f passed in variableGrads(f) must be a function'); + assert(varList == null || + Array.isArray(varList) && varList.every(v => v instanceof Variable), () => 'The varList passed in variableGrads(f, varList) must be an array ' + + 'of variables'); + const specifiedVarList = varList != null; + if (!specifiedVarList) { + // Get all of the trainable variables. + varList = []; + for (const varName in ENGINE.registeredVariables) { + varList.push(ENGINE.registeredVariables[varName]); + } + } + const specifiedNonTrainable = specifiedVarList ? varList.filter(variable => !variable.trainable) : null; + // Prune non-trainable variables. + const originalVarCount = varList.length; + varList = varList.filter(variable => variable.trainable); + assert(varList.length > 0, () => `variableGrads() expects at least one of the input variables to ` + + `be trainable, but none of the ${originalVarCount} variables is ` + + `trainable.`); + const allowNoGradients = true; + const { value, grads } = ENGINE.gradients(f, varList, null, allowNoGradients); + assert(grads.some(g => g != null), () => 'Cannot find a connection between any variable and the result of ' + + 'the loss function y=f(x). Please make sure the operations that ' + + 'use variables are inside the function f passed to minimize().'); + assert(value.rank === 0, () => `The f passed in variableGrads(f) must return a scalar, but it ` + + `returned a rank-${value.rank} tensor`); + const namedGrads = {}; + varList.forEach((v, i) => { + if (grads[i] != null) { + namedGrads[v.name] = grads[i]; + } + }); + if (specifiedNonTrainable != null) { + // If varList is explicitly provided and contains non-trainable values, + // add them to the returned gradients with `null` values. + specifiedNonTrainable.forEach(v => namedGrads[v.name] = null); + } + return { value, grads: namedGrads }; + } + /** + * Overrides the gradient computation of a function `f`. + * + * Takes a function + * `f(...inputs, save) => {value: Tensor, gradFunc: (dy, saved) => Tensor[]}` + * and returns another function `g(...inputs)` which takes the same inputs as + * `f`. When called, `g` returns `f().value`. In backward mode, custom gradients + * with respect to each input of `f` are computed using `f().gradFunc`. + * + * The `save` function passsed to `f` should be used for saving tensors needed + * in the gradient. And the `saved` passed to the `gradFunc` is a + * `NamedTensorMap`, which contains those saved tensor. + * + * ```js + * const customOp = tf.customGrad((x, save) => { + * // Save x to make sure it's available later for the gradient. + * save([x]); + * // Override gradient of our custom x ^ 2 op to be dy * abs(x); + * return { + * value: x.square(), + * // Note `saved.x` which points to the `x` we saved earlier. + * gradFunc: (dy, saved) => [dy.mul(saved[0].abs())] + * }; + * }); + * + * const x = tf.tensor1d([-1, -2, 3]); + * const dx = tf.grad(x => customOp(x)); + * + * console.log(`f(x):`); + * customOp(x).print(); + * console.log(`f'(x):`); + * dx(x).print(); + * ``` + * + * @param f The function to evaluate in forward mode, which should return + * `{value: Tensor, gradFunc: (dy, saved) => Tensor[]}`, where `gradFunc` + * returns the custom gradients of `f` with respect to its inputs. + */ + /** @doc {heading: 'Training', subheading: 'Gradients'} */ + function customGrad(f) { + return ENGINE.customGrad(f); + } + function checkGrads(grads) { + const numNullGradients = grads.filter(g => g == null).length; + if (numNullGradients > 0) { + throw new Error(`Cannot compute gradient of y=f(x) with respect to x. Make sure that + the f you passed encloses all operations that lead from x to y.`); + } + } + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Gradient helper function for the min and max operations. + */ + function gradForMinAndMax(dy, y, xOrig, origAxes, permutedAxes) { + if (y.rank < xOrig.rank) { + y = y.reshape(expandShapeToKeepDim(y.shape, origAxes)); + } + if (dy.rank < xOrig.rank) { + dy = dy.reshape(expandShapeToKeepDim(dy.shape, origAxes)); + } + return { + x: () => { + const dx = dy.mul(xOrig.equal(y).cast(dy.dtype)); + return permutedAxes == null ? dx : dx.transpose(permutedAxes); + } + }; + } + + /** + * @license + * Copyright 2018 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Computes the log(sum(exp(elements across the reduction dimensions)). + * + * Reduces the input along the dimensions given in `axis`. Unless `keepDims` + * is true, the rank of the array is reduced by 1 for each entry in `axis`. + * If `keepDims` is true, the reduced dimensions are retained with length 1. + * If `axis` has no entries, all dimensions are reduced, and an array with a + * single element is returned. + * + * ```js + * const x = tf.tensor1d([1, 2, 3]); + * + * x.logSumExp().print(); // or tf.logSumExp(x) + * ``` + * + * ```js + * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); + * + * const axis = 1; + * x.logSumExp(axis).print(); // or tf.logSumExp(a, axis) + * ``` + * @param x The input tensor. + * @param axis The dimension(s) to reduce. If null (the default), + * reduces all dimensions. + * @param keepDims If true, retains reduced dimensions with length + * of 1. Defaults to false. + */ + /** @doc {heading: 'Operations', subheading: 'Reduction'} */ + function logSumExp_(x, axis = null, keepDims = false) { + const $x = convertToTensor(x, 'x', 'logSumExp'); + const axes = parseAxisParam(axis, $x.shape); + const xMax = $x.max(axes, true /* keepDims */); + const a = $x.sub(xMax); + const b = a.exp(); + const c = b.sum(axes); + const d = c.log(); + const res = xMax.reshape(d.shape).add(d); + if (keepDims) { + const newShape = expandShapeToKeepDim(res.shape, axes); + return res.reshape(newShape); + } + return res; + } + /** + * Computes the sum of elements across dimensions of a `tf.Tensor`. + * + * Reduces the input along the dimensions given in `axes`. Unless `keepDims` + * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in + * `axes`. If `keepDims` is true, the reduced dimensions are retained with + * length 1. If axes has no entries, all dimensions are reduced, and a + * `tf.Tensor` with a single element is returned. + * + * ```js + * const x = tf.tensor1d([1, 2, 3]); + * + * x.sum().print(); // or tf.sum(x) + * ``` + * + * ```js + * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); + * + * const axis = 1; + * x.sum(axis).print(); // or tf.sum(x, axis) + * ``` + * + * @param x The input tensor to compute the sum over. If the dtype is `bool` + * it will be converted to `int32` and the output dtype will be `int32`. + * @param axis The dimension(s) to reduce. By default it reduces + * all dimensions. + * @param keepDims If true, retains reduced dimensions with size 1. + */ + /** @doc {heading: 'Operations', subheading: 'Reduction'} */ + function sum_(x, axis = null, keepDims = false) { + let $x = convertToTensor(x, 'x', 'sum'); + if ($x.dtype === 'bool') { + $x = $x.toInt(); + } + const axes = parseAxisParam(axis, $x.shape); + // Use a custom gradient to bypass 2 gradient backprops since sum is used + // extremely often. + const customOp = customGrad((x) => { + const permutation = getAxesPermutation(axes, x.rank); + let reductionAxes = axes; + let permutedX = x; + if (permutation != null) { + permutedX = x.transpose(permutation); + reductionAxes = getInnerMostAxes(reductionAxes.length, x.rank); + } + const gradFunc = (dy) => { + const expandedDyShape = x.shape.slice(); + axes.forEach(axis => { + expandedDyShape[axis] = 1; + }); + const expandedDy = dy.reshape(expandedDyShape); + const derX = expandedDy.mul(ones$1(x.shape, 'float32')); + return derX; + }; + const gradInputs = (dy) => { + return { x: () => gradFunc(dy) }; + }; + const attrs = { axes: reductionAxes }; + let value = ENGINE.runKernelFunc(backend => backend.sum(permutedX, reductionAxes), { x: permutedX }, gradInputs, 'Sum', attrs); + if (keepDims) { + const newShape = expandShapeToKeepDim(value.shape, axes); + value = value.reshape(newShape); + } + return { value, gradFunc }; + }); + return customOp($x); + } + /** + * Computes the product of elements across dimensions of a `tf.Tensor`. + * + * Reduces the input along the dimensions given in `axes`. Unless `keepDims` + * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in + * `axes`. If `keepDims` is true, the reduced dimensions are retained with + * length 1. If `axes` has no entries, all dimensions are reduced, and a + * `tf.Tensor` with a single element is returned. + * + * ```js + * const x = tf.tensor1d([1, 2, 3]); + * + * x.prod().print(); // or tf.prod(x) + * ``` + * + * ```js + * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); + * + * const axis = 1; + * x.prod(axis).print(); // or tf.prod(x, axis) + * ``` + * + * @param x The input tensor to compute the product over. If the dtype is `bool` + * it will be converted to `int32` and the output dtype will be `int32`. + * @param axis The dimension(s) to reduce. By default it reduces + * all dimensions. + * @param keepDims If true, retains reduced dimensions with size 1. + */ + /** @doc {heading: 'Operations', subheading: 'Reduction'} */ + function prod_(x, axis = null, keepDims = false) { + let $x = convertToTensor(x, 'x', 'prod'); + if ($x.dtype === 'bool') { + $x = $x.toInt(); + } + const axes = parseAxisParam(axis, $x.shape); + const permutation = getAxesPermutation(axes, $x.rank); + let reductionAxes = axes; + let permutedX = $x; + if (permutation != null) { + permutedX = $x.transpose(permutation); + reductionAxes = getInnerMostAxes(reductionAxes.length, $x.rank); + } + let value = ENGINE.runKernelFunc(backend => backend.prod(permutedX, reductionAxes), { permutedX }); + if (keepDims) { + const newShape = expandShapeToKeepDim(value.shape, axes); + value = value.reshape(newShape); + } + return value; + } + /** + * Computes the mean of elements across dimensions of a `tf.Tensor`. + * + * Reduces `x` along the dimensions given in `axis`. Unless `keepDims` is + * true, the rank of the `tf.Tensor` is reduced by 1 for each entry in `axis`. + * If `keepDims` is true, the reduced dimensions are retained with length 1. + * If `axis` has no entries, all dimensions are reduced, and a `tf.Tensor` with + * a single element is returned. + * + * ```js + * const x = tf.tensor1d([1, 2, 3]); + * + * x.mean().print(); // or tf.mean(a) + * ``` + * + * ```js + * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); + * + * const axis = 1; + * x.mean(axis).print(); // or tf.mean(x, axis) + * ``` + * + * @param x The input tensor. + * @param axis The dimension(s) to reduce. By default it reduces + * all dimensions. + * @param keepDims If true, retains reduced dimensions with size 1. + */ + /** @doc {heading: 'Operations', subheading: 'Reduction'} */ + function mean_(x, axis = null, keepDims = false) { + const $x = convertToTensor(x, 'x', 'mean'); + const axes = parseAxisParam(axis, $x.shape); + const shapes = computeOutAndReduceShapes($x.shape, axes); + const reduceShape = shapes[1]; + const reduceSize = sizeFromShape(reduceShape); + // Use a custom gradient to bypass 2 gradient backprops since mean is used + // extremely often. + const customOp = customGrad((x) => { + const reduceSizeScalar = scalar(reduceSize); + // Cast if needed. + const xReduce = reduceSizeScalar.dtype === x.dtype ? x : x.cast(reduceSizeScalar.dtype); + const res = xReduce.div(reduceSizeScalar); + const value = res.sum(axis, keepDims); + const gradFunc = (dy) => { + const expandedDyShape = x.shape.slice(); + axes.forEach(axis => { + expandedDyShape[axis] = 1; + }); + const expandedDy = dy.reshape(expandedDyShape); + const derX = expandedDy.mul(ones$1(x.shape, 'float32')).div(reduceSize); + return derX; + }; + return { value, gradFunc }; + }); + return customOp($x); + } + /** + * Computes the minimum value from the input. + * + * Reduces the input along the dimensions given in `axes`. Unless `keepDims` + * is true, the rank of the array is reduced by 1 for each entry in `axes`. + * If `keepDims` is true, the reduced dimensions are retained with length 1. + * If `axes` has no entries, all dimensions are reduced, and an array with a + * single element is returned. + * + * ```js + * const x = tf.tensor1d([1, 2, 3]); + * + * x.min().print(); // or tf.min(x) + * ``` + * + * ```js + * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); + * + * const axis = 1; + * x.min(axis).print(); // or tf.min(x, axis) + * ``` + * + * @param x The input Tensor. + * @param axis The dimension(s) to reduce. By default it reduces + * all dimensions. + * @param keepDims If true, retains reduced dimensions with size 1. + */ + /** @doc {heading: 'Operations', subheading: 'Reduction'} */ + function min_(x, axis = null, keepDims = false) { + let $x = convertToTensor(x, 'x', 'min'); + const xOrig = $x; + const origAxes = parseAxisParam(axis, $x.shape); + let axes = origAxes; + const permutedAxes = getAxesPermutation(axes, $x.rank); + if (permutedAxes != null) { + $x = $x.transpose(permutedAxes); + axes = getInnerMostAxes(axes.length, $x.rank); + } + const grad = (dy, saved) => gradForMinAndMax(dy, saved[1], saved[0], origAxes, permutedAxes); + const inputsToSave = [$x]; + const outputsToSave = [true]; + let res = ENGINE.runKernelFunc((backend, save) => { + const y = backend.min($x, axes); + save([xOrig, y]); + return y; + }, { x: $x }, grad, 'Min', { axes }, inputsToSave, outputsToSave); + if (keepDims) { + const newShape = expandShapeToKeepDim(res.shape, origAxes); + res = res.reshape(newShape); + } + return res; + } + /** + * Returns the indices of the minimum values along an `axis`. + * + * The result has the same shape as `input` with the dimension along `axis` + * removed. + * + * ```js + * const x = tf.tensor1d([1, 2, 3]); + * + * x.argMin().print(); // or tf.argMin(x) + * ``` + * + * ```js + * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]); + * + * const axis = 1; + * x.argMin(axis).print(); // or tf.argMin(x, axis) + * ``` + * + * @param x The input tensor. + * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension). + * + */ + /** @doc {heading: 'Operations', subheading: 'Reduction'} */ + function argMin_(x, axis = 0) { + let $x = convertToTensor(x, 'x', 'argMin'); + if (axis == null) { + axis = 0; + } + let axes = parseAxisParam(axis, $x.shape); + const permutedAxes = getAxesPermutation(axes, $x.rank); + if (permutedAxes != null) { + $x = $x.transpose(permutedAxes); + axes = getInnerMostAxes(axes.length, $x.rank); + } + const grad = (dy, saved) => { + const [$x] = saved; + return { $x: () => zerosLike($x) }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.argMin($x, axes[0]); + save([$x]); + return res; + }, { $x }, grad); + } + /** + * Returns the indices of the maximum values along an `axis`. + * + * The result has the same shape as `input` with the dimension along `axis` + * removed. + * + * ```js + * const x = tf.tensor1d([1, 2, 3]); + * + * x.argMax().print(); // or tf.argMax(x) + * ``` + * + * ```js + * const x = tf.tensor2d([1, 2, 4, 3], [2, 2]); + * + * const axis = 1; + * x.argMax(axis).print(); // or tf.argMax(x, axis) + * ``` + * + * @param x The input tensor. + * @param axis The dimension to reduce. Defaults to 0 (outer-most dimension). + */ + /** @doc {heading: 'Operations', subheading: 'Reduction'} */ + function argMax_(x, axis = 0) { + let $x = convertToTensor(x, 'x', 'argMax'); + if (axis == null) { + axis = 0; + } + let axes = parseAxisParam(axis, $x.shape); + const permutedAxes = getAxesPermutation(axes, $x.rank); + if (permutedAxes != null) { + $x = $x.transpose(permutedAxes); + axes = getInnerMostAxes(axes.length, $x.rank); + } + const grad = (dy, saved) => { + const [$x] = saved; + return { x: () => zerosLike($x) }; + }; + const attrs = { axis: axes[0] }; + const inputsToSave = [$x]; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.argMax($x, axes[0]); + save([$x]); + return res; + }, { x: $x }, grad, 'ArgMax', attrs, inputsToSave); + } + /** + * Computes the logical and of elements across dimensions of a `tf.Tensor`. + * + * Reduces the input along the dimensions given in `axes`. Unless `keepDims` + * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in + * `axes`. If `keepDims` is true, the reduced dimensions are retained with + * length 1. If `axes` has no entries, all dimensions are reduced, and an + * `tf.Tensor` with a single element is returned. + * + * ```js + * const x = tf.tensor1d([1, 1, 1], 'bool'); + * + * x.all().print(); // or tf.all(x) + * ``` + * + * ```js + * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool'); + * + * const axis = 1; + * x.all(axis).print(); // or tf.all(x, axis) + * ``` + * + * @param x The input tensor. Must be of dtype bool. + * @param axis The dimension(s) to reduce. By default it reduces + * all dimensions. + * @param keepDims If true, retains reduced dimensions with size 1. + */ + /** @doc {heading: 'Operations', subheading: 'Reduction'} */ + function all_(x, axis = null, keepDims = false) { + let $x = convertToTensor(x, 'x', 'all', 'bool'); + const origAxes = parseAxisParam(axis, $x.shape); + let axes = origAxes; + const permutedAxes = getAxesPermutation(axes, $x.rank); + if (permutedAxes != null) { + $x = $x.transpose(permutedAxes); + axes = getInnerMostAxes(axes.length, $x.rank); + } + const res = ENGINE.runKernelFunc(backend => backend.all($x, axes), { $x }); + if (keepDims) { + const newShape = expandShapeToKeepDim(res.shape, origAxes); + return res.reshape(newShape); + } + return res; + } + /** + * Computes the logical or of elements across dimensions of a `tf.Tensor`. + * + * Reduces the input along the dimensions given in `axes`. Unless `keepDims` + * is true, the rank of the `tf.Tensor` is reduced by 1 for each entry in + * `axes`. If `keepDims` is true, the reduced dimensions are retained with + * length 1. If `axes` has no entries, all dimensions are reduced, and an + * `tf.Tensor` with a single element is returned. + * + * ```js + * const x = tf.tensor1d([1, 1, 1], 'bool'); + * + * x.any().print(); // or tf.any(x) + * ``` + * + * ```js + * const x = tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool'); + * + * const axis = 1; + * x.any(axis).print(); // or tf.any(x, axis) + * ``` + * + * @param x The input tensor. Must be of dtype bool. + * @param axis The dimension(s) to reduce. By default it reduces + * all dimensions. + * @param keepDims If true, retains reduced dimensions with size 1. + */ + /** @doc {heading: 'Operations', subheading: 'Reduction'} */ + function any_(x, axis = null, keepDims = false) { + let $x = convertToTensor(x, 'x', 'any', 'bool'); + const origAxes = parseAxisParam(axis, $x.shape); + let axes = origAxes; + const permutedAxes = getAxesPermutation(axes, $x.rank); + if (permutedAxes != null) { + $x = $x.transpose(permutedAxes); + axes = getInnerMostAxes(axes.length, $x.rank); + } + const res = ENGINE.runKernelFunc(backend => backend.any($x, axes), { $x }); + if (keepDims) { + const newShape = expandShapeToKeepDim(res.shape, origAxes); + return res.reshape(newShape); + } + return res; + } + /** + * Calculates the mean and variance of `x`. The mean and variance are + * calculated by aggregating the contents of `x` across `axes`. If `x` is + * 1-D and `axes = [0]` this is just the mean and variance of a vector. + * + * @param x The input tensor. + * @param axis The dimension(s) along with to compute mean and + * variance. By default it reduces all dimensions. + * @param keepDims If true, the moments have the same dimensionality as the + * input. + * @return An object with two keys: `mean` and `variance`. + */ + /** @doc {heading: 'Operations', subheading: 'Normalization'} */ + function moments_(x, axis = null, keepDims = false) { + x = convertToTensor(x, 'x', 'moments'); + const axes = parseAxisParam(axis, x.shape); + const mean = x.mean(axes, keepDims); + let keepDimsShape = mean.shape; + if (!keepDims) { + keepDimsShape = expandShapeToKeepDim(mean.shape, axes); + } + const devSquared = x.toFloat().sub(mean.reshape(keepDimsShape)).square(); + const variance = devSquared.mean(axes, keepDims); + return { mean, variance }; + } + const all = op({ all_ }); + // tslint:disable-next-line:variable-name + const any = op({ any_ }); + const argMax = op({ argMax_ }); + const argMin = op({ argMin_ }); + const logSumExp = op({ logSumExp_ }); + const mean = op({ mean_ }); + const min = op({ min_ }); + const moments = op({ moments_ }); + const sum$1 = op({ sum_ }); + const prod = op({ prod_ }); + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const broadcastToGradConfig = { + kernelName: BroadcastTo, + gradFunc: (dy, saved, attrs) => { + const broadCastToAttrs = attrs; + const inputShape = broadCastToAttrs.inputShape; + const outputShape = broadCastToAttrs.shape; + const reps = Array.from(outputShape); + for (let i = inputShape.length - 1; i >= 0; i--) { + if (inputShape[i] === outputShape[i]) { + reps[i] = 1; + } + else if (inputShape[i] !== 1) { + throw new Error(`broadcastTo(): [${inputShape}] cannot be broadcast to [${outputShape}].`); + } + } + const axes = []; + for (let i = 0; i < reps.length; i++) { + if (reps[i] > 1) { + axes.push(i); + } + } + return { x: () => sum$1(dy, axes, true /* keepDims */) }; + } + }; + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Splits a `tf.Tensor` into sub tensors. + * + * If `numOrSizeSplits` is a number, splits `x` along dimension `axis` + * into `numOrSizeSplits` smaller tensors. + * Requires that `numOrSizeSplits` evenly divides `x.shape[axis]`. + * + * If `numOrSizeSplits` is a number array, splits `x` into + * `numOrSizeSplits.length` pieces. The shape of the `i`-th piece has the + * same size as `x` except along dimension `axis` where the size is + * `numOrSizeSplits[i]`. + * + * ```js + * const x = tf.tensor2d([1, 2, 3, 4, 5, 6, 7, 8], [2, 4]); + * const [a, b] = tf.split(x, 2, 1); + * a.print(); + * b.print(); + * + * const [c, d, e] = tf.split(x, [1, 2, 1], 1); + * c.print(); + * d.print(); + * e.print(); + * ``` + * + * @param x The input tensor to split. + * @param numOrSizeSplits Either an integer indicating the number of + * splits along the axis or an array of integers containing the sizes of + * each output tensor along the axis. If a number then it must evenly divide + * `x.shape[axis]`; otherwise the sum of sizes must match `x.shape[axis]`. + * @param axis The dimension along which to split. Defaults to 0 (the first + * dim). + */ + /** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */ + function split_(x, numOrSizeSplits, axis = 0) { + const $x = convertToTensor(x, 'x', 'split'); + const $axis = parseAxisParam(axis, $x.shape)[0]; + let splitSizes; + if (typeof (numOrSizeSplits) === 'number') { + assert($x.shape[$axis] % numOrSizeSplits === 0, () => 'Number of splits must evenly divide the axis.'); + splitSizes = + new Array(numOrSizeSplits).fill($x.shape[$axis] / numOrSizeSplits); + } + else { + assert($x.shape[$axis] === numOrSizeSplits.reduce((a, b) => a + b), () => 'The sum of sizes must match the size of the axis dimension.'); + splitSizes = numOrSizeSplits; + } + const forward = (backend, _) => { + return backend.split($x, splitSizes, $axis); + }; + const inputs = { x: $x }; + const attr = { numOrSizeSplits, axis }; + return ENGINE.runKernelFunc(forward, inputs, null /* grad */, SplitV, attr); + } + const split = op({ split_ }); + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const concatGradConfig = { + kernelName: Concat, + saveAllInputs: true, + gradFunc: (dy, saved, attrs) => { + const shapes = saved.map(t => t.shape); + const { axis } = attrs; + const $axis = parseAxisParam(axis, saved[0].shape)[0]; + const sizeSplits = shapes.map(s => s[$axis]); + const derTensors = split(dy, sizeSplits, $axis); + return derTensors.map(t => () => t); + } + }; + + /** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + function computePool2DInfo(inShape, filterSize, strides, dilations, pad, roundingMode, dataFormat = 'channelsLast') { + const [filterHeight, filterWidth] = parseTupleParam(filterSize); + let filterShape; + if (dataFormat === 'channelsLast') { + filterShape = [filterHeight, filterWidth, inShape[3], inShape[3]]; + } + else if (dataFormat === 'channelsFirst') { + filterShape = [filterHeight, filterWidth, inShape[1], inShape[1]]; + } + else { + throw new Error(`Unknown dataFormat ${dataFormat}`); + } + return computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, false, dataFormat); + } + /** + * Computes the information for a forward pass of a pooling3D operation. + */ + function computePool3DInfo(inShape, filterSize, strides, dilations, pad, roundingMode, dataFormat = 'NDHWC') { + const [filterDepth, filterHeight, filterWidth] = parse3TupleParam(filterSize); + let filterShape; + let $dataFormat; + if (dataFormat === 'NDHWC') { + $dataFormat = 'channelsLast'; + filterShape = + [filterDepth, filterHeight, filterWidth, inShape[4], inShape[4]]; + } + else if (dataFormat === 'NCDHW') { + $dataFormat = 'channelsFirst'; + filterShape = + [filterDepth, filterHeight, filterWidth, inShape[1], inShape[1]]; + } + else { + throw new Error(`Unknown dataFormat ${dataFormat}`); + } + return computeConv3DInfo(inShape, filterShape, strides, dilations, pad, false, $dataFormat, roundingMode); + } + /** + * Computes the information for a forward pass of a convolution/pooling + * operation. + */ + function computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, depthwise = false, dataFormat = 'channelsLast') { + let [batchSize, inHeight, inWidth, inChannels] = [-1, -1, -1, -1]; + if (dataFormat === 'channelsLast') { + [batchSize, inHeight, inWidth, inChannels] = inShape; + } + else if (dataFormat === 'channelsFirst') { + [batchSize, inChannels, inHeight, inWidth] = inShape; + } + else { + throw new Error(`Unknown dataFormat ${dataFormat}`); + } + const [filterHeight, filterWidth, , filterChannels] = filterShape; + const [strideHeight, strideWidth] = parseTupleParam(strides); + const [dilationHeight, dilationWidth] = parseTupleParam(dilations); + const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight); + const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth); + const { padInfo, outHeight, outWidth } = getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, effectiveFilterHeight, effectiveFilterWidth, roundingMode); + const outChannels = depthwise ? filterChannels * inChannels : filterChannels; + let outShape; + if (dataFormat === 'channelsFirst') { + outShape = [batchSize, outChannels, outHeight, outWidth]; + } + else if (dataFormat === 'channelsLast') { + outShape = [batchSize, outHeight, outWidth, outChannels]; + } + return { + batchSize, + dataFormat, + inHeight, + inWidth, + inChannels, + outHeight, + outWidth, + outChannels, + padInfo, + strideHeight, + strideWidth, + filterHeight, + filterWidth, + effectiveFilterHeight, + effectiveFilterWidth, + dilationHeight, + dilationWidth, + inShape, + outShape, + filterShape + }; + } + /** + * Computes the information for a forward pass of a 3D convolution/pooling + * operation. + */ + function computeConv3DInfo(inShape, filterShape, strides, dilations, pad, depthwise = false, dataFormat = 'channelsLast', roundingMode) { + let [batchSize, inDepth, inHeight, inWidth, inChannels] = [-1, -1, -1, -1, -1]; + if (dataFormat === 'channelsLast') { + [batchSize, inDepth, inHeight, inWidth, inChannels] = inShape; + } + else if (dataFormat === 'channelsFirst') { + [batchSize, inChannels, inDepth, inHeight, inWidth] = inShape; + } + else { + throw new Error(`Unknown dataFormat ${dataFormat}`); + } + const [filterDepth, filterHeight, filterWidth, , filterChannels] = filterShape; + const [strideDepth, strideHeight, strideWidth] = parse3TupleParam(strides); + const [dilationDepth, dilationHeight, dilationWidth] = parse3TupleParam(dilations); + const effectiveFilterDepth = getEffectiveFilterSize(filterDepth, dilationDepth); + const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight); + const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth); + const { padInfo, outDepth, outHeight, outWidth } = get3DPadAndOutInfo(pad, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, effectiveFilterDepth, effectiveFilterHeight, effectiveFilterWidth, roundingMode); + const outChannels = depthwise ? filterChannels * inChannels : filterChannels; + let outShape; + if (dataFormat === 'channelsFirst') { + outShape = [batchSize, outChannels, outDepth, outHeight, outWidth]; + } + else if (dataFormat === 'channelsLast') { + outShape = [batchSize, outDepth, outHeight, outWidth, outChannels]; + } + return { + batchSize, + dataFormat, + inDepth, + inHeight, + inWidth, + inChannels, + outDepth, + outHeight, + outWidth, + outChannels, + padInfo, + strideDepth, + strideHeight, + strideWidth, + filterDepth, + filterHeight, + filterWidth, + effectiveFilterDepth, + effectiveFilterHeight, + effectiveFilterWidth, + dilationDepth, + dilationHeight, + dilationWidth, + inShape, + outShape, + filterShape + }; + } + function computeOutputShape2D(inShape, fieldSize, stride, zeroPad, roundingMode) { + if (zeroPad == null) { + zeroPad = computeDefaultPad(inShape, fieldSize, stride); + } + const inputRows = inShape[0]; + const inputCols = inShape[1]; + const outputRows = conditionalRound((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode); + assert(isInt(outputRows), () => `The output # of rows (${outputRows}) must be an integer. ` + + `Change the stride and/or zero pad parameters`); + const outputCols = conditionalRound((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode); + assert(isInt(outputCols), () => `The output # of columns (${outputCols}) must be an integer. ` + + `Change the stride and/or zero pad parameters`); + return [outputRows, outputCols]; + } + function computeOutputShape4D(inShape, fieldSize, outChannels, stride, zeroPad, roundingMode) { + if (zeroPad == null) { + zeroPad = computeDefaultPad(inShape, fieldSize, stride); + } + const inputDepth = inShape[0]; + const inputRows = inShape[1]; + const inputCols = inShape[2]; + const outputDepths = conditionalRound((inputDepth - fieldSize + 2 * zeroPad) / stride + 1, roundingMode); + assert(isInt(outputDepths), () => `The output # of depths (${outputDepths}) must be an integer. ` + + `Change the stride and/or zero pad parameters`); + const outputRows = conditionalRound((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode); + assert(isInt(outputRows), () => `The output # of rows (${outputRows}) must be an integer. ` + + `Change the stride and/or zero pad parameters`); + const outputCols = conditionalRound((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode); + assert(isInt(outputCols), () => `The output # of columns (${outputCols}) must be an integer. ` + + `Change the stride and/or zero pad parameters`); + return [outputDepths, outputRows, outputCols, outChannels]; + } + function computeDefaultPad(inputShape, fieldSize, stride, dilation = 1) { + const effectiveFieldSize = getEffectiveFilterSize(fieldSize, dilation); + return Math.floor((inputShape[0] * (stride - 1) - stride + effectiveFieldSize) / 2); + } + function parseTupleParam(param) { + if (typeof param === 'number') { + return [param, param, param]; + } + if (param.length === 2) { + return [param[0], param[1], 1]; + } + return param; + } + function parse3TupleParam(param) { + return typeof param === 'number' ? [param, param, param] : param; + } + /* See https://www.tensorflow.org/api_docs/python/tf/nn/atrous_conv2d + * Atrous convolution is equivalent to standard convolution with upsampled + * filters with effective_filter_height = + * filter_height + (filter_height - 1) * (dilation - 1) + * and effective_filter_width = + * filter_width + (filter_width - 1) * (dilation - 1), + * produced by inserting dilation - 1 zeros along consecutive elements across + * the filters' spatial dimensions. + * When there is a dilation, this converts a filter dimension to the + * effective filter dimension, so it can be used in a standard convolution. + */ + function getEffectiveFilterSize(filterSize, dilation) { + if (dilation <= 1) { + return filterSize; + } + return filterSize + (filterSize - 1) * (dilation - 1); + } + function getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, filterHeight, filterWidth, roundingMode) { + let padInfo; + let outHeight; + let outWidth; + if (typeof pad === 'number') { + const padType = (pad === 0) ? 'VALID' : 'NUMBER'; + padInfo = { top: pad, bottom: pad, left: pad, right: pad, type: padType }; + const outShape = computeOutputShape2D([inHeight, inWidth], filterHeight, strideHeight, pad, roundingMode); + outHeight = outShape[0]; + outWidth = outShape[1]; + } + else if (pad === 'same') { + outHeight = Math.ceil(inHeight / strideHeight); + outWidth = Math.ceil(inWidth / strideWidth); + const padAlongHeight = Math.max(0, (outHeight - 1) * strideHeight + filterHeight - inHeight); + const padAlongWidth = Math.max(0, (outWidth - 1) * strideWidth + filterWidth - inWidth); + const top = Math.floor(padAlongHeight / 2); + const bottom = padAlongHeight - top; + const left = Math.floor(padAlongWidth / 2); + const right = padAlongWidth - left; + padInfo = { top, bottom, left, right, type: 'SAME' }; + } + else if (pad === 'valid') { + padInfo = { top: 0, bottom: 0, left: 0, right: 0, type: 'VALID' }; + outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight); + outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth); + } + else { + throw Error(`Unknown padding parameter: ${pad}`); + } + return { padInfo, outHeight, outWidth }; + } + function get3DPadAndOutInfo(pad, inDepth, inHeight, inWidth, strideDepth, strideHeight, strideWidth, filterDepth, filterHeight, filterWidth, roundingMode) { + let padInfo; + let outDepth; + let outHeight; + let outWidth; + if (typeof pad === 'number') { + const padType = (pad === 0) ? 'VALID' : 'NUMBER'; + padInfo = { + top: pad, + bottom: pad, + left: pad, + right: pad, + front: pad, + back: pad, + type: padType + }; + const outShape = computeOutputShape4D([inDepth, inHeight, inWidth, 1], filterDepth, 1, strideDepth, pad, roundingMode); + outDepth = outShape[0]; + outHeight = outShape[1]; + outWidth = outShape[2]; + } + else if (pad === 'same') { + outDepth = Math.ceil(inDepth / strideDepth); + outHeight = Math.ceil(inHeight / strideHeight); + outWidth = Math.ceil(inWidth / strideWidth); + const padAlongDepth = (outDepth - 1) * strideDepth + filterDepth - inDepth; + const padAlongHeight = (outHeight - 1) * strideHeight + filterHeight - inHeight; + const padAlongWidth = (outWidth - 1) * strideWidth + filterWidth - inWidth; + const front = Math.floor(padAlongDepth / 2); + const back = padAlongDepth - front; + const top = Math.floor(padAlongHeight / 2); + const bottom = padAlongHeight - top; + const left = Math.floor(padAlongWidth / 2); + const right = padAlongWidth - left; + padInfo = { top, bottom, left, right, front, back, type: 'SAME' }; + } + else if (pad === 'valid') { + padInfo = { + top: 0, + bottom: 0, + left: 0, + right: 0, + front: 0, + back: 0, + type: 'VALID' + }; + outDepth = Math.ceil((inDepth - filterDepth + 1) / strideDepth); + outHeight = Math.ceil((inHeight - filterHeight + 1) / strideHeight); + outWidth = Math.ceil((inWidth - filterWidth + 1) / strideWidth); + } + else { + throw Error(`Unknown padding parameter: ${pad}`); + } + return { padInfo, outDepth, outHeight, outWidth }; + } + /** + * Rounds a value depending on the rounding mode + * @param value + * @param roundingMode + */ + function conditionalRound(value, roundingMode) { + if (!roundingMode) { + return value; + } + switch (roundingMode) { + case 'round': + // used for Caffe Conv + return Math.round(value); + case 'ceil': + // used for Caffe Pool + return Math.ceil(value); + case 'floor': + return Math.floor(value); + default: + throw new Error(`Unknown roundingMode ${roundingMode}`); + } + } + function tupleValuesAreOne(param) { + const [dimA, dimB, dimC] = parseTupleParam(param); + return dimA === 1 && dimB === 1 && dimC === 1; + } + function eitherStridesOrDilationsAreOne(strides, dilations) { + return tupleValuesAreOne(strides) || tupleValuesAreOne(dilations); + } + /** + * Convert Conv2D dataFormat from 'NHWC'|'NCHW' to + * 'channelsLast'|'channelsFirst' + * @param dataFormat in 'NHWC'|'NCHW' mode + * @return dataFormat in 'channelsLast'|'channelsFirst' mode + * @throws unknown dataFormat + */ + function convertConv2DDataFormat(dataFormat) { + if (dataFormat === 'NHWC') { + return 'channelsLast'; + } + else if (dataFormat === 'NCHW') { + return 'channelsFirst'; + } + else { + throw new Error(`Unknown dataFormat ${dataFormat}`); + } + } + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Computes the derivative of the filter of a 2D convolution. + * + * @param x The input tensor, of rank 4 or rank 3 of shape + * [batch, height, width, inChannels]. If rank 3, batch of 1 is assumed. + * @param dy The dy image, of rank 4 or rank 3, of shape + * [batch, height, width, outDepth]. If rank 3, batch of 1 is assumed. + * @param filterShape The shape of the filter, length 4, + * [filterHeight, filterWidth, inDepth, outDepth]. + * @param strides The strides of the convolution: [strideHeight, + * strideWidth]. + * @param pad A string from: 'same', 'valid'. The type of padding algorithm + * used in the forward prop of the op. + * @param dataFormat: An optional string from: "NHWC", "NCHW". Defaults to + * "NHWC". Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: [batch, + * height, width, channels]. + * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. The + * rounding mode used when computing output dimensions if pad is a + * number. If none is provided, it will not round and error if the output + * is of fractional size. + */ + function conv2DBackpropFilter_(x, dy, filterShape, strides, pad, dataFormat = 'NHWC', dimRoundingMode) { + let x4D = x; + if (x.rank === 3) { + x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]); + } + let dy4D = dy; + if (dy4D.rank === 3) { + dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); + } + assert(x4D.rank === 4, () => `Error in conv2dDerFilter: input must be rank 4, but got shape ` + + `${x4D.shape}.`); + assert(dy4D.rank === 4, () => `Error in conv2dDerFilter: dy must be rank 4, but got shape ` + + `${dy4D.shape}.`); + assert(filterShape.length === 4, () => `Error in conv2dDerFilter: filterShape must be length 4, but got ` + + `${filterShape}.`); + const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1]; + const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1]; + assert(inDepth === filterShape[2], () => `Error in conv2dDerFilter: depth of input ${inDepth}) must ` + + `match input depth in filter (${filterShape[2]}.`); + assert(outDepth === filterShape[3], () => `Error in conv2dDerFilter: depth of dy (${outDepth}) must ` + + `match output depth for filter (${filterShape[3]}).`); + if (dimRoundingMode != null) { + assert(isInt(pad), () => `Error in conv2dDerFilter: pad must be an integer when using, ` + + `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); + } + const forward = backend => { + const dilations = 1; + const $dataFormat = convertConv2DDataFormat(dataFormat); + const convInfo = computeConv2DInfo(x4D.shape, filterShape, strides, dilations, pad, dimRoundingMode, false, $dataFormat); + return backend.conv2dDerFilter(x4D, dy4D, convInfo); + }; + const inputs = { x: x4D, dy: dy4D }; + const attrs = { strides, pad, dataFormat, dimRoundingMode }; + return ENGINE.runKernelFunc(forward, inputs, null, Conv2DBackpropFilter, attrs); + } + const conv2DBackpropFilter = op({ conv2DBackpropFilter_ }); + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Computes the derivative of the input of a 2D convolution. + * + * @param xShape The shape of the input: [batch, height, width, inDepth]. + * If length of 3, batch of 1 is assumed. + * @param dy The derivative of the output, of rank 4 or rank 3 of shape + * `[batch, outHeight, outWidth, outDepth]`. If rank 3, batch of 1 is + * assumed. + * @param filter The filter, rank 4, of shape + * `[filterHeight, filterWidth, inDepth, outDepth]`. + * @param strides The strides of the convolution: `[strideHeight, + * strideWidth]`. + * @param pad The type of padding algorithm used: + * - `same` and stride 1: output will be of same size as input, + * regardless of filter size. + * - `valid`: output will be smaller than input if filter is larger + * than 1x1. + * @param dataFormat: An optional string from: "NHWC", "NCHW". Defaults to + * "NHWC". Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: [batch, + * height, width, channels]. + * @param dimRoundingMode The rounding mode used when computing output + * dimensions if pad is a number. If none is provided, it will not round + * and error if the output is of fractional size. + */ + function conv2DBackpropInput_(xShape, dy, filter, strides, pad, dataFormat = 'NHWC', dimRoundingMode) { + assert(xShape.length === dy.rank, () => `Length of inShape ` + + `(${xShape.length}) and rank of dy (${dy.rank}) must match`); + let xShape4D = xShape; + let dy4D = dy; + let reshapedTo4D = false; + if (dy.rank === 3) { + reshapedTo4D = true; + dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); + xShape4D = [1, xShape[0], xShape[1], xShape[2]]; + } + assert(xShape4D.length === 4, () => `Error in conv2dDerInput: inShape must be length 4, but got length ` + + `${xShape4D.length}.`); + assert(dy4D.rank === 4, () => `Error in conv2dDerInput: dy must be rank 4, but got ` + + `rank ${dy4D.rank}`); + assert(filter.rank === 4, () => `Error in conv2dDerInput: filter must be rank 4, but got ` + + `rank ${filter.rank}`); + const inDepth = dataFormat === 'NHWC' ? xShape4D[3] : xShape4D[1]; + const outDepth = dataFormat === 'NHWC' ? dy4D.shape[3] : dy4D.shape[1]; + assert(inDepth === filter.shape[2], () => `Error in conv2dDerInput: depth of input (${inDepth}) must ` + + `match input depth for filter ${filter.shape[2]}.`); + assert(outDepth === filter.shape[3], () => `Error in conv2dDerInput: depth of output (${outDepth}) must ` + + `match output depth for filter ${filter.shape[3]}.`); + if (dimRoundingMode != null) { + assert(isInt(pad), () => `Error in conv2dDerInput: pad must be an integer when using, ` + + `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); + } + const forward = (backend, save) => { + const dilations = 1; + const $dataFormat = convertConv2DDataFormat(dataFormat); + const convInfo = computeConv2DInfo(xShape4D, filter.shape, strides, dilations, pad, dimRoundingMode, false, $dataFormat); + const res = backend.conv2dDerInput(dy4D, filter, convInfo); + save([dy4D, filter]); + return res; + }; + const inputs = { dy: dy4D, filter }; + const attrs = { strides, pad, dataFormat, dimRoundingMode }; + const res = ENGINE.runKernelFunc(forward, inputs, null /* grad */, Conv2DBackpropInput, attrs); + if (reshapedTo4D) { + return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); + } + return res; + } + const conv2DBackpropInput = op({ conv2DBackpropInput_ }); + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const conv2DGradConfig = { + kernelName: Conv2D, + inputsToSave: ['x', 'filter'], + gradFunc: (dy, saved, attrs) => { + const [x4D, $filter] = saved; + const { dilations, strides, pad, dataFormat } = attrs; + assert(tupleValuesAreOne(dilations), () => 'Error in gradient of conv2D: dilation rates greater than 1 ' + + `are not yet supported in gradients. Got dilations '${dilations}'`); + return { + x: () => conv2DBackpropInput(x4D.shape, dy, $filter, strides, pad, dataFormat), + filter: () => conv2DBackpropFilter(x4D, dy, $filter.shape, strides, pad, dataFormat) + }; + } + }; + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Computes a 2D convolution over the input x. + * + * @param x The input tensor, of rank 4 or rank 3, of shape + * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is + * assumed. + * @param filter The filter, rank 4, of shape + * `[filterHeight, filterWidth, inDepth, outDepth]`. + * @param strides The strides of the convolution: `[strideHeight, + * strideWidth]`. + * @param pad The type of padding algorithm. + * - `same` and stride 1: output will be of same size as input, + * regardless of filter size. + * - `valid`: output will be smaller than input if filter is larger + * than 1x1. + * - For more info, see this guide: + * [https://www.tensorflow.org/api_guides/python/nn#Convolution]( + * https://www.tensorflow.org/api_guides/python/nn#Convolution) + * @param dataFormat: An optional string from: "NHWC", "NCHW". Defaults to + * "NHWC". Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: [batch, + * height, width, channels]. + * @param dilations The dilation rates: `[dilationHeight, dilationWidth]` + * in which we sample input values across the height and width dimensions + * in atrous convolution. Defaults to `[1, 1]`. If `dilations` is a single + * number, then `dilationHeight == dilationWidth`. If it is greater than + * 1, then all values of `strides` must be 1. + * @param dimRoundingMode The rounding mode used when computing output + * dimensions if pad is a number. If none is provided, it will not round + * and error if the output is of fractional size. + */ + /** @doc {heading: 'Operations', subheading: 'Convolution'} */ + function conv2d_(x, filter, strides, pad, dataFormat = 'NHWC', dilations = [1, 1], dimRoundingMode) { + const $x = convertToTensor(x, 'x', 'conv2d'); + const $filter = convertToTensor(filter, 'filter', 'conv2d'); + let x4D = $x; + let reshapedTo4D = false; + if ($x.rank === 3) { + reshapedTo4D = true; + x4D = reshape($x, [1, $x.shape[0], $x.shape[1], $x.shape[2]]); + } + assert(x4D.rank === 4, () => `Error in conv2d: input must be rank 4, but got rank ${x4D.rank}.`); + assert($filter.rank === 4, () => `Error in conv2d: filter must be rank 4, but got rank ` + + `${$filter.rank}.`); + if (dimRoundingMode != null) { + assert(isInt(pad), () => `Error in conv2d: pad must be an integer when using, ` + + `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); + } + const inDepth = dataFormat === 'NHWC' ? x4D.shape[3] : x4D.shape[1]; + assert(inDepth === $filter.shape[2], () => `Error in conv2d: depth of input (${inDepth}) must match ` + + `input depth for filter ${$filter.shape[2]}.`); + assert(eitherStridesOrDilationsAreOne(strides, dilations), () => 'Error in conv2D: Either strides or dilations must be 1. ' + + `Got strides ${strides} and dilations '${dilations}'`); + const forward = (backend, save) => { + const $dataFormat = convertConv2DDataFormat(dataFormat); + const convInfo = computeConv2DInfo(x4D.shape, $filter.shape, strides, dilations, pad, dimRoundingMode, false, $dataFormat); + const res = backend.conv2d(x4D, $filter, convInfo); + save([x4D, $filter]); + return res; + }; + const inputs = { x: x4D, filter: $filter }; + const attrs = { strides, pad, dataFormat, dilations, dimRoundingMode }; + const res = ENGINE.runKernelFunc(forward, inputs, null /* grad */, Conv2D, attrs); + if (reshapedTo4D) { + return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); + } + return res; + } + const conv2d = op({ conv2d_ }); + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const conv2DBackpropInputGradConfig = { + kernelName: Conv2DBackpropInput, + inputsToSave: ['dy', 'filter'], + gradFunc: (ddx, saved, attrs) => { + const [dy, filter] = saved; + const { strides, pad, dataFormat, dimRoundingMode } = attrs; + return { + dy: () => conv2d(ddx, filter, strides, pad, dataFormat, 1 /* dilations */, dimRoundingMode), + filter: () => conv2DBackpropFilter(ddx, dy, filter.shape, strides, pad, dataFormat, dimRoundingMode) + }; + } + }; + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Computes the derivative of the filter of a 3D convolution. + * + * @param x The input tensor, of rank 5 or rank 4 of shape + * [batch, depth, height, width, inChannels]. If rank 4, batch of 1 is + * assumed. + * @param dy The dy image, of rank 5 or rank 4, of shape + * [batch, depth, height, width, outDepth]. If rank 4, batch of 1 is + * assumed. + * @param filterShape The shape of the filter, length 5, + * [filterDepth, filterHeight, filterWidth, inDepth, outDepth]. + * @param strides The strides of the convolution: [strideDepth, strideHeight, + * strideWidth]. + * @param pad A string from: 'same', 'valid'. The type of padding algorithm + * used in the forward prop of the op. + */ + function conv3DBackpropFilter_(x, dy, filterShape, strides, pad) { + let x5D = x; + if (x.rank === 4) { + x5D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2], x.shape[3]]); + } + let dy5D = dy; + if (dy5D.rank === 4) { + dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]); + } + assert(x5D.rank === 5, () => `Error in conv3dDerFilter: input must be rank 5, but got shape ` + + `${x5D.shape}.`); + assert(dy5D.rank === 5, () => `Error in conv3dDerFilter: dy must be rank 5, but got shape ` + + `${dy5D.shape}.`); + assert(filterShape.length === 5, () => `Error in conv3dDerFilter: filterShape must be length 5, but got ` + + `${filterShape}.`); + assert(x5D.shape[4] === filterShape[3], () => `Error in conv3dDerFilter: depth of input ${x5D.shape[4]}) must ` + + `match input depth in filter (${filterShape[3]}.`); + assert(dy5D.shape[4] === filterShape[4], () => `Error in conv3dDerFilter: depth of dy (${dy5D.shape[4]}) must ` + + `match output depth for filter (${filterShape[4]}).`); + const forward = backend => { + const dilations = 1; + const convInfo = computeConv3DInfo(x5D.shape, filterShape, strides, dilations, pad); + return backend.conv3dDerFilter(x5D, dy5D, convInfo); + }; + const inputs = { x: x5D, y: dy5D }; + const attrs = { strides, pad }; + return ENGINE.runKernelFunc(forward, inputs, null, Conv3DBackpropFilterV2, attrs); + } + const conv3DBackpropFilter = op({ conv3DBackpropFilter_ }); + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Computes the derivative of the input of a 3D convolution. + * + * @param xShape The shape of the input: [batch, depth, height, width, + * in_channels]. If length of 4, batch of 1 is assumed. + * @param dy The derivative of the output, of rank 5 or rank 4 of shape + * `[batch, outDepth, outHeight, outWidth, in_channels]`. + * If rank 4, batch of 1 is assumed. + * @param filter The filter, rank 5, of shape + * `[filterDepth, filterHeight, filterWidth, inDepth, outDepth]`. + * @param strides The strides of the convolution: `[strideDepth, strideHeight, + * strideWidth]`. + * @param pad The type of padding algorithm used: + * - `same` and stride 1: output will be of same size as input, + * regardless of filter size. + * - `valid`: output will be smaller than input if filter is larger + * than 1x1. + */ + function conv3DBackpropInput_(xShape, dy, filter, strides, pad) { + assert(xShape.length === dy.rank, () => `Length of inShape ` + + `(${xShape.length}) and rank of dy (${dy.rank}) must match`); + let xShape5D = xShape; + let dy5D = dy; + let reshapedTo5D = false; + if (dy.rank === 4) { + reshapedTo5D = true; + dy5D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2], dy.shape[3]]); + xShape5D = [1, xShape[0], xShape[1], xShape[2], xShape[3]]; + } + const inDepth = xShape5D[4]; + const outDepth = dy5D.shape[4]; + assert(xShape5D.length === 5, () => `Error in conv3dDerInput: inShape must be length 5, but got length ` + + `${xShape5D.length}.`); + assert(dy5D.rank === 5, () => `Error in conv3dDerInput: dy must be rank 5, but got ` + + `rank ${dy5D.rank}`); + assert(filter.rank === 5, () => `Error in conv3dDerInput: filter must be rank 5, but got ` + + `rank ${filter.rank}`); + assert(inDepth === filter.shape[3], () => `Error in conv3dDerInput: depth of input (${inDepth}) must ` + + `match input depth for filter ${filter.shape[3]}.`); + assert(outDepth === filter.shape[4], () => `Error in conv3dDerInput: depth of output (${outDepth}) must ` + + `match output depth for filter ${filter.shape[4]}.`); + const forward = backend => { + const dilations = 1; + const convInfo = computeConv3DInfo(xShape5D, filter.shape, strides, dilations, pad); + return backend.conv3dDerInput(dy5D, filter, convInfo); + }; + const inputs = { dy: dy5D }; + const attrs = { pad }; + const res = ENGINE.runKernelFunc(forward, inputs, null, Conv3DBackpropInputV2, attrs); + if (reshapedTo5D) { + return reshape(res, [res.shape[1], res.shape[2], res.shape[3], res.shape[4]]); + } + return res; + } + const conv3DBackpropInput = op({ conv3DBackpropInput_ }); + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const conv3DGradConfig = { + kernelName: Conv3D, + inputsToSave: ['x', 'filter'], + gradFunc: (dy, saved, attrs) => { + const { dilations, strides, pad } = attrs; + assert(tupleValuesAreOne(dilations), () => 'Error in gradient of conv3D: dilation rates greater than 1 are ' + + `not yet supported in gradients. Got dilations '${dilations}'`); + const [x5D, $filter] = saved; + return { + x: () => conv3DBackpropInput(x5D.shape, dy, $filter, strides, pad), + filter: () => conv3DBackpropFilter(x5D, dy, $filter.shape, strides, pad) + }; + } + }; + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + function depthwiseConv2dNativeBackpropFilter_(x, dy, filterShape, convInfo) { + let x4D = x; + if (x.rank === 3) { + x4D = reshape(x, [1, x.shape[0], x.shape[1], x.shape[2]]); + } + let dy4D = dy; + if (dy4D.rank === 3) { + dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); + } + const forward = backend => backend.depthwiseConv2DDerFilter(x4D, dy4D, convInfo); + const inputs = { x: x4D, dy: dy4D }; + return ENGINE.runKernelFunc(forward, inputs, null, DepthwiseConv2dNativeBackpropFilter); + } + const depthwiseConv2dNativeBackpropFilter = op({ depthwiseConv2dNativeBackpropFilter_ }); + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + function depthwiseConv2dNativeBackpropInput_(xShape, dy, filter, convInfo) { + let dy4D = dy; + let reshapedTo4D = false; + if (dy.rank === 3) { + reshapedTo4D = true; + dy4D = reshape(dy, [1, dy.shape[0], dy.shape[1], dy.shape[2]]); + } + const forward = backend => backend.depthwiseConv2DDerInput(dy4D, filter, convInfo); + const inputs = { dy: dy4D }; + const res = ENGINE.runKernelFunc(forward, inputs, null, DepthwiseConv2dNativeBackpropInput); + if (reshapedTo4D) { + return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]); + } + return res; + } + const depthwiseConv2dNativeBackpropInput = op({ depthwiseConv2dNativeBackpropInput_ }); + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const depthwiseConv2dNativeGradConfig = { + kernelName: DepthwiseConv2dNative, + inputsToSave: ['x', 'filter'], + gradFunc: (dy, saved, attrs) => { + const { dilations, strides, pad, dimRoundingMode } = attrs; + const $dilations = dilations == null ? [1, 1] : dilations; + assert(tupleValuesAreOne($dilations), () => 'Error in gradient of depthwiseConv2dNative: dilation rates ' + + `greater than 1 are not yet supported. Got dilations ` + + `'${$dilations}'`); + const [x, filter] = saved; + assert(x.rank === 4, () => `Error in gradient of depthwiseConv2dNative: input must be ` + + `rank 4, but got rank ${x.rank}.`); + assert(filter.rank === 4, () => `Error in gradient of depthwiseConv2dNative: filter must be ` + + `rank 4, but got rank ${filter.rank}.`); + assert(x.shape[3] === filter.shape[2], () => `Error in gradient of depthwiseConv2d: number of input ` + + `channels (${x.shape[3]}) must match the inChannels dimension ` + + `in filter ${filter.shape[2]}.`); + assert(eitherStridesOrDilationsAreOne(strides, $dilations), () => 'Error in gradient of depthwiseConv2d: Either strides or ' + + `dilations must be 1. Got strides ${strides} and dilations ` + + `'${$dilations}'.`); + if (dimRoundingMode != null) { + assert(isInt(pad), () => `Error in depthwiseConv2d: pad must be an integer when using, ` + + `dimRoundingMode ${dimRoundingMode} but got pad ${pad}.`); + } + const convInfo = computeConv2DInfo(x.shape, filter.shape, strides, $dilations, pad, dimRoundingMode, true /* depthwise */); + return { + x: () => depthwiseConv2dNativeBackpropInput(x.shape, dy, filter, convInfo), + filter: () => depthwiseConv2dNativeBackpropFilter(x, dy, filter.shape, convInfo), + }; + } + }; + + /** + * @license + * Copyright 2018 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Enables production mode which disables correctness checks in favor of + * performance. + */ + /** @doc {heading: 'Environment'} */ + function enableProdMode() { + env().set('PROD', true); + } + /** + * Enables debug mode which will log information about all executed kernels: + * the elapsed time of the kernel execution, as well as the rank, shape, and + * size of the output tensor. + * + * Debug mode will significantly slow down your application as it will + * download the result of every operation to the CPU. This should not be used in + * production. Debug mode does not affect the timing information of the kernel + * execution as we do not measure download time in the kernel execution time. + * + * See also: `tf.profile`, `tf.memory`. + */ + /** @doc {heading: 'Environment'} */ + function enableDebugMode() { + env().set('DEBUG', true); + } + /** Globally disables deprecation warnings */ + function disableDeprecationWarnings() { + env().set('DEPRECATION_WARNINGS_ENABLED', false); + console.warn(`TensorFlow.js deprecation warnings have been disabled.`); + } + /** Warn users about deprecated functionality. */ + function deprecationWarn(msg) { + if (env().getBool('DEPRECATION_WARNINGS_ENABLED')) { + console.warn(msg + ' You can disable deprecation warnings with ' + + 'tf.disableDeprecationWarnings().'); + } + } + /** + * Dispose all variables kept in backend engine. + */ + /** @doc {heading: 'Environment'} */ + function disposeVariables() { + ENGINE.disposeVariables(); + } + /** + * It returns the global engine that keeps track of all tensors and backends. + */ + /** @doc {heading: 'Environment'} */ + function engine() { + return ENGINE; + } + /** + * Returns memory info at the current time in the program. The result is an + * object with the following properties: + * + * - `numBytes`: Number of bytes allocated (undisposed) at this time. + * - `numTensors`: Number of unique tensors allocated. + * - `numDataBuffers`: Number of unique data buffers allocated + * (undisposed) at this time, which is ≤ the number of tensors + * (e.g. `a.reshape(newShape)` makes a new Tensor that shares the same + * data buffer with `a`). + * - `unreliable`: True if the memory usage is unreliable. See `reasons` when + * `unreliable` is true. + * - `reasons`: `string[]`, reasons why the memory is unreliable, present if + * `unreliable` is true. + * + * WebGL Properties: + * - `numBytesInGPU`: Number of bytes allocated (undisposed) in the GPU only at + * this time. + */ + /** @doc {heading: 'Performance', subheading: 'Memory'} */ + function memory() { + return ENGINE.memory(); + } + /** + * Executes the provided function `f()` and returns a promise that resolves + * with information about the function's memory use: + * - `newBytes`: the number of new bytes allocated + * - `newTensors`: the number of new tensors created + * - `peakBytes`: the peak number of bytes allocated + * - `kernels`: an array of objects for each kernel involved that reports + * their input and output shapes, number of bytes used, and number of new + * tensors created. + * + * ```js + * const profile = await tf.profile(() => { + * const x = tf.tensor1d([1, 2, 3]); + * let x2 = x.square(); + * x2.dispose(); + * x2 = x.square(); + * x2.dispose(); + * return x; + * }); + * + * console.log(`newBytes: ${profile.newBytes}`); + * console.log(`newTensors: ${profile.newTensors}`); + * console.log(`byte usage over all kernels: ${profile.kernels.map(k => + * k.totalBytesSnapshot)}`); + * ``` + * + */ + /** @doc {heading: 'Performance', subheading: 'Profile'} */ + function profile(f) { + return ENGINE.profile(f); + } + /** + * Executes the provided function `fn` and after it is executed, cleans up all + * intermediate tensors allocated by `fn` except those returned by `fn`. + * `fn` must not return a Promise (async functions not allowed). The returned + * result can be a complex object. + * + * Using this method helps avoid memory leaks. In general, wrap calls to + * operations in `tf.tidy` for automatic memory cleanup. + * + * NOTE: Variables do *not* get cleaned up when inside a tidy(). If you want to + * dispose variables, please use `tf.disposeVariables` or call dispose() + * directly on variables. + * + * ```js + * // y = 2 ^ 2 + 1 + * const y = tf.tidy(() => { + * // a, b, and one will be cleaned up when the tidy ends. + * const one = tf.scalar(1); + * const a = tf.scalar(2); + * const b = a.square(); + * + * console.log('numTensors (in tidy): ' + tf.memory().numTensors); + * + * // The value returned inside the tidy function will return + * // through the tidy, in this case to the variable y. + * return b.add(one); + * }); + * + * console.log('numTensors (outside tidy): ' + tf.memory().numTensors); + * y.print(); + * ``` + * + * @param nameOrFn The name of the closure, or the function to execute. + * If a name is provided, the 2nd argument should be the function. + * If debug mode is on, the timing and the memory usage of the function + * will be tracked and displayed on the console using the provided name. + * @param fn The function to execute. + */ + /** @doc {heading: 'Performance', subheading: 'Memory'} */ + function tidy(nameOrFn, fn) { + return ENGINE.tidy(nameOrFn, fn); + } + /** + * Disposes any `tf.Tensor`s found within the provided object. + * + * @param container an object that may be a `tf.Tensor` or may directly + * contain `tf.Tensor`s, such as a `Tensor[]` or `{key: Tensor, ...}`. If + * the object is not a `tf.Tensor` or does not contain `Tensors`, nothing + * happens. In general it is safe to pass any object here, except that + * `Promise`s are not supported. + */ + /** @doc {heading: 'Performance', subheading: 'Memory'} */ + function dispose(container) { + const tensors = getTensorsInContainer(container); + tensors.forEach(tensor => tensor.dispose()); + } + /** + * Keeps a `tf.Tensor` generated inside a `tf.tidy` from being disposed + * automatically. + * + * ```js + * let b; + * const y = tf.tidy(() => { + * const one = tf.scalar(1); + * const a = tf.scalar(2); + * + * // b will not be cleaned up by the tidy. a and one will be cleaned up + * // when the tidy ends. + * b = tf.keep(a.square()); + * + * console.log('numTensors (in tidy): ' + tf.memory().numTensors); + * + * // The value returned inside the tidy function will return + * // through the tidy, in this case to the variable y. + * return b.add(one); + * }); + * + * console.log('numTensors (outside tidy): ' + tf.memory().numTensors); + * console.log('y:'); + * y.print(); + * console.log('b:'); + * b.print(); + * ``` + * + * @param result The tensor to keep from being disposed. + */ + /** @doc {heading: 'Performance', subheading: 'Memory'} */ + function keep(result) { + return ENGINE.keep(result); + } + /** + * Executes `f()` and returns a promise that resolves with timing + * information. + * + * The result is an object with the following properties: + * + * - `wallMs`: Wall execution time. + * - `kernelMs`: Kernel execution time, ignoring data transfer. If using the + * WebGL backend and the query timer extension is not available, this will + * return an error object. + * - On `WebGL` The following additional properties exist: + * - `uploadWaitMs`: CPU blocking time on texture uploads. + * - `downloadWaitMs`: CPU blocking time on texture downloads (readPixels). + * + * ```js + * const x = tf.randomNormal([20, 20]); + * const time = await tf.time(() => x.matMul(x)); + * + * console.log(`kernelMs: ${time.kernelMs}, wallTimeMs: ${time.wallMs}`); + * ``` + * + * @param f The function to execute and time. + */ + /** @doc {heading: 'Performance', subheading: 'Timing'} */ + function time(f) { + return ENGINE.time(f); + } + /** + * Sets the backend (cpu, webgl, wasm, etc) responsible for creating tensors and + * executing operations on those tensors. Returns a promise that resolves + * to a boolean if the backend initialization was successful. + * + * Note this disposes the current backend, if any, as well as any tensors + * associated with it. A new backend is initialized, even if it is of the + * same type as the previous one. + * + * @param backendName The name of the backend. Currently supports + * `'webgl'|'cpu'` in the browser, `'tensorflow'` under node.js + * (requires tfjs-node), and `'wasm'` (requires tfjs-backend-wasm). + */ + /** @doc {heading: 'Backends'} */ + function setBackend(backendName) { + return ENGINE.setBackend(backendName); + } + /** + * Returns a promise that resolves when the currently selected backend (or the + * highest priority one) has initialized. Await this promise when you are using + * a backend that has async initialization. + */ + /** @doc {heading: 'Backends'} */ + function ready() { + return ENGINE.ready(); + } + /** + * Returns the current backend name (cpu, webgl, etc). The backend is + * responsible for creating tensors and executing operations on those tensors. + */ + /** @doc {heading: 'Backends'} */ + function getBackend() { + return ENGINE.backendName; + } + /** + * Removes a backend and the registered factory. + */ + /** @doc {heading: 'Backends'} */ + function removeBackend(name) { + ENGINE.removeBackend(name); + } + /** + * Finds the backend registered under the provided name. Returns null if the + * name is not in the registry, or the registration hasn't finished yet. + */ + function findBackend(name) { + return ENGINE.findBackend(name); + } + /** + * Finds the backend factory registered under the provided name. Returns a + * function that produces a new backend when called. Returns null if the name + * is not in the registry. + */ + function findBackendFactory(name) { + return ENGINE.findBackendFactory(name); + } + /** + * Registers a global backend. The registration should happen when importing + * a module file (e.g. when importing `backend_webgl.ts`), and is used for + * modular builds (e.g. custom tfjs bundle with only webgl support). + * + * @param factory The backend factory function. When called, it should + * return a backend instance, or a promise of an instance. + * @param priority The priority of the backend (higher = more important). + * In case multiple backends are registered, the priority is used to find + * the best backend. Defaults to 1. + * @return False if there is already a registered backend under this name, true + * if not. + */ + /** @doc {heading: 'Backends'} */ + function registerBackend(name, factory, priority = 1) { + return ENGINE.registerBackend(name, factory, priority); + } + /** + * Gets the current backend. If no backends have been initialized, this will + * attempt to initialize the best backend. Will throw an error if the highest + * priority backend has async initialization, in which case, you should call + * 'await tf.ready()' before running other code. + */ + /** @doc {heading: 'Backends'} */ + function backend() { + return ENGINE.backend; + } + /** + * Sets the global platform. + * + * @param platformName The name of this platform. + * @param platform A platform implementation. + */ + function setPlatform(platformName, platform) { + env().setPlatform(platformName, platform); + } + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Adds two `tf.Tensor`s element-wise, A + B. Supports broadcasting. + * + * + * ```js + * const a = tf.tensor1d([1, 2, 3, 4]); + * const b = tf.tensor1d([10, 20, 30, 40]); + * + * a.add(b).print(); // or tf.add(a, b) + * ``` + * + * ```js + * // Broadcast add a with b. + * const a = tf.scalar(5); + * const b = tf.tensor1d([10, 20, 30, 40]); + * + * a.add(b).print(); // or tf.add(a, b) + * ``` + * @param a The first `tf.Tensor` to add. + * @param b The second `tf.Tensor` to add. Must have the same type as `a`. + */ + /** @doc {heading: 'Operations', subheading: 'Arithmetic'} */ + function add_(a, b) { + let $a = convertToTensor(a, 'a', 'add'); + let $b = convertToTensor(b, 'b', 'add'); + [$a, $b] = makeTypesMatch($a, $b); + const forward = (backend, save) => { + const res = backend.add($a, $b); + save([$a, $b]); + return res; + }; + const inputs = { a: $a, b: $b }; + return ENGINE.runKernelFunc(forward, inputs, null /* gradient */, Add); + } + const add = op({ add_ }); + + /** + * @license + * Copyright 2018 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Computes `-1 * x` element-wise. + * + * ```js + * const x = tf.tensor2d([1, 2, -2, 0], [2, 2]); + * + * x.neg().print(); // or tf.neg(x) + * ``` + * + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function neg_(x) { + const $x = convertToTensor(x, 'x', 'neg'); + const grad = (dy) => { + return { x: () => dy.neg() }; + }; + const attrs = {}; + const inputsToSave = [$x]; + return ENGINE.runKernelFunc(backend => backend.neg($x), { x: $x }, grad, 'Neg', attrs, inputsToSave); + } + /** + * Computes ceiling of input `tf.Tensor` element-wise: `ceil(x)` + * + * ```js + * const x = tf.tensor1d([.6, 1.1, -3.3]); + * + * x.ceil().print(); // or tf.ceil(x) + * ``` + * @param x The input Tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function ceil_(x) { + const $x = convertToTensor(x, 'x', 'ceil'); + // TODO(manrajgrover): Return null for gradients when backprop supports it. + const grad = (dy) => { + return { $x: () => zerosLike(dy) }; + }; + return ENGINE.runKernelFunc(backend => backend.ceil($x), { $x }, grad); + } + /** + * Computes floor of input `tf.Tensor` element-wise: `floor(x)`. + * + * ```js + * const x = tf.tensor1d([.6, 1.1, -3.3]); + * + * x.floor().print(); // or tf.floor(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function floor_(x) { + const $x = convertToTensor(x, 'x', 'floor'); + // TODO(nsthorat): Let gradients be null for cases where we want to stop + // backpropgation. + const grad = (dy) => { + return { $x: () => zerosLike(dy) }; + }; + return ENGINE.runKernelFunc(backend => backend.floor($x), { $x }, grad); + } + /** + * Returns an element-wise indication of the sign of a number. + * + * ```js + * const x = tf.tensor1d([.6, 1.1, -3.3, NaN, 0]); + * + * x.sign().print(); // or tf.sign(x) + * ``` + * @param x The input Tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function sign_(x) { + const $x = convertToTensor(x, 'x', 'sign'); + const grad = (dy) => { + return { $x: () => zerosLike(dy) }; + }; + return ENGINE.runKernelFunc(backend => backend.sign($x), { $x }, grad); + } + /** + * RReturns which elements of x are NaN. + * + * ```js + * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]); + * + * x.isNaN().print(); // or tf.isNaN(x) + * ``` + * @param x The input Tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function isNaN_(x) { + const $x = convertToTensor(x, 'x', 'isNaN'); + // TODO(nsthorat): Let gradients be null for cases where we want to stop + // backpropgation. + const grad = (dy) => { + return { $x: () => zerosLike(dy) }; + }; + return ENGINE.runKernelFunc(backend => backend.isNaN($x), { $x }, grad); + } + /** + * Returns which elements of x are Infinity or -Infinity. + * + * ```js + * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]); + * + * x.isInf().print(); // or tf.isNaN(x) + * ``` + * @param x The input Tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function isInf_(x) { + const $x = convertToTensor(x, 'x', 'isInf'); + // TODO(nsthorat): Let gradients be null for cases where we want to stop + // backpropgation. + const grad = (dy) => { + return { $x: () => zerosLike(dy) }; + }; + return ENGINE.runKernelFunc(backend => backend.isInf($x), { $x }, grad); + } + /** + * Returns which elements of x are finite. + * + * ```js + * const x = tf.tensor1d([NaN, Infinity, -Infinity, 0, 1]); + * + * x.isFinite().print(); // or tf.isNaN(x) + * ``` + * @param x The input Tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function isFinite_(x) { + const $x = convertToTensor(x, 'x', 'isFinite'); + // TODO(nsthorat): Let gradients be null for cases where we want to stop + // backpropgation. + const grad = (dy) => { + return { $x: () => zerosLike(dy) }; + }; + return ENGINE.runKernelFunc(backend => backend.isFinite($x), { $x }, grad); + } + /** + * Computes round of input `tf.Tensor` element-wise: `round(x)`. + * It implements banker's rounding. + * + * ```js + * const x = tf.tensor1d([.6, 1.1, -3.3]); + * + * x.round().print(); // or tf.round(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function round_(x) { + const $x = convertToTensor(x, 'x', 'round'); + // TODO(nsthorat): Let gradients be null for cases where we want to stop + // backpropgation. + const grad = (dy) => { + return { $x: () => zerosLike(dy) }; + }; + return ENGINE.runKernelFunc(backend => backend.round($x), { $x }, grad); + } + /** + * Computes exponential of the input `tf.Tensor` element-wise. `e ^ x` + * + * ```js + * const x = tf.tensor1d([1, 2, -3]); + * + * x.exp().print(); // or tf.exp(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function exp_(x) { + const $x = convertToTensor(x, 'x', 'exp'); + const bck = (dy, saved) => { + // tslint:disable-next-line: no-unnecessary-type-assertion + return { x: () => dy.mul(saved[0]) }; + }; + const attrs = {}; + const inputsToSave = []; + const outputsToSave = [true]; + return ENGINE.runKernelFunc((backend, save) => { + const y = backend.exp($x); + save([y]); + return y; + }, { x: $x }, bck, 'Exp', attrs, inputsToSave, outputsToSave); + } + /** + * Computes exponential of the input `tf.Tensor` minus one element-wise. + * `e ^ x - 1` + * + * ```js + * const x = tf.tensor1d([1, 2, -3]); + * + * x.expm1().print(); // or tf.expm1(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function expm1_(x) { + const $x = convertToTensor(x, 'x', 'expm1'); + const grad = (dy, saved) => { + const [$x] = saved; + return { $x: () => dy.mul($x.exp()) }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.expm1($x); + save([$x]); + return res; + }, { $x }, grad); + } + /** + * Computes natural logarithm of the input `tf.Tensor` element-wise: `ln(x)` + * + * ```js + * const x = tf.tensor1d([1, 2, Math.E]); + * + * x.log().print(); // or tf.log(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function log_(x) { + const $x = convertToTensor(x, 'x', 'log'); + const grad = (dy, saved) => { + const [$x] = saved; + return { x: () => dy.div($x.toFloat()) }; + }; + const attrs = {}; + const inputsToSave = [$x]; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.log($x); + save([$x]); + return res; + }, { x: $x }, grad, 'Log', attrs, inputsToSave); + } + /** + * Computes natural logarithm of the input `tf.Tensor` plus one + * element-wise: `ln(1 + x)` + * + * ```js + * const x = tf.tensor1d([1, 2, Math.E - 1]); + * + * x.log1p().print(); // or tf.log1p(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function log1p_(x) { + const $x = convertToTensor(x, 'x', 'log1p'); + const grad = (dy, saved) => { + const [$x] = saved; + return { $x: () => dy.div($x.add(1)) }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.log1p($x); + save([$x]); + return res; + }, { $x }, grad); + } + /** + * Computes square root of the input `tf.Tensor` element-wise: `y = sqrt(x)` + * + * ```js + * const x = tf.tensor1d([1, 2, 4, -1]); + * + * x.sqrt().print(); // or tf.sqrt(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function sqrt_(x) { + const $x = convertToTensor(x, 'x', 'sqrt'); + const grad = (dy, saved) => { + const [$x] = saved; + return { x: () => dy.div($x.toFloat().sqrt().mul(2)) }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.sqrt($x); + save([$x]); + return res; + }, { x: $x }, grad, 'Sqrt', {}); + } + /** + * Computes reciprocal of square root of the input `tf.Tensor` element-wise: + * `y = 1 / sqrt(x)` + * + * ```js + * const x = tf.tensor1d([1, 2, 4, -1]); + * + * x.rsqrt().print(); // or tf.rsqrt(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function rsqrt_(x) { + const $x = convertToTensor(x, 'x', 'rsqrt'); + const grad = (dy, saved) => { + const [$x] = saved; + return { x: () => dy.div($x.pow(1.5).mul(2)).neg() }; + }; + const inputsToSave = [$x]; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.rsqrt($x); + save([$x]); + return res; + }, { x: $x }, grad, 'Rsqrt', {} /* attrs */, inputsToSave); + } + /** + * Computes reciprocal of x element-wise: `1 / x` + * + * ```js + * const x = tf.tensor1d([0, 1, 2]); + * + * x.reciprocal().print(); // or tf.reciprocal(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function reciprocal_(x) { + const $x = convertToTensor(x, 'x', 'reciprocal'); + const grad = (dy, saved) => { + const [$x] = saved; + return { $x: () => dy.div($x.square().neg()) }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.reciprocal($x); + save([$x]); + return res; + }, { $x }, grad); + } + /** + * Computes absolute value element-wise: `abs(x)` + * + * ```js + * const x = tf.tensor1d([-1, 2, -3, 4]); + * + * x.abs().print(); // or tf.abs(x) + * ``` + * @param x The input `tf.Tensor`. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function abs_(x) { + const $x = convertToTensor(x, 'x', 'abs'); + if ($x.dtype === 'complex64') { + return ENGINE.runKernelFunc(backend => backend.complexAbs($x), { $x }); + } + const grad = (dy, saved) => { + const [$x] = saved; + return { x: () => dy.mul($x.toFloat().step(-1)) }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.abs($x); + save([$x]); + return res; + }, { x: $x }, grad, 'Abs'); + } + /** + * Clips values element-wise. `max(min(x, clipValueMax), clipValueMin)` + * + * ```js + * const x = tf.tensor1d([-1, 2, -3, 4]); + * + * x.clipByValue(-2, 3).print(); // or tf.clipByValue(x, -2, 3) + * ``` + * @param x The input tensor. + * @param clipValueMin Lower-bound of range to be clipped to. + * @param clipValueMax Upper-bound of range to be clipped to. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function clipByValue_(x, clipValueMin, clipValueMax) { + const $x = convertToTensor(x, 'x', 'clipByValue'); + assert((clipValueMin <= clipValueMax), () => `Error in clip: min (${clipValueMin}) must be ` + + `less than or equal to max (${clipValueMax}).`); + const grad = (dy, saved) => { + const [$x] = saved; + return { + x: () => dy.where($x.greaterEqual(clipValueMin) + .logicalAnd($x.lessEqual(clipValueMax)), zerosLike(dy)), + }; + }; + const inputsToSave = [$x]; + const attr = { min: clipValueMin, max: clipValueMax }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.clip($x, clipValueMin, clipValueMax); + save([$x]); + return res; + }, { x: $x }, grad, 'ClipByValue', attr, inputsToSave); + } + /** + * Computes sigmoid element-wise, `1 / (1 + exp(-x))` + * + * ```js + * const x = tf.tensor1d([0, -1, 2, -3]); + * + * x.sigmoid().print(); // or tf.sigmoid(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function sigmoid_(x) { + const $x = convertToTensor(x, 'x', 'sigmoid'); + const grad = (dy, saved) => { + const [y] = saved; + return { x: () => dy.mul(y.mul(scalar(1).sub(y))) }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const y = backend.sigmoid($x); + save([y]); + return y; + }, { x: $x }, grad, 'Sigmoid'); + } + /** + * Computes log sigmoid of the input `tf.Tensor` element-wise: + * `logSigmoid(x)`. For numerical stability, we use `-tf.softplus(-x)`. + * + * ```js + * const x = tf.tensor1d([0, 1, -1, .7]); + * + * x.logSigmoid().print(); // or tf.logSigmoid(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function logSigmoid_(x) { + const $x = convertToTensor(x, 'x', 'logSigmoid'); + const grad = (dy, saved) => { + const [$x] = saved; + return { $x: () => dy.mul($x.neg().sigmoid()) }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.softplus($x.neg()).neg(); + save([$x]); + return res; + }, { $x }, grad); + } + /** + * Computes softplus of the input `tf.Tensor` element-wise: `log(exp(x) + 1)` + * + * ```js + * const x = tf.tensor1d([0, 1, -1, .7]); + * + * x.softplus().print(); // or tf.softplus(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function softplus_(x) { + const $x = convertToTensor(x, 'x', 'softplus'); + const grad = (dy, saved) => { + const [$x] = saved; + return { $x: () => dy.mul($x.sigmoid()) }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.softplus($x); + save([$x]); + return res; + }, { $x }, grad); + } + /** + * Computes sin of the input Tensor element-wise: `sin(x)` + * + * ```js + * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]); + * + * x.sin().print(); // or tf.sin(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function sin_(x) { + const $x = convertToTensor(x, 'x', 'sin'); + const grad = (dy, saved) => { + const [$x] = saved; + return { x: () => $x.toFloat().cos().mul(dy) }; + }; + const inputsToSave = [$x]; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.sin($x); + save([$x]); + return res; + }, { x: $x }, grad, 'Sin', {} /* attrs */, inputsToSave); + } + /** + * Computes cos of the input `tf.Tensor` element-wise: `cos(x)` + * + * ```js + * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]); + * + * x.cos().print(); // or tf.cos(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function cos_(x) { + const $x = convertToTensor(x, 'x', 'cos'); + const grad = (dy, saved) => { + const [$x] = saved; + return { x: () => $x.toFloat().sin().neg().mul(dy) }; + }; + const inputsToSave = [$x]; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.cos($x); + save([$x]); + return res; + }, { x: $x }, grad, 'Cos', {} /* attrs */, inputsToSave); + } + /** + * Computes tan of the input `tf.Tensor` element-wise, `tan(x)` + * + * ```js + * const x = tf.tensor1d([0, Math.PI / 2, Math.PI * 3 / 4]); + * + * x.tan().print(); // or tf.tan(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function tan_(x) { + const $x = convertToTensor(x, 'x', 'tan'); + const grad = (dy, saved) => { + const [$x] = saved; + return { $x: () => dy.div($x.cos().square()) }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.tan($x); + save([$x]); + return res; + }, { $x }, grad); + } + /** + * Computes asin of the input `tf.Tensor` element-wise: `asin(x)` + * + * ```js + * const x = tf.tensor1d([0, 1, -1, .7]); + * + * x.asin().print(); // or tf.asin(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function asin_(x) { + const $x = convertToTensor(x, 'x', 'asin'); + const grad = (dy, saved) => { + const [$x] = saved; + return { + // tslint:disable-next-line: no-unnecessary-type-assertion + $x: () => dy.div(scalar(1).sub($x.toFloat().square()).sqrt()) + }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.asin($x); + save([$x]); + return res; + }, { $x }, grad); + } + /** + * Computes acos of the input `tf.Tensor` element-wise: `acos(x)` + * + * ```js + * const x = tf.tensor1d([0, 1, -1, .7]); + * + * x.acos().print(); // or tf.acos(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function acos_(x) { + const $x = convertToTensor(x, 'x', 'acos'); + const grad = (dy, saved) => { + const [$x] = saved; + return { + $x: () => { + const a = $x.toFloat().square(); + const b = scalar(1).sub(a).sqrt(); + // tslint:disable-next-line: no-unnecessary-type-assertion + return dy.div(b).neg(); + } + }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.acos($x); + save([$x]); + return res; + }, { $x }, grad); + } + /** + * Computes atan of the input `tf.Tensor` element-wise: `atan(x)` + * + * ```js + * const x = tf.tensor1d([0, 1, -1, .7]); + * + * x.atan().print(); // or tf.atan(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function atan_(x) { + const $x = convertToTensor(x, 'x', 'atan'); + const grad = (dy, saved) => { + const [$x] = saved; + return { $x: () => dy.div($x.toFloat().square().add(1)) }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.atan($x); + save([$x]); + return res; + }, { $x }, grad); + } + /** + * Computes hyperbolic sin of the input `tf.Tensor` element-wise: `sinh(x)` + * + * ```js + * const x = tf.tensor1d([0, 1, -1, .7]); + * + * x.sinh().print(); // or tf.sinh(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function sinh_(x) { + const $x = convertToTensor(x, 'x', 'sinh'); + const grad = (dy, saved) => { + const [$x] = saved; + // tslint:disable-next-line: no-unnecessary-type-assertion + return { $x: () => $x.toFloat().cosh().mul(dy) }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.sinh($x); + save([$x]); + return res; + }, { $x }, grad); + } + /** + * Computes hyperbolic cos of the input `tf.Tensor` element-wise: `cosh(x)` + * + * ```js + * const x = tf.tensor1d([0, 1, -1, .7]); + * + * x.cosh().print(); // or tf.cosh(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function cosh_(x) { + const $x = convertToTensor(x, 'x', 'cosh'); + const grad = (dy, saved) => { + const [$x] = saved; + // tslint:disable-next-line: no-unnecessary-type-assertion + return { $x: () => $x.toFloat().sinh().mul(dy) }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.cosh($x); + save([$x]); + return res; + }, { $x }, grad); + } + /** + * Computes hyperbolic tangent of the input `tf.Tensor` element-wise: `tanh(x)` + * + * ```js + * const x = tf.tensor1d([0, 1, -1, 70]); + * + * x.tanh().print(); // or tf.tanh(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function tanh_(x) { + const $x = convertToTensor(x, 'x', 'tanh'); + const grad = (dy, saved) => { + const [y] = saved; + // tslint:disable-next-line: no-unnecessary-type-assertion + return { x: () => scalar(1).sub(y.square()).mul(dy) }; + }; + const outputsToSave = [true]; + return ENGINE.runKernelFunc((backend, save) => { + const y = backend.tanh($x); + save([y]); + return y; + }, { x: $x }, grad, 'Tanh', {} /* attrs */, null /* inputsToSave */, outputsToSave); + } + /** + * Computes inverse hyperbolic sin of the input `tf.Tensor` element-wise: + * `asinh(x)` + * + * ```js + * const x = tf.tensor1d([0, 1, -1, .7]); + * + * x.asinh().print(); // or tf.asinh(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function asinh_(x) { + const $x = convertToTensor(x, 'x', 'asinh'); + const grad = (dy, saved) => { + const [$x] = saved; + return { + $x: () => { + const a = scalar(1).add($x.toFloat().square()).sqrt(); + // tslint:disable-next-line: no-unnecessary-type-assertion + return dy.div(a); + } + }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.asinh($x); + save([$x]); + return res; + }, { $x }, grad); + } + /** + * Computes the inverse hyperbolic cos of the input `tf.Tensor` element-wise: + * `acosh(x)` + * + * ```js + * const x = tf.tensor1d([10, 1, 3, 5.7]); + * + * x.acosh().print(); // or tf.acosh(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function acosh_(x) { + const $x = convertToTensor(x, 'x', 'acosh'); + const grad = (dy, saved) => { + const [$x] = saved; + return { + $x: () => { + const a = $x.toFloat().square().sub(1).sqrt(); + // tslint:disable-next-line: no-unnecessary-type-assertion + return dy.div(a); + } + }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.acosh($x); + save([$x]); + return res; + }, { $x }, grad); + } + /** + * Computes inverse hyperbolic tan of the input `tf.Tensor` element-wise: + * `atanh(x)` + * + * ```js + * const x = tf.tensor1d([0, .1, -.1, .7]); + * + * x.atanh().print(); // or tf.atanh(x) + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function atanh_(x) { + const $x = convertToTensor(x, 'x', 'atanh'); + const grad = (dy, saved) => { + const [$x] = saved; + return { $x: () => dy.div(scalar(1).sub($x.toFloat().square())) }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.atanh($x); + save([$x]); + return res; + }, { $x }, grad); + } + /** + * Computes gause error function of the input `tf.Tensor` element-wise: + * `erf(x)` + * + * ```js + * const x = tf.tensor1d([0, .1, -.1, .7]); + * + * x.erf().print(); // or tf.erf(x); + * ``` + * @param x The input tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function erf_(x) { + let $x = convertToTensor(x, 'x', 'erf'); + assert($x.dtype === 'int32' || $x.dtype === 'float32', () => 'Input dtype must be `int32` or `float32`.'); + if ($x.dtype === 'int32') { + $x = $x.toFloat(); + } + const grad = (dy, saved) => { + const [$x] = saved; + return { + $x: () => dy.mul($x.square().neg().exp().mul(2 / Math.sqrt(Math.PI))) + }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.erf($x); + save([$x]); + return res; + }, { $x }, grad); + } + /** + * Computes step of the input `tf.Tensor` element-wise: `x > 0 ? 1 : alpha * x` + * + * ```js + * const x = tf.tensor1d([0, 2, -1, -3]); + * + * x.step(.5).print(); // or tf.step(x, .5) + * ``` + * @param x The input tensor. + * @param alpha The gradient when input is negative. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function step_(x, alpha = 0.0) { + const $x = convertToTensor(x, 'x', 'step'); + // TODO(manrajgrover): Return null for gradients when backprop supports + // it. + const grad = (dy) => { + return { $x: () => zerosLike(dy) }; + }; + return ENGINE.runKernelFunc(backend => backend.step($x, alpha), { $x }, grad); + } + const abs = op({ abs_ }); + const acos = op({ acos_ }); + const acosh = op({ acosh_ }); + const asin = op({ asin_ }); + const asinh = op({ asinh_ }); + const atan = op({ atan_ }); + const atanh = op({ atanh_ }); + const ceil = op({ ceil_ }); + const clipByValue = op({ clipByValue_ }); + const cos = op({ cos_ }); + const cosh = op({ cosh_ }); + const erf = op({ erf_ }); + const exp = op({ exp_ }); + const expm1 = op({ expm1_ }); + const floor = op({ floor_ }); + const log = op({ log_ }); + const log1p = op({ log1p_ }); + const logSigmoid = op({ logSigmoid_ }); + const neg = op({ neg_ }); + const reciprocal = op({ reciprocal_ }); + const round = op({ round_ }); + const rsqrt = op({ rsqrt_ }); + const sigmoid = op({ sigmoid_ }); + const sign = op({ sign_ }); + const isNaN$1 = op({ isNaN_ }); + const isInf = op({ isInf_ }); + const isFinite$1 = op({ isFinite_ }); + const sin = op({ sin_ }); + const sinh = op({ sinh_ }); + const softplus = op({ softplus_ }); + const sqrt = op({ sqrt_ }); + const step = op({ step_ }); + const tan = op({ tan_ }); + const tanh$1 = op({ tanh_ }); + + /** + * @license + * Copyright 2018 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * @deprecated + * Adds two `tf.Tensor`s element-wise, A + B. + * + * Inputs must be the same shape. For broadcasting support, use add() instead. + * + * @param a The first Tensor to add element-wise. + * @param b The second Tensor to add element-wise. + */ + function addStrict_(a, b) { + deprecationWarn('strict variants of ops have been deprecated ' + + 'and will be removed in future'); + const $a = convertToTensor(a, 'a', 'addStrict'); + const $b = convertToTensor(b, 'b', 'addStrict'); + assertShapesMatch($a.shape, $b.shape, 'Error in addStrict: '); + return $a.add($b); + } + /** + * @deprecated + * Subtracts two `tf.Tensor`s element-wise, A - B. Inputs must + * be the same shape. + * + * For broadcasting support, use `tf.sub` instead. + * + * @param a The first Tensor to subtract element-wise. + * @param b The second Tensor to subtract element-wise. + */ + function subStrict_(a, b) { + deprecationWarn('strict variants of ops have been deprecated ' + + 'and will be removed in future'); + const $a = convertToTensor(a, 'a', 'subStrict'); + const $b = convertToTensor(b, 'b', 'subStrict'); + assertShapesMatch($a.shape, $b.shape, 'Error in subStrict: '); + return $a.sub($b); + } + /** + * Computes the power of one `tf.Tensor` to another. Supports broadcasting. + * + * Given a `tf.Tensor` x and a `tf.Tensor` y, this operation computes x^y for + * corresponding elements in x and y. The result's dtype will be the upcasted + * type of the `base` and `exp` dtypes. + * + * ```js + * const a = tf.tensor([[2, 3], [4, 5]]) + * const b = tf.tensor([[1, 2], [3, 0]]).toInt(); + * + * a.pow(b).print(); // or tf.pow(a, b) + * ``` + * + * ```js + * const a = tf.tensor([[1, 2], [3, 4]]) + * const b = tf.tensor(2).toInt(); + * + * a.pow(b).print(); // or tf.pow(a, b) + * ``` + * We also expose `powStrict` which has the same signature as this op and + * asserts that `base` and `exp` are the same shape (does not broadcast). + * + * @param base The base `tf.Tensor` to pow element-wise. + * @param exp The exponent `tf.Tensor` to pow element-wise. + */ + /** @doc {heading: 'Operations', subheading: 'Arithmetic'} */ + function pow_(base, exp) { + let $base = convertToTensor(base, 'base', 'pow'); + let $exp = convertToTensor(exp, 'exp', 'pow'); + [$base, $exp] = makeTypesMatch($base, $exp); + const outShape = assertAndGetBroadcastShape($base.shape, $exp.shape); + const grad = (dy, saved) => { + const [$base, $exp, y] = saved; + const derBase = () => { + const expFloat = $exp.toFloat(); + let res = dy.mul(expFloat.mul($base.pow(expFloat.sub(scalar(1))))); + const reduceAxes = getReductionAxes($base.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes); + } + return res.reshape($base.shape); + }; + const derExp = () => { + const condition = $base.greater(0); + const logBase = $base.log().where(condition, zerosLike($base)); + let res = dy.mul(y.mul(logBase)); + const reduceAxes = getReductionAxes($exp.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes); + } + return res.reshape($exp.shape); + }; + return { a: derBase, b: derExp }; + }; + const attrs = {}; + const inputsToSave = [$base, $exp]; + const outputsToSave = [true]; + return ENGINE.runKernelFunc((backend, save) => { + const y = backend.pow($base, $exp); + save([$base, $exp, y]); + return y; + }, { a: $base, b: $exp }, grad, 'Pow', attrs, inputsToSave, outputsToSave); + } + /** + * @deprecated + * Computes the power of one `tf.Tensor` to another. Inputs must + * be the same shape. + * + * For broadcasting support, use `tf.pow` instead. + * + * @param base The base tensor to pow element-wise. + * @param exp The exponent tensor to pow element-wise. + */ + function powStrict_(base, exp) { + deprecationWarn('strict variants of ops have been deprecated ' + + 'and will be removed in future'); + assertShapesMatch(base.shape, exp.shape, 'Error in powStrict: '); + return base.pow(exp); + } + /** + * Multiplies two `tf.Tensor`s element-wise, A * B. Supports broadcasting. + * + * We also expose `tf.mulStrict` which has the same signature as this op and + * asserts that `a` and `b` are the same shape (does not broadcast). + * + * ```js + * const a = tf.tensor1d([1, 2, 3, 4]); + * const b = tf.tensor1d([2, 3, 4, 5]); + * + * a.mul(b).print(); // or tf.mul(a, b) + * ``` + * + * ```js + * // Broadcast mul a with b. + * const a = tf.tensor1d([1, 2, 3, 4]); + * const b = tf.scalar(5); + * + * a.mul(b).print(); // or tf.mul(a, b) + * ``` + * @param a The first tensor to multiply. + * @param b The second tensor to multiply. Must have the same dtype as `a`. + */ + /** @doc {heading: 'Operations', subheading: 'Arithmetic'} */ + function mul_(a, b) { + let $a = convertToTensor(a, 'a', 'mul'); + let $b = convertToTensor(b, 'b', 'mul'); + [$a, $b] = makeTypesMatch($a, $b); + const outShape = assertAndGetBroadcastShape($a.shape, $b.shape); + const der = (dy, saved) => { + const [$a, $b] = saved; + const derA = () => { + const res = dy.mul($b.toFloat()); + const reduceAxes = getReductionAxes($a.shape, outShape); + if (reduceAxes.length > 0) { + return res.sum(reduceAxes).reshape($a.shape); + } + return res; + }; + const derB = () => { + const res = dy.mul($a.toFloat()); + const reduceAxes = getReductionAxes($b.shape, outShape); + if (reduceAxes.length > 0) { + return res.sum(reduceAxes).reshape($b.shape); + } + return res; + }; + return { a: derA, b: derB }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.multiply($a, $b); + save([$a, $b]); + return res; + }, { a: $a, b: $b }, der, 'Mul'); + } + /** + * @deprecated + * Multiplies two `tf.Tensor`s element-wise, A * B. + * + * Inputs must be the same shape. For broadcasting support, use `tf.mul`. + * + * @param a The first tensor to multiply. + * @param b The first tensor to multiply. Must have the same + * dtype as `a`. + */ + function mulStrict_(a, b) { + deprecationWarn('strict variants of ops have been deprecated ' + + 'and will be removed in future'); + const $a = convertToTensor(a, 'a', 'mul'); + const $b = convertToTensor(b, 'b', 'mul'); + assertShapesMatch($a.shape, $b.shape, 'Error in multiplyStrict: '); + return $a.mul($b); + } + /** + * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. + * The result is rounded with floor function. + * + * + * ```js + * const a = tf.tensor1d([1, 4, 9, 16]); + * const b = tf.tensor1d([1, 2, 3, 4]); + * + * a.floorDiv(b).print(); // or tf.div(a, b) + * ``` + * + * ```js + * // Broadcast div a with b. + * const a = tf.tensor1d([2, 4, 6, 8]); + * const b = tf.scalar(2); + * + * a.floorDiv(b).print(); // or tf.floorDiv(a, b) + * ``` + * + * @param a The first tensor as the numerator. + * @param b The second tensor as the denominator. Must have the same dtype as + * `a`. + */ + /** @doc {heading: 'Operations', subheading: 'Arithmetic'} */ + function floorDiv_(a, b) { + let $a = convertToTensor(a, 'a', 'floorDiv'); + let $b = convertToTensor(b, 'b', 'floorDiv'); + [$a, $b] = makeTypesMatch($a, $b); + const outShape = assertAndGetBroadcastShape($a.shape, $b.shape); + const der = (dy, saved) => { + const [$a, $b] = saved; + const derA = () => { + const res = dy.div($b.toFloat()); + const reduceAxes = getReductionAxes($a.shape, outShape); + if (reduceAxes.length > 0) { + return res.sum(reduceAxes).reshape($a.shape); + } + return res; + }; + const derB = () => { + let res = dy.mul($a.toFloat()); + const reduceAxes = getReductionAxes($b.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes).reshape($b.shape); + } + const tmp = $b.square(); + return res.div(tmp.toFloat()).neg(); + }; + return { a: derA, b: derB }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.floorDiv($a, $b); + save([$a, $b]); + return res; + }, { a: $a, b: $b }, der, 'FloorDiv'); + } + /** + * @deprecated + * Divides two `tf.Tensor`s element-wise, A / B. Inputs must + * be the same shape. + * + * @param a The first tensor as the numerator for element-wise division. + * @param b The second tensor as the denominator for element-wise division. + */ + function divStrict_(a, b) { + deprecationWarn('strict variants of ops have been deprecated ' + + 'and will be removed in future'); + const $a = convertToTensor(a, 'a', 'div'); + const $b = convertToTensor(b, 'b', 'div'); + assertShapesMatch($a.shape, $b.shape, 'Error in divideStrict: '); + return $a.div($b); + } + /** + * Returns the mod of a and b element-wise. + * `floor(x / y) * y + mod(x, y) = x` + * Supports broadcasting. + * + * We also expose `tf.modStrict` which has the same signature as this op and + * asserts that `a` and `b` are the same shape (does not broadcast). + * + * ```js + * const a = tf.tensor1d([1, 4, 3, 16]); + * const b = tf.tensor1d([1, 2, 9, 4]); + * + * a.mod(b).print(); // or tf.mod(a, b) + * ``` + * + * ```js + * // Broadcast a mod b. + * const a = tf.tensor1d([2, 4, 6, 8]); + * const b = tf.scalar(5); + * + * a.mod(b).print(); // or tf.mod(a, b) + * ``` + * + * @param a The first tensor. + * @param b The second tensor. Must have the same type as `a`. + */ + /** @doc {heading: 'Operations', subheading: 'Arithmetic'} */ + function mod_(a, b) { + let $a = convertToTensor(a, 'a', 'mod'); + let $b = convertToTensor(b, 'b', 'mod'); + [$a, $b] = makeTypesMatch($a, $b); + const outShape = assertAndGetBroadcastShape($a.shape, $b.shape); + const der = (dy, saved) => { + const [$a, $b] = saved; + const derA = () => { + const reduceAxes = getReductionAxes($a.shape, outShape); + if (reduceAxes.length > 0) { + return dy.sum(reduceAxes).reshape($a.shape); + } + return dy; + }; + const derB = () => { + const res = dy.mul($a.div($b).floor().neg()); + const reduceAxes = getReductionAxes($b.shape, outShape); + if (reduceAxes.length > 0) { + return res.sum(reduceAxes).reshape($b.shape); + } + return res; + }; + return { $a: derA, $b: derB }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.mod($a, $b); + save([$a, $b]); + return res; + }, { $a, $b }, der); + } + /** + * @deprecated + * Returns the mod of a and b (`a < b ? a : b`) element-wise. Inputs must + * be the same shape. For broadcasting support, use mod(). + * + * @param a The first tensor. + * @param b The second tensor. Must have the same dtype as `a`. + */ + function modStrict_(a, b) { + deprecationWarn('strict variants of ops have been deprecated ' + + 'and will be removed in future'); + const $a = convertToTensor(a, 'a', 'modStrict'); + const $b = convertToTensor(b, 'b', 'modStrict'); + assertShapesMatch($a.shape, $b.shape, 'Error in modStrict: '); + return $a.mod($b); + } + /** + * Returns the min of a and b (`a < b ? a : b`) element-wise. + * Supports broadcasting. + * + * We also expose `minimumStrict` which has the same signature as this op and + * asserts that `a` and `b` are the same shape (does not broadcast). + * + * ```js + * const a = tf.tensor1d([1, 4, 3, 16]); + * const b = tf.tensor1d([1, 2, 9, 4]); + * + * a.minimum(b).print(); // or tf.minimum(a, b) + * ``` + * + * ```js + * // Broadcast minimum a with b. + * const a = tf.tensor1d([2, 4, 6, 8]); + * const b = tf.scalar(5); + * + * a.minimum(b).print(); // or tf.minimum(a, b) + * ``` + * + * @param a The first tensor. + * @param b The second tensor. Must have the same type as `a`. + */ + /** @doc {heading: 'Operations', subheading: 'Arithmetic'} */ + function minimum_(a, b) { + let $a = convertToTensor(a, 'a', 'minimum'); + let $b = convertToTensor(b, 'b', 'minimum'); + [$a, $b] = makeTypesMatch($a, $b); + if ($a.dtype === 'bool') { + $a = $a.toInt(); + $b = $b.toInt(); + } + assertAndGetBroadcastShape($a.shape, $b.shape); + const der = (dy, saved) => { + const [$a, $b] = saved; + const derA = () => dy.mul($a.lessEqual($b).toFloat()); + const derB = () => dy.mul($a.greater($b).toFloat()); + return { a: derA, b: derB }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.minimum($a, $b); + save([$a, $b]); + return res; + }, { a: $a, b: $b }, der, 'Minimum'); + } + /** + * @deprecated + * Returns the min of a and b (`a < b ? a : b`) element-wise. Inputs must + * be the same shape. For broadcasting support, use minimum(). + * + * @param a The first tensor. + * @param b The second tensor. Must have the same dtype as `a`. + */ + function minimumStrict_(a, b) { + deprecationWarn('strict variants of ops have been deprecated ' + + 'and will be removed in future'); + const $a = convertToTensor(a, 'a', 'minimumStrict'); + const $b = convertToTensor(b, 'b', 'minimumStrict'); + assertShapesMatch($a.shape, $b.shape, 'Error in minimumStrict: '); + return $a.minimum($b); + } + /** + * Returns the max of a and b (`a > b ? a : b`) element-wise. + * Supports broadcasting. + * + * We also expose `tf.maximumStrict` which has the same signature as this op and + * asserts that `a` and `b` are the same shape (does not broadcast). + * + * ```js + * const a = tf.tensor1d([1, 4, 3, 16]); + * const b = tf.tensor1d([1, 2, 9, 4]); + * + * a.maximum(b).print(); // or tf.maximum(a, b) + * ``` + * + * ```js + * // Broadcast maximum a with b. + * const a = tf.tensor1d([2, 4, 6, 8]); + * const b = tf.scalar(5); + * + * a.maximum(b).print(); // or tf.maximum(a, b) + * ``` + * + * @param a The first tensor. + * @param b The second tensor. Must have the same type as `a`. + */ + /** @doc {heading: 'Operations', subheading: 'Arithmetic'} */ + function maximum_(a, b) { + let $a = convertToTensor(a, 'a', 'maximum'); + let $b = convertToTensor(b, 'b', 'maximum'); + [$a, $b] = makeTypesMatch($a, $b); + if ($a.dtype === 'bool') { + $a = $a.toInt(); + $b = $b.toInt(); + } + assertAndGetBroadcastShape($a.shape, $b.shape); + const der = (dy, saved) => { + const [$a, $b] = saved; + const derA = () => dy.mul($a.greaterEqual($b).toFloat()); + const derB = () => dy.mul($a.less($b).toFloat()); + return { a: derA, b: derB }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.maximum($a, $b); + save([$a, $b]); + return res; + }, { a: $a, b: $b }, der, 'Maximum'); + } + /** + * @deprecated + * Returns the max of a and b (`a > b ? a : b`) element-wise. Inputs must + * be the same shape. For broadcasting support, use maximum(). + * + * @param a The first tensor. + * @param b The second tensor. Must have the same dtype as `a`. + */ + function maximumStrict_(a, b) { + deprecationWarn('strict variants of ops have been deprecated ' + + 'and will be removed in future'); + const $a = convertToTensor(a, 'a', 'maximumStrict'); + const $b = convertToTensor(b, 'b', 'maximumStrict'); + assertShapesMatch($a.shape, $b.shape, 'Error in maximumStrict: '); + return $a.maximum($b); + } + /** + * @deprecated + * Returns (a - b) * (a - b) element-wise. + * + * Inputs must be the same shape. For broadcasting support, use + * `tf.squaredDifference` instead. + * + * @param a The first tensor. + * @param b The second tensor. Must have the same type as `a`. + */ + function squaredDifferenceStrict_(a, b) { + deprecationWarn('strict variants of ops have been deprecated ' + + 'and will be removed in future'); + const $a = convertToTensor(a, 'a', 'squaredDifferenceStrict'); + const $b = convertToTensor(b, 'b', 'squaredDifferenceStrict'); + assertShapesMatch($a.shape, $b.shape, 'Error in squaredDifferenceStrict: '); + return $a.squaredDifference($b); + } + /** + * Computes arctangent of `tf.Tensor`s a / b element-wise: `atan2(a, b)`. + * Supports broadcasting. + * + * ```js + * const a = tf.tensor1d([1.0, 1.0, -1.0, .7]); + * const b = tf.tensor1d([2.0, 13.0, 3.5, .21]); + * + * tf.atan2(a, b).print() + * ``` + * + * @param a The first tensor. + * @param b The second tensor. Must have the same dtype as `a`. + * + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function atan2_(a, b) { + let $a = convertToTensor(a, 'a', 'atan2'); + let $b = convertToTensor(b, 'b', 'atan2'); + [$a, $b] = makeTypesMatch($a, $b); + const outShape = assertAndGetBroadcastShape($a.shape, $b.shape); + const der = (dy, saved) => { + const [$a, $b] = saved; + const derA = () => { + const d = add($a.square(), $b.square()); + let res = dy.mul($b.div(d)); + const reduceAxes = getReductionAxes($a.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes); + } + return res.reshape($a.shape); + }; + const derB = () => { + const d = add($a.square(), $b.square()); + let res = neg(dy.mul($a.div(d))); + const reduceAxes = getReductionAxes($b.shape, outShape); + if (reduceAxes.length > 0) { + res = res.sum(reduceAxes); + } + return res.reshape($b.shape); + }; + return { $a: derA, $b: derB }; + }; + return ENGINE.runKernelFunc((backend, save) => { + const res = backend.atan2($a, $b); + save([$a, $b]); + return res; + }, { $a, $b }, der); + } + const addStrict = op({ addStrict_ }); + const atan2 = op({ atan2_ }); + const divStrict = op({ divStrict_ }); + const floorDiv = op({ floorDiv_ }); + const maximum = op({ maximum_ }); + const maximumStrict = op({ maximumStrict_ }); + const minimum = op({ minimum_ }); + const minimumStrict = op({ minimumStrict_ }); + const mod = op({ mod_ }); + const modStrict = op({ modStrict_ }); + const mul = op({ mul_ }); + const mulStrict = op({ mulStrict_ }); + const pow = op({ pow_ }); + const powStrict = op({ powStrict_ }); + const squaredDifferenceStrict = op({ squaredDifferenceStrict_ }); + const subStrict = op({ subStrict_ }); + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Divides two `tf.Tensor`s element-wise, A / B. Supports broadcasting. + * + * ```js + * const a = tf.tensor1d([1, 4, 9, 16]); + * const b = tf.tensor1d([1, 2, 3, 4]); + * + * a.div(b).print(); // or tf.div(a, b) + * ``` + * + * ```js + * // Broadcast div a with b. + * const a = tf.tensor1d([2, 4, 6, 8]); + * const b = tf.scalar(2); + * + * a.div(b).print(); // or tf.div(a, b) + * ``` + * + * @param a The first tensor as the numerator. + * @param b The second tensor as the denominator. Must have the same dtype as + * `a`. + */ + /** @doc {heading: 'Operations', subheading: 'Arithmetic'} */ + function div_(a, b) { + let $a = convertToTensor(a, 'a', 'div'); + let $b = convertToTensor(b, 'b', 'div'); + [$a, $b] = makeTypesMatch($a, $b); + if ($a.dtype === 'int32' && $b.dtype === 'int32') { + return floorDiv($a, $b); + } + const forward = (backend, save) => { + const res = backend.realDivide($a, $b); + save([$a, $b]); + return res; + }; + const inputs = { a: $a, b: $b }; + const attrs = {}; + return ENGINE.runKernelFunc(forward, inputs, null /* gradient */, Div, attrs); + } + const div = op({ div_ }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Computes square of `x` element-wise: `x ^ 2` + * + * ```js + * const x = tf.tensor1d([1, 2, Math.sqrt(2), -1]); + * + * x.square().print(); // or tf.square(x) + * ``` + * @param x The input Tensor. + */ + /** @doc {heading: 'Operations', subheading: 'Basic math'} */ + function square_(x) { + const $x = convertToTensor(x, 'x', 'square'); + const attrs = {}; + const inputsToSave = [$x]; + const outputsToSave = []; + return ENGINE.runKernelFunc((backend, save) => { + save([$x]); + return backend.square($x); + }, { x: $x }, null /* grad */, 'Square', attrs, inputsToSave, outputsToSave); + } + const square = op({ square_ }); + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const divGradConfig = { + kernelName: Div, + inputsToSave: ['a', 'b'], + gradFunc: (dy, saved) => { + const [a, b] = saved; + const outShape = assertAndGetBroadcastShape(a.shape, b.shape); + const derA = () => { + const res = div(dy, b.toFloat()); + const reduceAxes = getReductionAxes(a.shape, outShape); + if (reduceAxes.length > 0) { + return sum$1(res, reduceAxes).reshape(a.shape); + } + return res; + }; + const derB = () => { + let res = mul(dy, a.toFloat()); + const reduceAxes = getReductionAxes(b.shape, outShape); + if (reduceAxes.length > 0) { + res = reshape(sum$1(res, reduceAxes), b.shape); + } + const tmp = square(b); + return neg(div(res, tmp.toFloat())); + }; + return { a: derA, b: derB }; + } + }; + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Subtracts two `tf.Tensor`s element-wise, A - B. Supports broadcasting. + * + * ```js + * const a = tf.tensor1d([10, 20, 30, 40]); + * const b = tf.tensor1d([1, 2, 3, 4]); + * + * a.sub(b).print(); // or tf.sub(a, b) + * ``` + * + * ```js + * // Broadcast subtract a with b. + * const a = tf.tensor1d([10, 20, 30, 40]); + * const b = tf.scalar(5); + * + * a.sub(b).print(); // or tf.sub(a, b) + * ``` + * @param a The first `tf.Tensor` to subtract from. + * @param b The second `tf.Tensor` to be subtracted. Must have the same dtype as + * `a`. + */ + /** @doc {heading: 'Operations', subheading: 'Arithmetic'} */ + function sub_(a, b) { + let $a = convertToTensor(a, 'a', 'sub'); + let $b = convertToTensor(b, 'b', 'sub'); + [$a, $b] = makeTypesMatch($a, $b); + const forward = (backend, save) => { + const res = backend.subtract($a, $b); + save([$a, $b]); + return res; + }; + const inputs = { a: $a, b: $b }; + return ENGINE.runKernelFunc(forward, inputs, null /* grad */, Sub); + } + const sub = op({ sub_ }); + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Construct a tensor by repeating it the number of times given by reps. + * + * This operation creates a new tensor by replicating `input` `reps` + * times. The output tensor's i'th dimension has `input.shape[i] * + * reps[i]` elements, and the values of `input` are replicated + * `reps[i]` times along the i'th dimension. For example, tiling + * `[a, b, c, d]` by `[2]` produces `[a, b, c, d, a, b, c, d]`. + * + * ```js + * const a = tf.tensor1d([1, 2]); + * + * a.tile([2]).print(); // or a.tile([2]) + * ``` + * + * ```js + * const a = tf.tensor2d([1, 2, 3, 4], [2, 2]); + * + * a.tile([1, 2]).print(); // or a.tile([1, 2]) + * ``` + * @param x The tensor to tile. + * @param reps Determines the number of replications per dimension. + */ + /** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */ + function tile_(x, reps) { + const parseAs = null; + const $x = convertToTensor(x, 'x', 'tile', parseAs); + assert($x.rank === reps.length, () => `Error in transpose: rank of input ${$x.rank} ` + + `must match length of reps ${reps}.`); + const forward = (backend, save) => { + const res = backend.tile($x, reps); + save([$x]); + return res; + }; + const inputsToSave = [$x]; + const inputs = { x: $x }; + const attrs = { reps }; + return ENGINE.runKernelFunc(forward, inputs, null /* grad */, Tile, attrs, inputsToSave); + } + const tile = op({ tile_ }); + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const fusedBatchNormGradConfig = { + kernelName: FusedBatchNorm, + inputsToSave: ['x', 'mean', 'variance', 'scale'], + gradFunc: (dy, saved, attrs) => { + const { varianceEpsilon } = attrs; + const [x, mean, variance, scale] = saved; + const scaleValue = scale == null ? scalar(1) : scale; + const reductionAxes = getReductionAxes(mean.shape, x.shape); + const tileShape = []; + if (mean.rank === 1) { + for (let i = 0; i < x.shape.length - 1; ++i) { + tileShape.push(x.shape[i]); + } + tileShape.push(1); + } + const xMinusMean = sub(x, mean); + const dyTimesScaleValue = mul(dy, scaleValue); + const oneOverSqrtVariance = rsqrt(add(variance, scalar(varianceEpsilon))); + const minusHalfRCube = mul(mul(mul(oneOverSqrtVariance, oneOverSqrtVariance), oneOverSqrtVariance), scalar(-0.5)); + const derX = () => { + if (mean.rank === 1) { + return reshape(mul(mul(dy, tile(oneOverSqrtVariance.as4D(1, 1, 1, mean.shape[0]), tileShape)), scaleValue), x.shape); + } + else { + return reshape(mul(mul(dy, oneOverSqrtVariance), scaleValue), x.shape); + } + }; + const derMean = () => { + let meanDer = mul(mul(oneOverSqrtVariance, scalar(-1)), dyTimesScaleValue); + if (mean.rank === 1) { + meanDer = sum$1(meanDer, reductionAxes); + } + return reshape(meanDer, mean.shape); + }; + const derVariance = () => { + let varianceDer = mul(mul(minusHalfRCube, xMinusMean), dyTimesScaleValue); + if (mean.rank === 1) { + varianceDer = sum$1(varianceDer, reductionAxes); + } + return reshape(varianceDer, mean.shape); + }; + const derScale = () => { + const xMinusMean2TimesRsqrt = mul(xMinusMean, oneOverSqrtVariance); + let scaleDer = mul(dy, xMinusMean2TimesRsqrt); + if (mean.rank === 1) { + scaleDer = sum$1(scaleDer, reductionAxes); + } + return reshape(scaleDer, mean.shape); + }; + const derOffset = () => { + let offsetDer = dy; + if (mean.rank === 1) { + offsetDer = sum$1(offsetDer, reductionAxes); + } + return reshape(offsetDer, mean.shape); + }; + return { + x: derX, + mean: derMean, + variance: derVariance, + scale: derScale, + offset: derOffset + }; + } + }; + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const greaterEqualGradConfig = { + kernelName: GreaterEqual, + inputsToSave: ['a', 'b'], + gradFunc: (dy, saved) => { + const [a, b] = saved; + return { a: () => zerosLike(a), b: () => zerosLike(b) }; + } + }; + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const identityGradConfig = { + kernelName: Identity, + gradFunc: (dy) => { + return { x: () => dy.toFloat() }; + } + }; + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + function localResponseNormalizationBackprop_(x, y, dy, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5) { + const forward = backend => backend.LRNGrad(dy, x, y, depthRadius, bias, alpha, beta); + const inputs = { x, y, dy }; + const attrs = { depthRadius, bias, alpha, beta }; + return ENGINE.runKernelFunc(forward, inputs, null /* grad */, LRNBackprop, attrs); + } + const localResponseNormalizationBackprop = op({ localResponseNormalizationBackprop_ }); + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const lrnGradConfig = { + kernelName: LRN, + inputsToSave: ['x'], + outputsToSave: [true], + gradFunc: (dy, saved, attrs) => { + const [x, y] = saved; + const { depthRadius, bias, alpha, beta } = attrs; + return { + x: () => localResponseNormalizationBackprop(x, y, dy, depthRadius, bias, alpha, beta) + }; + } + }; + + /** + * @license + * Copyright 2018 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Transposes the `tf.Tensor`. Permutes the dimensions according to `perm`. + * + * The returned `tf.Tensor`'s dimension `i` will correspond to the input + * dimension `perm[i]`. If `perm` is not given, it is set to `[n-1...0]`, + * where `n` is the rank of the input `tf.Tensor`. Hence by default, this + * operation performs a regular matrix transpose on 2-D input `tf.Tensor`s. + * + * ```js + * const a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]); + * + * a.transpose().print(); // or tf.transpose(a) + * ``` + * + * @param x The tensor to transpose. + * @param perm The permutation of the dimensions of a. + */ + /** @doc {heading: 'Operations', subheading: 'Matrices'} */ + function transpose_(x, perm) { + const $x = convertToTensor(x, 'x', 'transpose'); + if (perm == null) { + perm = $x.shape.map((s, i) => i).reverse(); + } + assert($x.rank === perm.length, () => `Error in transpose: rank of input ${$x.rank} ` + + `must match length of perm ${perm}.`); + perm.forEach(axis => { + assert(axis >= 0 && axis < $x.rank, () => `All entries in 'perm' must be between 0 and ${$x.rank - 1}` + + ` but got ${perm}`); + }); + if ($x.rank <= 1) { + return $x.clone(); + } + const attrs = { perm }; + return ENGINE.runKernelFunc(backend => backend.transpose($x, perm), { x: $x }, null /* gradient */, 'Transpose', attrs); + } + const transpose = op({ transpose_ }); + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const maxGradConfig = { + kernelName: Max, + inputsToSave: ['x'], + outputsToSave: [true], + gradFunc: (dy, saved, attrs) => { + const maxAttrs = attrs; + const { reductionIndices } = maxAttrs; + const [x, y] = saved; + const origAxes = parseAxisParam(reductionIndices, x.shape); + const permutedAxes = getAxesPermutation(origAxes, x.rank); + const maxGrad = gradForMinAndMax(dy, y, x, origAxes, permutedAxes); + return { + x: () => { + let out = maxGrad['x'](); + if (permutedAxes != null) { + out = transpose(out); + } + return out; + } + }; + } + }; + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const oneHotGradConfig = { + kernelName: OneHot, + inputsToSave: ['indices'], + gradFunc: (dy, saved) => { + const indices = saved[0]; + return { indices: () => zeros(indices.shape, 'float32') }; + } + }; + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const padV2GradConfig = { + kernelName: PadV2, + inputsToSave: ['x'], + gradFunc: (dy, saved, attrs) => { + // Pad introduces values around the original tensor, so the gradient + // slices the original shape out of the gradient. + const x = saved[0]; + const { paddings } = attrs; + const begin = paddings.map(p => p[0]); + return { x: () => dy.slice(begin, x.shape) }; + } + }; + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const splitVGradConfig = { + kernelName: SplitV, + gradFunc: (dy, saved, attrs) => { + const { axis } = attrs; + return { x: () => concat(dy, axis) }; + } + }; + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const squareGradConfig = { + kernelName: Square, + inputsToSave: ['x'], + gradFunc: (dy, saved) => { + const [x] = saved; + return { x: () => mul(dy, mul(x.toFloat(), 2)) }; + } + }; + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const squaredDifferenceGradConfig = { + kernelName: SquaredDifference, + inputsToSave: ['a', 'b'], + gradFunc: (dy, saved) => { + const [a, b] = saved; + const two = scalar(2); + const derA = () => mul(dy, mul(two, sub(a, b))); + const derB = () => mul(dy, mul(two, sub(b, a))); + return { a: derA, b: derB }; + } + }; + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const subGradConfig = { + kernelName: Sub, + inputsToSave: ['a', 'b'], + gradFunc: (dy, saved) => { + const [a, b] = saved; + const outShape = assertAndGetBroadcastShape(a.shape, b.shape); + const derA = () => { + let res = dy; + const reduceAxes = getReductionAxes(a.shape, outShape); + if (reduceAxes.length > 0) { + res = sum$1(res, reduceAxes); + } + return reshape(res, a.shape); + }; + const derB = () => { + let res = dy; + const reduceAxes = getReductionAxes(b.shape, outShape); + if (reduceAxes.length > 0) { + res = sum$1(res, reduceAxes); + } + return reshape(neg(res), b.shape); + }; + return { a: derA, b: derB }; + } + }; + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Pads a `tf.Tensor` with a given value and paddings. + * + * This operation currently only implements the `CONSTANT` mode. + * + * Also available are stricter rank-specific methods with the same signature + * as this method that assert that `paddings` is of given length. + * - `tf.pad1d` + * - `tf.pad2d` + * - `tf.pad3d` + * - `tf.pad4d` + * + * ```js + * const x = tf.tensor1d([1, 2, 3, 4]); + * x.pad([[1, 2]]).print(); + * ``` + * @param x The tensor to pad. + * @param paddings An array of length `R` (the rank of the tensor), where + * each element is a length-2 tuple of ints `[padBefore, padAfter]`, + * specifying how much to pad along each dimension of the tensor. + * @param constantValue The pad value to use. Defaults to 0. + */ + /** @doc {heading: 'Tensors', subheading: 'Transformations'} */ + function pad_(x, paddings, constantValue = 0) { + const $x = convertToTensor(x, 'x', 'pad'); + if ($x.rank === 0) { + throw new Error('pad(scalar) is not defined. Pass non-scalar to pad'); + } + const forward = (backend, save) => { + save([$x]); + return backend.pad($x, paddings, constantValue); + }; + const attrs = { paddings, constantValue }; + const inputs = { x: $x }; + return ENGINE.runKernelFunc(forward, inputs, null /* grad */, PadV2, attrs); + } + const pad = op({ pad_ }); + + /** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + function assertParamsValid(input, begin, size) { + assert(input.rank === begin.length, () => `Error in slice${input.rank}D: Length of begin ${begin} must ` + + `match the rank of the array (${input.rank}).`); + assert(input.rank === size.length, () => `Error in slice${input.rank}D: Length of size ${size} must ` + + `match the rank of the array (${input.rank}).`); + for (let i = 0; i < input.rank; ++i) { + assert(begin[i] + size[i] <= input.shape[i], () => `Error in slice${input.rank}D: begin[${i}] + size[${i}] ` + + `(${begin[i] + size[i]}) would overflow input.shape[${i}] (${input.shape[i]})`); + } + } + /** Converts a binary mask to an array of axes. Used in stridedSlice(). */ + function maskToAxes(mask) { + const axes = []; + let axis = 0; + while (mask > 0) { + if (mask & 1) { + axes.push(axis); + } + mask /= 2; + axis++; + } + return axes; + } + /** Computes the output shape given the strided slice params. */ + function computeOutShape$1(begin, end, strides) { + const size = []; + for (let axis = 0; axis < begin.length; axis++) { + size[axis] = Math.ceil((end[axis] - begin[axis]) / strides[axis]); + } + return size; + } + function startForAxis(beginMask, startIndices, strides, inputShape, axis) { + // Begin with the specified index + let start = startIndices[axis]; + const stride = strides[axis] || 1; + // Check the axis bit from right of beginMask or the begin index is not set + // for the axis. + if (beginMask & 1 << axis || start == null) { + if (stride > 0) { + // Forward iteration - use the first element. These values will get + // clamped below (Note: We could have set them to 0 and axis_size-1, but + // use lowest() and max() to maintain symmetry with StopForAxis()) + start = Number.MIN_SAFE_INTEGER; + } + else { + // Backward iteration - use the last element. + start = Number.MAX_SAFE_INTEGER; + } + } + // Handle negative indices + const axisSize = inputShape[axis]; + if (start < 0) { + start += axisSize; + } + // Clamping + start = clamp(0, start, axisSize - 1); + return start; + } + function stopForAxis(endMask, stopIndices, strides, inputShape, axis) { + // Begin with the specified index + let stop = stopIndices[axis]; + const stride = strides[axis] || 1; + // Check the axis bit from right of endMask or if the stop index is not set + // for this axis. + if (endMask & (1 << axis) || stop == null) { + if (stride > 0) { + // Forward iteration - use the last element. These values will get + // clamped below + stop = Number.MAX_SAFE_INTEGER; + } + else { + // Backward iteration - use the first element. + stop = Number.MIN_SAFE_INTEGER; + } + } + // Handle negative indices + const axisSize = inputShape[axis]; + if (stop < 0) { + stop += axisSize; + } + // Clamping + // Because the end index points one past the last element, we need slightly + // different clamping ranges depending on the direction. + if (stride > 0) { + // Forward iteration + stop = clamp(0, stop, axisSize); + } + else { + // Backward iteration + stop = clamp(-1, stop, axisSize - 1); + } + return stop; + } + /** + * Returns true if the slice occupies a continous set of elements in the + * 'flat' space. + */ + function isSliceContinous(shape, begin, size) { + // Index of the first axis that has size > 1. + let firstNonOneAxis = size.length; + for (let i = 0; i < size.length; i++) { + if (size[i] > 1) { + firstNonOneAxis = i; + break; + } + } + for (let i = firstNonOneAxis + 1; i < size.length; i++) { + if (begin[i] > 0 || size[i] !== shape[i]) { + return false; + } + } + return true; + } + function computeFlatOffset(begin, strides) { + let flatOffset = begin.length > 0 ? begin[begin.length - 1] : 1; + for (let i = 0; i < begin.length - 1; i++) { + flatOffset += begin[i] * strides[i]; + } + return flatOffset; + } + + var slice_util = /*#__PURE__*/Object.freeze({ + __proto__: null, + assertParamsValid: assertParamsValid, + maskToAxes: maskToAxes, + computeOutShape: computeOutShape$1, + startForAxis: startForAxis, + stopForAxis: stopForAxis, + isSliceContinous: isSliceContinous, + computeFlatOffset: computeFlatOffset + }); + + /** + * @license + * Copyright 2018 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Extracts a 1D slice from 1D array starting at coordinates `begin` and is + * of length `size`. See `slice` for details. + */ + function slice1d_(x, begin, size) { + const $x = convertToTensor(x, 'x', 'slice1d'); + assert($x.rank === 1, () => `slice1d expects a rank-1 tensor, but got a rank-${$x.rank} tensor`); + return slice($x, [begin], [size]); + } + /** + * Extracts a 2D slice from a 2D array starting at coordinates `begin` and + * is of size `size`. See `slice` for details. + */ + function slice2d_(x, begin, size) { + const $x = convertToTensor(x, 'x', 'slice2d'); + assert($x.rank === 2, () => `slice2d expects a rank-2 tensor, but got a rank-${$x.rank} tensor`); + return slice($x, begin, size); + } + /** + * Extracts a 3D slice from a 3D array starting at coordinates `begin` and + * is of size `size`. See `slice` for details. + */ + function slice3d_(x, begin, size) { + const $x = convertToTensor(x, 'x', 'slice3d'); + assert($x.rank === 3, () => `slice3d expects a rank-3 tensor, but got a rank-${$x.rank} tensor`); + return slice($x, begin, size); + } + /** + * Extracts a 4D slice from a 4D array starting at coordinates `begin` and + * is of size `size`. See `slice` for details. + */ + function slice4d_(x, begin, size) { + const $x = convertToTensor(x, 'x', 'slice4d'); + assert($x.rank === 4, () => `slice4d expects a rank-4 tensor, but got a rank-${$x.rank} tensor`); + return slice($x, begin, size); + } + /** + * Extracts a slice from a `tf.Tensor` starting at coordinates `begin` + * and is of size `size`. + * + * Also available are stricter rank-specific methods with the same signature + * as this method that assert that `x` is of the given rank: + * - `tf.slice1d` + * - `tf.slice2d` + * - `tf.slice3d` + * - `tf.slice4d` + * + * ```js + * const x = tf.tensor1d([1, 2, 3, 4]); + * + * x.slice([1], [2]).print(); + * ``` + * + * ```js + * const x = tf.tensor2d([1, 2, 3, 4], [2, 2]); + * + * x.slice([1, 0], [1, 2]).print(); + * ``` + * @param x The input `tf.Tensor` to slice from. + * @param begin The coordinates to start the slice from. The length can be + * less than the rank of x - the rest of the axes will have implicit 0 as + * start. Can also be a single number, in which case it specifies the + * first axis. + * @param size The size of the slice. The length can be less than the rank of + * x - the rest of the axes will have implicit -1. A value of -1 requests + * the rest of the dimensions in the axis. Can also be a single number, + * in which case it specifies the size of the first axis. + */ + /** @doc {heading: 'Tensors', subheading: 'Slicing and Joining'} */ + function slice_(x, begin, size) { + const $x = convertToTensor(x, 'x', 'slice'); + if ($x.rank === 0) { + throw new Error('Slicing scalar is not possible'); + } + // The following logic allows for more ergonomic calls. + let begin_; + if (typeof begin === 'number') { + begin_ = [begin, ...new Array($x.rank - 1).fill(0)]; + } + else if (begin.length < $x.rank) { + begin_ = begin.concat(new Array($x.rank - begin.length).fill(0)); + } + else { + begin_ = begin.slice(); + } + begin_.forEach(d => { + assert(d !== -1, () => 'slice() does not support negative begin indexing.'); + }); + let size_; + if (size == null) { + size_ = new Array($x.rank).fill(-1); + } + else if (typeof size === 'number') { + size_ = [size, ...new Array($x.rank - 1).fill(-1)]; + } + else if (size.length < $x.rank) { + size_ = size.concat(new Array($x.rank - size.length).fill(-1)); + } + else { + size_ = size; + } + size_ = size_.map((d, i) => { + if (d >= 0) { + return d; + } + else { + assert(d === -1, () => `Negative size values should be exactly -1 but got ` + + `${d} for the slice() size at index ${i}.`); + return $x.shape[i] - begin_[i]; + } + }); + assertParamsValid($x, begin_, size_); + const inputShape = $x.shape; + const grad = (dy) => { + // Create an Nx2 padding where the first column represents how many + // zeros are prepended (at start) for each dimension, and the second + // column indicates how many zeros are appended (at end). + // The number of zeros to append is the shape of the input + // elementwise-subtracted by both the begin vector and sizes vector. + const paddings = []; + for (let i = 0; i < dy.rank; i++) { + paddings.push([begin_[i], inputShape[i] - begin_[i] - size_[i]]); + } + return { x: () => pad(dy, paddings) }; + }; + const attrs = { begin: begin_, size: size_ }; + return ENGINE.runKernelFunc(backend => backend.slice($x, begin_, size_), { x: $x }, grad, 'Slice', attrs); + } + const slice = op({ slice_ }); + const slice1d = op({ slice1d_ }); + const slice2d = op({ slice2d_ }); + const slice3d = op({ slice3d_ }); + const slice4d = op({ slice4d_ }); + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const tileGradConfig = { + kernelName: Tile, + inputsToSave: ['x'], + gradFunc: (dy, saved, attrs) => { + const [x] = saved; + const { reps } = attrs; + const derX = () => { + let xGrad = zerosLike(x); + // TODO(cais): Maybe reduce memory footprint by avoiding repeated + // slicing. + if (x.rank === 1) { + for (let i = 0; i < reps[0]; ++i) { + xGrad = add(xGrad, slice(dy, [i * x.shape[0]], [x.shape[0]])); + } + } + else if (x.rank === 2) { + for (let i = 0; i < reps[0]; ++i) { + for (let j = 0; j < reps[1]; ++j) { + xGrad = add(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1]], [ + x.shape[0], x.shape[1] + ])); + } + } + } + else if (x.rank === 3) { + for (let i = 0; i < reps[0]; ++i) { + for (let j = 0; j < reps[1]; ++j) { + for (let k = 0; k < reps[2]; ++k) { + xGrad = + add(xGrad, slice(dy, [i * x.shape[0], j * x.shape[1], k * x.shape[2]], [x.shape[0], x.shape[1], x.shape[2]])); + } + } + } + } + else if (x.rank === 4) { + for (let i = 0; i < reps[0]; ++i) { + for (let j = 0; j < reps[1]; ++j) { + for (let k = 0; k < reps[2]; ++k) { + for (let l = 0; l < reps[3]; ++l) { + xGrad = + add(xGrad, slice(dy, [ + i * x.shape[0], j * x.shape[1], k * x.shape[2], + l * x.shape[3] + ], [x.shape[0], x.shape[1], x.shape[2], x.shape[3]])); + } + } + } + } + } + else { + throw new Error(`Gradient for tile operation is not implemented for rank-` + + `${x.rank} tensors yet.`); + } + return xGrad; + }; + return { x: derX }; + }, + }; + + /** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const transposeGradConfig = { + kernelName: Transpose, + gradFunc: (dy, saved, attrs) => { + const transposeAttrs = attrs; + const { perm } = transposeAttrs; + const undoPerm = getUndoAxesPermutation(perm); + return { x: () => transpose(dy, undoPerm) }; + } + }; + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + // Export all kernel configs here so that the package can auto register them + const gradConfigs = [ + addGradConfig, + addNGradConfig, + batchMatMulGradConfig, + broadcastToGradConfig, + concatGradConfig, + conv2DGradConfig, + conv2DBackpropInputGradConfig, + conv3DGradConfig, + depthwiseConv2dNativeGradConfig, + divGradConfig, + fusedBatchNormGradConfig, + greaterEqualGradConfig, + identityGradConfig, + lrnGradConfig, + oneHotGradConfig, + padV2GradConfig, + splitVGradConfig, + maxGradConfig, + squareGradConfig, + squaredDifferenceGradConfig, + tileGradConfig, + transposeGradConfig, + subGradConfig + ]; + for (const gradientConfig of gradConfigs) { + registerGradient(gradientConfig); + } + + /** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + class PlatformBrowser { + fetch(path, init) { + return fetch(path, init); + } + now() { + return performance.now(); + } + encode(text, encoding) { + if (encoding !== 'utf-8' && encoding !== 'utf8') { + throw new Error(`Browser's encoder only supports utf-8, but got ${encoding}`); + } + if (this.textEncoder == null) { + this.textEncoder = new TextEncoder(); + } + return this.textEncoder.encode(text); + } + decode(bytes, encoding) { + return new TextDecoder(encoding).decode(bytes); + } + } + if (env().get('IS_BROWSER')) { + env().setPlatform('browser', new PlatformBrowser()); + } + + /** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + // We are wrapping this within an object so it can be stubbed by Jasmine. + const getNodeFetch = { + // tslint:disable-next-line:no-require-imports + importFetch: () => require('node-fetch') + }; + let systemFetch; + class PlatformNode { + constructor() { + // tslint:disable-next-line:no-require-imports + this.util = require('util'); + // According to the spec, the built-in encoder can do only UTF-8 encoding. + // https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/TextEncoder + this.textEncoder = new this.util.TextEncoder(); + } + fetch(path, requestInits) { + if (env().global.fetch != null) { + return env().global.fetch(path, requestInits); + } + if (systemFetch == null) { + systemFetch = getNodeFetch.importFetch(); + } + return systemFetch(path, requestInits); + } + now() { + const time = process.hrtime(); + return time[0] * 1000 + time[1] / 1000000; + } + encode(text, encoding) { + if (encoding !== 'utf-8' && encoding !== 'utf8') { + throw new Error(`Node built-in encoder only supports utf-8, but got ${encoding}`); + } + return this.textEncoder.encode(text); + } + decode(bytes, encoding) { + if (bytes.length === 0) { + return ''; + } + return new this.util.TextDecoder(encoding).decode(bytes); + } + } + if (env().get('IS_NODE')) { + env().setPlatform('node', new PlatformNode()); + } + + /** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /* Type definitions for exporting and importing of models. */ + /** + * A map from Tensor dtype to number of bytes per element of the Tensor. + */ + const DTYPE_VALUE_SIZE_MAP = { + 'float32': 4, + 'int32': 4, + 'uint16': 2, + 'uint8': 1, + 'bool': 1, + }; + + /** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** Number of bytes reserved for the length of the string. (32bit integer). */ + const NUM_BYTES_STRING_LENGTH = 4; + /** + * Encode a map from names to weight values as an ArrayBuffer, along with an + * `Array` of `WeightsManifestEntry` as specification of the encoded weights. + * + * This function does not perform sharding. + * + * This function is the reverse of `decodeWeights`. + * + * @param tensors A map ("dict") from names to tensors. + * @param group Group to which the weights belong (optional). + * @returns A `Promise` of + * - A flat `ArrayBuffer` with all the binary values of the `Tensor`s + * concatenated. + * - An `Array` of `WeightManifestEntry`s, carrying information including + * tensor names, `dtype`s and shapes. + * @throws Error: on unsupported tensor `dtype`. + */ + async function encodeWeights(tensors, group) { + // TODO(adarob, cais): Support quantization. + const specs = []; + const dataPromises = []; + const names = Array.isArray(tensors) ? + tensors.map(tensor => tensor.name) : + Object.keys(tensors); + for (let i = 0; i < names.length; ++i) { + const name = names[i]; + const t = Array.isArray(tensors) ? tensors[i].tensor : tensors[name]; + if (t.dtype !== 'float32' && t.dtype !== 'int32' && t.dtype !== 'bool' && + t.dtype !== 'string') { + throw new Error(`Unsupported dtype in weight '${name}': ${t.dtype}`); + } + const spec = { name, shape: t.shape, dtype: t.dtype }; + if (t.dtype === 'string') { + const utf8bytes = new Promise(async (resolve) => { + const vals = await t.bytes(); + const totalNumBytes = vals.reduce((p, c) => p + c.length, 0) + + NUM_BYTES_STRING_LENGTH * vals.length; + const bytes = new Uint8Array(totalNumBytes); + let offset = 0; + for (let i = 0; i < vals.length; i++) { + const val = vals[i]; + const bytesOfLength = new Uint8Array(new Uint32Array([val.length]).buffer); + bytes.set(bytesOfLength, offset); + offset += NUM_BYTES_STRING_LENGTH; + bytes.set(val, offset); + offset += val.length; + } + resolve(bytes); + }); + dataPromises.push(utf8bytes); + } + else { + dataPromises.push(t.data()); + } + if (group != null) { + spec.group = group; + } + specs.push(spec); + } + const tensorValues = await Promise.all(dataPromises); + return { data: concatenateTypedArrays(tensorValues), specs }; + } + /** + * Decode flat ArrayBuffer as weights. + * + * This function does not handle sharding. + * + * This function is the reverse of `encodeWeights`. + * + * @param buffer A flat ArrayBuffer carrying the binary values of the tensors + * concatenated in the order specified in `specs`. + * @param specs Specifications of the names, dtypes and shapes of the tensors + * whose value are encoded by `buffer`. + * @return A map from tensor name to tensor value, with the names corresponding + * to names in `specs`. + * @throws Error, if any of the tensors has unsupported dtype. + */ + function decodeWeights(buffer, specs) { + // TODO(adarob, cais): Support quantization. + const out = {}; + let offset = 0; + for (const spec of specs) { + const name = spec.name; + const dtype = spec.dtype; + const shape = spec.shape; + const size = sizeFromShape(shape); + let values; + if ('quantization' in spec) { + const quantization = spec.quantization; + if (quantization.dtype !== 'uint8' && quantization.dtype !== 'uint16') { + throw new Error(`Weight ${spec.name} has unknown ` + + `quantization dtype ${quantization.dtype}. ` + + `Supported quantization dtypes are: 'uint8' and 'uint16'.`); + } + const quantizationSizeFactor = DTYPE_VALUE_SIZE_MAP[quantization.dtype]; + const byteBuffer = buffer.slice(offset, offset + size * quantizationSizeFactor); + const quantizedArray = (quantization.dtype === 'uint8') ? + new Uint8Array(byteBuffer) : + new Uint16Array(byteBuffer); + if (dtype === 'float32') { + values = Float32Array.from(quantizedArray, v => v * quantization.scale + quantization.min); + } + else if (dtype === 'int32') { + values = Int32Array.from(quantizedArray, v => Math.round(v * quantization.scale + quantization.min)); + } + else { + throw new Error(`Unsupported dtype in weight '${name}': ${dtype}`); + } + offset += size * quantizationSizeFactor; + } + else if (dtype === 'string') { + const size = sizeFromShape(spec.shape); + values = []; + for (let i = 0; i < size; i++) { + const byteLength = new Uint32Array(buffer.slice(offset, offset + NUM_BYTES_STRING_LENGTH))[0]; + offset += NUM_BYTES_STRING_LENGTH; + const bytes = new Uint8Array(buffer.slice(offset, offset + byteLength)); + values.push(bytes); + offset += byteLength; + } + } + else { + const dtypeFactor = DTYPE_VALUE_SIZE_MAP[dtype]; + const byteBuffer = buffer.slice(offset, offset + size * dtypeFactor); + if (dtype === 'float32') { + values = new Float32Array(byteBuffer); + } + else if (dtype === 'int32') { + values = new Int32Array(byteBuffer); + } + else if (dtype === 'bool') { + values = new Uint8Array(byteBuffer); + } + else { + throw new Error(`Unsupported dtype in weight '${name}': ${dtype}`); + } + offset += size * dtypeFactor; + } + out[name] = tensor(values, shape, dtype); + } + return out; + } + /** + * Concatenate TypedArrays into an ArrayBuffer. + */ + function concatenateTypedArrays(xs) { + // TODO(adarob, cais): Support quantization. + if (xs === null) { + throw new Error(`Invalid input value: ${JSON.stringify(xs)}`); + } + let totalByteLength = 0; + // `normalizedXs` is here for this reason: a `TypedArray`'s `buffer' + // can have a different byte length from that of the `TypedArray` itself, + // for example, when the `TypedArray` is created from an offset in an + // `ArrayBuffer`. `normliazedXs` holds `TypedArray`s whose `buffer`s match + // the `TypedArray` in byte length. If an element of `xs` does not show + // this property, a new `TypedArray` that satisfy this property will be + // constructed and pushed into `normalizedXs`. + const normalizedXs = []; + xs.forEach((x) => { + totalByteLength += x.byteLength; + // tslint:disable:no-any + normalizedXs.push(x.byteLength === x.buffer.byteLength ? x : + new x.constructor(x)); + if (!(x instanceof Float32Array || x instanceof Int32Array || + x instanceof Uint8Array)) { + throw new Error(`Unsupported TypedArray subtype: ${x.constructor.name}`); + } + // tslint:enable:no-any + }); + const y = new Uint8Array(totalByteLength); + let offset = 0; + normalizedXs.forEach((x) => { + y.set(new Uint8Array(x.buffer), offset); + offset += x.byteLength; + }); + return y.buffer; + } + // Use Buffer on Node.js instead of Blob/atob/btoa + const useNodeBuffer = typeof Buffer !== 'undefined' && + (typeof Blob === 'undefined' || typeof atob === 'undefined' || + typeof btoa === 'undefined'); + /** + * Calculate the byte length of a JavaScript string. + * + * Note that a JavaScript string can contain wide characters, therefore the + * length of the string is not necessarily equal to the byte length. + * + * @param str Input string. + * @returns Byte length. + */ + function stringByteLength(str) { + if (useNodeBuffer) { + return Buffer.byteLength(str); + } + return new Blob([str]).size; + } + /** + * Encode an ArrayBuffer as a base64 encoded string. + * + * @param buffer `ArrayBuffer` to be converted. + * @returns A string that base64-encodes `buffer`. + */ + function arrayBufferToBase64String(buffer) { + if (useNodeBuffer) { + return Buffer.from(buffer).toString('base64'); + } + const buf = new Uint8Array(buffer); + let s = ''; + for (let i = 0, l = buf.length; i < l; i++) { + s += String.fromCharCode(buf[i]); + } + return btoa(s); + } + /** + * Decode a base64 string as an ArrayBuffer. + * + * @param str Base64 string. + * @returns Decoded `ArrayBuffer`. + */ + function base64StringToArrayBuffer(str) { + if (useNodeBuffer) { + const buf = Buffer.from(str, 'base64'); + return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + } + const s = atob(str); + const buffer = new Uint8Array(s.length); + for (let i = 0; i < s.length; ++i) { + buffer.set([s.charCodeAt(i)], i); + } + return buffer.buffer; + } + /** + * Concatenate a number of ArrayBuffers into one. + * + * @param buffers A number of array buffers to concatenate. + * @returns Result of concatenating `buffers` in order. + */ + function concatenateArrayBuffers(buffers) { + let totalByteLength = 0; + buffers.forEach((buffer) => { + totalByteLength += buffer.byteLength; + }); + const temp = new Uint8Array(totalByteLength); + let offset = 0; + buffers.forEach((buffer) => { + temp.set(new Uint8Array(buffer), offset); + offset += buffer.byteLength; + }); + return temp.buffer; + } + /** + * Get the basename of a path. + * + * Behaves in a way analogous to Linux's basename command. + * + * @param path + */ + function basename(path) { + const SEPARATOR = '/'; + path = path.trim(); + while (path.endsWith(SEPARATOR)) { + path = path.slice(0, path.length - 1); + } + const items = path.split(SEPARATOR); + return items[items.length - 1]; + } + /** + * Populate ModelArtifactsInfo fields for a model with JSON topology. + * @param modelArtifacts + * @returns A ModelArtifactsInfo object. + */ + function getModelArtifactsInfoForJSON(modelArtifacts) { + if (modelArtifacts.modelTopology instanceof ArrayBuffer) { + throw new Error('Expected JSON model topology, received ArrayBuffer.'); + } + return { + dateSaved: new Date(), + modelTopologyType: 'JSON', + modelTopologyBytes: modelArtifacts.modelTopology == null ? + 0 : + stringByteLength(JSON.stringify(modelArtifacts.modelTopology)), + weightSpecsBytes: modelArtifacts.weightSpecs == null ? + 0 : + stringByteLength(JSON.stringify(modelArtifacts.weightSpecs)), + weightDataBytes: modelArtifacts.weightData == null ? + 0 : + modelArtifacts.weightData.byteLength, + }; + } + + /** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + class IORouterRegistry { + constructor() { + this.saveRouters = []; + this.loadRouters = []; + } + static getInstance() { + if (IORouterRegistry.instance == null) { + IORouterRegistry.instance = new IORouterRegistry(); + } + return IORouterRegistry.instance; + } + /** + * Register a save-handler router. + * + * @param saveRouter A function that maps a URL-like string onto an instance + * of `IOHandler` with the `save` method defined or `null`. + */ + static registerSaveRouter(saveRouter) { + IORouterRegistry.getInstance().saveRouters.push(saveRouter); + } + /** + * Register a load-handler router. + * + * @param loadRouter A function that maps a URL-like string onto an instance + * of `IOHandler` with the `load` method defined or `null`. + */ + static registerLoadRouter(loadRouter) { + IORouterRegistry.getInstance().loadRouters.push(loadRouter); + } + /** + * Look up IOHandler for saving, given a URL-like string. + * + * @param url + * @returns If only one match is found, an instance of IOHandler with the + * `save` method defined. If no match is found, `null`. + * @throws Error, if more than one match is found. + */ + static getSaveHandlers(url) { + return IORouterRegistry.getHandlers(url, 'save'); + } + /** + * Look up IOHandler for loading, given a URL-like string. + * + * @param url + * @param onProgress Optional, progress callback function, fired periodically + * before the load is completed. + * @returns All valid handlers for `url`, given the currently registered + * handler routers. + */ + static getLoadHandlers(url, onProgress) { + return IORouterRegistry.getHandlers(url, 'load', onProgress); + } + static getHandlers(url, handlerType, onProgress) { + const validHandlers = []; + const routers = handlerType === 'load' ? + IORouterRegistry.getInstance().loadRouters : + IORouterRegistry.getInstance().saveRouters; + routers.forEach(router => { + const handler = router(url, onProgress); + if (handler !== null) { + validHandlers.push(handler); + } + }); + return validHandlers; + } + } + const registerSaveRouter = (loudRouter) => IORouterRegistry.registerSaveRouter(loudRouter); + const registerLoadRouter = (loudRouter) => IORouterRegistry.registerLoadRouter(loudRouter); + const getSaveHandlers = (url) => IORouterRegistry.getSaveHandlers(url); + const getLoadHandlers = (url, onProgress) => IORouterRegistry.getLoadHandlers(url, onProgress); + + /** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const URL_SCHEME_SUFFIX = '://'; + class ModelStoreManagerRegistry { + constructor() { + this.managers = {}; + } + static getInstance() { + if (ModelStoreManagerRegistry.instance == null) { + ModelStoreManagerRegistry.instance = new ModelStoreManagerRegistry(); + } + return ModelStoreManagerRegistry.instance; + } + /** + * Register a save-handler router. + * + * @param saveRouter A function that maps a URL-like string onto an instance + * of `IOHandler` with the `save` method defined or `null`. + */ + static registerManager(scheme, manager) { + assert(scheme != null, () => 'scheme must not be undefined or null.'); + if (scheme.endsWith(URL_SCHEME_SUFFIX)) { + scheme = scheme.slice(0, scheme.indexOf(URL_SCHEME_SUFFIX)); + } + assert(scheme.length > 0, () => 'scheme must not be an empty string.'); + const registry = ModelStoreManagerRegistry.getInstance(); + assert(registry.managers[scheme] == null, () => `A model store manager is already registered for scheme '${scheme}'.`); + registry.managers[scheme] = manager; + } + static getManager(scheme) { + const manager = this.getInstance().managers[scheme]; + if (manager == null) { + throw new Error(`Cannot find model manager for scheme '${scheme}'`); + } + return manager; + } + static getSchemes() { + return Object.keys(this.getInstance().managers); + } + } + /** + * Helper method for parsing a URL string into a scheme and a path. + * + * @param url E.g., 'localstorage://my-model' + * @returns A dictionary with two fields: scheme and path. + * Scheme: e.g., 'localstorage' in the example above. + * Path: e.g., 'my-model' in the example above. + */ + function parseURL(url) { + if (url.indexOf(URL_SCHEME_SUFFIX) === -1) { + throw new Error(`The url string provided does not contain a scheme. ` + + `Supported schemes are: ` + + `${ModelStoreManagerRegistry.getSchemes().join(',')}`); + } + return { + scheme: url.split(URL_SCHEME_SUFFIX)[0], + path: url.split(URL_SCHEME_SUFFIX)[1], + }; + } + async function cloneModelInternal(sourceURL, destURL, deleteSource = false) { + assert(sourceURL !== destURL, () => `Old path and new path are the same: '${sourceURL}'`); + const loadHandlers = IORouterRegistry.getLoadHandlers(sourceURL); + assert(loadHandlers.length > 0, () => `Copying failed because no load handler is found for source URL ${sourceURL}.`); + assert(loadHandlers.length < 2, () => `Copying failed because more than one (${loadHandlers.length}) ` + + `load handlers for source URL ${sourceURL}.`); + const loadHandler = loadHandlers[0]; + const saveHandlers = IORouterRegistry.getSaveHandlers(destURL); + assert(saveHandlers.length > 0, () => `Copying failed because no save handler is found for destination ` + + `URL ${destURL}.`); + assert(saveHandlers.length < 2, () => `Copying failed because more than one (${loadHandlers.length}) ` + + `save handlers for destination URL ${destURL}.`); + const saveHandler = saveHandlers[0]; + const sourceScheme = parseURL(sourceURL).scheme; + const sourcePath = parseURL(sourceURL).path; + const sameMedium = sourceScheme === parseURL(sourceURL).scheme; + const modelArtifacts = await loadHandler.load(); + // If moving within the same storage medium, remove the old model as soon as + // the loading is done. Without doing this, it is possible that the combined + // size of the two models will cause the cloning to fail. + if (deleteSource && sameMedium) { + await ModelStoreManagerRegistry.getManager(sourceScheme) + .removeModel(sourcePath); + } + const saveResult = await saveHandler.save(modelArtifacts); + // If moving between mediums, the deletion is done after the save succeeds. + // This guards against the case in which saving to the destination medium + // fails. + if (deleteSource && !sameMedium) { + await ModelStoreManagerRegistry.getManager(sourceScheme) + .removeModel(sourcePath); + } + return saveResult.modelArtifactsInfo; + } + /** + * List all models stored in registered storage mediums. + * + * For a web browser environment, the registered mediums are Local Storage and + * IndexedDB. + * + * ```js + * // First create and save a model. + * const model = tf.sequential(); + * model.add(tf.layers.dense( + * {units: 1, inputShape: [10], activation: 'sigmoid'})); + * await model.save('localstorage://demo/management/model1'); + * + * // Then list existing models. + * console.log(JSON.stringify(await tf.io.listModels())); + * + * // Delete the model. + * await tf.io.removeModel('localstorage://demo/management/model1'); + * + * // List models again. + * console.log(JSON.stringify(await tf.io.listModels())); + * ``` + * + * @returns A `Promise` of a dictionary mapping URLs of existing models to + * their model artifacts info. URLs include medium-specific schemes, e.g., + * 'indexeddb://my/model/1'. Model artifacts info include type of the + * model's topology, byte sizes of the topology, weights, etc. + */ + /** + * @doc { + * heading: 'Models', + * subheading: 'Management', + * namespace: 'io', + * ignoreCI: true + * } + */ + async function listModels() { + const schemes = ModelStoreManagerRegistry.getSchemes(); + const out = {}; + for (const scheme of schemes) { + const schemeOut = await ModelStoreManagerRegistry.getManager(scheme).listModels(); + for (const path in schemeOut) { + const url = scheme + URL_SCHEME_SUFFIX + path; + out[url] = schemeOut[path]; + } + } + return out; + } + /** + * Remove a model specified by URL from a reigstered storage medium. + * + * ```js + * // First create and save a model. + * const model = tf.sequential(); + * model.add(tf.layers.dense( + * {units: 1, inputShape: [10], activation: 'sigmoid'})); + * await model.save('localstorage://demo/management/model1'); + * + * // Then list existing models. + * console.log(JSON.stringify(await tf.io.listModels())); + * + * // Delete the model. + * await tf.io.removeModel('localstorage://demo/management/model1'); + * + * // List models again. + * console.log(JSON.stringify(await tf.io.listModels())); + * ``` + * + * @param url A URL to a stored model, with a scheme prefix, e.g., + * 'localstorage://my-model-1', 'indexeddb://my/model/2'. + * @returns ModelArtifactsInfo of the deleted model (if and only if deletion + * is successful). + * @throws Error if deletion fails, e.g., if no model exists at `path`. + */ + /** + * @doc { + * heading: 'Models', + * subheading: 'Management', + * namespace: 'io', + * ignoreCI: true + * } + */ + async function removeModel(url) { + const schemeAndPath = parseURL(url); + const manager = ModelStoreManagerRegistry.getManager(schemeAndPath.scheme); + return manager.removeModel(schemeAndPath.path); + } + /** + * Copy a model from one URL to another. + * + * This function supports: + * + * 1. Copying within a storage medium, e.g., + * `tf.io.copyModel('localstorage://model-1', 'localstorage://model-2')` + * 2. Copying between two storage mediums, e.g., + * `tf.io.copyModel('localstorage://model-1', 'indexeddb://model-1')` + * + * ```js + * // First create and save a model. + * const model = tf.sequential(); + * model.add(tf.layers.dense( + * {units: 1, inputShape: [10], activation: 'sigmoid'})); + * await model.save('localstorage://demo/management/model1'); + * + * // Then list existing models. + * console.log(JSON.stringify(await tf.io.listModels())); + * + * // Copy the model, from Local Storage to IndexedDB. + * await tf.io.copyModel( + * 'localstorage://demo/management/model1', + * 'indexeddb://demo/management/model1'); + * + * // List models again. + * console.log(JSON.stringify(await tf.io.listModels())); + * + * // Remove both models. + * await tf.io.removeModel('localstorage://demo/management/model1'); + * await tf.io.removeModel('indexeddb://demo/management/model1'); + * ``` + * + * @param sourceURL Source URL of copying. + * @param destURL Destination URL of copying. + * @returns ModelArtifactsInfo of the copied model (if and only if copying + * is successful). + * @throws Error if copying fails, e.g., if no model exists at `sourceURL`, or + * if `oldPath` and `newPath` are identical. + */ + /** + * @doc { + * heading: 'Models', + * subheading: 'Management', + * namespace: 'io', + * ignoreCI: true + * } + */ + async function copyModel(sourceURL, destURL) { + const deleteSource = false; + return cloneModelInternal(sourceURL, destURL, deleteSource); + } + /** + * Move a model from one URL to another. + * + * This function supports: + * + * 1. Moving within a storage medium, e.g., + * `tf.io.moveModel('localstorage://model-1', 'localstorage://model-2')` + * 2. Moving between two storage mediums, e.g., + * `tf.io.moveModel('localstorage://model-1', 'indexeddb://model-1')` + * + * ```js + * // First create and save a model. + * const model = tf.sequential(); + * model.add(tf.layers.dense( + * {units: 1, inputShape: [10], activation: 'sigmoid'})); + * await model.save('localstorage://demo/management/model1'); + * + * // Then list existing models. + * console.log(JSON.stringify(await tf.io.listModels())); + * + * // Move the model, from Local Storage to IndexedDB. + * await tf.io.moveModel( + * 'localstorage://demo/management/model1', + * 'indexeddb://demo/management/model1'); + * + * // List models again. + * console.log(JSON.stringify(await tf.io.listModels())); + * + * // Remove the moved model. + * await tf.io.removeModel('indexeddb://demo/management/model1'); + * ``` + * + * @param sourceURL Source URL of moving. + * @param destURL Destination URL of moving. + * @returns ModelArtifactsInfo of the copied model (if and only if copying + * is successful). + * @throws Error if moving fails, e.g., if no model exists at `sourceURL`, or + * if `oldPath` and `newPath` are identical. + */ + /** + * @doc { + * heading: 'Models', + * subheading: 'Management', + * namespace: 'io', + * ignoreCI: true + * } + */ + async function moveModel(sourceURL, destURL) { + const deleteSource = true; + return cloneModelInternal(sourceURL, destURL, deleteSource); + } + + /** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const DATABASE_NAME = 'tensorflowjs'; + const DATABASE_VERSION = 1; + // Model data and ModelArtifactsInfo (metadata) are stored in two separate + // stores for efficient access of the list of stored models and their metadata. + // 1. The object store for model data: topology, weights and weight manifests. + const MODEL_STORE_NAME = 'models_store'; + // 2. The object store for ModelArtifactsInfo, including meta-information such + // as the type of topology (JSON vs binary), byte size of the topology, byte + // size of the weights, etc. + const INFO_STORE_NAME = 'model_info_store'; + function getIndexedDBFactory() { + if (!env().getBool('IS_BROWSER')) { + // TODO(cais): Add more info about what IOHandler subtypes are available. + // Maybe point to a doc page on the web and/or automatically determine + // the available IOHandlers and print them in the error message. + throw new Error('Failed to obtain IndexedDB factory because the current environment' + + 'is not a web browser.'); + } + // tslint:disable-next-line:no-any + const theWindow = window || self; + const factory = theWindow.indexedDB || theWindow.mozIndexedDB || + theWindow.webkitIndexedDB || theWindow.msIndexedDB || + theWindow.shimIndexedDB; + if (factory == null) { + throw new Error('The current browser does not appear to support IndexedDB.'); + } + return factory; + } + function setUpDatabase(openRequest) { + const db = openRequest.result; + db.createObjectStore(MODEL_STORE_NAME, { keyPath: 'modelPath' }); + db.createObjectStore(INFO_STORE_NAME, { keyPath: 'modelPath' }); + } + /** + * IOHandler subclass: Browser IndexedDB. + * + * See the doc string of `browserIndexedDB` for more details. + */ + class BrowserIndexedDB { + constructor(modelPath) { + this.indexedDB = getIndexedDBFactory(); + if (modelPath == null || !modelPath) { + throw new Error('For IndexedDB, modelPath must not be null, undefined or empty.'); + } + this.modelPath = modelPath; + } + async save(modelArtifacts) { + // TODO(cais): Support saving GraphDef models. + if (modelArtifacts.modelTopology instanceof ArrayBuffer) { + throw new Error('BrowserLocalStorage.save() does not support saving model topology ' + + 'in binary formats yet.'); + } + return this.databaseAction(this.modelPath, modelArtifacts); + } + async load() { + return this.databaseAction(this.modelPath); + } + /** + * Perform database action to put model artifacts into or read model artifacts + * from IndexedDB object store. + * + * Whether the action is put or get depends on whether `modelArtifacts` is + * specified. If it is specified, the action will be put; otherwise the action + * will be get. + * + * @param modelPath A unique string path for the model. + * @param modelArtifacts If specified, it will be the model artifacts to be + * stored in IndexedDB. + * @returns A `Promise` of `SaveResult`, if the action is put, or a `Promise` + * of `ModelArtifacts`, if the action is get. + */ + databaseAction(modelPath, modelArtifacts) { + return new Promise((resolve, reject) => { + const openRequest = this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION); + openRequest.onupgradeneeded = () => setUpDatabase(openRequest); + openRequest.onsuccess = () => { + const db = openRequest.result; + if (modelArtifacts == null) { + // Read model out from object store. + const modelTx = db.transaction(MODEL_STORE_NAME, 'readonly'); + const modelStore = modelTx.objectStore(MODEL_STORE_NAME); + const getRequest = modelStore.get(this.modelPath); + getRequest.onsuccess = () => { + if (getRequest.result == null) { + db.close(); + return reject(new Error(`Cannot find model with path '${this.modelPath}' ` + + `in IndexedDB.`)); + } + else { + resolve(getRequest.result.modelArtifacts); + } + }; + getRequest.onerror = error => { + db.close(); + return reject(getRequest.error); + }; + modelTx.oncomplete = () => db.close(); + } + else { + // Put model into object store. + const modelArtifactsInfo = getModelArtifactsInfoForJSON(modelArtifacts); + // First, put ModelArtifactsInfo into info store. + const infoTx = db.transaction(INFO_STORE_NAME, 'readwrite'); + let infoStore = infoTx.objectStore(INFO_STORE_NAME); + const putInfoRequest = infoStore.put({ modelPath: this.modelPath, modelArtifactsInfo }); + let modelTx; + putInfoRequest.onsuccess = () => { + // Second, put model data into model store. + modelTx = db.transaction(MODEL_STORE_NAME, 'readwrite'); + const modelStore = modelTx.objectStore(MODEL_STORE_NAME); + const putModelRequest = modelStore.put({ + modelPath: this.modelPath, + modelArtifacts, + modelArtifactsInfo + }); + putModelRequest.onsuccess = () => resolve({ modelArtifactsInfo }); + putModelRequest.onerror = error => { + // If the put-model request fails, roll back the info entry as + // well. + infoStore = infoTx.objectStore(INFO_STORE_NAME); + const deleteInfoRequest = infoStore.delete(this.modelPath); + deleteInfoRequest.onsuccess = () => { + db.close(); + return reject(putModelRequest.error); + }; + deleteInfoRequest.onerror = error => { + db.close(); + return reject(putModelRequest.error); + }; + }; + }; + putInfoRequest.onerror = error => { + db.close(); + return reject(putInfoRequest.error); + }; + infoTx.oncomplete = () => { + if (modelTx == null) { + db.close(); + } + else { + modelTx.oncomplete = () => db.close(); + } + }; + } + }; + openRequest.onerror = error => reject(openRequest.error); + }); + } + } + BrowserIndexedDB.URL_SCHEME = 'indexeddb://'; + const indexedDBRouter = (url) => { + if (!env().getBool('IS_BROWSER')) { + return null; + } + else { + if (!Array.isArray(url) && url.startsWith(BrowserIndexedDB.URL_SCHEME)) { + return browserIndexedDB(url.slice(BrowserIndexedDB.URL_SCHEME.length)); + } + else { + return null; + } + } + }; + IORouterRegistry.registerSaveRouter(indexedDBRouter); + IORouterRegistry.registerLoadRouter(indexedDBRouter); + /** + * Creates a browser IndexedDB IOHandler for saving and loading models. + * + * ```js + * const model = tf.sequential(); + * model.add( + * tf.layers.dense({units: 1, inputShape: [100], activation: 'sigmoid'})); + * + * const saveResult = await model.save('indexeddb://MyModel')); + * console.log(saveResult); + * ``` + * + * @param modelPath A unique identifier for the model to be saved. Must be a + * non-empty string. + * @returns An instance of `BrowserIndexedDB` (sublcass of `IOHandler`), + * which can be used with, e.g., `tf.Model.save`. + */ + function browserIndexedDB(modelPath) { + return new BrowserIndexedDB(modelPath); + } + function maybeStripScheme(key) { + return key.startsWith(BrowserIndexedDB.URL_SCHEME) ? + key.slice(BrowserIndexedDB.URL_SCHEME.length) : + key; + } + class BrowserIndexedDBManager { + constructor() { + this.indexedDB = getIndexedDBFactory(); + } + async listModels() { + return new Promise((resolve, reject) => { + const openRequest = this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION); + openRequest.onupgradeneeded = () => setUpDatabase(openRequest); + openRequest.onsuccess = () => { + const db = openRequest.result; + const tx = db.transaction(INFO_STORE_NAME, 'readonly'); + const store = tx.objectStore(INFO_STORE_NAME); + // tslint:disable:max-line-length + // Need to cast `store` as `any` here because TypeScript's DOM + // library does not have the `getAll()` method even though the + // method is supported in the latest version of most mainstream + // browsers: + // https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/getAll + // tslint:enable:max-line-length + // tslint:disable-next-line:no-any + const getAllInfoRequest = store.getAll(); + getAllInfoRequest.onsuccess = () => { + const out = {}; + for (const item of getAllInfoRequest.result) { + out[item.modelPath] = item.modelArtifactsInfo; + } + resolve(out); + }; + getAllInfoRequest.onerror = error => { + db.close(); + return reject(getAllInfoRequest.error); + }; + tx.oncomplete = () => db.close(); + }; + openRequest.onerror = error => reject(openRequest.error); + }); + } + async removeModel(path) { + path = maybeStripScheme(path); + return new Promise((resolve, reject) => { + const openRequest = this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION); + openRequest.onupgradeneeded = () => setUpDatabase(openRequest); + openRequest.onsuccess = () => { + const db = openRequest.result; + const infoTx = db.transaction(INFO_STORE_NAME, 'readwrite'); + const infoStore = infoTx.objectStore(INFO_STORE_NAME); + const getInfoRequest = infoStore.get(path); + let modelTx; + getInfoRequest.onsuccess = () => { + if (getInfoRequest.result == null) { + db.close(); + return reject(new Error(`Cannot find model with path '${path}' ` + + `in IndexedDB.`)); + } + else { + // First, delete the entry in the info store. + const deleteInfoRequest = infoStore.delete(path); + const deleteModelData = () => { + // Second, delete the entry in the model store. + modelTx = db.transaction(MODEL_STORE_NAME, 'readwrite'); + const modelStore = modelTx.objectStore(MODEL_STORE_NAME); + const deleteModelRequest = modelStore.delete(path); + deleteModelRequest.onsuccess = () => resolve(getInfoRequest.result.modelArtifactsInfo); + deleteModelRequest.onerror = error => reject(getInfoRequest.error); + }; + // Proceed with deleting model data regardless of whether deletion + // of info data succeeds or not. + deleteInfoRequest.onsuccess = deleteModelData; + deleteInfoRequest.onerror = error => { + deleteModelData(); + db.close(); + return reject(getInfoRequest.error); + }; + } + }; + getInfoRequest.onerror = error => { + db.close(); + return reject(getInfoRequest.error); + }; + infoTx.oncomplete = () => { + if (modelTx == null) { + db.close(); + } + else { + modelTx.oncomplete = () => db.close(); + } + }; + }; + openRequest.onerror = error => reject(openRequest.error); + }); + } + } + if (env().getBool('IS_BROWSER')) { + // Wrap the construction and registration, to guard against browsers that + // don't support Local Storage. + try { + ModelStoreManagerRegistry.registerManager(BrowserIndexedDB.URL_SCHEME, new BrowserIndexedDBManager()); + } + catch (err) { + } + } + + /** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const PATH_SEPARATOR = '/'; + const PATH_PREFIX = 'tensorflowjs_models'; + const INFO_SUFFIX = 'info'; + const MODEL_TOPOLOGY_SUFFIX = 'model_topology'; + const WEIGHT_SPECS_SUFFIX = 'weight_specs'; + const WEIGHT_DATA_SUFFIX = 'weight_data'; + const MODEL_METADATA_SUFFIX = 'model_metadata'; + function getModelKeys(path) { + return { + info: [PATH_PREFIX, path, INFO_SUFFIX].join(PATH_SEPARATOR), + topology: [PATH_PREFIX, path, MODEL_TOPOLOGY_SUFFIX].join(PATH_SEPARATOR), + weightSpecs: [PATH_PREFIX, path, WEIGHT_SPECS_SUFFIX].join(PATH_SEPARATOR), + weightData: [PATH_PREFIX, path, WEIGHT_DATA_SUFFIX].join(PATH_SEPARATOR), + modelMetadata: [PATH_PREFIX, path, MODEL_METADATA_SUFFIX].join(PATH_SEPARATOR) + }; + } + /** + * Get model path from a local-storage key. + * + * E.g., 'tensorflowjs_models/my/model/1/info' --> 'my/model/1' + * + * @param key + */ + function getModelPathFromKey(key) { + const items = key.split(PATH_SEPARATOR); + if (items.length < 3) { + throw new Error(`Invalid key format: ${key}`); + } + return items.slice(1, items.length - 1).join(PATH_SEPARATOR); + } + function maybeStripScheme$1(key) { + return key.startsWith(BrowserLocalStorage.URL_SCHEME) ? + key.slice(BrowserLocalStorage.URL_SCHEME.length) : + key; + } + /** + * IOHandler subclass: Browser Local Storage. + * + * See the doc string to `browserLocalStorage` for more details. + */ + class BrowserLocalStorage { + constructor(modelPath) { + if (!env().getBool('IS_BROWSER') || + typeof window === 'undefined' || + typeof window.localStorage === 'undefined') { + // TODO(cais): Add more info about what IOHandler subtypes are + // available. + // Maybe point to a doc page on the web and/or automatically determine + // the available IOHandlers and print them in the error message. + throw new Error('The current environment does not support local storage.'); + } + this.LS = window.localStorage; + if (modelPath == null || !modelPath) { + throw new Error('For local storage, modelPath must not be null, undefined or empty.'); + } + this.modelPath = modelPath; + this.keys = getModelKeys(this.modelPath); + } + /** + * Save model artifacts to browser local storage. + * + * See the documentation to `browserLocalStorage` for details on the saved + * artifacts. + * + * @param modelArtifacts The model artifacts to be stored. + * @returns An instance of SaveResult. + */ + async save(modelArtifacts) { + if (modelArtifacts.modelTopology instanceof ArrayBuffer) { + throw new Error('BrowserLocalStorage.save() does not support saving model topology ' + + 'in binary formats yet.'); + } + else { + const topology = JSON.stringify(modelArtifacts.modelTopology); + const weightSpecs = JSON.stringify(modelArtifacts.weightSpecs); + const modelArtifactsInfo = getModelArtifactsInfoForJSON(modelArtifacts); + try { + this.LS.setItem(this.keys.info, JSON.stringify(modelArtifactsInfo)); + this.LS.setItem(this.keys.topology, topology); + this.LS.setItem(this.keys.weightSpecs, weightSpecs); + this.LS.setItem(this.keys.weightData, arrayBufferToBase64String(modelArtifacts.weightData)); + this.LS.setItem(this.keys.modelMetadata, JSON.stringify({ + format: modelArtifacts.format, + generatedBy: modelArtifacts.generatedBy, + convertedBy: modelArtifacts.convertedBy, + userDefinedMetadata: modelArtifacts.userDefinedMetadata + })); + return { modelArtifactsInfo }; + } + catch (err) { + // If saving failed, clean up all items saved so far. + this.LS.removeItem(this.keys.info); + this.LS.removeItem(this.keys.topology); + this.LS.removeItem(this.keys.weightSpecs); + this.LS.removeItem(this.keys.weightData); + this.LS.removeItem(this.keys.modelMetadata); + throw new Error(`Failed to save model '${this.modelPath}' to local storage: ` + + `size quota being exceeded is a possible cause of this failure: ` + + `modelTopologyBytes=${modelArtifactsInfo.modelTopologyBytes}, ` + + `weightSpecsBytes=${modelArtifactsInfo.weightSpecsBytes}, ` + + `weightDataBytes=${modelArtifactsInfo.weightDataBytes}.`); + } + } + } + /** + * Load a model from local storage. + * + * See the documentation to `browserLocalStorage` for details on the saved + * artifacts. + * + * @returns The loaded model (if loading succeeds). + */ + async load() { + const info = JSON.parse(this.LS.getItem(this.keys.info)); + if (info == null) { + throw new Error(`In local storage, there is no model with name '${this.modelPath}'`); + } + if (info.modelTopologyType !== 'JSON') { + throw new Error('BrowserLocalStorage does not support loading non-JSON model ' + + 'topology yet.'); + } + const out = {}; + // Load topology. + const topology = JSON.parse(this.LS.getItem(this.keys.topology)); + if (topology == null) { + throw new Error(`In local storage, the topology of model '${this.modelPath}' ` + + `is missing.`); + } + out.modelTopology = topology; + // Load weight specs. + const weightSpecs = JSON.parse(this.LS.getItem(this.keys.weightSpecs)); + if (weightSpecs == null) { + throw new Error(`In local storage, the weight specs of model '${this.modelPath}' ` + + `are missing.`); + } + out.weightSpecs = weightSpecs; + // Load meta-data fields. + const metadataString = this.LS.getItem(this.keys.modelMetadata); + if (metadataString != null) { + const metadata = JSON.parse(metadataString); + out.format = metadata['format']; + out.generatedBy = metadata['generatedBy']; + out.convertedBy = metadata['convertedBy']; + out.userDefinedMetadata = metadata['userDefinedMetadata']; + } + // Load weight data. + const weightDataBase64 = this.LS.getItem(this.keys.weightData); + if (weightDataBase64 == null) { + throw new Error(`In local storage, the binary weight values of model ` + + `'${this.modelPath}' are missing.`); + } + out.weightData = base64StringToArrayBuffer(weightDataBase64); + return out; + } + } + BrowserLocalStorage.URL_SCHEME = 'localstorage://'; + const localStorageRouter = (url) => { + if (!env().getBool('IS_BROWSER')) { + return null; + } + else { + if (!Array.isArray(url) && url.startsWith(BrowserLocalStorage.URL_SCHEME)) { + return browserLocalStorage(url.slice(BrowserLocalStorage.URL_SCHEME.length)); + } + else { + return null; + } + } + }; + IORouterRegistry.registerSaveRouter(localStorageRouter); + IORouterRegistry.registerLoadRouter(localStorageRouter); + /** + * Factory function for local storage IOHandler. + * + * This `IOHandler` supports both `save` and `load`. + * + * For each model's saved artifacts, four items are saved to local storage. + * - `${PATH_SEPARATOR}/${modelPath}/info`: Contains meta-info about the + * model, such as date saved, type of the topology, size in bytes, etc. + * - `${PATH_SEPARATOR}/${modelPath}/topology`: Model topology. For Keras- + * style models, this is a stringized JSON. + * - `${PATH_SEPARATOR}/${modelPath}/weight_specs`: Weight specs of the + * model, can be used to decode the saved binary weight values (see + * item below). + * - `${PATH_SEPARATOR}/${modelPath}/weight_data`: Concatenated binary + * weight values, stored as a base64-encoded string. + * + * Saving may throw an `Error` if the total size of the artifacts exceed the + * browser-specific quota. + * + * @param modelPath A unique identifier for the model to be saved. Must be a + * non-empty string. + * @returns An instance of `IOHandler`, which can be used with, e.g., + * `tf.Model.save`. + */ + function browserLocalStorage(modelPath) { + return new BrowserLocalStorage(modelPath); + } + class BrowserLocalStorageManager { + constructor() { + assert(env().getBool('IS_BROWSER'), () => 'Current environment is not a web browser'); + assert(typeof window === 'undefined' || + typeof window.localStorage !== 'undefined', () => 'Current browser does not appear to support localStorage'); + this.LS = window.localStorage; + } + async listModels() { + const out = {}; + const prefix = PATH_PREFIX + PATH_SEPARATOR; + const suffix = PATH_SEPARATOR + INFO_SUFFIX; + for (let i = 0; i < this.LS.length; ++i) { + const key = this.LS.key(i); + if (key.startsWith(prefix) && key.endsWith(suffix)) { + const modelPath = getModelPathFromKey(key); + out[modelPath] = JSON.parse(this.LS.getItem(key)); + } + } + return out; + } + async removeModel(path) { + path = maybeStripScheme$1(path); + const keys = getModelKeys(path); + if (this.LS.getItem(keys.info) == null) { + throw new Error(`Cannot find model at path '${path}'`); + } + const info = JSON.parse(this.LS.getItem(keys.info)); + this.LS.removeItem(keys.info); + this.LS.removeItem(keys.topology); + this.LS.removeItem(keys.weightSpecs); + this.LS.removeItem(keys.weightData); + return info; + } + } + if (env().getBool('IS_BROWSER')) { + // Wrap the construction and registration, to guard against browsers that + // don't support Local Storage. + try { + ModelStoreManagerRegistry.registerManager(BrowserLocalStorage.URL_SCHEME, new BrowserLocalStorageManager()); + } + catch (err) { + } + } + + /** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const DEFAULT_FILE_NAME_PREFIX = 'model'; + const DEFAULT_JSON_EXTENSION_NAME = '.json'; + const DEFAULT_WEIGHT_DATA_EXTENSION_NAME = '.weights.bin'; + function defer(f) { + return new Promise(resolve => setTimeout(resolve)).then(f); + } + class BrowserDownloads { + constructor(fileNamePrefix) { + if (!env().getBool('IS_BROWSER')) { + // TODO(cais): Provide info on what IOHandlers are available under the + // current environment. + throw new Error('browserDownloads() cannot proceed because the current environment ' + + 'is not a browser.'); + } + if (fileNamePrefix.startsWith(BrowserDownloads.URL_SCHEME)) { + fileNamePrefix = fileNamePrefix.slice(BrowserDownloads.URL_SCHEME.length); + } + if (fileNamePrefix == null || fileNamePrefix.length === 0) { + fileNamePrefix = DEFAULT_FILE_NAME_PREFIX; + } + this.modelTopologyFileName = fileNamePrefix + DEFAULT_JSON_EXTENSION_NAME; + this.weightDataFileName = + fileNamePrefix + DEFAULT_WEIGHT_DATA_EXTENSION_NAME; + } + async save(modelArtifacts) { + if (typeof (document) === 'undefined') { + throw new Error('Browser downloads are not supported in ' + + 'this environment since `document` is not present'); + } + const weightsURL = window.URL.createObjectURL(new Blob([modelArtifacts.weightData], { type: 'application/octet-stream' })); + if (modelArtifacts.modelTopology instanceof ArrayBuffer) { + throw new Error('BrowserDownloads.save() does not support saving model topology ' + + 'in binary formats yet.'); + } + else { + const weightsManifest = [{ + paths: ['./' + this.weightDataFileName], + weights: modelArtifacts.weightSpecs + }]; + const modelTopologyAndWeightManifest = { + modelTopology: modelArtifacts.modelTopology, + format: modelArtifacts.format, + generatedBy: modelArtifacts.generatedBy, + convertedBy: modelArtifacts.convertedBy, + weightsManifest + }; + const modelTopologyAndWeightManifestURL = window.URL.createObjectURL(new Blob([JSON.stringify(modelTopologyAndWeightManifest)], { type: 'application/json' })); + // If anchor elements are not provided, create them without attaching them + // to parents, so that the downloaded file names can be controlled. + const jsonAnchor = this.jsonAnchor == null ? document.createElement('a') : + this.jsonAnchor; + jsonAnchor.download = this.modelTopologyFileName; + jsonAnchor.href = modelTopologyAndWeightManifestURL; + // Trigger downloads by evoking a click event on the download anchors. + // When multiple downloads are started synchronously, Firefox will only + // save the last one. + await defer(() => jsonAnchor.dispatchEvent(new MouseEvent('click'))); + if (modelArtifacts.weightData != null) { + const weightDataAnchor = this.weightDataAnchor == null ? + document.createElement('a') : + this.weightDataAnchor; + weightDataAnchor.download = this.weightDataFileName; + weightDataAnchor.href = weightsURL; + await defer(() => weightDataAnchor.dispatchEvent(new MouseEvent('click'))); + } + return { modelArtifactsInfo: getModelArtifactsInfoForJSON(modelArtifacts) }; + } + } + } + BrowserDownloads.URL_SCHEME = 'downloads://'; + class BrowserFiles { + constructor(files) { + if (files == null || files.length < 1) { + throw new Error(`When calling browserFiles, at least 1 file is required, ` + + `but received ${files}`); + } + this.files = files; + } + async load() { + const jsonFile = this.files[0]; + const weightFiles = this.files.slice(1); + return new Promise((resolve, reject) => { + const jsonReader = new FileReader(); + jsonReader.onload = (event) => { + // tslint:disable-next-line:no-any + const modelJSON = JSON.parse(event.target.result); + const modelTopology = modelJSON.modelTopology; + if (modelTopology == null) { + reject(new Error(`modelTopology field is missing from file ${jsonFile.name}`)); + return; + } + if (weightFiles.length === 0) { + resolve({ modelTopology }); + } + const weightsManifest = modelJSON.weightsManifest; + if (weightsManifest == null) { + reject(new Error(`weightManifest field is missing from file ${jsonFile.name}`)); + return; + } + let pathToFile; + try { + pathToFile = + this.checkManifestAndWeightFiles(weightsManifest, weightFiles); + } + catch (err) { + reject(err); + return; + } + const weightSpecs = []; + const paths = []; + const perFileBuffers = []; + weightsManifest.forEach(weightsGroup => { + weightsGroup.paths.forEach(path => { + paths.push(path); + perFileBuffers.push(null); + }); + weightSpecs.push(...weightsGroup.weights); + }); + weightsManifest.forEach(weightsGroup => { + weightsGroup.paths.forEach(path => { + const weightFileReader = new FileReader(); + weightFileReader.onload = (event) => { + // tslint:disable-next-line:no-any + const weightData = event.target.result; + const index = paths.indexOf(path); + perFileBuffers[index] = weightData; + if (perFileBuffers.indexOf(null) === -1) { + resolve({ + modelTopology, + weightSpecs, + weightData: concatenateArrayBuffers(perFileBuffers), + format: modelJSON.format, + generatedBy: modelJSON.generatedBy, + convertedBy: modelJSON.convertedBy, + userDefinedMetadata: modelJSON.userDefinedMetadata + }); + } + }; + weightFileReader.onerror = error => reject(`Failed to weights data from file of path '${path}'.`); + weightFileReader.readAsArrayBuffer(pathToFile[path]); + }); + }); + }; + jsonReader.onerror = error => reject(`Failed to read model topology and weights manifest JSON ` + + `from file '${jsonFile.name}'. BrowserFiles supports loading ` + + `Keras-style tf.Model artifacts only.`); + jsonReader.readAsText(jsonFile); + }); + } + /** + * Check the compatibility between weights manifest and weight files. + */ + checkManifestAndWeightFiles(manifest, files) { + const basenames = []; + const fileNames = files.map(file => basename(file.name)); + const pathToFile = {}; + for (const group of manifest) { + group.paths.forEach(path => { + const pathBasename = basename(path); + if (basenames.indexOf(pathBasename) !== -1) { + throw new Error(`Duplicate file basename found in weights manifest: ` + + `'${pathBasename}'`); + } + basenames.push(pathBasename); + if (fileNames.indexOf(pathBasename) === -1) { + throw new Error(`Weight file with basename '${pathBasename}' is not provided.`); + } + else { + pathToFile[path] = files[fileNames.indexOf(pathBasename)]; + } + }); + } + if (basenames.length !== files.length) { + throw new Error(`Mismatch in the number of files in weights manifest ` + + `(${basenames.length}) and the number of weight files provided ` + + `(${files.length}).`); + } + return pathToFile; + } + } + const browserDownloadsRouter = (url) => { + if (!env().getBool('IS_BROWSER')) { + return null; + } + else { + if (!Array.isArray(url) && url.startsWith(BrowserDownloads.URL_SCHEME)) { + return browserDownloads(url.slice(BrowserDownloads.URL_SCHEME.length)); + } + else { + return null; + } + } + }; + IORouterRegistry.registerSaveRouter(browserDownloadsRouter); + /** + * Creates an IOHandler that triggers file downloads from the browser. + * + * The returned `IOHandler` instance can be used as model exporting methods such + * as `tf.Model.save` and supports only saving. + * + * ```js + * const model = tf.sequential(); + * model.add(tf.layers.dense( + * {units: 1, inputShape: [10], activation: 'sigmoid'})); + * const saveResult = await model.save('downloads://mymodel'); + * // This will trigger downloading of two files: + * // 'mymodel.json' and 'mymodel.weights.bin'. + * console.log(saveResult); + * ``` + * + * @param fileNamePrefix Prefix name of the files to be downloaded. For use with + * `tf.Model`, `fileNamePrefix` should follow either of the following two + * formats: + * 1. `null` or `undefined`, in which case the default file + * names will be used: + * - 'model.json' for the JSON file containing the model topology and + * weights manifest. + * - 'model.weights.bin' for the binary file containing the binary weight + * values. + * 2. A single string or an Array of a single string, as the file name prefix. + * For example, if `'foo'` is provided, the downloaded JSON + * file and binary weights file will be named 'foo.json' and + * 'foo.weights.bin', respectively. + * @param config Additional configuration for triggering downloads. + * @returns An instance of `BrowserDownloads` `IOHandler`. + */ + /** + * @doc { + * heading: 'Models', + * subheading: 'Loading', + * namespace: 'io', + * ignoreCI: true + * } + */ + function browserDownloads(fileNamePrefix = 'model') { + return new BrowserDownloads(fileNamePrefix); + } + /** + * Creates an IOHandler that loads model artifacts from user-selected files. + * + * This method can be used for loading from files such as user-selected files + * in the browser. + * When used in conjunction with `tf.loadLayersModel`, an instance of + * `tf.LayersModel` (Keras-style) can be constructed from the loaded artifacts. + * + * ```js + * // Note: This code snippet won't run properly without the actual file input + * // elements in the HTML DOM. + * + * // Suppose there are two HTML file input (``) + * // elements. + * const uploadJSONInput = document.getElementById('upload-json'); + * const uploadWeightsInput = document.getElementById('upload-weights'); + * const model = await tf.loadLayersModel(tf.io.browserFiles( + * [uploadJSONInput.files[0], uploadWeightsInput.files[0]])); + * ``` + * + * @param files `File`s to load from. Currently, this function supports only + * loading from files that contain Keras-style models (i.e., `tf.Model`s), for + * which an `Array` of `File`s is expected (in that order): + * - A JSON file containing the model topology and weight manifest. + * - Optionally, One or more binary files containing the binary weights. + * These files must have names that match the paths in the `weightsManifest` + * contained by the aforementioned JSON file, or errors will be thrown + * during loading. These weights files have the same format as the ones + * generated by `tensorflowjs_converter` that comes with the `tensorflowjs` + * Python PIP package. If no weights files are provided, only the model + * topology will be loaded from the JSON file above. + * @returns An instance of `Files` `IOHandler`. + */ + /** + * @doc { + * heading: 'Models', + * subheading: 'Loading', + * namespace: 'io', + * ignoreCI: true + * } + */ + function browserFiles(files) { + return new BrowserFiles(files); + } + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Monitor Promise.all progress, fire onProgress callback function. + * + * @param promises Promise list going to be monitored + * @param onProgress Callback function. Fired when a promise resolved. + * @param startFraction Optional fraction start. Default to 0. + * @param endFraction Optional fraction end. Default to 1. + */ + function monitorPromisesProgress(promises, onProgress, startFraction, endFraction) { + checkPromises(promises); + startFraction = startFraction == null ? 0 : startFraction; + endFraction = endFraction == null ? 1 : endFraction; + checkFraction(startFraction, endFraction); + let resolvedPromise = 0; + const registerMonitor = (promise) => { + promise.then(value => { + const fraction = startFraction + + ++resolvedPromise / promises.length * (endFraction - startFraction); + // pass fraction as parameter to callback function. + onProgress(fraction); + return value; + }); + return promise; + }; + function checkPromises(promises) { + assert(promises != null && Array.isArray(promises) && promises.length > 0, () => 'promises must be a none empty array'); + } + function checkFraction(startFraction, endFraction) { + assert(startFraction >= 0 && startFraction <= 1, () => `Progress fraction must be in range [0, 1], but ` + + `got startFraction ${startFraction}`); + assert(endFraction >= 0 && endFraction <= 1, () => `Progress fraction must be in range [0, 1], but ` + + `got endFraction ${endFraction}`); + assert(endFraction >= startFraction, () => `startFraction must be no more than endFraction, but ` + + `got startFraction ${startFraction} and endFraction ` + + `${endFraction}`); + } + return Promise.all(promises.map(registerMonitor)); + } + + /** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Reads binary weights data from a number of URLs. + * + * @param fetchURLs URLs to send the HTTP requests at, using `fetch` calls. + * @param requestOptions RequestInit (options) for the HTTP requests. + * @param fetchFunc Optional overriding value for the `window.fetch` function. + * @param onProgress Optional, progress callback function, fired periodically + * before the load is completed. + * @returns A `Promise` of an Array of `ArrayBuffer`. The Array has the same + * length as `fetchURLs`. + */ + async function loadWeightsAsArrayBuffer(fetchURLs, loadOptions) { + if (loadOptions == null) { + loadOptions = {}; + } + const fetchFunc = loadOptions.fetchFunc == null ? env().platform.fetch : + loadOptions.fetchFunc; + // Create the requests for all of the weights in parallel. + const requests = fetchURLs.map(fetchURL => fetchFunc(fetchURL, loadOptions.requestInit, { isBinary: true })); + const fetchStartFraction = 0; + const fetchEndFraction = 0.5; + const responses = loadOptions.onProgress == null ? + await Promise.all(requests) : + await monitorPromisesProgress(requests, loadOptions.onProgress, fetchStartFraction, fetchEndFraction); + const bufferPromises = responses.map(response => response.arrayBuffer()); + const bufferStartFraction = 0.5; + const bufferEndFraction = 1; + const buffers = loadOptions.onProgress == null ? + await Promise.all(bufferPromises) : + await monitorPromisesProgress(bufferPromises, loadOptions.onProgress, bufferStartFraction, bufferEndFraction); + return buffers; + } + /** + * Reads a weights manifest JSON configuration, fetches the weights and + * returns them as `Tensor`s. + * + * @param manifest The weights manifest JSON. + * @param filePathPrefix The path prefix for filenames given in the manifest. + * Defaults to the empty string. + * @param weightNames The names of the weights to be fetched. + */ + async function loadWeights(manifest, filePathPrefix = '', weightNames, requestInit) { + // TODO(nsthorat): Groups are currently fetched atomically. If you need a + // single weight from a group, the whole group will be fetched. At a future + // date, we should support fetching only the individual shards within a + // group that are needed to reconstruct the requested weight. + // TODO(cais): Use `decodeWeights` for implementation. + const fetchWeights = (fetchUrls) => loadWeightsAsArrayBuffer(fetchUrls, { requestInit }); + const loadWeights = weightsLoaderFactory(fetchWeights); + return loadWeights(manifest, filePathPrefix, weightNames); + } + /** + * Creates a function, which reads a weights manifest JSON configuration, + * fetches the weight files using the specified function and returns them as + * `Tensor`s. + * + * ```js + * // example for creating a nodejs weight loader, which reads the weight files + * // from disk using fs.readFileSync + * + * import * as fs from 'fs' + * + * const fetchWeightsFromDisk = (filePaths: string[]) => + * filePaths.map(filePath => fs.readFileSync(filePath).buffer) + * + * const loadWeights = tf.io.weightsLoaderFactory(fetchWeightsFromDisk) + * + * const manifest = JSON.parse( + * fs.readFileSync('./my_model-weights_manifest').toString() + * ) + * const weightMap = await loadWeights(manifest, './') + * ``` + * @param fetchWeightsFunction The function used for fetching the weight files. + * @returns Weight loading function. + */ + function weightsLoaderFactory(fetchWeightsFunction) { + return async (manifest, filePathPrefix = '', weightNames) => { + // Collect all the groups, weights, and their relative offsets to be + // fetched. + const groupIndicesToFetchMap = manifest.map(() => false); + const groupWeightsToFetch = {}; + const weightsFound = weightNames != null ? weightNames.map(() => false) : []; + const allManifestWeightNames = []; + manifest.forEach((manifestGroupConfig, groupIndex) => { + let groupOffset = 0; + manifestGroupConfig.weights.forEach(weightsEntry => { + const rawDtype = ('quantization' in weightsEntry) ? + weightsEntry.quantization.dtype : + weightsEntry.dtype; + const weightsBytes = DTYPE_VALUE_SIZE_MAP[rawDtype] * + sizeFromShape(weightsEntry.shape); + const enqueueWeightsForFetchingFn = () => { + groupIndicesToFetchMap[groupIndex] = true; + if (groupWeightsToFetch[groupIndex] == null) { + groupWeightsToFetch[groupIndex] = []; + } + groupWeightsToFetch[groupIndex].push({ + manifestEntry: weightsEntry, + groupOffset, + sizeBytes: weightsBytes + }); + }; + if (weightNames != null) { + weightNames.forEach((weightName, weightIndex) => { + if (weightName === weightsEntry.name) { + enqueueWeightsForFetchingFn(); + weightsFound[weightIndex] = true; + } + }); + } + else { + enqueueWeightsForFetchingFn(); + } + allManifestWeightNames.push(weightsEntry.name); + groupOffset += weightsBytes; + }); + }); + if (!weightsFound.every(found => found)) { + const weightsNotFound = weightNames.filter((_, i) => !weightsFound[i]); + throw new Error(`Could not find weights in manifest with names: ` + + `${weightsNotFound.join(', ')}. \n` + + `Manifest JSON has weights with names: ` + + `${allManifestWeightNames.join(', ')}.`); + } + // Convert the one-hot boolean groupId => shouldFetch map to a list of group + // IDs. + const groupIndicesToFetch = groupIndicesToFetchMap.reduce((accumulator, shouldFetch, i) => { + if (shouldFetch) { + accumulator.push(i); + } + return accumulator; + }, []); + const fetchUrls = []; + groupIndicesToFetch.forEach(i => { + manifest[i].paths.forEach(filepath => { + const fetchUrl = filePathPrefix + + (!filePathPrefix.endsWith('/') ? '/' : '') + filepath; + fetchUrls.push(fetchUrl); + }); + }); + const buffers = await fetchWeightsFunction(fetchUrls); + const weightsTensorMap = {}; + let bufferIndexOffset = 0; + groupIndicesToFetch.forEach(i => { + const numBuffers = manifest[i].paths.length; + let groupBytes = 0; + for (let i = 0; i < numBuffers; i++) { + groupBytes += buffers[bufferIndexOffset + i].byteLength; + } + // Create a buffer for the whole group. + const groupBuffer = new ArrayBuffer(groupBytes); + const groupByteBuffer = new Uint8Array(groupBuffer); + let groupBufferOffset = 0; + for (let i = 0; i < numBuffers; i++) { + const buffer = new Uint8Array(buffers[bufferIndexOffset + i]); + groupByteBuffer.set(buffer, groupBufferOffset); + groupBufferOffset += buffer.byteLength; + } + const weightsEntries = groupWeightsToFetch[i]; + weightsEntries.forEach(weightsEntry => { + const byteBuffer = groupBuffer.slice(weightsEntry.groupOffset, weightsEntry.groupOffset + weightsEntry.sizeBytes); + const nameToTensorMap = decodeWeights(byteBuffer, [weightsEntry.manifestEntry]); + for (const name in nameToTensorMap) { + weightsTensorMap[name] = nameToTensorMap[name]; + } + }); + bufferIndexOffset += numBuffers; + }); + return weightsTensorMap; + }; + } + + /** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + const OCTET_STREAM_MIME_TYPE = 'application/octet-stream'; + const JSON_TYPE = 'application/json'; + class HTTPRequest { + constructor(path, loadOptions) { + this.DEFAULT_METHOD = 'POST'; + if (loadOptions == null) { + loadOptions = {}; + } + this.weightPathPrefix = loadOptions.weightPathPrefix; + this.onProgress = loadOptions.onProgress; + if (loadOptions.fetchFunc != null) { + assert(typeof loadOptions.fetchFunc === 'function', () => 'Must pass a function that matches the signature of ' + + '`fetch` (see ' + + 'https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)'); + this.fetch = loadOptions.fetchFunc; + } + else { + this.fetch = env().platform.fetch; + } + assert(path != null && path.length > 0, () => 'URL path for http must not be null, undefined or ' + + 'empty.'); + if (Array.isArray(path)) { + assert(path.length === 2, () => 'URL paths for http must have a length of 2, ' + + `(actual length is ${path.length}).`); + } + this.path = path; + if (loadOptions.requestInit != null && + loadOptions.requestInit.body != null) { + throw new Error('requestInit is expected to have no pre-existing body, but has one.'); + } + this.requestInit = loadOptions.requestInit || {}; + } + async save(modelArtifacts) { + if (modelArtifacts.modelTopology instanceof ArrayBuffer) { + throw new Error('BrowserHTTPRequest.save() does not support saving model topology ' + + 'in binary formats yet.'); + } + const init = Object.assign({ method: this.DEFAULT_METHOD }, this.requestInit); + init.body = new FormData(); + const weightsManifest = [{ + paths: ['./model.weights.bin'], + weights: modelArtifacts.weightSpecs, + }]; + const modelTopologyAndWeightManifest = { + modelTopology: modelArtifacts.modelTopology, + format: modelArtifacts.format, + generatedBy: modelArtifacts.generatedBy, + convertedBy: modelArtifacts.convertedBy, + userDefinedMetadata: modelArtifacts.userDefinedMetadata, + weightsManifest + }; + init.body.append('model.json', new Blob([JSON.stringify(modelTopologyAndWeightManifest)], { type: JSON_TYPE }), 'model.json'); + if (modelArtifacts.weightData != null) { + init.body.append('model.weights.bin', new Blob([modelArtifacts.weightData], { type: OCTET_STREAM_MIME_TYPE }), 'model.weights.bin'); + } + const response = await this.fetch(this.path, init); + if (response.ok) { + return { + modelArtifactsInfo: getModelArtifactsInfoForJSON(modelArtifacts), + responses: [response], + }; + } + else { + throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ` + + `${response.status}.`); + } + } + /** + * Load model artifacts via HTTP request(s). + * + * See the documentation to `tf.io.http` for details on the saved + * artifacts. + * + * @returns The loaded model artifacts (if loading succeeds). + */ + async load() { + const modelConfigRequest = await this.fetch(this.path, this.requestInit); + if (!modelConfigRequest.ok) { + throw new Error(`Request to ${this.path} failed with status code ` + + `${modelConfigRequest.status}. Please verify this URL points to ` + + `the model JSON of the model to load.`); + } + let modelConfig; + try { + modelConfig = await modelConfigRequest.json(); + } + catch (e) { + let message = `Failed to parse model JSON of response from ${this.path}.`; + // TODO(nsthorat): Remove this after some time when we're comfortable that + // .pb files are mostly gone. + if (this.path.endsWith('.pb')) { + message += ' Your path contains a .pb file extension. ' + + 'Support for .pb models have been removed in TensorFlow.js 1.0 ' + + 'in favor of .json models. You can re-convert your Python ' + + 'TensorFlow model using the TensorFlow.js 1.0 conversion scripts ' + + 'or you can convert your.pb models with the \'pb2json\'' + + 'NPM script in the tensorflow/tfjs-converter repository.'; + } + else { + message += ' Please make sure the server is serving valid ' + + 'JSON for this request.'; + } + throw new Error(message); + } + const modelTopology = modelConfig.modelTopology; + const weightsManifest = modelConfig.weightsManifest; + const generatedBy = modelConfig.generatedBy; + const convertedBy = modelConfig.convertedBy; + const format = modelConfig.format; + const userDefinedMetadata = modelConfig.userDefinedMetadata; + // We do not allow both modelTopology and weightsManifest to be missing. + if (modelTopology == null && weightsManifest == null) { + throw new Error(`The JSON from HTTP path ${this.path} contains neither model ` + + `topology or manifest for weights.`); + } + let weightSpecs; + let weightData; + if (weightsManifest != null) { + const results = await this.loadWeights(weightsManifest); + [weightSpecs, weightData] = results; + } + return { + modelTopology, + weightSpecs, + weightData, + userDefinedMetadata, + generatedBy, + convertedBy, + format + }; + } + async loadWeights(weightsManifest) { + const weightPath = Array.isArray(this.path) ? this.path[1] : this.path; + const [prefix, suffix] = parseUrl(weightPath); + const pathPrefix = this.weightPathPrefix || prefix; + const weightSpecs = []; + for (const entry of weightsManifest) { + weightSpecs.push(...entry.weights); + } + const fetchURLs = []; + weightsManifest.forEach(weightsGroup => { + weightsGroup.paths.forEach(path => { + fetchURLs.push(pathPrefix + path + suffix); + }); + }); + const buffers = await loadWeightsAsArrayBuffer(fetchURLs, { + requestInit: this.requestInit, + fetchFunc: this.fetch, + onProgress: this.onProgress + }); + return [weightSpecs, concatenateArrayBuffers(buffers)]; + } + } + HTTPRequest.URL_SCHEME_REGEX = /^https?:\/\//; + /** + * Extract the prefix and suffix of the url, where the prefix is the path before + * the last file, and suffix is the search params after the last file. + * ``` + * const url = 'http://tfhub.dev/model/1/tensorflowjs_model.pb?tfjs-format=file' + * [prefix, suffix] = parseUrl(url) + * // prefix = 'http://tfhub.dev/model/1/' + * // suffix = '?tfjs-format=file' + * ``` + * @param url the model url to be parsed. + */ + function parseUrl(url) { + const lastSlash = url.lastIndexOf('/'); + const lastSearchParam = url.lastIndexOf('?'); + const prefix = url.substring(0, lastSlash); + const suffix = lastSearchParam > lastSlash ? url.substring(lastSearchParam) : ''; + return [prefix + '/', suffix]; + } + function isHTTPScheme(url) { + return url.match(HTTPRequest.URL_SCHEME_REGEX) != null; + } + const httpRouter = (url, onProgress) => { + if (typeof fetch === 'undefined') { + // `http` uses `fetch` or `node-fetch`, if one wants to use it in + // an environment that is not the browser or node they have to setup a + // global fetch polyfill. + return null; + } + else { + let isHTTP = true; + if (Array.isArray(url)) { + isHTTP = url.every(urlItem => isHTTPScheme(urlItem)); + } + else { + isHTTP = isHTTPScheme(url); + } + if (isHTTP) { + return http(url, { onProgress }); + } + } + return null; + }; + IORouterRegistry.registerSaveRouter(httpRouter); + IORouterRegistry.registerLoadRouter(httpRouter); + /** + * Creates an IOHandler subtype that sends model artifacts to HTTP server. + * + * An HTTP request of the `multipart/form-data` mime type will be sent to the + * `path` URL. The form data includes artifacts that represent the topology + * and/or weights of the model. In the case of Keras-style `tf.Model`, two + * blobs (files) exist in form-data: + * - A JSON file consisting of `modelTopology` and `weightsManifest`. + * - A binary weights file consisting of the concatenated weight values. + * These files are in the same format as the one generated by + * [tfjs_converter](https://js.tensorflow.org/tutorials/import-keras.html). + * + * The following code snippet exemplifies the client-side code that uses this + * function: + * + * ```js + * const model = tf.sequential(); + * model.add( + * tf.layers.dense({units: 1, inputShape: [100], activation: 'sigmoid'})); + * + * const saveResult = await model.save(tf.io.http( + * 'http://model-server:5000/upload', {requestInit: {method: 'PUT'}})); + * console.log(saveResult); + * ``` + * + * If the default `POST` method is to be used, without any custom parameters + * such as headers, you can simply pass an HTTP or HTTPS URL to `model.save`: + * + * ```js + * const saveResult = await model.save('http://model-server:5000/upload'); + * ``` + * + * The following GitHub Gist + * https://gist.github.com/dsmilkov/1b6046fd6132d7408d5257b0976f7864 + * implements a server based on [flask](https://github.com/pallets/flask) that + * can receive the request. Upon receiving the model artifacts via the requst, + * this particular server reconsistutes instances of [Keras + * Models](https://keras.io/models/model/) in memory. + * + * + * @param path A URL path to the model. + * Can be an absolute HTTP path (e.g., + * 'http://localhost:8000/model-upload)') or a relative path (e.g., + * './model-upload'). + * @param requestInit Request configurations to be used when sending + * HTTP request to server using `fetch`. It can contain fields such as + * `method`, `credentials`, `headers`, `mode`, etc. See + * https://developer.mozilla.org/en-US/docs/Web/API/Request/Request + * for more information. `requestInit` must not have a body, because the + * body will be set by TensorFlow.js. File blobs representing the model + * topology (filename: 'model.json') and the weights of the model (filename: + * 'model.weights.bin') will be appended to the body. If `requestInit` has a + * `body`, an Error will be thrown. + * @param loadOptions Optional configuration for the loading. It includes the + * following fields: + * - weightPathPrefix Optional, this specifies the path prefix for weight + * files, by default this is calculated from the path param. + * - fetchFunc Optional, custom `fetch` function. E.g., in Node.js, + * the `fetch` from node-fetch can be used here. + * - onProgress Optional, progress callback function, fired periodically + * before the load is completed. + * @returns An instance of `IOHandler`. + */ + /** + * @doc { + * heading: 'Models', + * subheading: 'Loading', + * namespace: 'io', + * ignoreCI: true + * } + */ + function http(path, loadOptions) { + return new HTTPRequest(path, loadOptions); + } + /** + * Deprecated. Use `tf.io.http`. + * @param path + * @param loadOptions + */ + function browserHTTPRequest(path, loadOptions) { + return http(path, loadOptions); + } + + /** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + class PassthroughLoader { + constructor(modelArtifacts) { + this.modelArtifacts = modelArtifacts; + } + async load() { + return this.modelArtifacts; + } + } + class PassthroughSaver { + constructor(saveHandler) { + this.saveHandler = saveHandler; + } + async save(modelArtifacts) { + return this.saveHandler(modelArtifacts); + } + } + /** + * Creates an IOHandler that loads model artifacts from memory. + * + * When used in conjunction with `tf.loadLayersModel`, an instance of + * `tf.LayersModel` (Keras-style) can be constructed from the loaded artifacts. + * + * ```js + * const model = await tf.loadLayersModel(tf.io.fromMemory( + * modelTopology, weightSpecs, weightData)); + * ``` + * + * @param modelArtifacts a object containing model topology (i.e., parsed from + * the JSON format). + * @param weightSpecs An array of `WeightsManifestEntry` objects describing the + * names, shapes, types, and quantization of the weight data. + * @param weightData A single `ArrayBuffer` containing the weight data, + * concatenated in the order described by the weightSpecs. + * @param trainingConfig Model training configuration. Optional. + * + * @returns A passthrough `IOHandler` that simply loads the provided data. + */ + function fromMemory(modelArtifacts, weightSpecs, weightData, trainingConfig) { + if (arguments.length === 1) { + const isModelArtifacts = modelArtifacts.modelTopology != null || + modelArtifacts.weightSpecs != null; + if (isModelArtifacts) { + return new PassthroughLoader(modelArtifacts); + } + else { + // Legacy support: with only modelTopology. + // TODO(cais): Remove this deprecated API. + console.warn('Please call tf.io.fromMemory() with only one argument. ' + + 'The argument should be of type ModelArtifacts. ' + + 'The multi-argument signature of tf.io.fromMemory() has been ' + + 'deprecated and will be removed in a future release.'); + return new PassthroughLoader({ modelTopology: modelArtifacts }); + } + } + else { + // Legacy support. + // TODO(cais): Remove this deprecated API. + console.warn('Please call tf.io.fromMemory() with only one argument. ' + + 'The argument should be of type ModelArtifacts. ' + + 'The multi-argument signature of tf.io.fromMemory() has been ' + + 'deprecated and will be removed in a future release.'); + return new PassthroughLoader({ + modelTopology: modelArtifacts, + weightSpecs, + weightData, + trainingConfig + }); + } + } + /** + * Creates an IOHandler that passes saved model artifacts to a callback. + * + * ```js + * function handleSave(artifacts) { + * // ... do something with the artifacts ... + * return {modelArtifactsInfo: {...}, ...}; + * } + * + * const saveResult = model.save(tf.io.withSaveHandler(handleSave)); + * ``` + * + * @param saveHandler A function that accepts a `ModelArtifacts` and returns a + * `SaveResult`. + */ + function withSaveHandler(saveHandler) { + return new PassthroughSaver(saveHandler); + } + + /** + * @license + * Copyright 2018 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + + var io = /*#__PURE__*/Object.freeze({ + __proto__: null, + browserFiles: browserFiles, + browserHTTPRequest: browserHTTPRequest, + concatenateArrayBuffers: concatenateArrayBuffers, + decodeWeights: decodeWeights, + encodeWeights: encodeWeights, + fromMemory: fromMemory, + getLoadHandlers: getLoadHandlers, + getModelArtifactsInfoForJSON: getModelArtifactsInfoForJSON, + getSaveHandlers: getSaveHandlers, + http: http, + isHTTPScheme: isHTTPScheme, + loadWeights: loadWeights, + registerLoadRouter: registerLoadRouter, + registerSaveRouter: registerSaveRouter, + weightsLoaderFactory: weightsLoaderFactory, + withSaveHandler: withSaveHandler, + copyModel: copyModel, + listModels: listModels, + moveModel: moveModel, + removeModel: removeModel + }); + + /** + * @license + * Copyright 2020 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Creates a one-hot `tf.Tensor`. The locations represented by `indices` take + * value `onValue` (defaults to 1), while all other locations take value + * `offValue` (defaults to 0). If `indices` is rank `R`, the output has rank + * `R+1` with the last axis of size `depth`. + * + * ```js + * tf.oneHot(tf.tensor1d([0, 1], 'int32'), 3).print(); + * ``` + * + * @param indices `tf.Tensor` of indices with dtype `int32`. + * @param depth The depth of the one hot dimension. + * @param onValue A number used to fill in the output when the index matches + * the location. + * @param offValue A number used to fill in the output when the index does + * not match the location. + */ + /** @doc {heading: 'Tensors', subheading: 'Creation'} */ + function oneHot_(indices, depth, onValue = 1, offValue = 0) { + if (depth < 2) { + throw new Error(`Error in oneHot: depth must be >=2, but it is ${depth}`); + } + let $indices = convertToTensor(indices, 'indices', 'oneHot', 'int32'); + const outShape = [...$indices.shape, depth]; + $indices = $indices.flatten(); + const forward = (backend, save) => { + save([$indices]); + return reshape(backend.oneHot($indices, depth, onValue, offValue), outShape); + }; + const inputs = { indices: $indices }; + const attrs = { depth, onValue, offValue }; + return ENGINE.runKernelFunc(forward, inputs, null /* grad */, OneHot, attrs); + } + const oneHot = op({ oneHot_ }); + + /** + * @license + * Copyright 2018 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + /** + * Computes the confusion matrix from true labels and predicted labels. + * + * ```js + * const labels = tf.tensor1d([0, 1, 2, 1, 0], 'int32'); + * const predictions = tf.tensor1d([0, 2, 2, 1, 0], 'int32'); + * const numClasses = 3; + * const out = tf.math.confusionMatrix(labels, predictions, numClasses); + * out.print(); + * // Expected output matrix: + * // [[2, 0, 0], + * // [0, 1, 1], + * // [0, 0, 1]] + * ``` + * + * @param labels The target labels, assumed to be 0-based integers + * for the classes. The shape is `[numExamples]`, where + * `numExamples` is the number of examples included. + * @param predictions The predicted classes, assumed to be + * 0-based integers for the classes. Must have the same shape as `labels`. + * @param numClasses Number of all classes, as an integer. + * Its value must be larger than the largest element in `labels` and + * `predictions`. + * @returns The confusion matrix as a int32-type 2D tensor. The value at + * row `r` and column `c` is the number of times examples of actual class + * `r` were predicted as class `c`. + */ + /** @doc {heading: 'Operations', subheading: 'Evaluation'} */ + function confusionMatrix_(labels, predictions, numClasses) { + const $labels = convertToTensor(labels, 'labels', 'confusionMatrix'); + const $predictions = convertToTensor(predictions, 'predictions', 'confusionMatrix'); + assert(numClasses == null || numClasses > 0 && Number.isInteger(numClasses), () => `If provided, numClasses must be a positive integer, ` + + `but got ${numClasses}`); + assert($labels.rank === 1, () => `Expected the rank of labels to be 1, but got ${$labels.rank}`); + assert($predictions.rank === 1, () => `Expected the rank of predictions to be 1, ` + + `but got ${$predictions.rank}`); + assert($labels.shape[0] === $predictions.shape[0], () => `Mismatch in the number of examples: ` + + `${$labels.shape[0]} vs. ${$predictions.shape[0]}. ` + + `Labels and predictions should have the same number of elements.`); + assert(numClasses > 0 && Number.isInteger(numClasses), () => `numClasses is required to be a positive integer, but got ` + + `${numClasses}`); + // TODO(cais): In the future, if oneHot supports tensors inputs for + // `numClasses`, `confusionMatrix` can make `numClasses` optional. + const oneHotLabels = oneHot($labels.asType('int32'), numClasses); + const oneHotPredictions = oneHot($predictions.asType('int32'), numClasses); + const oneHotLabelsT = oneHotLabels.transpose(); + return oneHotLabelsT.matMul(oneHotPredictions).asType('int32'); + } + const confusionMatrix = op({ confusionMatrix_ }); + + /** + * @license + * Copyright 2018 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + + var math = /*#__PURE__*/Object.freeze({ + __proto__: null, + confusionMatrix: confusionMatrix + }); + + /** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + let fromPixels2DContext; + /** + * Creates a `tf.Tensor` from an image. + * + * ```js + * const image = new ImageData(1, 1); + * image.data[0] = 100; + * image.data[1] = 150; + * image.data[2] = 200; + * image.data[3] = 255; + * + * tf.browser.fromPixels(image).print(); + * ``` + * + * @param pixels The input image to construct the tensor from. The + * supported image types are all 4-channel. You can also pass in an image + * object with following attributes: + * `{data: Uint8Array; width: number; height: number}` + * @param numChannels The number of channels of the output tensor. A + * numChannels value less than 4 allows you to ignore channels. Defaults to + * 3 (ignores alpha channel of input image). + */ + /** @doc {heading: 'Browser', namespace: 'browser', ignoreCI: true} */ + function fromPixels_(pixels, numChannels = 3) { + // Sanity checks. + if (numChannels > 4) { + throw new Error('Cannot construct Tensor with more than 4 channels from pixels.'); + } + if (pixels == null) { + throw new Error('pixels passed to tf.browser.fromPixels() can not be null'); + } + let isPixelData = false; + let isImageData = false; + let isVideo = false; + let isImage = false; + let isCanvasLike = false; + if (pixels.data instanceof Uint8Array) { + isPixelData = true; + } + else if (typeof (ImageData) !== 'undefined' && pixels instanceof ImageData) { + isImageData = true; + } + else if (typeof (HTMLVideoElement) !== 'undefined' && + pixels instanceof HTMLVideoElement) { + isVideo = true; + } + else if (typeof (HTMLImageElement) !== 'undefined' && + pixels instanceof HTMLImageElement) { + isImage = true; + // tslint:disable-next-line: no-any + } + else if (pixels.getContext != null) { + isCanvasLike = true; + } + else { + throw new Error('pixels passed to tf.browser.fromPixels() must be either an ' + + `HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData ` + + `in browser, or OffscreenCanvas, ImageData in webworker` + + ` or {data: Uint32Array, width: number, height: number}, ` + + `but was ${pixels.constructor.name}`); + } + if (isVideo) { + const HAVE_CURRENT_DATA_READY_STATE = 2; + if (isVideo && + pixels.readyState < + HAVE_CURRENT_DATA_READY_STATE) { + throw new Error('The video element has not loaded data yet. Please wait for ' + + '`loadeddata` event on the

aO6lFY`k~VPrTuEfBexG9@#kk_n-LN@3^y$9zH@N!N%YD-p*fW z^u6lhBO7md?40rhO2dY;ELDrVr_^MabzJL7qUmrcv0`%g;SvMQkzaalN z*SzF6Ekod1zJC0)-m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nlLRA9ZB+*?ophnNu~HM$Cgyd5`33lj|(2sMgj?f2V6##~oWWw|wTb3g;jXE{^TI z6MNICu9;k2Q5kk^H)V8X{Skx$+Hb&7Vc;@1FdOjGFMDlE(iBVb8xT diff --git a/tfjs-core/benchmarks/wasm_2_threads/tfjs-backend-wasm.js b/tfjs-core/benchmarks/wasm_2_threads/tfjs-backend-wasm.js deleted file mode 100755 index 90eb60e4a0f..00000000000 --- a/tfjs-core/benchmarks/wasm_2_threads/tfjs-backend-wasm.js +++ /dev/null @@ -1,3381 +0,0 @@ -var WasmBackendModule = (function () { - var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; - if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; - return ( - function (WasmBackendModule) { - WasmBackendModule = WasmBackendModule || {}; - - var Module = typeof WasmBackendModule !== "undefined" ? WasmBackendModule : {}; - var moduleOverrides = {}; - var key; - for (key in Module) { - if (Module.hasOwnProperty(key)) { - moduleOverrides[key] = Module[key] - } - } - var arguments_ = []; - var thisProgram = "./this.program"; - var quit_ = function (status, toThrow) { - throw toThrow - }; - var ENVIRONMENT_IS_WEB = false; - var ENVIRONMENT_IS_WORKER = false; - var ENVIRONMENT_IS_NODE = false; - var ENVIRONMENT_IS_SHELL = false; - ENVIRONMENT_IS_WEB = typeof window === "object"; - ENVIRONMENT_IS_WORKER = typeof importScripts === "function"; - ENVIRONMENT_IS_NODE = typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string"; - ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER; - if (Module["ENVIRONMENT"]) { - throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)") - } - var ENVIRONMENT_IS_PTHREAD = Module["ENVIRONMENT_IS_PTHREAD"] || false; - if (ENVIRONMENT_IS_PTHREAD) { - buffer = Module["buffer"]; - DYNAMIC_BASE = Module["DYNAMIC_BASE"]; - DYNAMICTOP_PTR = Module["DYNAMICTOP_PTR"] - } - var scriptDirectory = ""; - - function locateFile(path) { - if (Module["locateFile"]) { - return Module["locateFile"](path, scriptDirectory) - } - return scriptDirectory + path - } - var read_, readAsync, readBinary, setWindowTitle; - var nodeFS; - var nodePath; - if (ENVIRONMENT_IS_NODE) { - if (ENVIRONMENT_IS_WORKER) { - scriptDirectory = require("path").dirname(scriptDirectory) + "/" - } else { - scriptDirectory = __dirname + "/" - } - read_ = function shell_read(filename, binary) { - if (!nodeFS) nodeFS = require("fs"); - if (!nodePath) nodePath = require("path"); - filename = nodePath["normalize"](filename); - return nodeFS["readFileSync"](filename, binary ? null : "utf8") - }; - readBinary = function readBinary(filename) { - var ret = read_(filename, true); - if (!ret.buffer) { - ret = new Uint8Array(ret) - } - assert(ret.buffer); - return ret - }; - if (process["argv"].length > 1) { - thisProgram = process["argv"][1].replace(/\\/g, "/") - } - arguments_ = process["argv"].slice(2); - process["on"]("uncaughtException", function (ex) { - if (!(ex instanceof ExitStatus)) { - throw ex - } - }); - process["on"]("unhandledRejection", abort); - quit_ = function (status) { - process["exit"](status) - }; - Module["inspect"] = function () { - return "[Emscripten Module object]" - }; - var nodeWorkerThreads; - try { - nodeWorkerThreads = require("worker_threads") - } catch (e) { - console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'); - throw e - } - Worker = nodeWorkerThreads.Worker - } else if (ENVIRONMENT_IS_SHELL) { - if (typeof read != "undefined") { - read_ = function shell_read(f) { - return read(f) - } - } - readBinary = function readBinary(f) { - var data; - if (typeof readbuffer === "function") { - return new Uint8Array(readbuffer(f)) - } - data = read(f, "binary"); - assert(typeof data === "object"); - return data - }; - if (typeof scriptArgs != "undefined") { - arguments_ = scriptArgs - } else if (typeof arguments != "undefined") { - arguments_ = arguments - } - if (typeof quit === "function") { - quit_ = function (status) { - quit(status) - } - } - if (typeof print !== "undefined") { - if (typeof console === "undefined") console = {}; - console.log = print; - console.warn = console.error = typeof printErr !== "undefined" ? printErr : print - } - } else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { - if (ENVIRONMENT_IS_WORKER) { - scriptDirectory = self.location.href - } else if (document.currentScript) { - scriptDirectory = document.currentScript.src - } - if (_scriptDir) { - scriptDirectory = _scriptDir - } - if (scriptDirectory.indexOf("blob:") !== 0) { - scriptDirectory = scriptDirectory.substr(0, scriptDirectory.lastIndexOf("/") + 1) - } else { - scriptDirectory = "" - } - if (ENVIRONMENT_IS_NODE) { - read_ = function shell_read(filename, binary) { - if (!nodeFS) nodeFS = require("fs"); - if (!nodePath) nodePath = require("path"); - filename = nodePath["normalize"](filename); - return nodeFS["readFileSync"](filename, binary ? null : "utf8") - }; - readBinary = function readBinary(filename) { - var ret = read_(filename, true); - if (!ret.buffer) { - ret = new Uint8Array(ret) - } - assert(ret.buffer); - return ret - } - } else { - read_ = function shell_read(url) { - var xhr = new XMLHttpRequest; - xhr.open("GET", url, false); - xhr.send(null); - return xhr.responseText - }; - if (ENVIRONMENT_IS_WORKER) { - readBinary = function readBinary(url) { - var xhr = new XMLHttpRequest; - xhr.open("GET", url, false); - xhr.responseType = "arraybuffer"; - xhr.send(null); - return new Uint8Array(xhr.response) - } - } - readAsync = function readAsync(url, onload, onerror) { - var xhr = new XMLHttpRequest; - xhr.open("GET", url, true); - xhr.responseType = "arraybuffer"; - xhr.onload = function xhr_onload() { - if (xhr.status == 200 || xhr.status == 0 && xhr.response) { - onload(xhr.response); - return - } - onerror() - }; - xhr.onerror = onerror; - xhr.send(null) - } - } - setWindowTitle = function (title) { - document.title = title - } - } else { - throw new Error("environment detection error") - } - if (ENVIRONMENT_IS_NODE) { - if (typeof performance === "undefined") { - performance = require("perf_hooks").performance - } - } - var out = Module["print"] || console.log.bind(console); - var err = Module["printErr"] || console.warn.bind(console); - for (key in moduleOverrides) { - if (moduleOverrides.hasOwnProperty(key)) { - Module[key] = moduleOverrides[key] - } - } - moduleOverrides = null; - if (Module["arguments"]) arguments_ = Module["arguments"]; - if (!Object.getOwnPropertyDescriptor(Module, "arguments")) Object.defineProperty(Module, "arguments", { - configurable: true, - get: function () { - abort("Module.arguments has been replaced with plain arguments_") - } - }); - if (Module["thisProgram"]) thisProgram = Module["thisProgram"]; - if (!Object.getOwnPropertyDescriptor(Module, "thisProgram")) Object.defineProperty(Module, "thisProgram", { - configurable: true, - get: function () { - abort("Module.thisProgram has been replaced with plain thisProgram") - } - }); - if (Module["quit"]) quit_ = Module["quit"]; - if (!Object.getOwnPropertyDescriptor(Module, "quit")) Object.defineProperty(Module, "quit", { - configurable: true, - get: function () { - abort("Module.quit has been replaced with plain quit_") - } - }); - assert(typeof Module["memoryInitializerPrefixURL"] === "undefined", "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"); - assert(typeof Module["pthreadMainPrefixURL"] === "undefined", "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"); - assert(typeof Module["cdInitializerPrefixURL"] === "undefined", "Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"); - assert(typeof Module["filePackagePrefixURL"] === "undefined", "Module.filePackagePrefixURL option was removed, use Module.locateFile instead"); - assert(typeof Module["read"] === "undefined", "Module.read option was removed (modify read_ in JS)"); - assert(typeof Module["readAsync"] === "undefined", "Module.readAsync option was removed (modify readAsync in JS)"); - assert(typeof Module["readBinary"] === "undefined", "Module.readBinary option was removed (modify readBinary in JS)"); - assert(typeof Module["setWindowTitle"] === "undefined", "Module.setWindowTitle option was removed (modify setWindowTitle in JS)"); - assert(typeof Module["TOTAL_MEMORY"] === "undefined", "Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"); - if (!Object.getOwnPropertyDescriptor(Module, "read")) Object.defineProperty(Module, "read", { - configurable: true, - get: function () { - abort("Module.read has been replaced with plain read_") - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "readAsync")) Object.defineProperty(Module, "readAsync", { - configurable: true, - get: function () { - abort("Module.readAsync has been replaced with plain readAsync") - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "readBinary")) Object.defineProperty(Module, "readBinary", { - configurable: true, - get: function () { - abort("Module.readBinary has been replaced with plain readBinary") - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "setWindowTitle")) Object.defineProperty(Module, "setWindowTitle", { - configurable: true, - get: function () { - abort("Module.setWindowTitle has been replaced with plain setWindowTitle") - } - }); - assert(ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER || ENVIRONMENT_IS_NODE, "Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)"); - var stackSave; - var stackRestore; - var stackAlloc; - stackSave = stackRestore = stackAlloc = function () { - abort("cannot use the stack before compiled code is ready to run, and has provided stack access") - }; - - function warnOnce(text) { - if (!warnOnce.shown) warnOnce.shown = {}; - if (!warnOnce.shown[text]) { - warnOnce.shown[text] = 1; - err(text) - } - } - var Atomics_load = Atomics.load; - var Atomics_store = Atomics.store; - var Atomics_compareExchange = Atomics.compareExchange; - var wasmBinary; - if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"]; - if (!Object.getOwnPropertyDescriptor(Module, "wasmBinary")) Object.defineProperty(Module, "wasmBinary", { - configurable: true, - get: function () { - abort("Module.wasmBinary has been replaced with plain wasmBinary") - } - }); - var noExitRuntime; - if (Module["noExitRuntime"]) noExitRuntime = Module["noExitRuntime"]; - if (!Object.getOwnPropertyDescriptor(Module, "noExitRuntime")) Object.defineProperty(Module, "noExitRuntime", { - configurable: true, - get: function () { - abort("Module.noExitRuntime has been replaced with plain noExitRuntime") - } - }); - if (typeof WebAssembly !== "object") { - abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.") - } - var wasmMemory; - var wasmTable = new WebAssembly.Table({ - "initial": 119, - "maximum": 119 + 0, - "element": "anyfunc" - }); - var wasmModule; - var threadInfoStruct = 0; - var selfThreadId = 0; - var ABORT = false; - var EXITSTATUS = 0; - - function assert(condition, text) { - if (!condition) { - abort("Assertion failed: " + text) - } - } - - function getCFunc(ident) { - var func = Module["_" + ident]; - assert(func, "Cannot call unknown function " + ident + ", make sure it is exported"); - return func - } - - function ccall(ident, returnType, argTypes, args, opts) { - var toC = { - "string": function (str) { - var ret = 0; - if (str !== null && str !== undefined && str !== 0) { - var len = (str.length << 2) + 1; - ret = stackAlloc(len); - stringToUTF8(str, ret, len) - } - return ret - }, - "array": function (arr) { - var ret = stackAlloc(arr.length); - writeArrayToMemory(arr, ret); - return ret - } - }; - - function convertReturnValue(ret) { - if (returnType === "string") return UTF8ToString(ret); - if (returnType === "boolean") return Boolean(ret); - return ret - } - var func = getCFunc(ident); - var cArgs = []; - var stack = 0; - assert(returnType !== "array", 'Return type should not be "array".'); - if (args) { - for (var i = 0; i < args.length; i++) { - var converter = toC[argTypes[i]]; - if (converter) { - if (stack === 0) stack = stackSave(); - cArgs[i] = converter(args[i]) - } else { - cArgs[i] = args[i] - } - } - } - var ret = func.apply(null, cArgs); - ret = convertReturnValue(ret); - if (stack !== 0) stackRestore(stack); - return ret - } - - function cwrap(ident, returnType, argTypes, opts) { - return function () { - return ccall(ident, returnType, argTypes, arguments, opts) - } - } - - function UTF8ArrayToString(heap, idx, maxBytesToRead) { - var endIdx = idx + maxBytesToRead; - var str = ""; - while (!(idx >= endIdx)) { - var u0 = heap[idx++]; - if (!u0) return str; - if (!(u0 & 128)) { - str += String.fromCharCode(u0); - continue - } - var u1 = heap[idx++] & 63; - if ((u0 & 224) == 192) { - str += String.fromCharCode((u0 & 31) << 6 | u1); - continue - } - var u2 = heap[idx++] & 63; - if ((u0 & 240) == 224) { - u0 = (u0 & 15) << 12 | u1 << 6 | u2 - } else { - if ((u0 & 248) != 240) warnOnce("Invalid UTF-8 leading byte 0x" + u0.toString(16) + " encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!"); - u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heap[idx++] & 63 - } - if (u0 < 65536) { - str += String.fromCharCode(u0) - } else { - var ch = u0 - 65536; - str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023) - } - } - return str - } - - function UTF8ToString(ptr, maxBytesToRead) { - return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "" - } - - function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { - if (!(maxBytesToWrite > 0)) return 0; - var startIdx = outIdx; - var endIdx = outIdx + maxBytesToWrite - 1; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) { - var u1 = str.charCodeAt(++i); - u = 65536 + ((u & 1023) << 10) | u1 & 1023 - } - if (u <= 127) { - if (outIdx >= endIdx) break; - heap[outIdx++] = u - } else if (u <= 2047) { - if (outIdx + 1 >= endIdx) break; - heap[outIdx++] = 192 | u >> 6; - heap[outIdx++] = 128 | u & 63 - } else if (u <= 65535) { - if (outIdx + 2 >= endIdx) break; - heap[outIdx++] = 224 | u >> 12; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63 - } else { - if (outIdx + 3 >= endIdx) break; - if (u >= 2097152) warnOnce("Invalid Unicode code point 0x" + u.toString(16) + " encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF)."); - heap[outIdx++] = 240 | u >> 18; - heap[outIdx++] = 128 | u >> 12 & 63; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63 - } - } - heap[outIdx] = 0; - return outIdx - startIdx - } - - function stringToUTF8(str, outPtr, maxBytesToWrite) { - assert(typeof maxBytesToWrite == "number", "stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"); - return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite) - } - - function lengthBytesUTF8(str) { - var len = 0; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; - if (u <= 127) ++len; - else if (u <= 2047) len += 2; - else if (u <= 65535) len += 3; - else len += 4 - } - return len - } - - function writeArrayToMemory(array, buffer) { - assert(array.length >= 0, "writeArrayToMemory array must have a length (should be an array or typed array)"); - HEAP8.set(array, buffer) - } - var WASM_PAGE_SIZE = 65536; - var buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; - - function updateGlobalBufferAndViews(buf) { - buffer = buf; - Module["HEAP8"] = HEAP8 = new Int8Array(buf); - Module["HEAP16"] = HEAP16 = new Int16Array(buf); - Module["HEAP32"] = HEAP32 = new Int32Array(buf); - Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); - Module["HEAPU16"] = HEAPU16 = new Uint16Array(buf); - Module["HEAPU32"] = HEAPU32 = new Uint32Array(buf); - Module["HEAPF32"] = HEAPF32 = new Float32Array(buf); - Module["HEAPF64"] = HEAPF64 = new Float64Array(buf) - } - var STACK_BASE = 5255808, - STACKTOP = STACK_BASE, - STACK_MAX = 12928, - DYNAMIC_BASE = 5255808, - DYNAMICTOP_PTR = 12e3; - assert(STACK_BASE % 16 === 0, "stack must start aligned"); - assert(DYNAMIC_BASE % 16 === 0, "heap must start aligned"); - if (ENVIRONMENT_IS_PTHREAD) { - STACK_MAX = STACKTOP = STACK_MAX = 2147483647 - } - var TOTAL_STACK = 5242880; - if (Module["TOTAL_STACK"]) assert(TOTAL_STACK === Module["TOTAL_STACK"], "the stack size can no longer be determined at runtime"); - var INITIAL_INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 1073741824; - if (!Object.getOwnPropertyDescriptor(Module, "INITIAL_MEMORY")) Object.defineProperty(Module, "INITIAL_MEMORY", { - configurable: true, - get: function () { - abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY") - } - }); - assert(INITIAL_INITIAL_MEMORY >= TOTAL_STACK, "INITIAL_MEMORY should be larger than TOTAL_STACK, was " + INITIAL_INITIAL_MEMORY + "! (TOTAL_STACK=" + TOTAL_STACK + ")"); - assert(typeof Int32Array !== "undefined" && typeof Float64Array !== "undefined" && Int32Array.prototype.subarray !== undefined && Int32Array.prototype.set !== undefined, "JS engine does not provide full typed array support"); - if (ENVIRONMENT_IS_PTHREAD) { - wasmMemory = Module["wasmMemory"]; - buffer = Module["buffer"] - } else { - if (Module["wasmMemory"]) { - wasmMemory = Module["wasmMemory"] - } else { - wasmMemory = new WebAssembly.Memory({ - "initial": INITIAL_INITIAL_MEMORY / WASM_PAGE_SIZE, - "maximum": INITIAL_INITIAL_MEMORY / WASM_PAGE_SIZE, - "shared": true - }); - if (!(wasmMemory.buffer instanceof SharedArrayBuffer)) { - err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"); - if (ENVIRONMENT_IS_NODE) { - console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)") - } - throw Error("bad memory") - } - } - } - if (wasmMemory) { - buffer = wasmMemory.buffer - } - INITIAL_INITIAL_MEMORY = buffer.byteLength; - assert(INITIAL_INITIAL_MEMORY % WASM_PAGE_SIZE === 0); - updateGlobalBufferAndViews(buffer); - if (!ENVIRONMENT_IS_PTHREAD) { - HEAP32[DYNAMICTOP_PTR >> 2] = DYNAMIC_BASE - } - - function writeStackCookie() { - assert((STACK_MAX & 3) == 0); - HEAPU32[(STACK_MAX >> 2) + 1] = 34821223; - HEAPU32[(STACK_MAX >> 2) + 2] = 2310721022; - HEAP32[0] = 1668509029 - } - - function checkStackCookie() { - var cookie1 = HEAPU32[(STACK_MAX >> 2) + 1]; - var cookie2 = HEAPU32[(STACK_MAX >> 2) + 2]; - if (cookie1 != 34821223 || cookie2 != 2310721022) { - abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x" + cookie2.toString(16) + " " + cookie1.toString(16)) - } - if (HEAP32[0] !== 1668509029) abort("Runtime error: The application has corrupted its heap memory area (address zero)!") - } - - function abortStackOverflow(allocSize) { - abort("Stack overflow! Attempted to allocate " + allocSize + " bytes on the stack, but stack has only " + (STACK_MAX - stackSave() + allocSize) + " bytes available!") - }(function () { - var h16 = new Int16Array(1); - var h8 = new Int8Array(h16.buffer); - h16[0] = 25459; - if (h8[0] !== 115 || h8[1] !== 99) throw "Runtime error: expected the system to be little-endian!" - })(); - - function callRuntimeCallbacks(callbacks) { - while (callbacks.length > 0) { - var callback = callbacks.shift(); - if (typeof callback == "function") { - callback(Module); - continue - } - var func = callback.func; - if (typeof func === "number") { - if (callback.arg === undefined) { - Module["dynCall_v"](func) - } else { - Module["dynCall_vi"](func, callback.arg) - } - } else { - func(callback.arg === undefined ? null : callback.arg) - } - } - } - var __ATPRERUN__ = []; - var __ATINIT__ = []; - var __ATMAIN__ = []; - var __ATEXIT__ = []; - var __ATPOSTRUN__ = []; - var runtimeInitialized = false; - var runtimeExited = false; - if (ENVIRONMENT_IS_PTHREAD) runtimeInitialized = true; - - function preRun() { - if (ENVIRONMENT_IS_PTHREAD) return; - if (Module["preRun"]) { - if (typeof Module["preRun"] == "function") Module["preRun"] = [Module["preRun"]]; - while (Module["preRun"].length) { - addOnPreRun(Module["preRun"].shift()) - } - } - callRuntimeCallbacks(__ATPRERUN__) - } - - function initRuntime() { - checkStackCookie(); - assert(!runtimeInitialized); - runtimeInitialized = true; - callRuntimeCallbacks(__ATINIT__) - } - - function preMain() { - checkStackCookie(); - if (ENVIRONMENT_IS_PTHREAD) return; - callRuntimeCallbacks(__ATMAIN__) - } - - function postRun() { - checkStackCookie(); - if (ENVIRONMENT_IS_PTHREAD) return; - if (Module["postRun"]) { - if (typeof Module["postRun"] == "function") Module["postRun"] = [Module["postRun"]]; - while (Module["postRun"].length) { - addOnPostRun(Module["postRun"].shift()) - } - } - callRuntimeCallbacks(__ATPOSTRUN__) - } - - function addOnPreRun(cb) { - __ATPRERUN__.unshift(cb) - } - - function addOnPostRun(cb) { - __ATPOSTRUN__.unshift(cb) - } - assert(Math.imul, "This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); - assert(Math.fround, "This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); - assert(Math.clz32, "This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); - assert(Math.trunc, "This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); - var Math_ceil = Math.ceil; - var Math_floor = Math.floor; - var runDependencies = 0; - var runDependencyWatcher = null; - var dependenciesFulfilled = null; - var runDependencyTracking = {}; - - function addRunDependency(id) { - assert(!ENVIRONMENT_IS_PTHREAD, "addRunDependency cannot be used in a pthread worker"); - runDependencies++; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies) - } - if (id) { - assert(!runDependencyTracking[id]); - runDependencyTracking[id] = 1; - if (runDependencyWatcher === null && typeof setInterval !== "undefined") { - runDependencyWatcher = setInterval(function () { - if (ABORT) { - clearInterval(runDependencyWatcher); - runDependencyWatcher = null; - return - } - var shown = false; - for (var dep in runDependencyTracking) { - if (!shown) { - shown = true; - err("still waiting on run dependencies:") - } - err("dependency: " + dep) - } - if (shown) { - err("(end of list)") - } - }, 1e4) - } - } else { - err("warning: run dependency added without ID") - } - } - - function removeRunDependency(id) { - runDependencies--; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies) - } - if (id) { - assert(runDependencyTracking[id]); - delete runDependencyTracking[id] - } else { - err("warning: run dependency removed without ID") - } - if (runDependencies == 0) { - if (runDependencyWatcher !== null) { - clearInterval(runDependencyWatcher); - runDependencyWatcher = null - } - if (dependenciesFulfilled) { - var callback = dependenciesFulfilled; - dependenciesFulfilled = null; - callback() - } - } - } - Module["preloadedImages"] = {}; - Module["preloadedAudios"] = {}; - - function abort(what) { - if (Module["onAbort"]) { - Module["onAbort"](what) - } - if (ENVIRONMENT_IS_PTHREAD) console.error("Pthread aborting at " + (new Error).stack); - what += ""; - out(what); - err(what); - ABORT = true; - EXITSTATUS = 1; - var output = "abort(" + what + ") at " + stackTrace(); - what = output; - throw new WebAssembly.RuntimeError(what) - } - var FS = { - error: function () { - abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1") - }, - init: function () { - FS.error() - }, - createDataFile: function () { - FS.error() - }, - createPreloadedFile: function () { - FS.error() - }, - createLazyFile: function () { - FS.error() - }, - open: function () { - FS.error() - }, - mkdev: function () { - FS.error() - }, - registerDevice: function () { - FS.error() - }, - analyzePath: function () { - FS.error() - }, - loadFilesFromDB: function () { - FS.error() - }, - ErrnoError: function ErrnoError() { - FS.error() - } - }; - Module["FS_createDataFile"] = FS.createDataFile; - Module["FS_createPreloadedFile"] = FS.createPreloadedFile; - - function hasPrefix(str, prefix) { - return String.prototype.startsWith ? str.startsWith(prefix) : str.indexOf(prefix) === 0 - } - var dataURIPrefix = "data:application/octet-stream;base64,"; - - function isDataURI(filename) { - return hasPrefix(filename, dataURIPrefix) - } - var fileURIPrefix = "file://"; - - function isFileURI(filename) { - return hasPrefix(filename, fileURIPrefix) - } - var wasmBinaryFile = "tfjs-backend-wasm.wasm"; - if (!isDataURI(wasmBinaryFile)) { - wasmBinaryFile = locateFile(wasmBinaryFile) - } - - function getBinary() { - try { - if (wasmBinary) { - return new Uint8Array(wasmBinary) - } - if (readBinary) { - return readBinary(wasmBinaryFile) - } else { - throw "both async and sync fetching of the wasm failed" - } - } catch (err) { - abort(err) - } - } - - function getBinaryPromise() { - if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) && typeof fetch === "function" && !isFileURI(wasmBinaryFile)) { - return fetch(wasmBinaryFile, { - credentials: "same-origin" - }).then(function (response) { - if (!response["ok"]) { - throw "failed to load wasm binary file at '" + wasmBinaryFile + "'" - } - return response["arrayBuffer"]() - }).catch(function () { - return getBinary() - }) - } - return new Promise(function (resolve, reject) { - resolve(getBinary()) - }) - } - - function createWasm() { - var info = { - "env": asmLibraryArg, - "wasi_snapshot_preview1": asmLibraryArg - }; - - function receiveInstance(instance, module) { - var exports = instance.exports; - Module["asm"] = exports; - wasmModule = module; - if (!ENVIRONMENT_IS_PTHREAD) { - var numWorkersToLoad = PThread.unusedWorkers.length; - PThread.unusedWorkers.forEach(function (w) { - PThread.loadWasmModuleToWorker(w, function () { - if (!--numWorkersToLoad) removeRunDependency("wasm-instantiate") - }) - }) - } - } - if (!ENVIRONMENT_IS_PTHREAD) { - addRunDependency("wasm-instantiate") - } - var trueModule = Module; - - function receiveInstantiatedSource(output) { - assert(Module === trueModule, "the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"); - trueModule = null; - receiveInstance(output["instance"], output["module"]) - } - - function instantiateArrayBuffer(receiver) { - return getBinaryPromise().then(function (binary) { - return WebAssembly.instantiate(binary, info) - }).then(receiver, function (reason) { - err("failed to asynchronously prepare wasm: " + reason); - abort(reason) - }) - } - - function instantiateAsync() { - if (!wasmBinary && typeof WebAssembly.instantiateStreaming === "function" && !isDataURI(wasmBinaryFile) && !isFileURI(wasmBinaryFile) && typeof fetch === "function") { - fetch(wasmBinaryFile, { - credentials: "same-origin" - }).then(function (response) { - var result = WebAssembly.instantiateStreaming(response, info); - return result.then(receiveInstantiatedSource, function (reason) { - err("wasm streaming compile failed: " + reason); - err("falling back to ArrayBuffer instantiation"); - instantiateArrayBuffer(receiveInstantiatedSource) - }) - }) - } else { - return instantiateArrayBuffer(receiveInstantiatedSource) - } - } - if (Module["instantiateWasm"]) { - try { - var exports = Module["instantiateWasm"](info, receiveInstance); - return exports - } catch (e) { - err("Module.instantiateWasm callback failed with error: " + e); - return false - } - } - instantiateAsync(); - return {} - } - var ASM_CONSTS = {}; - - function initPthreadsJS() { - PThread.initRuntime() - } - if (!ENVIRONMENT_IS_PTHREAD) __ATINIT__.push({ - func: function () { - ___wasm_call_ctors() - } - }); - - function demangle(func) { - warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"); - return func - } - - function demangleAll(text) { - var regex = /\b_Z[\w\d_]+/g; - return text.replace(regex, function (x) { - var y = demangle(x); - return x === y ? x : y + " [" + x + "]" - }) - } - var __pthread_ptr = 0; - var __pthread_is_main_runtime_thread = 0; - var __pthread_is_main_browser_thread = 0; - - function __register_pthread_ptr(pthreadPtr, isMainBrowserThread, isMainRuntimeThread) { - pthreadPtr = pthreadPtr | 0; - isMainBrowserThread = isMainBrowserThread | 0; - isMainRuntimeThread = isMainRuntimeThread | 0; - __pthread_ptr = pthreadPtr; - __pthread_is_main_browser_thread = isMainBrowserThread; - __pthread_is_main_runtime_thread = isMainRuntimeThread - } - Module["__register_pthread_ptr"] = __register_pthread_ptr; - var ERRNO_CODES = { - EPERM: 63, - ENOENT: 44, - ESRCH: 71, - EINTR: 27, - EIO: 29, - ENXIO: 60, - E2BIG: 1, - ENOEXEC: 45, - EBADF: 8, - ECHILD: 12, - EAGAIN: 6, - EWOULDBLOCK: 6, - ENOMEM: 48, - EACCES: 2, - EFAULT: 21, - ENOTBLK: 105, - EBUSY: 10, - EEXIST: 20, - EXDEV: 75, - ENODEV: 43, - ENOTDIR: 54, - EISDIR: 31, - EINVAL: 28, - ENFILE: 41, - EMFILE: 33, - ENOTTY: 59, - ETXTBSY: 74, - EFBIG: 22, - ENOSPC: 51, - ESPIPE: 70, - EROFS: 69, - EMLINK: 34, - EPIPE: 64, - EDOM: 18, - ERANGE: 68, - ENOMSG: 49, - EIDRM: 24, - ECHRNG: 106, - EL2NSYNC: 156, - EL3HLT: 107, - EL3RST: 108, - ELNRNG: 109, - EUNATCH: 110, - ENOCSI: 111, - EL2HLT: 112, - EDEADLK: 16, - ENOLCK: 46, - EBADE: 113, - EBADR: 114, - EXFULL: 115, - ENOANO: 104, - EBADRQC: 103, - EBADSLT: 102, - EDEADLOCK: 16, - EBFONT: 101, - ENOSTR: 100, - ENODATA: 116, - ETIME: 117, - ENOSR: 118, - ENONET: 119, - ENOPKG: 120, - EREMOTE: 121, - ENOLINK: 47, - EADV: 122, - ESRMNT: 123, - ECOMM: 124, - EPROTO: 65, - EMULTIHOP: 36, - EDOTDOT: 125, - EBADMSG: 9, - ENOTUNIQ: 126, - EBADFD: 127, - EREMCHG: 128, - ELIBACC: 129, - ELIBBAD: 130, - ELIBSCN: 131, - ELIBMAX: 132, - ELIBEXEC: 133, - ENOSYS: 52, - ENOTEMPTY: 55, - ENAMETOOLONG: 37, - ELOOP: 32, - EOPNOTSUPP: 138, - EPFNOSUPPORT: 139, - ECONNRESET: 15, - ENOBUFS: 42, - EAFNOSUPPORT: 5, - EPROTOTYPE: 67, - ENOTSOCK: 57, - ENOPROTOOPT: 50, - ESHUTDOWN: 140, - ECONNREFUSED: 14, - EADDRINUSE: 3, - ECONNABORTED: 13, - ENETUNREACH: 40, - ENETDOWN: 38, - ETIMEDOUT: 73, - EHOSTDOWN: 142, - EHOSTUNREACH: 23, - EINPROGRESS: 26, - EALREADY: 7, - EDESTADDRREQ: 17, - EMSGSIZE: 35, - EPROTONOSUPPORT: 66, - ESOCKTNOSUPPORT: 137, - EADDRNOTAVAIL: 4, - ENETRESET: 39, - EISCONN: 30, - ENOTCONN: 53, - ETOOMANYREFS: 141, - EUSERS: 136, - EDQUOT: 19, - ESTALE: 72, - ENOTSUP: 138, - ENOMEDIUM: 148, - EILSEQ: 25, - EOVERFLOW: 61, - ECANCELED: 11, - ENOTRECOVERABLE: 56, - EOWNERDEAD: 62, - ESTRPIPE: 135 - }; - var __main_thread_futex_wait_address = 12912; - - function _emscripten_futex_wake(addr, count) { - if (addr <= 0 || addr > HEAP8.length || addr & 3 != 0 || count < 0) return -28; - if (count == 0) return 0; - if (count >= 2147483647) count = Infinity; - var mainThreadWaitAddress = Atomics.load(HEAP32, __main_thread_futex_wait_address >> 2); - var mainThreadWoken = 0; - if (mainThreadWaitAddress == addr) { - var loadedAddr = Atomics.compareExchange(HEAP32, __main_thread_futex_wait_address >> 2, mainThreadWaitAddress, 0); - if (loadedAddr == mainThreadWaitAddress) { - --count; - mainThreadWoken = 1; - if (count <= 0) return 1 - } - } - var ret = Atomics.notify(HEAP32, addr >> 2, count); - if (ret >= 0) return ret + mainThreadWoken; - throw "Atomics.notify returned an unexpected value " + ret - } - Module["_emscripten_futex_wake"] = _emscripten_futex_wake; - - function __kill_thread(pthread_ptr) { - if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _kill_thread() can only ever be called from main application thread!"; - if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _kill_thread!"; - HEAP32[pthread_ptr + 12 >> 2] = 0; - var pthread = PThread.pthreads[pthread_ptr]; - pthread.worker.terminate(); - PThread.freeThreadData(pthread); - PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker), 1); - pthread.worker.pthread = undefined - } - - function __cancel_thread(pthread_ptr) { - if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _cancel_thread() can only ever be called from main application thread!"; - if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _cancel_thread!"; - var pthread = PThread.pthreads[pthread_ptr]; - pthread.worker.postMessage({ - "cmd": "cancel" - }) - } - - function __cleanup_thread(pthread_ptr) { - if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _cleanup_thread() can only ever be called from main application thread!"; - if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _cleanup_thread!"; - HEAP32[pthread_ptr + 12 >> 2] = 0; - var pthread = PThread.pthreads[pthread_ptr]; - if (pthread) { - var worker = pthread.worker; - PThread.returnWorkerToPool(worker) - } - } - var PThread = { - MAIN_THREAD_ID: 1, - mainThreadInfo: { - schedPolicy: 0, - schedPrio: 0 - }, - unusedWorkers: [], - runningWorkers: [], - initRuntime: function () { - __register_pthread_ptr(PThread.mainThreadBlock, !ENVIRONMENT_IS_WORKER, 1); - _emscripten_register_main_browser_thread_id(PThread.mainThreadBlock) - }, - initMainThreadBlock: function () { - assert(!ENVIRONMENT_IS_PTHREAD); - var pthreadPoolSize = 8; - for (var i = 0; i < pthreadPoolSize; ++i) { - PThread.allocateUnusedWorker() - } - PThread.mainThreadBlock = 12160; - for (var i = 0; i < 232 / 4; ++i) HEAPU32[PThread.mainThreadBlock / 4 + i] = 0; - HEAP32[PThread.mainThreadBlock + 12 >> 2] = PThread.mainThreadBlock; - var headPtr = PThread.mainThreadBlock + 156; - HEAP32[headPtr >> 2] = headPtr; - var tlsMemory = 12400; - for (var i = 0; i < 128; ++i) HEAPU32[tlsMemory / 4 + i] = 0; - Atomics.store(HEAPU32, PThread.mainThreadBlock + 104 >> 2, tlsMemory); - Atomics.store(HEAPU32, PThread.mainThreadBlock + 40 >> 2, PThread.mainThreadBlock); - Atomics.store(HEAPU32, PThread.mainThreadBlock + 44 >> 2, 42) - }, - initWorker: function () {}, - pthreads: {}, - exitHandlers: null, - setThreadStatus: function () {}, - runExitHandlers: function () { - if (PThread.exitHandlers !== null) { - while (PThread.exitHandlers.length > 0) { - PThread.exitHandlers.pop()() - } - PThread.exitHandlers = null - } - if (ENVIRONMENT_IS_PTHREAD && threadInfoStruct) ___pthread_tsd_run_dtors() - }, - threadExit: function (exitCode) { - var tb = _pthread_self(); - if (tb) { - err("Pthread 0x" + tb.toString(16) + " exited."); - Atomics.store(HEAPU32, tb + 4 >> 2, exitCode); - Atomics.store(HEAPU32, tb + 0 >> 2, 1); - Atomics.store(HEAPU32, tb + 60 >> 2, 1); - Atomics.store(HEAPU32, tb + 64 >> 2, 0); - PThread.runExitHandlers(); - _emscripten_futex_wake(tb + 0, 2147483647); - __register_pthread_ptr(0, 0, 0); - threadInfoStruct = 0; - if (ENVIRONMENT_IS_PTHREAD) { - postMessage({ - "cmd": "exit" - }) - } - } - }, - threadCancel: function () { - PThread.runExitHandlers(); - Atomics.store(HEAPU32, threadInfoStruct + 4 >> 2, -1); - Atomics.store(HEAPU32, threadInfoStruct + 0 >> 2, 1); - _emscripten_futex_wake(threadInfoStruct + 0, 2147483647); - threadInfoStruct = selfThreadId = 0; - __register_pthread_ptr(0, 0, 0); - postMessage({ - "cmd": "cancelDone" - }) - }, - terminateAllThreads: function () { - for (var t in PThread.pthreads) { - var pthread = PThread.pthreads[t]; - if (pthread && pthread.worker) { - PThread.returnWorkerToPool(pthread.worker) - } - } - PThread.pthreads = {}; - for (var i = 0; i < PThread.unusedWorkers.length; ++i) { - var worker = PThread.unusedWorkers[i]; - assert(!worker.pthread); - worker.terminate() - } - PThread.unusedWorkers = []; - for (var i = 0; i < PThread.runningWorkers.length; ++i) { - var worker = PThread.runningWorkers[i]; - var pthread = worker.pthread; - assert(pthread, "This Worker should have a pthread it is executing"); - PThread.freeThreadData(pthread); - worker.terminate() - } - PThread.runningWorkers = [] - }, - freeThreadData: function (pthread) { - if (!pthread) return; - if (pthread.threadInfoStruct) { - var tlsMemory = HEAP32[pthread.threadInfoStruct + 104 >> 2]; - HEAP32[pthread.threadInfoStruct + 104 >> 2] = 0; - _free(tlsMemory); - _free(pthread.threadInfoStruct) - } - pthread.threadInfoStruct = 0; - if (pthread.allocatedOwnStack && pthread.stackBase) _free(pthread.stackBase); - pthread.stackBase = 0; - if (pthread.worker) pthread.worker.pthread = null - }, - returnWorkerToPool: function (worker) { - delete PThread.pthreads[worker.pthread.thread]; - PThread.unusedWorkers.push(worker); - PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker), 1); - PThread.freeThreadData(worker.pthread); - worker.pthread = undefined - }, - receiveObjectTransfer: function (data) {}, - loadWasmModuleToWorker: function (worker, onFinishedLoading) { - worker.onmessage = function (e) { - var d = e["data"]; - var cmd = d["cmd"]; - if (worker.pthread) PThread.currentProxiedOperationCallerThread = worker.pthread.threadInfoStruct; - if (d["targetThread"] && d["targetThread"] != _pthread_self()) { - var thread = PThread.pthreads[d.targetThread]; - if (thread) { - thread.worker.postMessage(e.data, d["transferList"]) - } else { - console.error('Internal error! Worker sent a message "' + cmd + '" to target pthread ' + d["targetThread"] + ", but that thread no longer exists!") - } - PThread.currentProxiedOperationCallerThread = undefined; - return - } - if (cmd === "processQueuedMainThreadWork") { - _emscripten_main_thread_process_queued_calls() - } else if (cmd === "spawnThread") { - __spawn_thread(e.data) - } else if (cmd === "cleanupThread") { - __cleanup_thread(d["thread"]) - } else if (cmd === "killThread") { - __kill_thread(d["thread"]) - } else if (cmd === "cancelThread") { - __cancel_thread(d["thread"]) - } else if (cmd === "loaded") { - worker.loaded = true; - if (onFinishedLoading) onFinishedLoading(worker); - if (worker.runPthread) { - worker.runPthread(); - delete worker.runPthread - } - } else if (cmd === "print") { - out("Thread " + d["threadId"] + ": " + d["text"]) - } else if (cmd === "printErr") { - err("Thread " + d["threadId"] + ": " + d["text"]) - } else if (cmd === "alert") { - alert("Thread " + d["threadId"] + ": " + d["text"]) - } else if (cmd === "exit") { - var detached = worker.pthread && Atomics.load(HEAPU32, worker.pthread.thread + 68 >> 2); - if (detached) { - PThread.returnWorkerToPool(worker) - } - } else if (cmd === "cancelDone") { - PThread.returnWorkerToPool(worker) - } else if (cmd === "objectTransfer") { - PThread.receiveObjectTransfer(e.data) - } else if (e.data.target === "setimmediate") { - worker.postMessage(e.data) - } else { - err("worker sent an unknown command " + cmd) - } - PThread.currentProxiedOperationCallerThread = undefined - }; - worker.onerror = function (e) { - err("pthread sent an error! " + e.filename + ":" + e.lineno + ": " + e.message) - }; - if (ENVIRONMENT_IS_NODE) { - worker.on("message", function (data) { - worker.onmessage({ - data: data - }) - }); - worker.on("error", function (data) { - worker.onerror(data) - }); - worker.on("exit", function (data) { - console.log("worker exited - TODO: update the worker queue?") - }) - } - assert(wasmMemory instanceof WebAssembly.Memory, "WebAssembly memory should have been loaded by now!"); - assert(wasmModule instanceof WebAssembly.Module, "WebAssembly Module should have been loaded by now!"); - worker.postMessage({ - "cmd": "load", - "urlOrBlob": Module["mainScriptUrlOrBlob"] || _scriptDir, - "wasmMemory": wasmMemory, - "wasmModule": wasmModule, - "DYNAMIC_BASE": DYNAMIC_BASE, - "DYNAMICTOP_PTR": DYNAMICTOP_PTR - }) - }, - allocateUnusedWorker: function () { - var pthreadMainJs = locateFile("tfjs-backend-wasm.worker.js"); - PThread.unusedWorkers.push(new Worker(pthreadMainJs)) - }, - getNewWorker: function () { - if (PThread.unusedWorkers.length == 0) { - PThread.allocateUnusedWorker(); - PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0]) - } - if (PThread.unusedWorkers.length > 0) return PThread.unusedWorkers.pop(); - else return null - }, - busySpinWait: function (msecs) { - var t = performance.now() + msecs; - while (performance.now() < t) {} - } - }; - - function establishStackSpace(stackTop, stackMax) { - STACK_BASE = STACKTOP = stackTop; - STACK_MAX = stackMax; - ___set_stack_limit(STACK_MAX); - writeStackCookie(); - stackRestore(stackTop) - } - Module["establishStackSpace"] = establishStackSpace; - - function getNoExitRuntime() { - return noExitRuntime - } - Module["getNoExitRuntime"] = getNoExitRuntime; - - function jsStackTrace() { - var err = new Error; - if (!err.stack) { - try { - throw new Error - } catch (e) { - err = e - } - if (!err.stack) { - return "(no stack trace available)" - } - } - return err.stack.toString() - } - - function stackTrace() { - var js = jsStackTrace(); - if (Module["extraStackTrace"]) js += "\n" + Module["extraStackTrace"](); - return demangleAll(js) - } - - function ___assert_fail(condition, filename, line, func) { - abort("Assertion failed: " + UTF8ToString(condition) + ", at: " + [filename ? UTF8ToString(filename) : "unknown filename", line, func ? UTF8ToString(func) : "unknown function"]) - } - var _emscripten_get_now; - if (ENVIRONMENT_IS_NODE) { - _emscripten_get_now = function () { - var t = process["hrtime"](); - return t[0] * 1e3 + t[1] / 1e6 - } - } else if (ENVIRONMENT_IS_PTHREAD) { - _emscripten_get_now = function () { - return performance.now() - Module["__performance_now_clock_drift"] - } - } else if (typeof dateNow !== "undefined") { - _emscripten_get_now = dateNow - } else _emscripten_get_now = function () { - return performance.now() - }; - - function setErrNo(value) { - HEAP32[___errno_location() >> 2] = value; - return value - } - - function _atexit(func, arg) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(1, 1, func, arg); - warnOnce("atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)"); - __ATEXIT__.unshift({ - func: func, - arg: arg - }) - } - - function ___handle_stack_overflow() { - abort("stack overflow") - } - - function __emscripten_notify_thread_queue(targetThreadId, mainThreadId) { - if (targetThreadId == mainThreadId) { - postMessage({ - "cmd": "processQueuedMainThreadWork" - }) - } else if (ENVIRONMENT_IS_PTHREAD) { - postMessage({ - "targetThread": targetThreadId, - "cmd": "processThreadQueue" - }) - } else { - var pthread = PThread.pthreads[targetThreadId]; - var worker = pthread && pthread.worker; - if (!worker) { - err("Cannot send message to thread with ID " + targetThreadId + ", unknown thread ID!"); - return - } - worker.postMessage({ - "cmd": "processThreadQueue" - }) - } - return 1 - } - - function _abort() { - abort() - } - - function _emscripten_conditional_set_current_thread_status(expectedStatus, newStatus) { - expectedStatus = expectedStatus | 0; - newStatus = newStatus | 0 - } - - function _emscripten_futex_wait(addr, val, timeout) { - if (addr <= 0 || addr > HEAP8.length || addr & 3 != 0) return -28; - if (ENVIRONMENT_IS_WORKER) { - var ret = Atomics.wait(HEAP32, addr >> 2, val, timeout); - if (ret === "timed-out") return -73; - if (ret === "not-equal") return -6; - if (ret === "ok") return 0; - throw "Atomics.wait returned an unexpected value " + ret - } else { - var loadedVal = Atomics.load(HEAP32, addr >> 2); - if (val != loadedVal) return -6; - var tNow = performance.now(); - var tEnd = tNow + timeout; - Atomics.store(HEAP32, __main_thread_futex_wait_address >> 2, addr); - var ourWaitAddress = addr; - while (addr == ourWaitAddress) { - tNow = performance.now(); - if (tNow > tEnd) { - return -73 - } - _emscripten_main_thread_process_queued_calls(); - addr = Atomics.load(HEAP32, __main_thread_futex_wait_address >> 2) - } - return 0 - } - } - - function _emscripten_is_main_browser_thread() { - return __pthread_is_main_browser_thread | 0 - } - - function _emscripten_is_main_runtime_thread() { - return __pthread_is_main_runtime_thread | 0 - } - - function _emscripten_memcpy_big(dest, src, num) { - HEAPU8.copyWithin(dest, src, src + num) - } - - function _emscripten_proxy_to_main_thread_js(index, sync) { - var numCallArgs = arguments.length - 2; - if (numCallArgs > 20 - 1) throw "emscripten_proxy_to_main_thread_js: Too many arguments " + numCallArgs + " to proxied function idx=" + index + ", maximum supported is " + (20 - 1) + "!"; - var stack = stackSave(); - var args = stackAlloc(numCallArgs * 8); - var b = args >> 3; - for (var i = 0; i < numCallArgs; i++) { - HEAPF64[b + i] = arguments[2 + i] - } - var ret = _emscripten_run_in_main_runtime_thread_js(index, numCallArgs, args, sync); - stackRestore(stack); - return ret - } - var _emscripten_receive_on_main_thread_js_callArgs = []; - - function readAsmConstArgs(sigPtr, buf) { - if (!readAsmConstArgs.array) { - readAsmConstArgs.array = [] - } - var args = readAsmConstArgs.array; - args.length = 0; - var ch; - while (ch = HEAPU8[sigPtr++]) { - if (ch === 100 || ch === 102) { - buf = buf + 7 & ~7; - args.push(HEAPF64[buf >> 3]); - buf += 8 - } else if (ch === 105) { - buf = buf + 3 & ~3; - args.push(HEAP32[buf >> 2]); - buf += 4 - } else abort("unexpected char in asm const signature " + ch) - } - return args - } - - function _emscripten_receive_on_main_thread_js(index, numCallArgs, args) { - _emscripten_receive_on_main_thread_js_callArgs.length = numCallArgs; - var b = args >> 3; - for (var i = 0; i < numCallArgs; i++) { - _emscripten_receive_on_main_thread_js_callArgs[i] = HEAPF64[b + i] - } - var isEmAsmConst = index < 0; - var func = !isEmAsmConst ? proxiedFunctionTable[index] : ASM_CONSTS[-index - 1]; - if (isEmAsmConst) { - var sigPtr = _emscripten_receive_on_main_thread_js_callArgs[1]; - var varargPtr = _emscripten_receive_on_main_thread_js_callArgs[2]; - var constArgs = readAsmConstArgs(sigPtr, varargPtr); - return func.apply(null, constArgs) - } - assert(func.length == numCallArgs, "Call args mismatch in emscripten_receive_on_main_thread_js"); - return func.apply(null, _emscripten_receive_on_main_thread_js_callArgs) - } - - function abortOnCannotGrowMemory(requestedSize) { - abort("Cannot enlarge memory arrays to size " + requestedSize + " bytes (OOM). Either (1) compile with -s INITIAL_MEMORY=X with X higher than the current value " + HEAP8.length + ", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ") - } - - function _emscripten_resize_heap(requestedSize) { - abortOnCannotGrowMemory(requestedSize) - } - var JSEvents = { - keyEvent: 0, - mouseEvent: 0, - wheelEvent: 0, - uiEvent: 0, - focusEvent: 0, - deviceOrientationEvent: 0, - deviceMotionEvent: 0, - fullscreenChangeEvent: 0, - pointerlockChangeEvent: 0, - visibilityChangeEvent: 0, - touchEvent: 0, - previousFullscreenElement: null, - previousScreenX: null, - previousScreenY: null, - removeEventListenersRegistered: false, - removeAllEventListeners: function () { - for (var i = JSEvents.eventHandlers.length - 1; i >= 0; --i) { - JSEvents._removeHandler(i) - } - JSEvents.eventHandlers = []; - JSEvents.deferredCalls = [] - }, - registerRemoveEventListeners: function () { - if (!JSEvents.removeEventListenersRegistered) { - __ATEXIT__.push(JSEvents.removeAllEventListeners); - JSEvents.removeEventListenersRegistered = true - } - }, - deferredCalls: [], - deferCall: function (targetFunction, precedence, argsList) { - function arraysHaveEqualContent(arrA, arrB) { - if (arrA.length != arrB.length) return false; - for (var i in arrA) { - if (arrA[i] != arrB[i]) return false - } - return true - } - for (var i in JSEvents.deferredCalls) { - var call = JSEvents.deferredCalls[i]; - if (call.targetFunction == targetFunction && arraysHaveEqualContent(call.argsList, argsList)) { - return - } - } - JSEvents.deferredCalls.push({ - targetFunction: targetFunction, - precedence: precedence, - argsList: argsList - }); - JSEvents.deferredCalls.sort(function (x, y) { - return x.precedence < y.precedence - }) - }, - removeDeferredCalls: function (targetFunction) { - for (var i = 0; i < JSEvents.deferredCalls.length; ++i) { - if (JSEvents.deferredCalls[i].targetFunction == targetFunction) { - JSEvents.deferredCalls.splice(i, 1); - --i - } - } - }, - canPerformEventHandlerRequests: function () { - return JSEvents.inEventHandler && JSEvents.currentEventHandler.allowsDeferredCalls - }, - runDeferredCalls: function () { - if (!JSEvents.canPerformEventHandlerRequests()) { - return - } - for (var i = 0; i < JSEvents.deferredCalls.length; ++i) { - var call = JSEvents.deferredCalls[i]; - JSEvents.deferredCalls.splice(i, 1); - --i; - call.targetFunction.apply(null, call.argsList) - } - }, - inEventHandler: 0, - currentEventHandler: null, - eventHandlers: [], - removeAllHandlersOnTarget: function (target, eventTypeString) { - for (var i = 0; i < JSEvents.eventHandlers.length; ++i) { - if (JSEvents.eventHandlers[i].target == target && (!eventTypeString || eventTypeString == JSEvents.eventHandlers[i].eventTypeString)) { - JSEvents._removeHandler(i--) - } - } - }, - _removeHandler: function (i) { - var h = JSEvents.eventHandlers[i]; - h.target.removeEventListener(h.eventTypeString, h.eventListenerFunc, h.useCapture); - JSEvents.eventHandlers.splice(i, 1) - }, - registerOrRemoveHandler: function (eventHandler) { - var jsEventHandler = function jsEventHandler(event) { - ++JSEvents.inEventHandler; - JSEvents.currentEventHandler = eventHandler; - JSEvents.runDeferredCalls(); - eventHandler.handlerFunc(event); - JSEvents.runDeferredCalls(); - --JSEvents.inEventHandler - }; - if (eventHandler.callbackfunc) { - eventHandler.eventListenerFunc = jsEventHandler; - eventHandler.target.addEventListener(eventHandler.eventTypeString, jsEventHandler, eventHandler.useCapture); - JSEvents.eventHandlers.push(eventHandler); - JSEvents.registerRemoveEventListeners() - } else { - for (var i = 0; i < JSEvents.eventHandlers.length; ++i) { - if (JSEvents.eventHandlers[i].target == eventHandler.target && JSEvents.eventHandlers[i].eventTypeString == eventHandler.eventTypeString) { - JSEvents._removeHandler(i--) - } - } - } - }, - queueEventHandlerOnThread_iiii: function (targetThread, eventHandlerFunc, eventTypeId, eventData, userData) { - var stackTop = stackSave(); - var varargs = stackAlloc(12); - HEAP32[varargs >> 2] = eventTypeId; - HEAP32[varargs + 4 >> 2] = eventData; - HEAP32[varargs + 8 >> 2] = userData; - _emscripten_async_queue_on_thread_(targetThread, 637534208, eventHandlerFunc, eventData, varargs); - stackRestore(stackTop) - }, - getTargetThreadForEventCallback: function (targetThread) { - switch (targetThread) { - case 1: - return 0; - case 2: - return PThread.currentProxiedOperationCallerThread; - default: - return targetThread - } - }, - getNodeNameForTarget: function (target) { - if (!target) return ""; - if (target == window) return "#window"; - if (target == screen) return "#screen"; - return target && target.nodeName ? target.nodeName : "" - }, - fullscreenEnabled: function () { - return document.fullscreenEnabled || document.webkitFullscreenEnabled - } - }; - - function stringToNewUTF8(jsString) { - var length = lengthBytesUTF8(jsString) + 1; - var cString = _malloc(length); - stringToUTF8(jsString, cString, length); - return cString - } - - function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread, targetCanvas, width, height) { - var stackTop = stackSave(); - var varargs = stackAlloc(12); - var targetCanvasPtr = 0; - if (targetCanvas) { - targetCanvasPtr = stringToNewUTF8(targetCanvas) - } - HEAP32[varargs >> 2] = targetCanvasPtr; - HEAP32[varargs + 4 >> 2] = width; - HEAP32[varargs + 8 >> 2] = height; - _emscripten_async_queue_on_thread_(targetThread, 657457152, 0, targetCanvasPtr, varargs); - stackRestore(stackTop) - } - - function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread, targetCanvas, width, height) { - targetCanvas = targetCanvas ? UTF8ToString(targetCanvas) : ""; - _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread, targetCanvas, width, height) - } - - function __maybeCStringToJsString(cString) { - return cString === cString + 0 ? UTF8ToString(cString) : cString - } - var __specialEventTargets = [0, typeof document !== "undefined" ? document : 0, typeof window !== "undefined" ? window : 0]; - - function __findEventTarget(target) { - var domElement = __specialEventTargets[target] || (typeof document !== "undefined" ? document.querySelector(__maybeCStringToJsString(target)) : undefined); - return domElement - } - - function __findCanvasEventTarget(target) { - return __findEventTarget(target) - } - - function _emscripten_set_canvas_element_size_calling_thread(target, width, height) { - var canvas = __findCanvasEventTarget(target); - if (!canvas) return -4; - if (canvas.canvasSharedPtr) { - HEAP32[canvas.canvasSharedPtr >> 2] = width; - HEAP32[canvas.canvasSharedPtr + 4 >> 2] = height - } - if (canvas.offscreenCanvas || !canvas.controlTransferredOffscreen) { - if (canvas.offscreenCanvas) canvas = canvas.offscreenCanvas; - var autoResizeViewport = false; - if (canvas.GLctxObject && canvas.GLctxObject.GLctx) { - var prevViewport = canvas.GLctxObject.GLctx.getParameter(2978); - autoResizeViewport = prevViewport[0] === 0 && prevViewport[1] === 0 && prevViewport[2] === canvas.width && prevViewport[3] === canvas.height - } - canvas.width = width; - canvas.height = height; - if (autoResizeViewport) { - canvas.GLctxObject.GLctx.viewport(0, 0, width, height) - } - } else if (canvas.canvasSharedPtr) { - var targetThread = HEAP32[canvas.canvasSharedPtr + 8 >> 2]; - _emscripten_set_offscreencanvas_size_on_target_thread(targetThread, target, width, height); - return 1 - } else { - return -4 - } - return 0 - } - - function _emscripten_set_canvas_element_size_main_thread(target, width, height) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(2, 1, target, width, height); - return _emscripten_set_canvas_element_size_calling_thread(target, width, height) - } - - function _emscripten_set_canvas_element_size(target, width, height) { - var canvas = __findCanvasEventTarget(target); - if (canvas) { - return _emscripten_set_canvas_element_size_calling_thread(target, width, height) - } else { - return _emscripten_set_canvas_element_size_main_thread(target, width, height) - } - } - - function _emscripten_set_current_thread_status(newStatus) { - newStatus = newStatus | 0 - } - - function __webgl_acquireInstancedArraysExtension(ctx) { - var ext = ctx.getExtension("ANGLE_instanced_arrays"); - if (ext) { - ctx["vertexAttribDivisor"] = function (index, divisor) { - ext["vertexAttribDivisorANGLE"](index, divisor) - }; - ctx["drawArraysInstanced"] = function (mode, first, count, primcount) { - ext["drawArraysInstancedANGLE"](mode, first, count, primcount) - }; - ctx["drawElementsInstanced"] = function (mode, count, type, indices, primcount) { - ext["drawElementsInstancedANGLE"](mode, count, type, indices, primcount) - } - } - } - - function __webgl_acquireVertexArrayObjectExtension(ctx) { - var ext = ctx.getExtension("OES_vertex_array_object"); - if (ext) { - ctx["createVertexArray"] = function () { - return ext["createVertexArrayOES"]() - }; - ctx["deleteVertexArray"] = function (vao) { - ext["deleteVertexArrayOES"](vao) - }; - ctx["bindVertexArray"] = function (vao) { - ext["bindVertexArrayOES"](vao) - }; - ctx["isVertexArray"] = function (vao) { - return ext["isVertexArrayOES"](vao) - } - } - } - - function __webgl_acquireDrawBuffersExtension(ctx) { - var ext = ctx.getExtension("WEBGL_draw_buffers"); - if (ext) { - ctx["drawBuffers"] = function (n, bufs) { - ext["drawBuffersWEBGL"](n, bufs) - } - } - } - var GL = { - counter: 1, - lastError: 0, - buffers: [], - mappedBuffers: {}, - programs: [], - framebuffers: [], - renderbuffers: [], - textures: [], - uniforms: [], - shaders: [], - vaos: [], - contexts: {}, - currentContext: null, - offscreenCanvases: {}, - timerQueriesEXT: [], - programInfos: {}, - stringCache: {}, - unpackAlignment: 4, - init: function () { - var miniTempFloatBuffer = new Float32Array(GL.MINI_TEMP_BUFFER_SIZE); - for (var i = 0; i < GL.MINI_TEMP_BUFFER_SIZE; i++) { - GL.miniTempBufferFloatViews[i] = miniTempFloatBuffer.subarray(0, i + 1) - } - var miniTempIntBuffer = new Int32Array(GL.MINI_TEMP_BUFFER_SIZE); - for (var i = 0; i < GL.MINI_TEMP_BUFFER_SIZE; i++) { - GL.miniTempBufferIntViews[i] = miniTempIntBuffer.subarray(0, i + 1) - } - }, - recordError: function recordError(errorCode) { - if (!GL.lastError) { - GL.lastError = errorCode - } - }, - getNewId: function (table) { - var ret = GL.counter++; - for (var i = table.length; i < ret; i++) { - table[i] = null - } - return ret - }, - MINI_TEMP_BUFFER_SIZE: 256, - miniTempBufferFloatViews: [0], - miniTempBufferIntViews: [0], - getSource: function (shader, count, string, length) { - var source = ""; - for (var i = 0; i < count; ++i) { - var len = length ? HEAP32[length + i * 4 >> 2] : -1; - source += UTF8ToString(HEAP32[string + i * 4 >> 2], len < 0 ? undefined : len) - } - return source - }, - createContext: function (canvas, webGLContextAttributes) { - var ctx = canvas.getContext("webgl", webGLContextAttributes); - if (!ctx) return 0; - var handle = GL.registerContext(ctx, webGLContextAttributes); - return handle - }, - registerContext: function (ctx, webGLContextAttributes) { - var handle = _malloc(8); - HEAP32[handle + 4 >> 2] = _pthread_self(); - var context = { - handle: handle, - attributes: webGLContextAttributes, - version: webGLContextAttributes.majorVersion, - GLctx: ctx - }; - if (ctx.canvas) ctx.canvas.GLctxObject = context; - GL.contexts[handle] = context; - if (typeof webGLContextAttributes.enableExtensionsByDefault === "undefined" || webGLContextAttributes.enableExtensionsByDefault) { - GL.initExtensions(context) - } - return handle - }, - makeContextCurrent: function (contextHandle) { - GL.currentContext = GL.contexts[contextHandle]; - Module.ctx = GLctx = GL.currentContext && GL.currentContext.GLctx; - return !(contextHandle && !GLctx) - }, - getContext: function (contextHandle) { - return GL.contexts[contextHandle] - }, - deleteContext: function (contextHandle) { - if (GL.currentContext === GL.contexts[contextHandle]) GL.currentContext = null; - if (typeof JSEvents === "object") JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas); - if (GL.contexts[contextHandle] && GL.contexts[contextHandle].GLctx.canvas) GL.contexts[contextHandle].GLctx.canvas.GLctxObject = undefined; - _free(GL.contexts[contextHandle].handle); - GL.contexts[contextHandle] = null - }, - initExtensions: function (context) { - if (!context) context = GL.currentContext; - if (context.initExtensionsDone) return; - context.initExtensionsDone = true; - var GLctx = context.GLctx; - if (context.version < 2) { - __webgl_acquireInstancedArraysExtension(GLctx); - __webgl_acquireVertexArrayObjectExtension(GLctx); - __webgl_acquireDrawBuffersExtension(GLctx) - } - GLctx.disjointTimerQueryExt = GLctx.getExtension("EXT_disjoint_timer_query"); - var automaticallyEnabledExtensions = ["OES_texture_float", "OES_texture_half_float", "OES_standard_derivatives", "OES_vertex_array_object", "WEBGL_compressed_texture_s3tc", "WEBGL_depth_texture", "OES_element_index_uint", "EXT_texture_filter_anisotropic", "EXT_frag_depth", "WEBGL_draw_buffers", "ANGLE_instanced_arrays", "OES_texture_float_linear", "OES_texture_half_float_linear", "EXT_blend_minmax", "EXT_shader_texture_lod", "EXT_texture_norm16", "WEBGL_compressed_texture_pvrtc", "EXT_color_buffer_half_float", "WEBGL_color_buffer_float", "EXT_sRGB", "WEBGL_compressed_texture_etc1", "EXT_disjoint_timer_query", "WEBGL_compressed_texture_etc", "WEBGL_compressed_texture_astc", "EXT_color_buffer_float", "WEBGL_compressed_texture_s3tc_srgb", "EXT_disjoint_timer_query_webgl2", "WEBKIT_WEBGL_compressed_texture_pvrtc"]; - var exts = GLctx.getSupportedExtensions() || []; - exts.forEach(function (ext) { - if (automaticallyEnabledExtensions.indexOf(ext) != -1) { - GLctx.getExtension(ext) - } - }) - }, - populateUniformTable: function (program) { - var p = GL.programs[program]; - var ptable = GL.programInfos[program] = { - uniforms: {}, - maxUniformLength: 0, - maxAttributeLength: -1, - maxUniformBlockNameLength: -1 - }; - var utable = ptable.uniforms; - var numUniforms = GLctx.getProgramParameter(p, 35718); - for (var i = 0; i < numUniforms; ++i) { - var u = GLctx.getActiveUniform(p, i); - var name = u.name; - ptable.maxUniformLength = Math.max(ptable.maxUniformLength, name.length + 1); - if (name.slice(-1) == "]") { - name = name.slice(0, name.lastIndexOf("[")) - } - var loc = GLctx.getUniformLocation(p, name); - if (loc) { - var id = GL.getNewId(GL.uniforms); - utable[name] = [u.size, id]; - GL.uniforms[id] = loc; - for (var j = 1; j < u.size; ++j) { - var n = name + "[" + j + "]"; - loc = GLctx.getUniformLocation(p, n); - id = GL.getNewId(GL.uniforms); - GL.uniforms[id] = loc - } - } - } - } - }; - var __emscripten_webgl_power_preferences = ["default", "low-power", "high-performance"]; - - function _emscripten_webgl_do_create_context(target, attributes) { - assert(attributes); - var contextAttributes = {}; - var a = attributes >> 2; - contextAttributes["alpha"] = !!HEAP32[a + (0 >> 2)]; - contextAttributes["depth"] = !!HEAP32[a + (4 >> 2)]; - contextAttributes["stencil"] = !!HEAP32[a + (8 >> 2)]; - contextAttributes["antialias"] = !!HEAP32[a + (12 >> 2)]; - contextAttributes["premultipliedAlpha"] = !!HEAP32[a + (16 >> 2)]; - contextAttributes["preserveDrawingBuffer"] = !!HEAP32[a + (20 >> 2)]; - var powerPreference = HEAP32[a + (24 >> 2)]; - contextAttributes["powerPreference"] = __emscripten_webgl_power_preferences[powerPreference]; - contextAttributes["failIfMajorPerformanceCaveat"] = !!HEAP32[a + (28 >> 2)]; - contextAttributes.majorVersion = HEAP32[a + (32 >> 2)]; - contextAttributes.minorVersion = HEAP32[a + (36 >> 2)]; - contextAttributes.enableExtensionsByDefault = HEAP32[a + (40 >> 2)]; - contextAttributes.explicitSwapControl = HEAP32[a + (44 >> 2)]; - contextAttributes.proxyContextToMainThread = HEAP32[a + (48 >> 2)]; - contextAttributes.renderViaOffscreenBackBuffer = HEAP32[a + (52 >> 2)]; - var canvas = __findCanvasEventTarget(target); - if (!canvas) { - return 0 - } - if (contextAttributes.explicitSwapControl) { - return 0 - } - var contextHandle = GL.createContext(canvas, contextAttributes); - return contextHandle - } - - function _emscripten_webgl_create_context(a0, a1) { - return _emscripten_webgl_do_create_context(a0, a1) - } - var PATH = { - splitPath: function (filename) { - var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; - return splitPathRe.exec(filename).slice(1) - }, - normalizeArray: function (parts, allowAboveRoot) { - var up = 0; - for (var i = parts.length - 1; i >= 0; i--) { - var last = parts[i]; - if (last === ".") { - parts.splice(i, 1) - } else if (last === "..") { - parts.splice(i, 1); - up++ - } else if (up) { - parts.splice(i, 1); - up-- - } - } - if (allowAboveRoot) { - for (; up; up--) { - parts.unshift("..") - } - } - return parts - }, - normalize: function (path) { - var isAbsolute = path.charAt(0) === "/", - trailingSlash = path.substr(-1) === "/"; - path = PATH.normalizeArray(path.split("/").filter(function (p) { - return !!p - }), !isAbsolute).join("/"); - if (!path && !isAbsolute) { - path = "." - } - if (path && trailingSlash) { - path += "/" - } - return (isAbsolute ? "/" : "") + path - }, - dirname: function (path) { - var result = PATH.splitPath(path), - root = result[0], - dir = result[1]; - if (!root && !dir) { - return "." - } - if (dir) { - dir = dir.substr(0, dir.length - 1) - } - return root + dir - }, - basename: function (path) { - if (path === "/") return "/"; - var lastSlash = path.lastIndexOf("/"); - if (lastSlash === -1) return path; - return path.substr(lastSlash + 1) - }, - extname: function (path) { - return PATH.splitPath(path)[3] - }, - join: function () { - var paths = Array.prototype.slice.call(arguments, 0); - return PATH.normalize(paths.join("/")) - }, - join2: function (l, r) { - return PATH.normalize(l + "/" + r) - } - }; - var SYSCALLS = { - mappings: {}, - buffers: [null, [], - [] - ], - printChar: function (stream, curr) { - var buffer = SYSCALLS.buffers[stream]; - assert(buffer); - if (curr === 0 || curr === 10) { - (stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0)); - buffer.length = 0 - } else { - buffer.push(curr) - } - }, - varargs: undefined, - get: function () { - assert(SYSCALLS.varargs != undefined); - SYSCALLS.varargs += 4; - var ret = HEAP32[SYSCALLS.varargs - 4 >> 2]; - return ret - }, - getStr: function (ptr) { - var ret = UTF8ToString(ptr); - return ret - }, - get64: function (low, high) { - if (low >= 0) assert(high === 0); - else assert(high === -1); - return low - } - }; - - function _fd_close(fd) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(3, 1, fd); - abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM"); - return 0 - } - - function _fd_seek(fd, offset_low, offset_high, whence, newOffset) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(4, 1, fd, offset_low, offset_high, whence, newOffset); - abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM") - } - - function _fd_write(fd, iov, iovcnt, pnum) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(5, 1, fd, iov, iovcnt, pnum); - var num = 0; - for (var i = 0; i < iovcnt; i++) { - var ptr = HEAP32[iov + i * 8 >> 2]; - var len = HEAP32[iov + (i * 8 + 4) >> 2]; - for (var j = 0; j < len; j++) { - SYSCALLS.printChar(fd, HEAPU8[ptr + j]) - } - num += len - } - HEAP32[pnum >> 2] = num; - return 0 - } - - function _pthread_cleanup_pop(execute) { - var routine = PThread.exitHandlers.pop(); - if (execute) routine() - } - - function _pthread_cleanup_push(routine, arg) { - if (PThread.exitHandlers === null) { - PThread.exitHandlers = [] - } - PThread.exitHandlers.push(function () { - dynCall_vi(routine, arg) - }) - } - - function __spawn_thread(threadParams) { - if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _spawn_thread() can only ever be called from main application thread!"; - var worker = PThread.getNewWorker(); - if (worker.pthread !== undefined) throw "Internal error!"; - if (!threadParams.pthread_ptr) throw "Internal error, no pthread ptr!"; - PThread.runningWorkers.push(worker); - var tlsMemory = _malloc(128 * 4); - for (var i = 0; i < 128; ++i) { - HEAP32[tlsMemory + i * 4 >> 2] = 0 - } - var stackHigh = threadParams.stackBase + threadParams.stackSize; - var pthread = PThread.pthreads[threadParams.pthread_ptr] = { - worker: worker, - stackBase: threadParams.stackBase, - stackSize: threadParams.stackSize, - allocatedOwnStack: threadParams.allocatedOwnStack, - thread: threadParams.pthread_ptr, - threadInfoStruct: threadParams.pthread_ptr - }; - var tis = pthread.threadInfoStruct >> 2; - Atomics.store(HEAPU32, tis + (0 >> 2), 0); - Atomics.store(HEAPU32, tis + (4 >> 2), 0); - Atomics.store(HEAPU32, tis + (8 >> 2), 0); - Atomics.store(HEAPU32, tis + (68 >> 2), threadParams.detached); - Atomics.store(HEAPU32, tis + (104 >> 2), tlsMemory); - Atomics.store(HEAPU32, tis + (48 >> 2), 0); - Atomics.store(HEAPU32, tis + (40 >> 2), pthread.threadInfoStruct); - Atomics.store(HEAPU32, tis + (44 >> 2), 42); - Atomics.store(HEAPU32, tis + (108 >> 2), threadParams.stackSize); - Atomics.store(HEAPU32, tis + (84 >> 2), threadParams.stackSize); - Atomics.store(HEAPU32, tis + (80 >> 2), stackHigh); - Atomics.store(HEAPU32, tis + (108 + 8 >> 2), stackHigh); - Atomics.store(HEAPU32, tis + (108 + 12 >> 2), threadParams.detached); - Atomics.store(HEAPU32, tis + (108 + 20 >> 2), threadParams.schedPolicy); - Atomics.store(HEAPU32, tis + (108 + 24 >> 2), threadParams.schedPrio); - var global_libc = _emscripten_get_global_libc(); - var global_locale = global_libc + 40; - Atomics.store(HEAPU32, tis + (176 >> 2), global_locale); - worker.pthread = pthread; - var msg = { - "cmd": "run", - "start_routine": threadParams.startRoutine, - "arg": threadParams.arg, - "threadInfoStruct": threadParams.pthread_ptr, - "selfThreadId": threadParams.pthread_ptr, - "parentThreadId": threadParams.parent_pthread_ptr, - "stackBase": threadParams.stackBase, - "stackSize": threadParams.stackSize - }; - worker.runPthread = function () { - msg.time = performance.now(); - worker.postMessage(msg, threadParams.transferList) - }; - if (worker.loaded) { - worker.runPthread(); - delete worker.runPthread - } - } - - function _pthread_getschedparam(thread, policy, schedparam) { - if (!policy && !schedparam) return ERRNO_CODES.EINVAL; - if (!thread) { - err("pthread_getschedparam called with a null thread pointer!"); - return ERRNO_CODES.ESRCH - } - var self = HEAP32[thread + 12 >> 2]; - if (self !== thread) { - err("pthread_getschedparam attempted on thread " + thread + ", which does not point to a valid thread, or does not exist anymore!"); - return ERRNO_CODES.ESRCH - } - var schedPolicy = Atomics.load(HEAPU32, thread + 108 + 20 >> 2); - var schedPrio = Atomics.load(HEAPU32, thread + 108 + 24 >> 2); - if (policy) HEAP32[policy >> 2] = schedPolicy; - if (schedparam) HEAP32[schedparam >> 2] = schedPrio; - return 0 - } - - function _pthread_self() { - return __pthread_ptr | 0 - } - Module["_pthread_self"] = _pthread_self; - - function _pthread_create(pthread_ptr, attr, start_routine, arg) { - if (typeof SharedArrayBuffer === "undefined") { - err("Current environment does not support SharedArrayBuffer, pthreads are not available!"); - return 6 - } - if (!pthread_ptr) { - err("pthread_create called with a null thread pointer!"); - return 28 - } - var transferList = []; - var error = 0; - if (ENVIRONMENT_IS_PTHREAD && (transferList.length === 0 || error)) { - return _emscripten_sync_run_in_main_thread_4(687865856, pthread_ptr, attr, start_routine, arg) - } - if (error) return error; - var stackSize = 0; - var stackBase = 0; - var detached = 0; - var schedPolicy = 0; - var schedPrio = 0; - if (attr) { - stackSize = HEAP32[attr >> 2]; - stackSize += 81920; - stackBase = HEAP32[attr + 8 >> 2]; - detached = HEAP32[attr + 12 >> 2] !== 0; - var inheritSched = HEAP32[attr + 16 >> 2] === 0; - if (inheritSched) { - var prevSchedPolicy = HEAP32[attr + 20 >> 2]; - var prevSchedPrio = HEAP32[attr + 24 >> 2]; - var parentThreadPtr = PThread.currentProxiedOperationCallerThread ? PThread.currentProxiedOperationCallerThread : _pthread_self(); - _pthread_getschedparam(parentThreadPtr, attr + 20, attr + 24); - schedPolicy = HEAP32[attr + 20 >> 2]; - schedPrio = HEAP32[attr + 24 >> 2]; - HEAP32[attr + 20 >> 2] = prevSchedPolicy; - HEAP32[attr + 24 >> 2] = prevSchedPrio - } else { - schedPolicy = HEAP32[attr + 20 >> 2]; - schedPrio = HEAP32[attr + 24 >> 2] - } - } else { - stackSize = 2097152 - } - var allocatedOwnStack = stackBase == 0; - if (allocatedOwnStack) { - stackBase = _memalign(16, stackSize) - } else { - stackBase -= stackSize; - assert(stackBase > 0) - } - var threadInfoStruct = _malloc(232); - for (var i = 0; i < 232 >> 2; ++i) HEAPU32[(threadInfoStruct >> 2) + i] = 0; - HEAP32[pthread_ptr >> 2] = threadInfoStruct; - HEAP32[threadInfoStruct + 12 >> 2] = threadInfoStruct; - var headPtr = threadInfoStruct + 156; - HEAP32[headPtr >> 2] = headPtr; - var threadParams = { - stackBase: stackBase, - stackSize: stackSize, - allocatedOwnStack: allocatedOwnStack, - schedPolicy: schedPolicy, - schedPrio: schedPrio, - detached: detached, - startRoutine: start_routine, - pthread_ptr: threadInfoStruct, - parent_pthread_ptr: _pthread_self(), - arg: arg, - transferList: transferList - }; - if (ENVIRONMENT_IS_PTHREAD) { - threadParams.cmd = "spawnThread"; - postMessage(threadParams, transferList) - } else { - __spawn_thread(threadParams) - } - return 0 - } - - function _roundf(d) { - d = +d; - return d >= +0 ? +Math_floor(d + +.5) : +Math_ceil(d - +.5) - } - - function _sysconf(name) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(6, 1, name); - switch (name) { - case 30: - return 16384; - case 85: - var maxHeapSize = HEAPU8.length; - return maxHeapSize / 16384; - case 132: - case 133: - case 12: - case 137: - case 138: - case 15: - case 235: - case 16: - case 17: - case 18: - case 19: - case 20: - case 149: - case 13: - case 10: - case 236: - case 153: - case 9: - case 21: - case 22: - case 159: - case 154: - case 14: - case 77: - case 78: - case 139: - case 80: - case 81: - case 82: - case 68: - case 67: - case 164: - case 11: - case 29: - case 47: - case 48: - case 95: - case 52: - case 51: - case 46: - case 79: - return 200809; - case 27: - case 246: - case 127: - case 128: - case 23: - case 24: - case 160: - case 161: - case 181: - case 182: - case 242: - case 183: - case 184: - case 243: - case 244: - case 245: - case 165: - case 178: - case 179: - case 49: - case 50: - case 168: - case 169: - case 175: - case 170: - case 171: - case 172: - case 97: - case 76: - case 32: - case 173: - case 35: - return -1; - case 176: - case 177: - case 7: - case 155: - case 8: - case 157: - case 125: - case 126: - case 92: - case 93: - case 129: - case 130: - case 131: - case 94: - case 91: - return 1; - case 74: - case 60: - case 69: - case 70: - case 4: - return 1024; - case 31: - case 42: - case 72: - return 32; - case 87: - case 26: - case 33: - return 2147483647; - case 34: - case 1: - return 47839; - case 38: - case 36: - return 99; - case 43: - case 37: - return 2048; - case 0: - return 2097152; - case 3: - return 65536; - case 28: - return 32768; - case 44: - return 32767; - case 75: - return 16384; - case 39: - return 1e3; - case 89: - return 700; - case 71: - return 256; - case 40: - return 255; - case 2: - return 100; - case 180: - return 64; - case 25: - return 20; - case 5: - return 16; - case 6: - return 6; - case 73: - return 4; - case 84: { - if (typeof navigator === "object") return navigator["hardwareConcurrency"] || 1; - return 1 - } - } - setErrNo(28); - return -1 - } - if (!ENVIRONMENT_IS_PTHREAD) PThread.initMainThreadBlock(); - else PThread.initWorker(); - var GLctx; - GL.init(); - var proxiedFunctionTable = [null, _atexit, _emscripten_set_canvas_element_size_main_thread, _fd_close, _fd_seek, _fd_write, _sysconf]; - var asmLibraryArg = { - "__assert_fail": ___assert_fail, - "__handle_stack_overflow": ___handle_stack_overflow, - "_emscripten_notify_thread_queue": __emscripten_notify_thread_queue, - "abort": _abort, - "emscripten_conditional_set_current_thread_status": _emscripten_conditional_set_current_thread_status, - "emscripten_futex_wait": _emscripten_futex_wait, - "emscripten_futex_wake": _emscripten_futex_wake, - "emscripten_get_now": _emscripten_get_now, - "emscripten_is_main_browser_thread": _emscripten_is_main_browser_thread, - "emscripten_is_main_runtime_thread": _emscripten_is_main_runtime_thread, - "emscripten_memcpy_big": _emscripten_memcpy_big, - "emscripten_receive_on_main_thread_js": _emscripten_receive_on_main_thread_js, - "emscripten_resize_heap": _emscripten_resize_heap, - "emscripten_set_canvas_element_size": _emscripten_set_canvas_element_size, - "emscripten_set_current_thread_status": _emscripten_set_current_thread_status, - "emscripten_webgl_create_context": _emscripten_webgl_create_context, - "fd_close": _fd_close, - "fd_seek": _fd_seek, - "fd_write": _fd_write, - "initPthreadsJS": initPthreadsJS, - "memory": wasmMemory || Module["wasmMemory"], - "pthread_cleanup_pop": _pthread_cleanup_pop, - "pthread_cleanup_push": _pthread_cleanup_push, - "pthread_create": _pthread_create, - "pthread_self": _pthread_self, - "roundf": _roundf, - "table": wasmTable - }; - var asm = createWasm(); - Module["asm"] = asm; - var ___wasm_call_ctors = Module["___wasm_call_ctors"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["__wasm_call_ctors"].apply(null, arguments) - }; - var _init = Module["_init"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["init"].apply(null, arguments) - }; - var _register_tensor = Module["_register_tensor"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["register_tensor"].apply(null, arguments) - }; - var _dispose_data = Module["_dispose_data"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["dispose_data"].apply(null, arguments) - }; - var _dispose = Module["_dispose"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["dispose"].apply(null, arguments) - }; - var _Abs = Module["_Abs"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Abs"].apply(null, arguments) - }; - var _Add = Module["_Add"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Add"].apply(null, arguments) - }; - var _AddN = Module["_AddN"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["AddN"].apply(null, arguments) - }; - var _ArgMax = Module["_ArgMax"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["ArgMax"].apply(null, arguments) - }; - var _AvgPool = Module["_AvgPool"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["AvgPool"].apply(null, arguments) - }; - var _BatchMatMul = Module["_BatchMatMul"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["BatchMatMul"].apply(null, arguments) - }; - var _ClipByValue = Module["_ClipByValue"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["ClipByValue"].apply(null, arguments) - }; - var _Conv2D = Module["_Conv2D"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Conv2D"].apply(null, arguments) - }; - var _Cos = Module["_Cos"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Cos"].apply(null, arguments) - }; - var _CropAndResize = Module["_CropAndResize"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["CropAndResize"].apply(null, arguments) - }; - var _DepthwiseConv2dNative = Module["_DepthwiseConv2dNative"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["DepthwiseConv2dNative"].apply(null, arguments) - }; - var _Div = Module["_Div"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Div"].apply(null, arguments) - }; - var _Exp = Module["_Exp"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Exp"].apply(null, arguments) - }; - var _FloorDiv = Module["_FloorDiv"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["FloorDiv"].apply(null, arguments) - }; - var _FusedBatchNorm = Module["_FusedBatchNorm"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["FusedBatchNorm"].apply(null, arguments) - }; - var _FusedConv2D = Module["_FusedConv2D"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["FusedConv2D"].apply(null, arguments) - }; - var _FusedDepthwiseConv2D = Module["_FusedDepthwiseConv2D"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["FusedDepthwiseConv2D"].apply(null, arguments) - }; - var _Gather = Module["_Gather"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Gather"].apply(null, arguments) - }; - var _GatherNd = Module["_GatherNd"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["GatherNd"].apply(null, arguments) - }; - var _Greater = Module["_Greater"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Greater"].apply(null, arguments) - }; - var _GreaterEqual = Module["_GreaterEqual"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["GreaterEqual"].apply(null, arguments) - }; - var _Less = Module["_Less"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Less"].apply(null, arguments) - }; - var _LessEqual = Module["_LessEqual"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["LessEqual"].apply(null, arguments) - }; - var _Log = Module["_Log"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Log"].apply(null, arguments) - }; - var _LogicalAnd = Module["_LogicalAnd"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["LogicalAnd"].apply(null, arguments) - }; - var _Max = Module["_Max"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Max"].apply(null, arguments) - }; - var _MaxPool = Module["_MaxPool"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["MaxPool"].apply(null, arguments) - }; - var _Maximum = Module["_Maximum"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Maximum"].apply(null, arguments) - }; - var _Min = Module["_Min"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Min"].apply(null, arguments) - }; - var _Minimum = Module["_Minimum"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Minimum"].apply(null, arguments) - }; - var _Mul = Module["_Mul"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Mul"].apply(null, arguments) - }; - var _Neg = Module["_Neg"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Neg"].apply(null, arguments) - }; - var _NonMaxSuppressionV3 = Module["_NonMaxSuppressionV3"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["NonMaxSuppressionV3"].apply(null, arguments) - }; - var _NonMaxSuppressionV5 = Module["_NonMaxSuppressionV5"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["NonMaxSuppressionV5"].apply(null, arguments) - }; - var _NotEqual = Module["_NotEqual"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["NotEqual"].apply(null, arguments) - }; - var _PadV2 = Module["_PadV2"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["PadV2"].apply(null, arguments) - }; - var _Pow = Module["_Pow"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Pow"].apply(null, arguments) - }; - var _Prelu = Module["_Prelu"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Prelu"].apply(null, arguments) - }; - var _Relu = Module["_Relu"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Relu"].apply(null, arguments) - }; - var _Relu6 = Module["_Relu6"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Relu6"].apply(null, arguments) - }; - var _ResizeBilinear = Module["_ResizeBilinear"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["ResizeBilinear"].apply(null, arguments) - }; - var _Rsqrt = Module["_Rsqrt"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Rsqrt"].apply(null, arguments) - }; - var _ScatterNd = Module["_ScatterNd"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["ScatterNd"].apply(null, arguments) - }; - var _Sigmoid = Module["_Sigmoid"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Sigmoid"].apply(null, arguments) - }; - var _Sin = Module["_Sin"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Sin"].apply(null, arguments) - }; - var _Softmax = Module["_Softmax"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Softmax"].apply(null, arguments) - }; - var _Sqrt = Module["_Sqrt"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Sqrt"].apply(null, arguments) - }; - var _Square = Module["_Square"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Square"].apply(null, arguments) - }; - var _Sub = Module["_Sub"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Sub"].apply(null, arguments) - }; - var _Sum = Module["_Sum"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Sum"].apply(null, arguments) - }; - var _Tanh = Module["_Tanh"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Tanh"].apply(null, arguments) - }; - var _Tile = Module["_Tile"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Tile"].apply(null, arguments) - }; - var _Transpose = Module["_Transpose"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Transpose"].apply(null, arguments) - }; - var __FusedMatMul = Module["__FusedMatMul"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["_FusedMatMul"].apply(null, arguments) - }; - var _malloc = Module["_malloc"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["malloc"].apply(null, arguments) - }; - var _free = Module["_free"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["free"].apply(null, arguments) - }; - var ___em_js__initPthreadsJS = Module["___em_js__initPthreadsJS"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["__em_js__initPthreadsJS"].apply(null, arguments) - }; - var ___errno_location = Module["___errno_location"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["__errno_location"].apply(null, arguments) - }; - var _emscripten_get_global_libc = Module["_emscripten_get_global_libc"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_get_global_libc"].apply(null, arguments) - }; - var _memalign = Module["_memalign"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["memalign"].apply(null, arguments) - }; - var ___pthread_tsd_run_dtors = Module["___pthread_tsd_run_dtors"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["__pthread_tsd_run_dtors"].apply(null, arguments) - }; - var _emscripten_main_thread_process_queued_calls = Module["_emscripten_main_thread_process_queued_calls"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null, arguments) - }; - var _emscripten_current_thread_process_queued_calls = Module["_emscripten_current_thread_process_queued_calls"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null, arguments) - }; - var _emscripten_register_main_browser_thread_id = Module["_emscripten_register_main_browser_thread_id"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null, arguments) - }; - var _emscripten_main_browser_thread_id = Module["_emscripten_main_browser_thread_id"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_main_browser_thread_id"].apply(null, arguments) - }; - var _emscripten_async_run_in_main_thread = Module["_emscripten_async_run_in_main_thread"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread = Module["_emscripten_sync_run_in_main_thread"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_0 = Module["_emscripten_sync_run_in_main_thread_0"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_1 = Module["_emscripten_sync_run_in_main_thread_1"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_2 = Module["_emscripten_sync_run_in_main_thread_2"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_xprintf_varargs = Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_3 = Module["_emscripten_sync_run_in_main_thread_3"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_4 = Module["_emscripten_sync_run_in_main_thread_4"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_5 = Module["_emscripten_sync_run_in_main_thread_5"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_6 = Module["_emscripten_sync_run_in_main_thread_6"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_7 = Module["_emscripten_sync_run_in_main_thread_7"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null, arguments) - }; - var _emscripten_run_in_main_runtime_thread_js = Module["_emscripten_run_in_main_runtime_thread_js"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null, arguments) - }; - var _emscripten_async_queue_on_thread_ = Module["_emscripten_async_queue_on_thread_"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null, arguments) - }; - var _emscripten_tls_init = Module["_emscripten_tls_init"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_tls_init"].apply(null, arguments) - }; - var ___set_stack_limit = Module["___set_stack_limit"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["__set_stack_limit"].apply(null, arguments) - }; - var stackSave = Module["stackSave"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["stackSave"].apply(null, arguments) - }; - var stackAlloc = Module["stackAlloc"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["stackAlloc"].apply(null, arguments) - }; - var stackRestore = Module["stackRestore"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["stackRestore"].apply(null, arguments) - }; - var dynCall_vi = Module["dynCall_vi"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["dynCall_vi"].apply(null, arguments) - }; - var dynCall_v = Module["dynCall_v"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["dynCall_v"].apply(null, arguments) - }; - var dynCall_ii = Module["dynCall_ii"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["dynCall_ii"].apply(null, arguments) - }; - Module["asm"] = asm; - if (!Object.getOwnPropertyDescriptor(Module, "intArrayFromString")) Module["intArrayFromString"] = function () { - abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "intArrayToString")) Module["intArrayToString"] = function () { - abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "ccall")) Module["ccall"] = function () { - abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - Module["cwrap"] = cwrap; - if (!Object.getOwnPropertyDescriptor(Module, "setValue")) Module["setValue"] = function () { - abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getValue")) Module["getValue"] = function () { - abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "allocate")) Module["allocate"] = function () { - abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getMemory")) Module["getMemory"] = function () { - abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "UTF8ArrayToString")) Module["UTF8ArrayToString"] = function () { - abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "UTF8ToString")) Module["UTF8ToString"] = function () { - abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8Array")) Module["stringToUTF8Array"] = function () { - abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8")) Module["stringToUTF8"] = function () { - abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF8")) Module["lengthBytesUTF8"] = function () { - abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function () { - abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "addOnPreRun")) Module["addOnPreRun"] = function () { - abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "addOnInit")) Module["addOnInit"] = function () { - abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "addOnPreMain")) Module["addOnPreMain"] = function () { - abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "addOnExit")) Module["addOnExit"] = function () { - abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "addOnPostRun")) Module["addOnPostRun"] = function () { - abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeStringToMemory")) Module["writeStringToMemory"] = function () { - abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeArrayToMemory")) Module["writeArrayToMemory"] = function () { - abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeAsciiToMemory")) Module["writeAsciiToMemory"] = function () { - abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "addRunDependency")) Module["addRunDependency"] = function () { - abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "removeRunDependency")) Module["removeRunDependency"] = function () { - abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createFolder")) Module["FS_createFolder"] = function () { - abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createPath")) Module["FS_createPath"] = function () { - abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createDataFile")) Module["FS_createDataFile"] = function () { - abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createPreloadedFile")) Module["FS_createPreloadedFile"] = function () { - abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createLazyFile")) Module["FS_createLazyFile"] = function () { - abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createLink")) Module["FS_createLink"] = function () { - abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createDevice")) Module["FS_createDevice"] = function () { - abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_unlink")) Module["FS_unlink"] = function () { - abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "dynamicAlloc")) Module["dynamicAlloc"] = function () { - abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "loadDynamicLibrary")) Module["loadDynamicLibrary"] = function () { - abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "loadWebAssemblyModule")) Module["loadWebAssemblyModule"] = function () { - abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getLEB")) Module["getLEB"] = function () { - abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getFunctionTables")) Module["getFunctionTables"] = function () { - abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "alignFunctionTables")) Module["alignFunctionTables"] = function () { - abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "registerFunctions")) Module["registerFunctions"] = function () { - abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "addFunction")) Module["addFunction"] = function () { - abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "removeFunction")) Module["removeFunction"] = function () { - abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getFuncWrapper")) Module["getFuncWrapper"] = function () { - abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "prettyPrint")) Module["prettyPrint"] = function () { - abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "makeBigInt")) Module["makeBigInt"] = function () { - abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "dynCall")) Module["dynCall"] = function () { - abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getCompilerSetting")) Module["getCompilerSetting"] = function () { - abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "print")) Module["print"] = function () { - abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "printErr")) Module["printErr"] = function () { - abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getTempRet0")) Module["getTempRet0"] = function () { - abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "setTempRet0")) Module["setTempRet0"] = function () { - abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "callMain")) Module["callMain"] = function () { - abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "abort")) Module["abort"] = function () { - abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToNewUTF8")) Module["stringToNewUTF8"] = function () { - abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "abortOnCannotGrowMemory")) Module["abortOnCannotGrowMemory"] = function () { - abort("'abortOnCannotGrowMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "emscripten_realloc_buffer")) Module["emscripten_realloc_buffer"] = function () { - abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "ENV")) Module["ENV"] = function () { - abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "setjmpId")) Module["setjmpId"] = function () { - abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_CODES")) Module["ERRNO_CODES"] = function () { - abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_MESSAGES")) Module["ERRNO_MESSAGES"] = function () { - abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "setErrNo")) Module["setErrNo"] = function () { - abort("'setErrNo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "DNS")) Module["DNS"] = function () { - abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "GAI_ERRNO_MESSAGES")) Module["GAI_ERRNO_MESSAGES"] = function () { - abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "Protocols")) Module["Protocols"] = function () { - abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "Sockets")) Module["Sockets"] = function () { - abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "UNWIND_CACHE")) Module["UNWIND_CACHE"] = function () { - abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "readAsmConstArgs")) Module["readAsmConstArgs"] = function () { - abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "jstoi_q")) Module["jstoi_q"] = function () { - abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "jstoi_s")) Module["jstoi_s"] = function () { - abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "PATH")) Module["PATH"] = function () { - abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "PATH_FS")) Module["PATH_FS"] = function () { - abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "SYSCALLS")) Module["SYSCALLS"] = function () { - abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "syscallMmap2")) Module["syscallMmap2"] = function () { - abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "syscallMunmap")) Module["syscallMunmap"] = function () { - abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "flush_NO_FILESYSTEM")) Module["flush_NO_FILESYSTEM"] = function () { - abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "JSEvents")) Module["JSEvents"] = function () { - abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "demangle")) Module["demangle"] = function () { - abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "demangleAll")) Module["demangleAll"] = function () { - abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "jsStackTrace")) Module["jsStackTrace"] = function () { - abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function () { - abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getEnvStrings")) Module["getEnvStrings"] = function () { - abort("'getEnvStrings' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64")) Module["writeI53ToI64"] = function () { - abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Clamped")) Module["writeI53ToI64Clamped"] = function () { - abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Signaling")) Module["writeI53ToI64Signaling"] = function () { - abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Clamped")) Module["writeI53ToU64Clamped"] = function () { - abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Signaling")) Module["writeI53ToU64Signaling"] = function () { - abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "readI53FromI64")) Module["readI53FromI64"] = function () { - abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "readI53FromU64")) Module["readI53FromU64"] = function () { - abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "convertI32PairToI53")) Module["convertI32PairToI53"] = function () { - abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "convertU32PairToI53")) Module["convertU32PairToI53"] = function () { - abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "Browser")) Module["Browser"] = function () { - abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "GL")) Module["GL"] = function () { - abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGet")) Module["emscriptenWebGLGet"] = function () { - abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetTexPixelData")) Module["emscriptenWebGLGetTexPixelData"] = function () { - abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetUniform")) Module["emscriptenWebGLGetUniform"] = function () { - abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetVertexAttrib")) Module["emscriptenWebGLGetVertexAttrib"] = function () { - abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "AL")) Module["AL"] = function () { - abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "SDL_unicode")) Module["SDL_unicode"] = function () { - abort("'SDL_unicode' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "SDL_ttfContext")) Module["SDL_ttfContext"] = function () { - abort("'SDL_ttfContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "SDL_audio")) Module["SDL_audio"] = function () { - abort("'SDL_audio' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "SDL")) Module["SDL"] = function () { - abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "SDL_gfx")) Module["SDL_gfx"] = function () { - abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "GLUT")) Module["GLUT"] = function () { - abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "EGL")) Module["EGL"] = function () { - abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "GLFW_Window")) Module["GLFW_Window"] = function () { - abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "GLFW")) Module["GLFW"] = function () { - abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "GLEW")) Module["GLEW"] = function () { - abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "IDBStore")) Module["IDBStore"] = function () { - abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "runAndAbortIfError")) Module["runAndAbortIfError"] = function () { - abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - Module["PThread"] = PThread; - if (!Object.getOwnPropertyDescriptor(Module, "establishStackSpace")) Module["establishStackSpace"] = function () { - abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getNoExitRuntime")) Module["getNoExitRuntime"] = function () { - abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "resetPrototype")) Module["resetPrototype"] = function () { - abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "warnOnce")) Module["warnOnce"] = function () { - abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stackSave")) Module["stackSave"] = function () { - abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stackRestore")) Module["stackRestore"] = function () { - abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stackAlloc")) Module["stackAlloc"] = function () { - abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "AsciiToString")) Module["AsciiToString"] = function () { - abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToAscii")) Module["stringToAscii"] = function () { - abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "UTF16ToString")) Module["UTF16ToString"] = function () { - abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF16")) Module["stringToUTF16"] = function () { - abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF16")) Module["lengthBytesUTF16"] = function () { - abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "UTF32ToString")) Module["UTF32ToString"] = function () { - abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF32")) Module["stringToUTF32"] = function () { - abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF32")) Module["lengthBytesUTF32"] = function () { - abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8")) Module["allocateUTF8"] = function () { - abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8OnStack")) Module["allocateUTF8OnStack"] = function () { - abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - Module["writeStackCookie"] = writeStackCookie; - Module["checkStackCookie"] = checkStackCookie; - Module["abortStackOverflow"] = abortStackOverflow; - Module["PThread"] = PThread; - Module["_pthread_self"] = _pthread_self; - Module["wasmMemory"] = wasmMemory; - Module["ExitStatus"] = ExitStatus; - if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NORMAL")) Object.defineProperty(Module, "ALLOC_NORMAL", { - configurable: true, - get: function () { - abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_STACK")) Object.defineProperty(Module, "ALLOC_STACK", { - configurable: true, - get: function () { - abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_DYNAMIC")) Object.defineProperty(Module, "ALLOC_DYNAMIC", { - configurable: true, - get: function () { - abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NONE")) Object.defineProperty(Module, "ALLOC_NONE", { - configurable: true, - get: function () { - abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - } - }); - var calledRun; - Module["then"] = function (func) { - if (calledRun) { - func(Module) - } else { - var old = Module["onRuntimeInitialized"]; - Module["onRuntimeInitialized"] = function () { - if (old) old(); - func(Module) - } - } - return Module - }; - - function ExitStatus(status) { - this.name = "ExitStatus"; - this.message = "Program terminated with exit(" + status + ")"; - this.status = status - } - dependenciesFulfilled = function runCaller() { - if (!calledRun) run(); - if (!calledRun) dependenciesFulfilled = runCaller - }; - - function run(args) { - args = args || arguments_; - if (runDependencies > 0) { - return - } - writeStackCookie(); - preRun(); - if (runDependencies > 0) return; - - function doRun() { - if (calledRun) return; - calledRun = true; - Module["calledRun"] = true; - if (ABORT) return; - initRuntime(); - preMain(); - if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"](); - assert(!Module["_main"], 'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'); - postRun() - } - if (Module["setStatus"]) { - Module["setStatus"]("Running..."); - setTimeout(function () { - setTimeout(function () { - Module["setStatus"]("") - }, 1); - doRun() - }, 1) - } else { - doRun() - } - checkStackCookie() - } - Module["run"] = run; - if (Module["preInit"]) { - if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]]; - while (Module["preInit"].length > 0) { - Module["preInit"].pop()() - } - } - if (!ENVIRONMENT_IS_PTHREAD) noExitRuntime = true; - if (!ENVIRONMENT_IS_PTHREAD) run(); - - - return WasmBackendModule - } - ); -})(); -if (typeof exports === 'object' && typeof module === 'object') - module.exports = WasmBackendModule; -else if (typeof define === 'function' && define['amd']) - define([], function () { - return WasmBackendModule; - }); -else if (typeof exports === 'object') - exports["WasmBackendModule"] = WasmBackendModule; diff --git a/tfjs-core/benchmarks/wasm_2_threads/tfjs-backend-wasm.wasm b/tfjs-core/benchmarks/wasm_2_threads/tfjs-backend-wasm.wasm deleted file mode 100644 index d58e7a2edf2f399bc4ddf8babda305d4a2698ba1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 156992 zcmeFa3!Gn7dH1{a-v9e$=0C|KnPdXl|4pnRf<}u0(VE#wNI(#1LF+j!CXoy*V+mst*Cfui?_bE^0w4^tnF)+w%U3@a=yQ3?f+$F zG7;_R=W}}ALrC`C>-wx`J?puxXRW{6F}W*n&IO0^7i|xxr``5|ztQycbTDlXx4p!N z{pYslv!`?0b9z;2%2AJhikcktjW2uNxJ&HLi6Hd?Q4`_k6y?5E4dagcEsOa~1e{F|G;<(AolqisQZ z@ZdpvyIC#q7T%(NgPQ?Aym>mfd3(>?F8XFC@a48Io0sMjy3i?@+HDXtXx2TsO-pB^R;Kq2vE11_nninWFA}@wzDbVi&8?Bp#jplneXTpj|$7A zN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Uo(DJ;ddQ=*W-5!es|(`7k+E;djP+O@p}}%zvJh_ z@0V)tX{f7pn}3VE9ku%gibvC zuCJWge{OAk1JUkBj zrdK)#d2n%T=bhM_PEGBUn#!uMYr839sv3?U6wrPHj!FZM*#Jt-6zMS!_V}Lr4;?!E z4CnBp6eRtyt<8 diff --git a/tfjs-core/benchmarks/wasm_4_threads/tfjs-backend-wasm.js b/tfjs-core/benchmarks/wasm_4_threads/tfjs-backend-wasm.js deleted file mode 100755 index 90eb60e4a0f..00000000000 --- a/tfjs-core/benchmarks/wasm_4_threads/tfjs-backend-wasm.js +++ /dev/null @@ -1,3381 +0,0 @@ -var WasmBackendModule = (function () { - var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; - if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; - return ( - function (WasmBackendModule) { - WasmBackendModule = WasmBackendModule || {}; - - var Module = typeof WasmBackendModule !== "undefined" ? WasmBackendModule : {}; - var moduleOverrides = {}; - var key; - for (key in Module) { - if (Module.hasOwnProperty(key)) { - moduleOverrides[key] = Module[key] - } - } - var arguments_ = []; - var thisProgram = "./this.program"; - var quit_ = function (status, toThrow) { - throw toThrow - }; - var ENVIRONMENT_IS_WEB = false; - var ENVIRONMENT_IS_WORKER = false; - var ENVIRONMENT_IS_NODE = false; - var ENVIRONMENT_IS_SHELL = false; - ENVIRONMENT_IS_WEB = typeof window === "object"; - ENVIRONMENT_IS_WORKER = typeof importScripts === "function"; - ENVIRONMENT_IS_NODE = typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string"; - ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER; - if (Module["ENVIRONMENT"]) { - throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)") - } - var ENVIRONMENT_IS_PTHREAD = Module["ENVIRONMENT_IS_PTHREAD"] || false; - if (ENVIRONMENT_IS_PTHREAD) { - buffer = Module["buffer"]; - DYNAMIC_BASE = Module["DYNAMIC_BASE"]; - DYNAMICTOP_PTR = Module["DYNAMICTOP_PTR"] - } - var scriptDirectory = ""; - - function locateFile(path) { - if (Module["locateFile"]) { - return Module["locateFile"](path, scriptDirectory) - } - return scriptDirectory + path - } - var read_, readAsync, readBinary, setWindowTitle; - var nodeFS; - var nodePath; - if (ENVIRONMENT_IS_NODE) { - if (ENVIRONMENT_IS_WORKER) { - scriptDirectory = require("path").dirname(scriptDirectory) + "/" - } else { - scriptDirectory = __dirname + "/" - } - read_ = function shell_read(filename, binary) { - if (!nodeFS) nodeFS = require("fs"); - if (!nodePath) nodePath = require("path"); - filename = nodePath["normalize"](filename); - return nodeFS["readFileSync"](filename, binary ? null : "utf8") - }; - readBinary = function readBinary(filename) { - var ret = read_(filename, true); - if (!ret.buffer) { - ret = new Uint8Array(ret) - } - assert(ret.buffer); - return ret - }; - if (process["argv"].length > 1) { - thisProgram = process["argv"][1].replace(/\\/g, "/") - } - arguments_ = process["argv"].slice(2); - process["on"]("uncaughtException", function (ex) { - if (!(ex instanceof ExitStatus)) { - throw ex - } - }); - process["on"]("unhandledRejection", abort); - quit_ = function (status) { - process["exit"](status) - }; - Module["inspect"] = function () { - return "[Emscripten Module object]" - }; - var nodeWorkerThreads; - try { - nodeWorkerThreads = require("worker_threads") - } catch (e) { - console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'); - throw e - } - Worker = nodeWorkerThreads.Worker - } else if (ENVIRONMENT_IS_SHELL) { - if (typeof read != "undefined") { - read_ = function shell_read(f) { - return read(f) - } - } - readBinary = function readBinary(f) { - var data; - if (typeof readbuffer === "function") { - return new Uint8Array(readbuffer(f)) - } - data = read(f, "binary"); - assert(typeof data === "object"); - return data - }; - if (typeof scriptArgs != "undefined") { - arguments_ = scriptArgs - } else if (typeof arguments != "undefined") { - arguments_ = arguments - } - if (typeof quit === "function") { - quit_ = function (status) { - quit(status) - } - } - if (typeof print !== "undefined") { - if (typeof console === "undefined") console = {}; - console.log = print; - console.warn = console.error = typeof printErr !== "undefined" ? printErr : print - } - } else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { - if (ENVIRONMENT_IS_WORKER) { - scriptDirectory = self.location.href - } else if (document.currentScript) { - scriptDirectory = document.currentScript.src - } - if (_scriptDir) { - scriptDirectory = _scriptDir - } - if (scriptDirectory.indexOf("blob:") !== 0) { - scriptDirectory = scriptDirectory.substr(0, scriptDirectory.lastIndexOf("/") + 1) - } else { - scriptDirectory = "" - } - if (ENVIRONMENT_IS_NODE) { - read_ = function shell_read(filename, binary) { - if (!nodeFS) nodeFS = require("fs"); - if (!nodePath) nodePath = require("path"); - filename = nodePath["normalize"](filename); - return nodeFS["readFileSync"](filename, binary ? null : "utf8") - }; - readBinary = function readBinary(filename) { - var ret = read_(filename, true); - if (!ret.buffer) { - ret = new Uint8Array(ret) - } - assert(ret.buffer); - return ret - } - } else { - read_ = function shell_read(url) { - var xhr = new XMLHttpRequest; - xhr.open("GET", url, false); - xhr.send(null); - return xhr.responseText - }; - if (ENVIRONMENT_IS_WORKER) { - readBinary = function readBinary(url) { - var xhr = new XMLHttpRequest; - xhr.open("GET", url, false); - xhr.responseType = "arraybuffer"; - xhr.send(null); - return new Uint8Array(xhr.response) - } - } - readAsync = function readAsync(url, onload, onerror) { - var xhr = new XMLHttpRequest; - xhr.open("GET", url, true); - xhr.responseType = "arraybuffer"; - xhr.onload = function xhr_onload() { - if (xhr.status == 200 || xhr.status == 0 && xhr.response) { - onload(xhr.response); - return - } - onerror() - }; - xhr.onerror = onerror; - xhr.send(null) - } - } - setWindowTitle = function (title) { - document.title = title - } - } else { - throw new Error("environment detection error") - } - if (ENVIRONMENT_IS_NODE) { - if (typeof performance === "undefined") { - performance = require("perf_hooks").performance - } - } - var out = Module["print"] || console.log.bind(console); - var err = Module["printErr"] || console.warn.bind(console); - for (key in moduleOverrides) { - if (moduleOverrides.hasOwnProperty(key)) { - Module[key] = moduleOverrides[key] - } - } - moduleOverrides = null; - if (Module["arguments"]) arguments_ = Module["arguments"]; - if (!Object.getOwnPropertyDescriptor(Module, "arguments")) Object.defineProperty(Module, "arguments", { - configurable: true, - get: function () { - abort("Module.arguments has been replaced with plain arguments_") - } - }); - if (Module["thisProgram"]) thisProgram = Module["thisProgram"]; - if (!Object.getOwnPropertyDescriptor(Module, "thisProgram")) Object.defineProperty(Module, "thisProgram", { - configurable: true, - get: function () { - abort("Module.thisProgram has been replaced with plain thisProgram") - } - }); - if (Module["quit"]) quit_ = Module["quit"]; - if (!Object.getOwnPropertyDescriptor(Module, "quit")) Object.defineProperty(Module, "quit", { - configurable: true, - get: function () { - abort("Module.quit has been replaced with plain quit_") - } - }); - assert(typeof Module["memoryInitializerPrefixURL"] === "undefined", "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"); - assert(typeof Module["pthreadMainPrefixURL"] === "undefined", "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"); - assert(typeof Module["cdInitializerPrefixURL"] === "undefined", "Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"); - assert(typeof Module["filePackagePrefixURL"] === "undefined", "Module.filePackagePrefixURL option was removed, use Module.locateFile instead"); - assert(typeof Module["read"] === "undefined", "Module.read option was removed (modify read_ in JS)"); - assert(typeof Module["readAsync"] === "undefined", "Module.readAsync option was removed (modify readAsync in JS)"); - assert(typeof Module["readBinary"] === "undefined", "Module.readBinary option was removed (modify readBinary in JS)"); - assert(typeof Module["setWindowTitle"] === "undefined", "Module.setWindowTitle option was removed (modify setWindowTitle in JS)"); - assert(typeof Module["TOTAL_MEMORY"] === "undefined", "Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"); - if (!Object.getOwnPropertyDescriptor(Module, "read")) Object.defineProperty(Module, "read", { - configurable: true, - get: function () { - abort("Module.read has been replaced with plain read_") - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "readAsync")) Object.defineProperty(Module, "readAsync", { - configurable: true, - get: function () { - abort("Module.readAsync has been replaced with plain readAsync") - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "readBinary")) Object.defineProperty(Module, "readBinary", { - configurable: true, - get: function () { - abort("Module.readBinary has been replaced with plain readBinary") - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "setWindowTitle")) Object.defineProperty(Module, "setWindowTitle", { - configurable: true, - get: function () { - abort("Module.setWindowTitle has been replaced with plain setWindowTitle") - } - }); - assert(ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER || ENVIRONMENT_IS_NODE, "Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)"); - var stackSave; - var stackRestore; - var stackAlloc; - stackSave = stackRestore = stackAlloc = function () { - abort("cannot use the stack before compiled code is ready to run, and has provided stack access") - }; - - function warnOnce(text) { - if (!warnOnce.shown) warnOnce.shown = {}; - if (!warnOnce.shown[text]) { - warnOnce.shown[text] = 1; - err(text) - } - } - var Atomics_load = Atomics.load; - var Atomics_store = Atomics.store; - var Atomics_compareExchange = Atomics.compareExchange; - var wasmBinary; - if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"]; - if (!Object.getOwnPropertyDescriptor(Module, "wasmBinary")) Object.defineProperty(Module, "wasmBinary", { - configurable: true, - get: function () { - abort("Module.wasmBinary has been replaced with plain wasmBinary") - } - }); - var noExitRuntime; - if (Module["noExitRuntime"]) noExitRuntime = Module["noExitRuntime"]; - if (!Object.getOwnPropertyDescriptor(Module, "noExitRuntime")) Object.defineProperty(Module, "noExitRuntime", { - configurable: true, - get: function () { - abort("Module.noExitRuntime has been replaced with plain noExitRuntime") - } - }); - if (typeof WebAssembly !== "object") { - abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.") - } - var wasmMemory; - var wasmTable = new WebAssembly.Table({ - "initial": 119, - "maximum": 119 + 0, - "element": "anyfunc" - }); - var wasmModule; - var threadInfoStruct = 0; - var selfThreadId = 0; - var ABORT = false; - var EXITSTATUS = 0; - - function assert(condition, text) { - if (!condition) { - abort("Assertion failed: " + text) - } - } - - function getCFunc(ident) { - var func = Module["_" + ident]; - assert(func, "Cannot call unknown function " + ident + ", make sure it is exported"); - return func - } - - function ccall(ident, returnType, argTypes, args, opts) { - var toC = { - "string": function (str) { - var ret = 0; - if (str !== null && str !== undefined && str !== 0) { - var len = (str.length << 2) + 1; - ret = stackAlloc(len); - stringToUTF8(str, ret, len) - } - return ret - }, - "array": function (arr) { - var ret = stackAlloc(arr.length); - writeArrayToMemory(arr, ret); - return ret - } - }; - - function convertReturnValue(ret) { - if (returnType === "string") return UTF8ToString(ret); - if (returnType === "boolean") return Boolean(ret); - return ret - } - var func = getCFunc(ident); - var cArgs = []; - var stack = 0; - assert(returnType !== "array", 'Return type should not be "array".'); - if (args) { - for (var i = 0; i < args.length; i++) { - var converter = toC[argTypes[i]]; - if (converter) { - if (stack === 0) stack = stackSave(); - cArgs[i] = converter(args[i]) - } else { - cArgs[i] = args[i] - } - } - } - var ret = func.apply(null, cArgs); - ret = convertReturnValue(ret); - if (stack !== 0) stackRestore(stack); - return ret - } - - function cwrap(ident, returnType, argTypes, opts) { - return function () { - return ccall(ident, returnType, argTypes, arguments, opts) - } - } - - function UTF8ArrayToString(heap, idx, maxBytesToRead) { - var endIdx = idx + maxBytesToRead; - var str = ""; - while (!(idx >= endIdx)) { - var u0 = heap[idx++]; - if (!u0) return str; - if (!(u0 & 128)) { - str += String.fromCharCode(u0); - continue - } - var u1 = heap[idx++] & 63; - if ((u0 & 224) == 192) { - str += String.fromCharCode((u0 & 31) << 6 | u1); - continue - } - var u2 = heap[idx++] & 63; - if ((u0 & 240) == 224) { - u0 = (u0 & 15) << 12 | u1 << 6 | u2 - } else { - if ((u0 & 248) != 240) warnOnce("Invalid UTF-8 leading byte 0x" + u0.toString(16) + " encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!"); - u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heap[idx++] & 63 - } - if (u0 < 65536) { - str += String.fromCharCode(u0) - } else { - var ch = u0 - 65536; - str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023) - } - } - return str - } - - function UTF8ToString(ptr, maxBytesToRead) { - return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "" - } - - function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { - if (!(maxBytesToWrite > 0)) return 0; - var startIdx = outIdx; - var endIdx = outIdx + maxBytesToWrite - 1; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) { - var u1 = str.charCodeAt(++i); - u = 65536 + ((u & 1023) << 10) | u1 & 1023 - } - if (u <= 127) { - if (outIdx >= endIdx) break; - heap[outIdx++] = u - } else if (u <= 2047) { - if (outIdx + 1 >= endIdx) break; - heap[outIdx++] = 192 | u >> 6; - heap[outIdx++] = 128 | u & 63 - } else if (u <= 65535) { - if (outIdx + 2 >= endIdx) break; - heap[outIdx++] = 224 | u >> 12; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63 - } else { - if (outIdx + 3 >= endIdx) break; - if (u >= 2097152) warnOnce("Invalid Unicode code point 0x" + u.toString(16) + " encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF)."); - heap[outIdx++] = 240 | u >> 18; - heap[outIdx++] = 128 | u >> 12 & 63; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63 - } - } - heap[outIdx] = 0; - return outIdx - startIdx - } - - function stringToUTF8(str, outPtr, maxBytesToWrite) { - assert(typeof maxBytesToWrite == "number", "stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"); - return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite) - } - - function lengthBytesUTF8(str) { - var len = 0; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; - if (u <= 127) ++len; - else if (u <= 2047) len += 2; - else if (u <= 65535) len += 3; - else len += 4 - } - return len - } - - function writeArrayToMemory(array, buffer) { - assert(array.length >= 0, "writeArrayToMemory array must have a length (should be an array or typed array)"); - HEAP8.set(array, buffer) - } - var WASM_PAGE_SIZE = 65536; - var buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; - - function updateGlobalBufferAndViews(buf) { - buffer = buf; - Module["HEAP8"] = HEAP8 = new Int8Array(buf); - Module["HEAP16"] = HEAP16 = new Int16Array(buf); - Module["HEAP32"] = HEAP32 = new Int32Array(buf); - Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); - Module["HEAPU16"] = HEAPU16 = new Uint16Array(buf); - Module["HEAPU32"] = HEAPU32 = new Uint32Array(buf); - Module["HEAPF32"] = HEAPF32 = new Float32Array(buf); - Module["HEAPF64"] = HEAPF64 = new Float64Array(buf) - } - var STACK_BASE = 5255808, - STACKTOP = STACK_BASE, - STACK_MAX = 12928, - DYNAMIC_BASE = 5255808, - DYNAMICTOP_PTR = 12e3; - assert(STACK_BASE % 16 === 0, "stack must start aligned"); - assert(DYNAMIC_BASE % 16 === 0, "heap must start aligned"); - if (ENVIRONMENT_IS_PTHREAD) { - STACK_MAX = STACKTOP = STACK_MAX = 2147483647 - } - var TOTAL_STACK = 5242880; - if (Module["TOTAL_STACK"]) assert(TOTAL_STACK === Module["TOTAL_STACK"], "the stack size can no longer be determined at runtime"); - var INITIAL_INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 1073741824; - if (!Object.getOwnPropertyDescriptor(Module, "INITIAL_MEMORY")) Object.defineProperty(Module, "INITIAL_MEMORY", { - configurable: true, - get: function () { - abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY") - } - }); - assert(INITIAL_INITIAL_MEMORY >= TOTAL_STACK, "INITIAL_MEMORY should be larger than TOTAL_STACK, was " + INITIAL_INITIAL_MEMORY + "! (TOTAL_STACK=" + TOTAL_STACK + ")"); - assert(typeof Int32Array !== "undefined" && typeof Float64Array !== "undefined" && Int32Array.prototype.subarray !== undefined && Int32Array.prototype.set !== undefined, "JS engine does not provide full typed array support"); - if (ENVIRONMENT_IS_PTHREAD) { - wasmMemory = Module["wasmMemory"]; - buffer = Module["buffer"] - } else { - if (Module["wasmMemory"]) { - wasmMemory = Module["wasmMemory"] - } else { - wasmMemory = new WebAssembly.Memory({ - "initial": INITIAL_INITIAL_MEMORY / WASM_PAGE_SIZE, - "maximum": INITIAL_INITIAL_MEMORY / WASM_PAGE_SIZE, - "shared": true - }); - if (!(wasmMemory.buffer instanceof SharedArrayBuffer)) { - err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"); - if (ENVIRONMENT_IS_NODE) { - console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)") - } - throw Error("bad memory") - } - } - } - if (wasmMemory) { - buffer = wasmMemory.buffer - } - INITIAL_INITIAL_MEMORY = buffer.byteLength; - assert(INITIAL_INITIAL_MEMORY % WASM_PAGE_SIZE === 0); - updateGlobalBufferAndViews(buffer); - if (!ENVIRONMENT_IS_PTHREAD) { - HEAP32[DYNAMICTOP_PTR >> 2] = DYNAMIC_BASE - } - - function writeStackCookie() { - assert((STACK_MAX & 3) == 0); - HEAPU32[(STACK_MAX >> 2) + 1] = 34821223; - HEAPU32[(STACK_MAX >> 2) + 2] = 2310721022; - HEAP32[0] = 1668509029 - } - - function checkStackCookie() { - var cookie1 = HEAPU32[(STACK_MAX >> 2) + 1]; - var cookie2 = HEAPU32[(STACK_MAX >> 2) + 2]; - if (cookie1 != 34821223 || cookie2 != 2310721022) { - abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x" + cookie2.toString(16) + " " + cookie1.toString(16)) - } - if (HEAP32[0] !== 1668509029) abort("Runtime error: The application has corrupted its heap memory area (address zero)!") - } - - function abortStackOverflow(allocSize) { - abort("Stack overflow! Attempted to allocate " + allocSize + " bytes on the stack, but stack has only " + (STACK_MAX - stackSave() + allocSize) + " bytes available!") - }(function () { - var h16 = new Int16Array(1); - var h8 = new Int8Array(h16.buffer); - h16[0] = 25459; - if (h8[0] !== 115 || h8[1] !== 99) throw "Runtime error: expected the system to be little-endian!" - })(); - - function callRuntimeCallbacks(callbacks) { - while (callbacks.length > 0) { - var callback = callbacks.shift(); - if (typeof callback == "function") { - callback(Module); - continue - } - var func = callback.func; - if (typeof func === "number") { - if (callback.arg === undefined) { - Module["dynCall_v"](func) - } else { - Module["dynCall_vi"](func, callback.arg) - } - } else { - func(callback.arg === undefined ? null : callback.arg) - } - } - } - var __ATPRERUN__ = []; - var __ATINIT__ = []; - var __ATMAIN__ = []; - var __ATEXIT__ = []; - var __ATPOSTRUN__ = []; - var runtimeInitialized = false; - var runtimeExited = false; - if (ENVIRONMENT_IS_PTHREAD) runtimeInitialized = true; - - function preRun() { - if (ENVIRONMENT_IS_PTHREAD) return; - if (Module["preRun"]) { - if (typeof Module["preRun"] == "function") Module["preRun"] = [Module["preRun"]]; - while (Module["preRun"].length) { - addOnPreRun(Module["preRun"].shift()) - } - } - callRuntimeCallbacks(__ATPRERUN__) - } - - function initRuntime() { - checkStackCookie(); - assert(!runtimeInitialized); - runtimeInitialized = true; - callRuntimeCallbacks(__ATINIT__) - } - - function preMain() { - checkStackCookie(); - if (ENVIRONMENT_IS_PTHREAD) return; - callRuntimeCallbacks(__ATMAIN__) - } - - function postRun() { - checkStackCookie(); - if (ENVIRONMENT_IS_PTHREAD) return; - if (Module["postRun"]) { - if (typeof Module["postRun"] == "function") Module["postRun"] = [Module["postRun"]]; - while (Module["postRun"].length) { - addOnPostRun(Module["postRun"].shift()) - } - } - callRuntimeCallbacks(__ATPOSTRUN__) - } - - function addOnPreRun(cb) { - __ATPRERUN__.unshift(cb) - } - - function addOnPostRun(cb) { - __ATPOSTRUN__.unshift(cb) - } - assert(Math.imul, "This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); - assert(Math.fround, "This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); - assert(Math.clz32, "This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); - assert(Math.trunc, "This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); - var Math_ceil = Math.ceil; - var Math_floor = Math.floor; - var runDependencies = 0; - var runDependencyWatcher = null; - var dependenciesFulfilled = null; - var runDependencyTracking = {}; - - function addRunDependency(id) { - assert(!ENVIRONMENT_IS_PTHREAD, "addRunDependency cannot be used in a pthread worker"); - runDependencies++; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies) - } - if (id) { - assert(!runDependencyTracking[id]); - runDependencyTracking[id] = 1; - if (runDependencyWatcher === null && typeof setInterval !== "undefined") { - runDependencyWatcher = setInterval(function () { - if (ABORT) { - clearInterval(runDependencyWatcher); - runDependencyWatcher = null; - return - } - var shown = false; - for (var dep in runDependencyTracking) { - if (!shown) { - shown = true; - err("still waiting on run dependencies:") - } - err("dependency: " + dep) - } - if (shown) { - err("(end of list)") - } - }, 1e4) - } - } else { - err("warning: run dependency added without ID") - } - } - - function removeRunDependency(id) { - runDependencies--; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies) - } - if (id) { - assert(runDependencyTracking[id]); - delete runDependencyTracking[id] - } else { - err("warning: run dependency removed without ID") - } - if (runDependencies == 0) { - if (runDependencyWatcher !== null) { - clearInterval(runDependencyWatcher); - runDependencyWatcher = null - } - if (dependenciesFulfilled) { - var callback = dependenciesFulfilled; - dependenciesFulfilled = null; - callback() - } - } - } - Module["preloadedImages"] = {}; - Module["preloadedAudios"] = {}; - - function abort(what) { - if (Module["onAbort"]) { - Module["onAbort"](what) - } - if (ENVIRONMENT_IS_PTHREAD) console.error("Pthread aborting at " + (new Error).stack); - what += ""; - out(what); - err(what); - ABORT = true; - EXITSTATUS = 1; - var output = "abort(" + what + ") at " + stackTrace(); - what = output; - throw new WebAssembly.RuntimeError(what) - } - var FS = { - error: function () { - abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1") - }, - init: function () { - FS.error() - }, - createDataFile: function () { - FS.error() - }, - createPreloadedFile: function () { - FS.error() - }, - createLazyFile: function () { - FS.error() - }, - open: function () { - FS.error() - }, - mkdev: function () { - FS.error() - }, - registerDevice: function () { - FS.error() - }, - analyzePath: function () { - FS.error() - }, - loadFilesFromDB: function () { - FS.error() - }, - ErrnoError: function ErrnoError() { - FS.error() - } - }; - Module["FS_createDataFile"] = FS.createDataFile; - Module["FS_createPreloadedFile"] = FS.createPreloadedFile; - - function hasPrefix(str, prefix) { - return String.prototype.startsWith ? str.startsWith(prefix) : str.indexOf(prefix) === 0 - } - var dataURIPrefix = "data:application/octet-stream;base64,"; - - function isDataURI(filename) { - return hasPrefix(filename, dataURIPrefix) - } - var fileURIPrefix = "file://"; - - function isFileURI(filename) { - return hasPrefix(filename, fileURIPrefix) - } - var wasmBinaryFile = "tfjs-backend-wasm.wasm"; - if (!isDataURI(wasmBinaryFile)) { - wasmBinaryFile = locateFile(wasmBinaryFile) - } - - function getBinary() { - try { - if (wasmBinary) { - return new Uint8Array(wasmBinary) - } - if (readBinary) { - return readBinary(wasmBinaryFile) - } else { - throw "both async and sync fetching of the wasm failed" - } - } catch (err) { - abort(err) - } - } - - function getBinaryPromise() { - if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) && typeof fetch === "function" && !isFileURI(wasmBinaryFile)) { - return fetch(wasmBinaryFile, { - credentials: "same-origin" - }).then(function (response) { - if (!response["ok"]) { - throw "failed to load wasm binary file at '" + wasmBinaryFile + "'" - } - return response["arrayBuffer"]() - }).catch(function () { - return getBinary() - }) - } - return new Promise(function (resolve, reject) { - resolve(getBinary()) - }) - } - - function createWasm() { - var info = { - "env": asmLibraryArg, - "wasi_snapshot_preview1": asmLibraryArg - }; - - function receiveInstance(instance, module) { - var exports = instance.exports; - Module["asm"] = exports; - wasmModule = module; - if (!ENVIRONMENT_IS_PTHREAD) { - var numWorkersToLoad = PThread.unusedWorkers.length; - PThread.unusedWorkers.forEach(function (w) { - PThread.loadWasmModuleToWorker(w, function () { - if (!--numWorkersToLoad) removeRunDependency("wasm-instantiate") - }) - }) - } - } - if (!ENVIRONMENT_IS_PTHREAD) { - addRunDependency("wasm-instantiate") - } - var trueModule = Module; - - function receiveInstantiatedSource(output) { - assert(Module === trueModule, "the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"); - trueModule = null; - receiveInstance(output["instance"], output["module"]) - } - - function instantiateArrayBuffer(receiver) { - return getBinaryPromise().then(function (binary) { - return WebAssembly.instantiate(binary, info) - }).then(receiver, function (reason) { - err("failed to asynchronously prepare wasm: " + reason); - abort(reason) - }) - } - - function instantiateAsync() { - if (!wasmBinary && typeof WebAssembly.instantiateStreaming === "function" && !isDataURI(wasmBinaryFile) && !isFileURI(wasmBinaryFile) && typeof fetch === "function") { - fetch(wasmBinaryFile, { - credentials: "same-origin" - }).then(function (response) { - var result = WebAssembly.instantiateStreaming(response, info); - return result.then(receiveInstantiatedSource, function (reason) { - err("wasm streaming compile failed: " + reason); - err("falling back to ArrayBuffer instantiation"); - instantiateArrayBuffer(receiveInstantiatedSource) - }) - }) - } else { - return instantiateArrayBuffer(receiveInstantiatedSource) - } - } - if (Module["instantiateWasm"]) { - try { - var exports = Module["instantiateWasm"](info, receiveInstance); - return exports - } catch (e) { - err("Module.instantiateWasm callback failed with error: " + e); - return false - } - } - instantiateAsync(); - return {} - } - var ASM_CONSTS = {}; - - function initPthreadsJS() { - PThread.initRuntime() - } - if (!ENVIRONMENT_IS_PTHREAD) __ATINIT__.push({ - func: function () { - ___wasm_call_ctors() - } - }); - - function demangle(func) { - warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"); - return func - } - - function demangleAll(text) { - var regex = /\b_Z[\w\d_]+/g; - return text.replace(regex, function (x) { - var y = demangle(x); - return x === y ? x : y + " [" + x + "]" - }) - } - var __pthread_ptr = 0; - var __pthread_is_main_runtime_thread = 0; - var __pthread_is_main_browser_thread = 0; - - function __register_pthread_ptr(pthreadPtr, isMainBrowserThread, isMainRuntimeThread) { - pthreadPtr = pthreadPtr | 0; - isMainBrowserThread = isMainBrowserThread | 0; - isMainRuntimeThread = isMainRuntimeThread | 0; - __pthread_ptr = pthreadPtr; - __pthread_is_main_browser_thread = isMainBrowserThread; - __pthread_is_main_runtime_thread = isMainRuntimeThread - } - Module["__register_pthread_ptr"] = __register_pthread_ptr; - var ERRNO_CODES = { - EPERM: 63, - ENOENT: 44, - ESRCH: 71, - EINTR: 27, - EIO: 29, - ENXIO: 60, - E2BIG: 1, - ENOEXEC: 45, - EBADF: 8, - ECHILD: 12, - EAGAIN: 6, - EWOULDBLOCK: 6, - ENOMEM: 48, - EACCES: 2, - EFAULT: 21, - ENOTBLK: 105, - EBUSY: 10, - EEXIST: 20, - EXDEV: 75, - ENODEV: 43, - ENOTDIR: 54, - EISDIR: 31, - EINVAL: 28, - ENFILE: 41, - EMFILE: 33, - ENOTTY: 59, - ETXTBSY: 74, - EFBIG: 22, - ENOSPC: 51, - ESPIPE: 70, - EROFS: 69, - EMLINK: 34, - EPIPE: 64, - EDOM: 18, - ERANGE: 68, - ENOMSG: 49, - EIDRM: 24, - ECHRNG: 106, - EL2NSYNC: 156, - EL3HLT: 107, - EL3RST: 108, - ELNRNG: 109, - EUNATCH: 110, - ENOCSI: 111, - EL2HLT: 112, - EDEADLK: 16, - ENOLCK: 46, - EBADE: 113, - EBADR: 114, - EXFULL: 115, - ENOANO: 104, - EBADRQC: 103, - EBADSLT: 102, - EDEADLOCK: 16, - EBFONT: 101, - ENOSTR: 100, - ENODATA: 116, - ETIME: 117, - ENOSR: 118, - ENONET: 119, - ENOPKG: 120, - EREMOTE: 121, - ENOLINK: 47, - EADV: 122, - ESRMNT: 123, - ECOMM: 124, - EPROTO: 65, - EMULTIHOP: 36, - EDOTDOT: 125, - EBADMSG: 9, - ENOTUNIQ: 126, - EBADFD: 127, - EREMCHG: 128, - ELIBACC: 129, - ELIBBAD: 130, - ELIBSCN: 131, - ELIBMAX: 132, - ELIBEXEC: 133, - ENOSYS: 52, - ENOTEMPTY: 55, - ENAMETOOLONG: 37, - ELOOP: 32, - EOPNOTSUPP: 138, - EPFNOSUPPORT: 139, - ECONNRESET: 15, - ENOBUFS: 42, - EAFNOSUPPORT: 5, - EPROTOTYPE: 67, - ENOTSOCK: 57, - ENOPROTOOPT: 50, - ESHUTDOWN: 140, - ECONNREFUSED: 14, - EADDRINUSE: 3, - ECONNABORTED: 13, - ENETUNREACH: 40, - ENETDOWN: 38, - ETIMEDOUT: 73, - EHOSTDOWN: 142, - EHOSTUNREACH: 23, - EINPROGRESS: 26, - EALREADY: 7, - EDESTADDRREQ: 17, - EMSGSIZE: 35, - EPROTONOSUPPORT: 66, - ESOCKTNOSUPPORT: 137, - EADDRNOTAVAIL: 4, - ENETRESET: 39, - EISCONN: 30, - ENOTCONN: 53, - ETOOMANYREFS: 141, - EUSERS: 136, - EDQUOT: 19, - ESTALE: 72, - ENOTSUP: 138, - ENOMEDIUM: 148, - EILSEQ: 25, - EOVERFLOW: 61, - ECANCELED: 11, - ENOTRECOVERABLE: 56, - EOWNERDEAD: 62, - ESTRPIPE: 135 - }; - var __main_thread_futex_wait_address = 12912; - - function _emscripten_futex_wake(addr, count) { - if (addr <= 0 || addr > HEAP8.length || addr & 3 != 0 || count < 0) return -28; - if (count == 0) return 0; - if (count >= 2147483647) count = Infinity; - var mainThreadWaitAddress = Atomics.load(HEAP32, __main_thread_futex_wait_address >> 2); - var mainThreadWoken = 0; - if (mainThreadWaitAddress == addr) { - var loadedAddr = Atomics.compareExchange(HEAP32, __main_thread_futex_wait_address >> 2, mainThreadWaitAddress, 0); - if (loadedAddr == mainThreadWaitAddress) { - --count; - mainThreadWoken = 1; - if (count <= 0) return 1 - } - } - var ret = Atomics.notify(HEAP32, addr >> 2, count); - if (ret >= 0) return ret + mainThreadWoken; - throw "Atomics.notify returned an unexpected value " + ret - } - Module["_emscripten_futex_wake"] = _emscripten_futex_wake; - - function __kill_thread(pthread_ptr) { - if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _kill_thread() can only ever be called from main application thread!"; - if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _kill_thread!"; - HEAP32[pthread_ptr + 12 >> 2] = 0; - var pthread = PThread.pthreads[pthread_ptr]; - pthread.worker.terminate(); - PThread.freeThreadData(pthread); - PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker), 1); - pthread.worker.pthread = undefined - } - - function __cancel_thread(pthread_ptr) { - if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _cancel_thread() can only ever be called from main application thread!"; - if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _cancel_thread!"; - var pthread = PThread.pthreads[pthread_ptr]; - pthread.worker.postMessage({ - "cmd": "cancel" - }) - } - - function __cleanup_thread(pthread_ptr) { - if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _cleanup_thread() can only ever be called from main application thread!"; - if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _cleanup_thread!"; - HEAP32[pthread_ptr + 12 >> 2] = 0; - var pthread = PThread.pthreads[pthread_ptr]; - if (pthread) { - var worker = pthread.worker; - PThread.returnWorkerToPool(worker) - } - } - var PThread = { - MAIN_THREAD_ID: 1, - mainThreadInfo: { - schedPolicy: 0, - schedPrio: 0 - }, - unusedWorkers: [], - runningWorkers: [], - initRuntime: function () { - __register_pthread_ptr(PThread.mainThreadBlock, !ENVIRONMENT_IS_WORKER, 1); - _emscripten_register_main_browser_thread_id(PThread.mainThreadBlock) - }, - initMainThreadBlock: function () { - assert(!ENVIRONMENT_IS_PTHREAD); - var pthreadPoolSize = 8; - for (var i = 0; i < pthreadPoolSize; ++i) { - PThread.allocateUnusedWorker() - } - PThread.mainThreadBlock = 12160; - for (var i = 0; i < 232 / 4; ++i) HEAPU32[PThread.mainThreadBlock / 4 + i] = 0; - HEAP32[PThread.mainThreadBlock + 12 >> 2] = PThread.mainThreadBlock; - var headPtr = PThread.mainThreadBlock + 156; - HEAP32[headPtr >> 2] = headPtr; - var tlsMemory = 12400; - for (var i = 0; i < 128; ++i) HEAPU32[tlsMemory / 4 + i] = 0; - Atomics.store(HEAPU32, PThread.mainThreadBlock + 104 >> 2, tlsMemory); - Atomics.store(HEAPU32, PThread.mainThreadBlock + 40 >> 2, PThread.mainThreadBlock); - Atomics.store(HEAPU32, PThread.mainThreadBlock + 44 >> 2, 42) - }, - initWorker: function () {}, - pthreads: {}, - exitHandlers: null, - setThreadStatus: function () {}, - runExitHandlers: function () { - if (PThread.exitHandlers !== null) { - while (PThread.exitHandlers.length > 0) { - PThread.exitHandlers.pop()() - } - PThread.exitHandlers = null - } - if (ENVIRONMENT_IS_PTHREAD && threadInfoStruct) ___pthread_tsd_run_dtors() - }, - threadExit: function (exitCode) { - var tb = _pthread_self(); - if (tb) { - err("Pthread 0x" + tb.toString(16) + " exited."); - Atomics.store(HEAPU32, tb + 4 >> 2, exitCode); - Atomics.store(HEAPU32, tb + 0 >> 2, 1); - Atomics.store(HEAPU32, tb + 60 >> 2, 1); - Atomics.store(HEAPU32, tb + 64 >> 2, 0); - PThread.runExitHandlers(); - _emscripten_futex_wake(tb + 0, 2147483647); - __register_pthread_ptr(0, 0, 0); - threadInfoStruct = 0; - if (ENVIRONMENT_IS_PTHREAD) { - postMessage({ - "cmd": "exit" - }) - } - } - }, - threadCancel: function () { - PThread.runExitHandlers(); - Atomics.store(HEAPU32, threadInfoStruct + 4 >> 2, -1); - Atomics.store(HEAPU32, threadInfoStruct + 0 >> 2, 1); - _emscripten_futex_wake(threadInfoStruct + 0, 2147483647); - threadInfoStruct = selfThreadId = 0; - __register_pthread_ptr(0, 0, 0); - postMessage({ - "cmd": "cancelDone" - }) - }, - terminateAllThreads: function () { - for (var t in PThread.pthreads) { - var pthread = PThread.pthreads[t]; - if (pthread && pthread.worker) { - PThread.returnWorkerToPool(pthread.worker) - } - } - PThread.pthreads = {}; - for (var i = 0; i < PThread.unusedWorkers.length; ++i) { - var worker = PThread.unusedWorkers[i]; - assert(!worker.pthread); - worker.terminate() - } - PThread.unusedWorkers = []; - for (var i = 0; i < PThread.runningWorkers.length; ++i) { - var worker = PThread.runningWorkers[i]; - var pthread = worker.pthread; - assert(pthread, "This Worker should have a pthread it is executing"); - PThread.freeThreadData(pthread); - worker.terminate() - } - PThread.runningWorkers = [] - }, - freeThreadData: function (pthread) { - if (!pthread) return; - if (pthread.threadInfoStruct) { - var tlsMemory = HEAP32[pthread.threadInfoStruct + 104 >> 2]; - HEAP32[pthread.threadInfoStruct + 104 >> 2] = 0; - _free(tlsMemory); - _free(pthread.threadInfoStruct) - } - pthread.threadInfoStruct = 0; - if (pthread.allocatedOwnStack && pthread.stackBase) _free(pthread.stackBase); - pthread.stackBase = 0; - if (pthread.worker) pthread.worker.pthread = null - }, - returnWorkerToPool: function (worker) { - delete PThread.pthreads[worker.pthread.thread]; - PThread.unusedWorkers.push(worker); - PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker), 1); - PThread.freeThreadData(worker.pthread); - worker.pthread = undefined - }, - receiveObjectTransfer: function (data) {}, - loadWasmModuleToWorker: function (worker, onFinishedLoading) { - worker.onmessage = function (e) { - var d = e["data"]; - var cmd = d["cmd"]; - if (worker.pthread) PThread.currentProxiedOperationCallerThread = worker.pthread.threadInfoStruct; - if (d["targetThread"] && d["targetThread"] != _pthread_self()) { - var thread = PThread.pthreads[d.targetThread]; - if (thread) { - thread.worker.postMessage(e.data, d["transferList"]) - } else { - console.error('Internal error! Worker sent a message "' + cmd + '" to target pthread ' + d["targetThread"] + ", but that thread no longer exists!") - } - PThread.currentProxiedOperationCallerThread = undefined; - return - } - if (cmd === "processQueuedMainThreadWork") { - _emscripten_main_thread_process_queued_calls() - } else if (cmd === "spawnThread") { - __spawn_thread(e.data) - } else if (cmd === "cleanupThread") { - __cleanup_thread(d["thread"]) - } else if (cmd === "killThread") { - __kill_thread(d["thread"]) - } else if (cmd === "cancelThread") { - __cancel_thread(d["thread"]) - } else if (cmd === "loaded") { - worker.loaded = true; - if (onFinishedLoading) onFinishedLoading(worker); - if (worker.runPthread) { - worker.runPthread(); - delete worker.runPthread - } - } else if (cmd === "print") { - out("Thread " + d["threadId"] + ": " + d["text"]) - } else if (cmd === "printErr") { - err("Thread " + d["threadId"] + ": " + d["text"]) - } else if (cmd === "alert") { - alert("Thread " + d["threadId"] + ": " + d["text"]) - } else if (cmd === "exit") { - var detached = worker.pthread && Atomics.load(HEAPU32, worker.pthread.thread + 68 >> 2); - if (detached) { - PThread.returnWorkerToPool(worker) - } - } else if (cmd === "cancelDone") { - PThread.returnWorkerToPool(worker) - } else if (cmd === "objectTransfer") { - PThread.receiveObjectTransfer(e.data) - } else if (e.data.target === "setimmediate") { - worker.postMessage(e.data) - } else { - err("worker sent an unknown command " + cmd) - } - PThread.currentProxiedOperationCallerThread = undefined - }; - worker.onerror = function (e) { - err("pthread sent an error! " + e.filename + ":" + e.lineno + ": " + e.message) - }; - if (ENVIRONMENT_IS_NODE) { - worker.on("message", function (data) { - worker.onmessage({ - data: data - }) - }); - worker.on("error", function (data) { - worker.onerror(data) - }); - worker.on("exit", function (data) { - console.log("worker exited - TODO: update the worker queue?") - }) - } - assert(wasmMemory instanceof WebAssembly.Memory, "WebAssembly memory should have been loaded by now!"); - assert(wasmModule instanceof WebAssembly.Module, "WebAssembly Module should have been loaded by now!"); - worker.postMessage({ - "cmd": "load", - "urlOrBlob": Module["mainScriptUrlOrBlob"] || _scriptDir, - "wasmMemory": wasmMemory, - "wasmModule": wasmModule, - "DYNAMIC_BASE": DYNAMIC_BASE, - "DYNAMICTOP_PTR": DYNAMICTOP_PTR - }) - }, - allocateUnusedWorker: function () { - var pthreadMainJs = locateFile("tfjs-backend-wasm.worker.js"); - PThread.unusedWorkers.push(new Worker(pthreadMainJs)) - }, - getNewWorker: function () { - if (PThread.unusedWorkers.length == 0) { - PThread.allocateUnusedWorker(); - PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0]) - } - if (PThread.unusedWorkers.length > 0) return PThread.unusedWorkers.pop(); - else return null - }, - busySpinWait: function (msecs) { - var t = performance.now() + msecs; - while (performance.now() < t) {} - } - }; - - function establishStackSpace(stackTop, stackMax) { - STACK_BASE = STACKTOP = stackTop; - STACK_MAX = stackMax; - ___set_stack_limit(STACK_MAX); - writeStackCookie(); - stackRestore(stackTop) - } - Module["establishStackSpace"] = establishStackSpace; - - function getNoExitRuntime() { - return noExitRuntime - } - Module["getNoExitRuntime"] = getNoExitRuntime; - - function jsStackTrace() { - var err = new Error; - if (!err.stack) { - try { - throw new Error - } catch (e) { - err = e - } - if (!err.stack) { - return "(no stack trace available)" - } - } - return err.stack.toString() - } - - function stackTrace() { - var js = jsStackTrace(); - if (Module["extraStackTrace"]) js += "\n" + Module["extraStackTrace"](); - return demangleAll(js) - } - - function ___assert_fail(condition, filename, line, func) { - abort("Assertion failed: " + UTF8ToString(condition) + ", at: " + [filename ? UTF8ToString(filename) : "unknown filename", line, func ? UTF8ToString(func) : "unknown function"]) - } - var _emscripten_get_now; - if (ENVIRONMENT_IS_NODE) { - _emscripten_get_now = function () { - var t = process["hrtime"](); - return t[0] * 1e3 + t[1] / 1e6 - } - } else if (ENVIRONMENT_IS_PTHREAD) { - _emscripten_get_now = function () { - return performance.now() - Module["__performance_now_clock_drift"] - } - } else if (typeof dateNow !== "undefined") { - _emscripten_get_now = dateNow - } else _emscripten_get_now = function () { - return performance.now() - }; - - function setErrNo(value) { - HEAP32[___errno_location() >> 2] = value; - return value - } - - function _atexit(func, arg) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(1, 1, func, arg); - warnOnce("atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)"); - __ATEXIT__.unshift({ - func: func, - arg: arg - }) - } - - function ___handle_stack_overflow() { - abort("stack overflow") - } - - function __emscripten_notify_thread_queue(targetThreadId, mainThreadId) { - if (targetThreadId == mainThreadId) { - postMessage({ - "cmd": "processQueuedMainThreadWork" - }) - } else if (ENVIRONMENT_IS_PTHREAD) { - postMessage({ - "targetThread": targetThreadId, - "cmd": "processThreadQueue" - }) - } else { - var pthread = PThread.pthreads[targetThreadId]; - var worker = pthread && pthread.worker; - if (!worker) { - err("Cannot send message to thread with ID " + targetThreadId + ", unknown thread ID!"); - return - } - worker.postMessage({ - "cmd": "processThreadQueue" - }) - } - return 1 - } - - function _abort() { - abort() - } - - function _emscripten_conditional_set_current_thread_status(expectedStatus, newStatus) { - expectedStatus = expectedStatus | 0; - newStatus = newStatus | 0 - } - - function _emscripten_futex_wait(addr, val, timeout) { - if (addr <= 0 || addr > HEAP8.length || addr & 3 != 0) return -28; - if (ENVIRONMENT_IS_WORKER) { - var ret = Atomics.wait(HEAP32, addr >> 2, val, timeout); - if (ret === "timed-out") return -73; - if (ret === "not-equal") return -6; - if (ret === "ok") return 0; - throw "Atomics.wait returned an unexpected value " + ret - } else { - var loadedVal = Atomics.load(HEAP32, addr >> 2); - if (val != loadedVal) return -6; - var tNow = performance.now(); - var tEnd = tNow + timeout; - Atomics.store(HEAP32, __main_thread_futex_wait_address >> 2, addr); - var ourWaitAddress = addr; - while (addr == ourWaitAddress) { - tNow = performance.now(); - if (tNow > tEnd) { - return -73 - } - _emscripten_main_thread_process_queued_calls(); - addr = Atomics.load(HEAP32, __main_thread_futex_wait_address >> 2) - } - return 0 - } - } - - function _emscripten_is_main_browser_thread() { - return __pthread_is_main_browser_thread | 0 - } - - function _emscripten_is_main_runtime_thread() { - return __pthread_is_main_runtime_thread | 0 - } - - function _emscripten_memcpy_big(dest, src, num) { - HEAPU8.copyWithin(dest, src, src + num) - } - - function _emscripten_proxy_to_main_thread_js(index, sync) { - var numCallArgs = arguments.length - 2; - if (numCallArgs > 20 - 1) throw "emscripten_proxy_to_main_thread_js: Too many arguments " + numCallArgs + " to proxied function idx=" + index + ", maximum supported is " + (20 - 1) + "!"; - var stack = stackSave(); - var args = stackAlloc(numCallArgs * 8); - var b = args >> 3; - for (var i = 0; i < numCallArgs; i++) { - HEAPF64[b + i] = arguments[2 + i] - } - var ret = _emscripten_run_in_main_runtime_thread_js(index, numCallArgs, args, sync); - stackRestore(stack); - return ret - } - var _emscripten_receive_on_main_thread_js_callArgs = []; - - function readAsmConstArgs(sigPtr, buf) { - if (!readAsmConstArgs.array) { - readAsmConstArgs.array = [] - } - var args = readAsmConstArgs.array; - args.length = 0; - var ch; - while (ch = HEAPU8[sigPtr++]) { - if (ch === 100 || ch === 102) { - buf = buf + 7 & ~7; - args.push(HEAPF64[buf >> 3]); - buf += 8 - } else if (ch === 105) { - buf = buf + 3 & ~3; - args.push(HEAP32[buf >> 2]); - buf += 4 - } else abort("unexpected char in asm const signature " + ch) - } - return args - } - - function _emscripten_receive_on_main_thread_js(index, numCallArgs, args) { - _emscripten_receive_on_main_thread_js_callArgs.length = numCallArgs; - var b = args >> 3; - for (var i = 0; i < numCallArgs; i++) { - _emscripten_receive_on_main_thread_js_callArgs[i] = HEAPF64[b + i] - } - var isEmAsmConst = index < 0; - var func = !isEmAsmConst ? proxiedFunctionTable[index] : ASM_CONSTS[-index - 1]; - if (isEmAsmConst) { - var sigPtr = _emscripten_receive_on_main_thread_js_callArgs[1]; - var varargPtr = _emscripten_receive_on_main_thread_js_callArgs[2]; - var constArgs = readAsmConstArgs(sigPtr, varargPtr); - return func.apply(null, constArgs) - } - assert(func.length == numCallArgs, "Call args mismatch in emscripten_receive_on_main_thread_js"); - return func.apply(null, _emscripten_receive_on_main_thread_js_callArgs) - } - - function abortOnCannotGrowMemory(requestedSize) { - abort("Cannot enlarge memory arrays to size " + requestedSize + " bytes (OOM). Either (1) compile with -s INITIAL_MEMORY=X with X higher than the current value " + HEAP8.length + ", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ") - } - - function _emscripten_resize_heap(requestedSize) { - abortOnCannotGrowMemory(requestedSize) - } - var JSEvents = { - keyEvent: 0, - mouseEvent: 0, - wheelEvent: 0, - uiEvent: 0, - focusEvent: 0, - deviceOrientationEvent: 0, - deviceMotionEvent: 0, - fullscreenChangeEvent: 0, - pointerlockChangeEvent: 0, - visibilityChangeEvent: 0, - touchEvent: 0, - previousFullscreenElement: null, - previousScreenX: null, - previousScreenY: null, - removeEventListenersRegistered: false, - removeAllEventListeners: function () { - for (var i = JSEvents.eventHandlers.length - 1; i >= 0; --i) { - JSEvents._removeHandler(i) - } - JSEvents.eventHandlers = []; - JSEvents.deferredCalls = [] - }, - registerRemoveEventListeners: function () { - if (!JSEvents.removeEventListenersRegistered) { - __ATEXIT__.push(JSEvents.removeAllEventListeners); - JSEvents.removeEventListenersRegistered = true - } - }, - deferredCalls: [], - deferCall: function (targetFunction, precedence, argsList) { - function arraysHaveEqualContent(arrA, arrB) { - if (arrA.length != arrB.length) return false; - for (var i in arrA) { - if (arrA[i] != arrB[i]) return false - } - return true - } - for (var i in JSEvents.deferredCalls) { - var call = JSEvents.deferredCalls[i]; - if (call.targetFunction == targetFunction && arraysHaveEqualContent(call.argsList, argsList)) { - return - } - } - JSEvents.deferredCalls.push({ - targetFunction: targetFunction, - precedence: precedence, - argsList: argsList - }); - JSEvents.deferredCalls.sort(function (x, y) { - return x.precedence < y.precedence - }) - }, - removeDeferredCalls: function (targetFunction) { - for (var i = 0; i < JSEvents.deferredCalls.length; ++i) { - if (JSEvents.deferredCalls[i].targetFunction == targetFunction) { - JSEvents.deferredCalls.splice(i, 1); - --i - } - } - }, - canPerformEventHandlerRequests: function () { - return JSEvents.inEventHandler && JSEvents.currentEventHandler.allowsDeferredCalls - }, - runDeferredCalls: function () { - if (!JSEvents.canPerformEventHandlerRequests()) { - return - } - for (var i = 0; i < JSEvents.deferredCalls.length; ++i) { - var call = JSEvents.deferredCalls[i]; - JSEvents.deferredCalls.splice(i, 1); - --i; - call.targetFunction.apply(null, call.argsList) - } - }, - inEventHandler: 0, - currentEventHandler: null, - eventHandlers: [], - removeAllHandlersOnTarget: function (target, eventTypeString) { - for (var i = 0; i < JSEvents.eventHandlers.length; ++i) { - if (JSEvents.eventHandlers[i].target == target && (!eventTypeString || eventTypeString == JSEvents.eventHandlers[i].eventTypeString)) { - JSEvents._removeHandler(i--) - } - } - }, - _removeHandler: function (i) { - var h = JSEvents.eventHandlers[i]; - h.target.removeEventListener(h.eventTypeString, h.eventListenerFunc, h.useCapture); - JSEvents.eventHandlers.splice(i, 1) - }, - registerOrRemoveHandler: function (eventHandler) { - var jsEventHandler = function jsEventHandler(event) { - ++JSEvents.inEventHandler; - JSEvents.currentEventHandler = eventHandler; - JSEvents.runDeferredCalls(); - eventHandler.handlerFunc(event); - JSEvents.runDeferredCalls(); - --JSEvents.inEventHandler - }; - if (eventHandler.callbackfunc) { - eventHandler.eventListenerFunc = jsEventHandler; - eventHandler.target.addEventListener(eventHandler.eventTypeString, jsEventHandler, eventHandler.useCapture); - JSEvents.eventHandlers.push(eventHandler); - JSEvents.registerRemoveEventListeners() - } else { - for (var i = 0; i < JSEvents.eventHandlers.length; ++i) { - if (JSEvents.eventHandlers[i].target == eventHandler.target && JSEvents.eventHandlers[i].eventTypeString == eventHandler.eventTypeString) { - JSEvents._removeHandler(i--) - } - } - } - }, - queueEventHandlerOnThread_iiii: function (targetThread, eventHandlerFunc, eventTypeId, eventData, userData) { - var stackTop = stackSave(); - var varargs = stackAlloc(12); - HEAP32[varargs >> 2] = eventTypeId; - HEAP32[varargs + 4 >> 2] = eventData; - HEAP32[varargs + 8 >> 2] = userData; - _emscripten_async_queue_on_thread_(targetThread, 637534208, eventHandlerFunc, eventData, varargs); - stackRestore(stackTop) - }, - getTargetThreadForEventCallback: function (targetThread) { - switch (targetThread) { - case 1: - return 0; - case 2: - return PThread.currentProxiedOperationCallerThread; - default: - return targetThread - } - }, - getNodeNameForTarget: function (target) { - if (!target) return ""; - if (target == window) return "#window"; - if (target == screen) return "#screen"; - return target && target.nodeName ? target.nodeName : "" - }, - fullscreenEnabled: function () { - return document.fullscreenEnabled || document.webkitFullscreenEnabled - } - }; - - function stringToNewUTF8(jsString) { - var length = lengthBytesUTF8(jsString) + 1; - var cString = _malloc(length); - stringToUTF8(jsString, cString, length); - return cString - } - - function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread, targetCanvas, width, height) { - var stackTop = stackSave(); - var varargs = stackAlloc(12); - var targetCanvasPtr = 0; - if (targetCanvas) { - targetCanvasPtr = stringToNewUTF8(targetCanvas) - } - HEAP32[varargs >> 2] = targetCanvasPtr; - HEAP32[varargs + 4 >> 2] = width; - HEAP32[varargs + 8 >> 2] = height; - _emscripten_async_queue_on_thread_(targetThread, 657457152, 0, targetCanvasPtr, varargs); - stackRestore(stackTop) - } - - function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread, targetCanvas, width, height) { - targetCanvas = targetCanvas ? UTF8ToString(targetCanvas) : ""; - _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread, targetCanvas, width, height) - } - - function __maybeCStringToJsString(cString) { - return cString === cString + 0 ? UTF8ToString(cString) : cString - } - var __specialEventTargets = [0, typeof document !== "undefined" ? document : 0, typeof window !== "undefined" ? window : 0]; - - function __findEventTarget(target) { - var domElement = __specialEventTargets[target] || (typeof document !== "undefined" ? document.querySelector(__maybeCStringToJsString(target)) : undefined); - return domElement - } - - function __findCanvasEventTarget(target) { - return __findEventTarget(target) - } - - function _emscripten_set_canvas_element_size_calling_thread(target, width, height) { - var canvas = __findCanvasEventTarget(target); - if (!canvas) return -4; - if (canvas.canvasSharedPtr) { - HEAP32[canvas.canvasSharedPtr >> 2] = width; - HEAP32[canvas.canvasSharedPtr + 4 >> 2] = height - } - if (canvas.offscreenCanvas || !canvas.controlTransferredOffscreen) { - if (canvas.offscreenCanvas) canvas = canvas.offscreenCanvas; - var autoResizeViewport = false; - if (canvas.GLctxObject && canvas.GLctxObject.GLctx) { - var prevViewport = canvas.GLctxObject.GLctx.getParameter(2978); - autoResizeViewport = prevViewport[0] === 0 && prevViewport[1] === 0 && prevViewport[2] === canvas.width && prevViewport[3] === canvas.height - } - canvas.width = width; - canvas.height = height; - if (autoResizeViewport) { - canvas.GLctxObject.GLctx.viewport(0, 0, width, height) - } - } else if (canvas.canvasSharedPtr) { - var targetThread = HEAP32[canvas.canvasSharedPtr + 8 >> 2]; - _emscripten_set_offscreencanvas_size_on_target_thread(targetThread, target, width, height); - return 1 - } else { - return -4 - } - return 0 - } - - function _emscripten_set_canvas_element_size_main_thread(target, width, height) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(2, 1, target, width, height); - return _emscripten_set_canvas_element_size_calling_thread(target, width, height) - } - - function _emscripten_set_canvas_element_size(target, width, height) { - var canvas = __findCanvasEventTarget(target); - if (canvas) { - return _emscripten_set_canvas_element_size_calling_thread(target, width, height) - } else { - return _emscripten_set_canvas_element_size_main_thread(target, width, height) - } - } - - function _emscripten_set_current_thread_status(newStatus) { - newStatus = newStatus | 0 - } - - function __webgl_acquireInstancedArraysExtension(ctx) { - var ext = ctx.getExtension("ANGLE_instanced_arrays"); - if (ext) { - ctx["vertexAttribDivisor"] = function (index, divisor) { - ext["vertexAttribDivisorANGLE"](index, divisor) - }; - ctx["drawArraysInstanced"] = function (mode, first, count, primcount) { - ext["drawArraysInstancedANGLE"](mode, first, count, primcount) - }; - ctx["drawElementsInstanced"] = function (mode, count, type, indices, primcount) { - ext["drawElementsInstancedANGLE"](mode, count, type, indices, primcount) - } - } - } - - function __webgl_acquireVertexArrayObjectExtension(ctx) { - var ext = ctx.getExtension("OES_vertex_array_object"); - if (ext) { - ctx["createVertexArray"] = function () { - return ext["createVertexArrayOES"]() - }; - ctx["deleteVertexArray"] = function (vao) { - ext["deleteVertexArrayOES"](vao) - }; - ctx["bindVertexArray"] = function (vao) { - ext["bindVertexArrayOES"](vao) - }; - ctx["isVertexArray"] = function (vao) { - return ext["isVertexArrayOES"](vao) - } - } - } - - function __webgl_acquireDrawBuffersExtension(ctx) { - var ext = ctx.getExtension("WEBGL_draw_buffers"); - if (ext) { - ctx["drawBuffers"] = function (n, bufs) { - ext["drawBuffersWEBGL"](n, bufs) - } - } - } - var GL = { - counter: 1, - lastError: 0, - buffers: [], - mappedBuffers: {}, - programs: [], - framebuffers: [], - renderbuffers: [], - textures: [], - uniforms: [], - shaders: [], - vaos: [], - contexts: {}, - currentContext: null, - offscreenCanvases: {}, - timerQueriesEXT: [], - programInfos: {}, - stringCache: {}, - unpackAlignment: 4, - init: function () { - var miniTempFloatBuffer = new Float32Array(GL.MINI_TEMP_BUFFER_SIZE); - for (var i = 0; i < GL.MINI_TEMP_BUFFER_SIZE; i++) { - GL.miniTempBufferFloatViews[i] = miniTempFloatBuffer.subarray(0, i + 1) - } - var miniTempIntBuffer = new Int32Array(GL.MINI_TEMP_BUFFER_SIZE); - for (var i = 0; i < GL.MINI_TEMP_BUFFER_SIZE; i++) { - GL.miniTempBufferIntViews[i] = miniTempIntBuffer.subarray(0, i + 1) - } - }, - recordError: function recordError(errorCode) { - if (!GL.lastError) { - GL.lastError = errorCode - } - }, - getNewId: function (table) { - var ret = GL.counter++; - for (var i = table.length; i < ret; i++) { - table[i] = null - } - return ret - }, - MINI_TEMP_BUFFER_SIZE: 256, - miniTempBufferFloatViews: [0], - miniTempBufferIntViews: [0], - getSource: function (shader, count, string, length) { - var source = ""; - for (var i = 0; i < count; ++i) { - var len = length ? HEAP32[length + i * 4 >> 2] : -1; - source += UTF8ToString(HEAP32[string + i * 4 >> 2], len < 0 ? undefined : len) - } - return source - }, - createContext: function (canvas, webGLContextAttributes) { - var ctx = canvas.getContext("webgl", webGLContextAttributes); - if (!ctx) return 0; - var handle = GL.registerContext(ctx, webGLContextAttributes); - return handle - }, - registerContext: function (ctx, webGLContextAttributes) { - var handle = _malloc(8); - HEAP32[handle + 4 >> 2] = _pthread_self(); - var context = { - handle: handle, - attributes: webGLContextAttributes, - version: webGLContextAttributes.majorVersion, - GLctx: ctx - }; - if (ctx.canvas) ctx.canvas.GLctxObject = context; - GL.contexts[handle] = context; - if (typeof webGLContextAttributes.enableExtensionsByDefault === "undefined" || webGLContextAttributes.enableExtensionsByDefault) { - GL.initExtensions(context) - } - return handle - }, - makeContextCurrent: function (contextHandle) { - GL.currentContext = GL.contexts[contextHandle]; - Module.ctx = GLctx = GL.currentContext && GL.currentContext.GLctx; - return !(contextHandle && !GLctx) - }, - getContext: function (contextHandle) { - return GL.contexts[contextHandle] - }, - deleteContext: function (contextHandle) { - if (GL.currentContext === GL.contexts[contextHandle]) GL.currentContext = null; - if (typeof JSEvents === "object") JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas); - if (GL.contexts[contextHandle] && GL.contexts[contextHandle].GLctx.canvas) GL.contexts[contextHandle].GLctx.canvas.GLctxObject = undefined; - _free(GL.contexts[contextHandle].handle); - GL.contexts[contextHandle] = null - }, - initExtensions: function (context) { - if (!context) context = GL.currentContext; - if (context.initExtensionsDone) return; - context.initExtensionsDone = true; - var GLctx = context.GLctx; - if (context.version < 2) { - __webgl_acquireInstancedArraysExtension(GLctx); - __webgl_acquireVertexArrayObjectExtension(GLctx); - __webgl_acquireDrawBuffersExtension(GLctx) - } - GLctx.disjointTimerQueryExt = GLctx.getExtension("EXT_disjoint_timer_query"); - var automaticallyEnabledExtensions = ["OES_texture_float", "OES_texture_half_float", "OES_standard_derivatives", "OES_vertex_array_object", "WEBGL_compressed_texture_s3tc", "WEBGL_depth_texture", "OES_element_index_uint", "EXT_texture_filter_anisotropic", "EXT_frag_depth", "WEBGL_draw_buffers", "ANGLE_instanced_arrays", "OES_texture_float_linear", "OES_texture_half_float_linear", "EXT_blend_minmax", "EXT_shader_texture_lod", "EXT_texture_norm16", "WEBGL_compressed_texture_pvrtc", "EXT_color_buffer_half_float", "WEBGL_color_buffer_float", "EXT_sRGB", "WEBGL_compressed_texture_etc1", "EXT_disjoint_timer_query", "WEBGL_compressed_texture_etc", "WEBGL_compressed_texture_astc", "EXT_color_buffer_float", "WEBGL_compressed_texture_s3tc_srgb", "EXT_disjoint_timer_query_webgl2", "WEBKIT_WEBGL_compressed_texture_pvrtc"]; - var exts = GLctx.getSupportedExtensions() || []; - exts.forEach(function (ext) { - if (automaticallyEnabledExtensions.indexOf(ext) != -1) { - GLctx.getExtension(ext) - } - }) - }, - populateUniformTable: function (program) { - var p = GL.programs[program]; - var ptable = GL.programInfos[program] = { - uniforms: {}, - maxUniformLength: 0, - maxAttributeLength: -1, - maxUniformBlockNameLength: -1 - }; - var utable = ptable.uniforms; - var numUniforms = GLctx.getProgramParameter(p, 35718); - for (var i = 0; i < numUniforms; ++i) { - var u = GLctx.getActiveUniform(p, i); - var name = u.name; - ptable.maxUniformLength = Math.max(ptable.maxUniformLength, name.length + 1); - if (name.slice(-1) == "]") { - name = name.slice(0, name.lastIndexOf("[")) - } - var loc = GLctx.getUniformLocation(p, name); - if (loc) { - var id = GL.getNewId(GL.uniforms); - utable[name] = [u.size, id]; - GL.uniforms[id] = loc; - for (var j = 1; j < u.size; ++j) { - var n = name + "[" + j + "]"; - loc = GLctx.getUniformLocation(p, n); - id = GL.getNewId(GL.uniforms); - GL.uniforms[id] = loc - } - } - } - } - }; - var __emscripten_webgl_power_preferences = ["default", "low-power", "high-performance"]; - - function _emscripten_webgl_do_create_context(target, attributes) { - assert(attributes); - var contextAttributes = {}; - var a = attributes >> 2; - contextAttributes["alpha"] = !!HEAP32[a + (0 >> 2)]; - contextAttributes["depth"] = !!HEAP32[a + (4 >> 2)]; - contextAttributes["stencil"] = !!HEAP32[a + (8 >> 2)]; - contextAttributes["antialias"] = !!HEAP32[a + (12 >> 2)]; - contextAttributes["premultipliedAlpha"] = !!HEAP32[a + (16 >> 2)]; - contextAttributes["preserveDrawingBuffer"] = !!HEAP32[a + (20 >> 2)]; - var powerPreference = HEAP32[a + (24 >> 2)]; - contextAttributes["powerPreference"] = __emscripten_webgl_power_preferences[powerPreference]; - contextAttributes["failIfMajorPerformanceCaveat"] = !!HEAP32[a + (28 >> 2)]; - contextAttributes.majorVersion = HEAP32[a + (32 >> 2)]; - contextAttributes.minorVersion = HEAP32[a + (36 >> 2)]; - contextAttributes.enableExtensionsByDefault = HEAP32[a + (40 >> 2)]; - contextAttributes.explicitSwapControl = HEAP32[a + (44 >> 2)]; - contextAttributes.proxyContextToMainThread = HEAP32[a + (48 >> 2)]; - contextAttributes.renderViaOffscreenBackBuffer = HEAP32[a + (52 >> 2)]; - var canvas = __findCanvasEventTarget(target); - if (!canvas) { - return 0 - } - if (contextAttributes.explicitSwapControl) { - return 0 - } - var contextHandle = GL.createContext(canvas, contextAttributes); - return contextHandle - } - - function _emscripten_webgl_create_context(a0, a1) { - return _emscripten_webgl_do_create_context(a0, a1) - } - var PATH = { - splitPath: function (filename) { - var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; - return splitPathRe.exec(filename).slice(1) - }, - normalizeArray: function (parts, allowAboveRoot) { - var up = 0; - for (var i = parts.length - 1; i >= 0; i--) { - var last = parts[i]; - if (last === ".") { - parts.splice(i, 1) - } else if (last === "..") { - parts.splice(i, 1); - up++ - } else if (up) { - parts.splice(i, 1); - up-- - } - } - if (allowAboveRoot) { - for (; up; up--) { - parts.unshift("..") - } - } - return parts - }, - normalize: function (path) { - var isAbsolute = path.charAt(0) === "/", - trailingSlash = path.substr(-1) === "/"; - path = PATH.normalizeArray(path.split("/").filter(function (p) { - return !!p - }), !isAbsolute).join("/"); - if (!path && !isAbsolute) { - path = "." - } - if (path && trailingSlash) { - path += "/" - } - return (isAbsolute ? "/" : "") + path - }, - dirname: function (path) { - var result = PATH.splitPath(path), - root = result[0], - dir = result[1]; - if (!root && !dir) { - return "." - } - if (dir) { - dir = dir.substr(0, dir.length - 1) - } - return root + dir - }, - basename: function (path) { - if (path === "/") return "/"; - var lastSlash = path.lastIndexOf("/"); - if (lastSlash === -1) return path; - return path.substr(lastSlash + 1) - }, - extname: function (path) { - return PATH.splitPath(path)[3] - }, - join: function () { - var paths = Array.prototype.slice.call(arguments, 0); - return PATH.normalize(paths.join("/")) - }, - join2: function (l, r) { - return PATH.normalize(l + "/" + r) - } - }; - var SYSCALLS = { - mappings: {}, - buffers: [null, [], - [] - ], - printChar: function (stream, curr) { - var buffer = SYSCALLS.buffers[stream]; - assert(buffer); - if (curr === 0 || curr === 10) { - (stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0)); - buffer.length = 0 - } else { - buffer.push(curr) - } - }, - varargs: undefined, - get: function () { - assert(SYSCALLS.varargs != undefined); - SYSCALLS.varargs += 4; - var ret = HEAP32[SYSCALLS.varargs - 4 >> 2]; - return ret - }, - getStr: function (ptr) { - var ret = UTF8ToString(ptr); - return ret - }, - get64: function (low, high) { - if (low >= 0) assert(high === 0); - else assert(high === -1); - return low - } - }; - - function _fd_close(fd) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(3, 1, fd); - abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM"); - return 0 - } - - function _fd_seek(fd, offset_low, offset_high, whence, newOffset) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(4, 1, fd, offset_low, offset_high, whence, newOffset); - abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM") - } - - function _fd_write(fd, iov, iovcnt, pnum) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(5, 1, fd, iov, iovcnt, pnum); - var num = 0; - for (var i = 0; i < iovcnt; i++) { - var ptr = HEAP32[iov + i * 8 >> 2]; - var len = HEAP32[iov + (i * 8 + 4) >> 2]; - for (var j = 0; j < len; j++) { - SYSCALLS.printChar(fd, HEAPU8[ptr + j]) - } - num += len - } - HEAP32[pnum >> 2] = num; - return 0 - } - - function _pthread_cleanup_pop(execute) { - var routine = PThread.exitHandlers.pop(); - if (execute) routine() - } - - function _pthread_cleanup_push(routine, arg) { - if (PThread.exitHandlers === null) { - PThread.exitHandlers = [] - } - PThread.exitHandlers.push(function () { - dynCall_vi(routine, arg) - }) - } - - function __spawn_thread(threadParams) { - if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _spawn_thread() can only ever be called from main application thread!"; - var worker = PThread.getNewWorker(); - if (worker.pthread !== undefined) throw "Internal error!"; - if (!threadParams.pthread_ptr) throw "Internal error, no pthread ptr!"; - PThread.runningWorkers.push(worker); - var tlsMemory = _malloc(128 * 4); - for (var i = 0; i < 128; ++i) { - HEAP32[tlsMemory + i * 4 >> 2] = 0 - } - var stackHigh = threadParams.stackBase + threadParams.stackSize; - var pthread = PThread.pthreads[threadParams.pthread_ptr] = { - worker: worker, - stackBase: threadParams.stackBase, - stackSize: threadParams.stackSize, - allocatedOwnStack: threadParams.allocatedOwnStack, - thread: threadParams.pthread_ptr, - threadInfoStruct: threadParams.pthread_ptr - }; - var tis = pthread.threadInfoStruct >> 2; - Atomics.store(HEAPU32, tis + (0 >> 2), 0); - Atomics.store(HEAPU32, tis + (4 >> 2), 0); - Atomics.store(HEAPU32, tis + (8 >> 2), 0); - Atomics.store(HEAPU32, tis + (68 >> 2), threadParams.detached); - Atomics.store(HEAPU32, tis + (104 >> 2), tlsMemory); - Atomics.store(HEAPU32, tis + (48 >> 2), 0); - Atomics.store(HEAPU32, tis + (40 >> 2), pthread.threadInfoStruct); - Atomics.store(HEAPU32, tis + (44 >> 2), 42); - Atomics.store(HEAPU32, tis + (108 >> 2), threadParams.stackSize); - Atomics.store(HEAPU32, tis + (84 >> 2), threadParams.stackSize); - Atomics.store(HEAPU32, tis + (80 >> 2), stackHigh); - Atomics.store(HEAPU32, tis + (108 + 8 >> 2), stackHigh); - Atomics.store(HEAPU32, tis + (108 + 12 >> 2), threadParams.detached); - Atomics.store(HEAPU32, tis + (108 + 20 >> 2), threadParams.schedPolicy); - Atomics.store(HEAPU32, tis + (108 + 24 >> 2), threadParams.schedPrio); - var global_libc = _emscripten_get_global_libc(); - var global_locale = global_libc + 40; - Atomics.store(HEAPU32, tis + (176 >> 2), global_locale); - worker.pthread = pthread; - var msg = { - "cmd": "run", - "start_routine": threadParams.startRoutine, - "arg": threadParams.arg, - "threadInfoStruct": threadParams.pthread_ptr, - "selfThreadId": threadParams.pthread_ptr, - "parentThreadId": threadParams.parent_pthread_ptr, - "stackBase": threadParams.stackBase, - "stackSize": threadParams.stackSize - }; - worker.runPthread = function () { - msg.time = performance.now(); - worker.postMessage(msg, threadParams.transferList) - }; - if (worker.loaded) { - worker.runPthread(); - delete worker.runPthread - } - } - - function _pthread_getschedparam(thread, policy, schedparam) { - if (!policy && !schedparam) return ERRNO_CODES.EINVAL; - if (!thread) { - err("pthread_getschedparam called with a null thread pointer!"); - return ERRNO_CODES.ESRCH - } - var self = HEAP32[thread + 12 >> 2]; - if (self !== thread) { - err("pthread_getschedparam attempted on thread " + thread + ", which does not point to a valid thread, or does not exist anymore!"); - return ERRNO_CODES.ESRCH - } - var schedPolicy = Atomics.load(HEAPU32, thread + 108 + 20 >> 2); - var schedPrio = Atomics.load(HEAPU32, thread + 108 + 24 >> 2); - if (policy) HEAP32[policy >> 2] = schedPolicy; - if (schedparam) HEAP32[schedparam >> 2] = schedPrio; - return 0 - } - - function _pthread_self() { - return __pthread_ptr | 0 - } - Module["_pthread_self"] = _pthread_self; - - function _pthread_create(pthread_ptr, attr, start_routine, arg) { - if (typeof SharedArrayBuffer === "undefined") { - err("Current environment does not support SharedArrayBuffer, pthreads are not available!"); - return 6 - } - if (!pthread_ptr) { - err("pthread_create called with a null thread pointer!"); - return 28 - } - var transferList = []; - var error = 0; - if (ENVIRONMENT_IS_PTHREAD && (transferList.length === 0 || error)) { - return _emscripten_sync_run_in_main_thread_4(687865856, pthread_ptr, attr, start_routine, arg) - } - if (error) return error; - var stackSize = 0; - var stackBase = 0; - var detached = 0; - var schedPolicy = 0; - var schedPrio = 0; - if (attr) { - stackSize = HEAP32[attr >> 2]; - stackSize += 81920; - stackBase = HEAP32[attr + 8 >> 2]; - detached = HEAP32[attr + 12 >> 2] !== 0; - var inheritSched = HEAP32[attr + 16 >> 2] === 0; - if (inheritSched) { - var prevSchedPolicy = HEAP32[attr + 20 >> 2]; - var prevSchedPrio = HEAP32[attr + 24 >> 2]; - var parentThreadPtr = PThread.currentProxiedOperationCallerThread ? PThread.currentProxiedOperationCallerThread : _pthread_self(); - _pthread_getschedparam(parentThreadPtr, attr + 20, attr + 24); - schedPolicy = HEAP32[attr + 20 >> 2]; - schedPrio = HEAP32[attr + 24 >> 2]; - HEAP32[attr + 20 >> 2] = prevSchedPolicy; - HEAP32[attr + 24 >> 2] = prevSchedPrio - } else { - schedPolicy = HEAP32[attr + 20 >> 2]; - schedPrio = HEAP32[attr + 24 >> 2] - } - } else { - stackSize = 2097152 - } - var allocatedOwnStack = stackBase == 0; - if (allocatedOwnStack) { - stackBase = _memalign(16, stackSize) - } else { - stackBase -= stackSize; - assert(stackBase > 0) - } - var threadInfoStruct = _malloc(232); - for (var i = 0; i < 232 >> 2; ++i) HEAPU32[(threadInfoStruct >> 2) + i] = 0; - HEAP32[pthread_ptr >> 2] = threadInfoStruct; - HEAP32[threadInfoStruct + 12 >> 2] = threadInfoStruct; - var headPtr = threadInfoStruct + 156; - HEAP32[headPtr >> 2] = headPtr; - var threadParams = { - stackBase: stackBase, - stackSize: stackSize, - allocatedOwnStack: allocatedOwnStack, - schedPolicy: schedPolicy, - schedPrio: schedPrio, - detached: detached, - startRoutine: start_routine, - pthread_ptr: threadInfoStruct, - parent_pthread_ptr: _pthread_self(), - arg: arg, - transferList: transferList - }; - if (ENVIRONMENT_IS_PTHREAD) { - threadParams.cmd = "spawnThread"; - postMessage(threadParams, transferList) - } else { - __spawn_thread(threadParams) - } - return 0 - } - - function _roundf(d) { - d = +d; - return d >= +0 ? +Math_floor(d + +.5) : +Math_ceil(d - +.5) - } - - function _sysconf(name) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(6, 1, name); - switch (name) { - case 30: - return 16384; - case 85: - var maxHeapSize = HEAPU8.length; - return maxHeapSize / 16384; - case 132: - case 133: - case 12: - case 137: - case 138: - case 15: - case 235: - case 16: - case 17: - case 18: - case 19: - case 20: - case 149: - case 13: - case 10: - case 236: - case 153: - case 9: - case 21: - case 22: - case 159: - case 154: - case 14: - case 77: - case 78: - case 139: - case 80: - case 81: - case 82: - case 68: - case 67: - case 164: - case 11: - case 29: - case 47: - case 48: - case 95: - case 52: - case 51: - case 46: - case 79: - return 200809; - case 27: - case 246: - case 127: - case 128: - case 23: - case 24: - case 160: - case 161: - case 181: - case 182: - case 242: - case 183: - case 184: - case 243: - case 244: - case 245: - case 165: - case 178: - case 179: - case 49: - case 50: - case 168: - case 169: - case 175: - case 170: - case 171: - case 172: - case 97: - case 76: - case 32: - case 173: - case 35: - return -1; - case 176: - case 177: - case 7: - case 155: - case 8: - case 157: - case 125: - case 126: - case 92: - case 93: - case 129: - case 130: - case 131: - case 94: - case 91: - return 1; - case 74: - case 60: - case 69: - case 70: - case 4: - return 1024; - case 31: - case 42: - case 72: - return 32; - case 87: - case 26: - case 33: - return 2147483647; - case 34: - case 1: - return 47839; - case 38: - case 36: - return 99; - case 43: - case 37: - return 2048; - case 0: - return 2097152; - case 3: - return 65536; - case 28: - return 32768; - case 44: - return 32767; - case 75: - return 16384; - case 39: - return 1e3; - case 89: - return 700; - case 71: - return 256; - case 40: - return 255; - case 2: - return 100; - case 180: - return 64; - case 25: - return 20; - case 5: - return 16; - case 6: - return 6; - case 73: - return 4; - case 84: { - if (typeof navigator === "object") return navigator["hardwareConcurrency"] || 1; - return 1 - } - } - setErrNo(28); - return -1 - } - if (!ENVIRONMENT_IS_PTHREAD) PThread.initMainThreadBlock(); - else PThread.initWorker(); - var GLctx; - GL.init(); - var proxiedFunctionTable = [null, _atexit, _emscripten_set_canvas_element_size_main_thread, _fd_close, _fd_seek, _fd_write, _sysconf]; - var asmLibraryArg = { - "__assert_fail": ___assert_fail, - "__handle_stack_overflow": ___handle_stack_overflow, - "_emscripten_notify_thread_queue": __emscripten_notify_thread_queue, - "abort": _abort, - "emscripten_conditional_set_current_thread_status": _emscripten_conditional_set_current_thread_status, - "emscripten_futex_wait": _emscripten_futex_wait, - "emscripten_futex_wake": _emscripten_futex_wake, - "emscripten_get_now": _emscripten_get_now, - "emscripten_is_main_browser_thread": _emscripten_is_main_browser_thread, - "emscripten_is_main_runtime_thread": _emscripten_is_main_runtime_thread, - "emscripten_memcpy_big": _emscripten_memcpy_big, - "emscripten_receive_on_main_thread_js": _emscripten_receive_on_main_thread_js, - "emscripten_resize_heap": _emscripten_resize_heap, - "emscripten_set_canvas_element_size": _emscripten_set_canvas_element_size, - "emscripten_set_current_thread_status": _emscripten_set_current_thread_status, - "emscripten_webgl_create_context": _emscripten_webgl_create_context, - "fd_close": _fd_close, - "fd_seek": _fd_seek, - "fd_write": _fd_write, - "initPthreadsJS": initPthreadsJS, - "memory": wasmMemory || Module["wasmMemory"], - "pthread_cleanup_pop": _pthread_cleanup_pop, - "pthread_cleanup_push": _pthread_cleanup_push, - "pthread_create": _pthread_create, - "pthread_self": _pthread_self, - "roundf": _roundf, - "table": wasmTable - }; - var asm = createWasm(); - Module["asm"] = asm; - var ___wasm_call_ctors = Module["___wasm_call_ctors"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["__wasm_call_ctors"].apply(null, arguments) - }; - var _init = Module["_init"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["init"].apply(null, arguments) - }; - var _register_tensor = Module["_register_tensor"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["register_tensor"].apply(null, arguments) - }; - var _dispose_data = Module["_dispose_data"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["dispose_data"].apply(null, arguments) - }; - var _dispose = Module["_dispose"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["dispose"].apply(null, arguments) - }; - var _Abs = Module["_Abs"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Abs"].apply(null, arguments) - }; - var _Add = Module["_Add"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Add"].apply(null, arguments) - }; - var _AddN = Module["_AddN"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["AddN"].apply(null, arguments) - }; - var _ArgMax = Module["_ArgMax"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["ArgMax"].apply(null, arguments) - }; - var _AvgPool = Module["_AvgPool"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["AvgPool"].apply(null, arguments) - }; - var _BatchMatMul = Module["_BatchMatMul"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["BatchMatMul"].apply(null, arguments) - }; - var _ClipByValue = Module["_ClipByValue"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["ClipByValue"].apply(null, arguments) - }; - var _Conv2D = Module["_Conv2D"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Conv2D"].apply(null, arguments) - }; - var _Cos = Module["_Cos"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Cos"].apply(null, arguments) - }; - var _CropAndResize = Module["_CropAndResize"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["CropAndResize"].apply(null, arguments) - }; - var _DepthwiseConv2dNative = Module["_DepthwiseConv2dNative"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["DepthwiseConv2dNative"].apply(null, arguments) - }; - var _Div = Module["_Div"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Div"].apply(null, arguments) - }; - var _Exp = Module["_Exp"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Exp"].apply(null, arguments) - }; - var _FloorDiv = Module["_FloorDiv"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["FloorDiv"].apply(null, arguments) - }; - var _FusedBatchNorm = Module["_FusedBatchNorm"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["FusedBatchNorm"].apply(null, arguments) - }; - var _FusedConv2D = Module["_FusedConv2D"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["FusedConv2D"].apply(null, arguments) - }; - var _FusedDepthwiseConv2D = Module["_FusedDepthwiseConv2D"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["FusedDepthwiseConv2D"].apply(null, arguments) - }; - var _Gather = Module["_Gather"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Gather"].apply(null, arguments) - }; - var _GatherNd = Module["_GatherNd"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["GatherNd"].apply(null, arguments) - }; - var _Greater = Module["_Greater"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Greater"].apply(null, arguments) - }; - var _GreaterEqual = Module["_GreaterEqual"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["GreaterEqual"].apply(null, arguments) - }; - var _Less = Module["_Less"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Less"].apply(null, arguments) - }; - var _LessEqual = Module["_LessEqual"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["LessEqual"].apply(null, arguments) - }; - var _Log = Module["_Log"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Log"].apply(null, arguments) - }; - var _LogicalAnd = Module["_LogicalAnd"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["LogicalAnd"].apply(null, arguments) - }; - var _Max = Module["_Max"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Max"].apply(null, arguments) - }; - var _MaxPool = Module["_MaxPool"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["MaxPool"].apply(null, arguments) - }; - var _Maximum = Module["_Maximum"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Maximum"].apply(null, arguments) - }; - var _Min = Module["_Min"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Min"].apply(null, arguments) - }; - var _Minimum = Module["_Minimum"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Minimum"].apply(null, arguments) - }; - var _Mul = Module["_Mul"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Mul"].apply(null, arguments) - }; - var _Neg = Module["_Neg"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Neg"].apply(null, arguments) - }; - var _NonMaxSuppressionV3 = Module["_NonMaxSuppressionV3"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["NonMaxSuppressionV3"].apply(null, arguments) - }; - var _NonMaxSuppressionV5 = Module["_NonMaxSuppressionV5"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["NonMaxSuppressionV5"].apply(null, arguments) - }; - var _NotEqual = Module["_NotEqual"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["NotEqual"].apply(null, arguments) - }; - var _PadV2 = Module["_PadV2"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["PadV2"].apply(null, arguments) - }; - var _Pow = Module["_Pow"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Pow"].apply(null, arguments) - }; - var _Prelu = Module["_Prelu"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Prelu"].apply(null, arguments) - }; - var _Relu = Module["_Relu"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Relu"].apply(null, arguments) - }; - var _Relu6 = Module["_Relu6"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Relu6"].apply(null, arguments) - }; - var _ResizeBilinear = Module["_ResizeBilinear"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["ResizeBilinear"].apply(null, arguments) - }; - var _Rsqrt = Module["_Rsqrt"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Rsqrt"].apply(null, arguments) - }; - var _ScatterNd = Module["_ScatterNd"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["ScatterNd"].apply(null, arguments) - }; - var _Sigmoid = Module["_Sigmoid"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Sigmoid"].apply(null, arguments) - }; - var _Sin = Module["_Sin"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Sin"].apply(null, arguments) - }; - var _Softmax = Module["_Softmax"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Softmax"].apply(null, arguments) - }; - var _Sqrt = Module["_Sqrt"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Sqrt"].apply(null, arguments) - }; - var _Square = Module["_Square"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Square"].apply(null, arguments) - }; - var _Sub = Module["_Sub"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Sub"].apply(null, arguments) - }; - var _Sum = Module["_Sum"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Sum"].apply(null, arguments) - }; - var _Tanh = Module["_Tanh"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Tanh"].apply(null, arguments) - }; - var _Tile = Module["_Tile"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Tile"].apply(null, arguments) - }; - var _Transpose = Module["_Transpose"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["Transpose"].apply(null, arguments) - }; - var __FusedMatMul = Module["__FusedMatMul"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["_FusedMatMul"].apply(null, arguments) - }; - var _malloc = Module["_malloc"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["malloc"].apply(null, arguments) - }; - var _free = Module["_free"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["free"].apply(null, arguments) - }; - var ___em_js__initPthreadsJS = Module["___em_js__initPthreadsJS"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["__em_js__initPthreadsJS"].apply(null, arguments) - }; - var ___errno_location = Module["___errno_location"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["__errno_location"].apply(null, arguments) - }; - var _emscripten_get_global_libc = Module["_emscripten_get_global_libc"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_get_global_libc"].apply(null, arguments) - }; - var _memalign = Module["_memalign"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["memalign"].apply(null, arguments) - }; - var ___pthread_tsd_run_dtors = Module["___pthread_tsd_run_dtors"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["__pthread_tsd_run_dtors"].apply(null, arguments) - }; - var _emscripten_main_thread_process_queued_calls = Module["_emscripten_main_thread_process_queued_calls"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null, arguments) - }; - var _emscripten_current_thread_process_queued_calls = Module["_emscripten_current_thread_process_queued_calls"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null, arguments) - }; - var _emscripten_register_main_browser_thread_id = Module["_emscripten_register_main_browser_thread_id"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null, arguments) - }; - var _emscripten_main_browser_thread_id = Module["_emscripten_main_browser_thread_id"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_main_browser_thread_id"].apply(null, arguments) - }; - var _emscripten_async_run_in_main_thread = Module["_emscripten_async_run_in_main_thread"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread = Module["_emscripten_sync_run_in_main_thread"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_0 = Module["_emscripten_sync_run_in_main_thread_0"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_1 = Module["_emscripten_sync_run_in_main_thread_1"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_2 = Module["_emscripten_sync_run_in_main_thread_2"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_xprintf_varargs = Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_3 = Module["_emscripten_sync_run_in_main_thread_3"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_4 = Module["_emscripten_sync_run_in_main_thread_4"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_5 = Module["_emscripten_sync_run_in_main_thread_5"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_6 = Module["_emscripten_sync_run_in_main_thread_6"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null, arguments) - }; - var _emscripten_sync_run_in_main_thread_7 = Module["_emscripten_sync_run_in_main_thread_7"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null, arguments) - }; - var _emscripten_run_in_main_runtime_thread_js = Module["_emscripten_run_in_main_runtime_thread_js"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null, arguments) - }; - var _emscripten_async_queue_on_thread_ = Module["_emscripten_async_queue_on_thread_"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null, arguments) - }; - var _emscripten_tls_init = Module["_emscripten_tls_init"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["emscripten_tls_init"].apply(null, arguments) - }; - var ___set_stack_limit = Module["___set_stack_limit"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["__set_stack_limit"].apply(null, arguments) - }; - var stackSave = Module["stackSave"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["stackSave"].apply(null, arguments) - }; - var stackAlloc = Module["stackAlloc"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["stackAlloc"].apply(null, arguments) - }; - var stackRestore = Module["stackRestore"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["stackRestore"].apply(null, arguments) - }; - var dynCall_vi = Module["dynCall_vi"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["dynCall_vi"].apply(null, arguments) - }; - var dynCall_v = Module["dynCall_v"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["dynCall_v"].apply(null, arguments) - }; - var dynCall_ii = Module["dynCall_ii"] = function () { - assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); - assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); - return Module["asm"]["dynCall_ii"].apply(null, arguments) - }; - Module["asm"] = asm; - if (!Object.getOwnPropertyDescriptor(Module, "intArrayFromString")) Module["intArrayFromString"] = function () { - abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "intArrayToString")) Module["intArrayToString"] = function () { - abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "ccall")) Module["ccall"] = function () { - abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - Module["cwrap"] = cwrap; - if (!Object.getOwnPropertyDescriptor(Module, "setValue")) Module["setValue"] = function () { - abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getValue")) Module["getValue"] = function () { - abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "allocate")) Module["allocate"] = function () { - abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getMemory")) Module["getMemory"] = function () { - abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "UTF8ArrayToString")) Module["UTF8ArrayToString"] = function () { - abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "UTF8ToString")) Module["UTF8ToString"] = function () { - abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8Array")) Module["stringToUTF8Array"] = function () { - abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8")) Module["stringToUTF8"] = function () { - abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF8")) Module["lengthBytesUTF8"] = function () { - abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function () { - abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "addOnPreRun")) Module["addOnPreRun"] = function () { - abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "addOnInit")) Module["addOnInit"] = function () { - abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "addOnPreMain")) Module["addOnPreMain"] = function () { - abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "addOnExit")) Module["addOnExit"] = function () { - abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "addOnPostRun")) Module["addOnPostRun"] = function () { - abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeStringToMemory")) Module["writeStringToMemory"] = function () { - abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeArrayToMemory")) Module["writeArrayToMemory"] = function () { - abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeAsciiToMemory")) Module["writeAsciiToMemory"] = function () { - abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "addRunDependency")) Module["addRunDependency"] = function () { - abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "removeRunDependency")) Module["removeRunDependency"] = function () { - abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createFolder")) Module["FS_createFolder"] = function () { - abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createPath")) Module["FS_createPath"] = function () { - abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createDataFile")) Module["FS_createDataFile"] = function () { - abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createPreloadedFile")) Module["FS_createPreloadedFile"] = function () { - abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createLazyFile")) Module["FS_createLazyFile"] = function () { - abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createLink")) Module["FS_createLink"] = function () { - abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_createDevice")) Module["FS_createDevice"] = function () { - abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "FS_unlink")) Module["FS_unlink"] = function () { - abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") - }; - if (!Object.getOwnPropertyDescriptor(Module, "dynamicAlloc")) Module["dynamicAlloc"] = function () { - abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "loadDynamicLibrary")) Module["loadDynamicLibrary"] = function () { - abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "loadWebAssemblyModule")) Module["loadWebAssemblyModule"] = function () { - abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getLEB")) Module["getLEB"] = function () { - abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getFunctionTables")) Module["getFunctionTables"] = function () { - abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "alignFunctionTables")) Module["alignFunctionTables"] = function () { - abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "registerFunctions")) Module["registerFunctions"] = function () { - abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "addFunction")) Module["addFunction"] = function () { - abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "removeFunction")) Module["removeFunction"] = function () { - abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getFuncWrapper")) Module["getFuncWrapper"] = function () { - abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "prettyPrint")) Module["prettyPrint"] = function () { - abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "makeBigInt")) Module["makeBigInt"] = function () { - abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "dynCall")) Module["dynCall"] = function () { - abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getCompilerSetting")) Module["getCompilerSetting"] = function () { - abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "print")) Module["print"] = function () { - abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "printErr")) Module["printErr"] = function () { - abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getTempRet0")) Module["getTempRet0"] = function () { - abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "setTempRet0")) Module["setTempRet0"] = function () { - abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "callMain")) Module["callMain"] = function () { - abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "abort")) Module["abort"] = function () { - abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToNewUTF8")) Module["stringToNewUTF8"] = function () { - abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "abortOnCannotGrowMemory")) Module["abortOnCannotGrowMemory"] = function () { - abort("'abortOnCannotGrowMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "emscripten_realloc_buffer")) Module["emscripten_realloc_buffer"] = function () { - abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "ENV")) Module["ENV"] = function () { - abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "setjmpId")) Module["setjmpId"] = function () { - abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_CODES")) Module["ERRNO_CODES"] = function () { - abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_MESSAGES")) Module["ERRNO_MESSAGES"] = function () { - abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "setErrNo")) Module["setErrNo"] = function () { - abort("'setErrNo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "DNS")) Module["DNS"] = function () { - abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "GAI_ERRNO_MESSAGES")) Module["GAI_ERRNO_MESSAGES"] = function () { - abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "Protocols")) Module["Protocols"] = function () { - abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "Sockets")) Module["Sockets"] = function () { - abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "UNWIND_CACHE")) Module["UNWIND_CACHE"] = function () { - abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "readAsmConstArgs")) Module["readAsmConstArgs"] = function () { - abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "jstoi_q")) Module["jstoi_q"] = function () { - abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "jstoi_s")) Module["jstoi_s"] = function () { - abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "PATH")) Module["PATH"] = function () { - abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "PATH_FS")) Module["PATH_FS"] = function () { - abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "SYSCALLS")) Module["SYSCALLS"] = function () { - abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "syscallMmap2")) Module["syscallMmap2"] = function () { - abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "syscallMunmap")) Module["syscallMunmap"] = function () { - abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "flush_NO_FILESYSTEM")) Module["flush_NO_FILESYSTEM"] = function () { - abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "JSEvents")) Module["JSEvents"] = function () { - abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "demangle")) Module["demangle"] = function () { - abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "demangleAll")) Module["demangleAll"] = function () { - abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "jsStackTrace")) Module["jsStackTrace"] = function () { - abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function () { - abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getEnvStrings")) Module["getEnvStrings"] = function () { - abort("'getEnvStrings' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64")) Module["writeI53ToI64"] = function () { - abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Clamped")) Module["writeI53ToI64Clamped"] = function () { - abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Signaling")) Module["writeI53ToI64Signaling"] = function () { - abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Clamped")) Module["writeI53ToU64Clamped"] = function () { - abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Signaling")) Module["writeI53ToU64Signaling"] = function () { - abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "readI53FromI64")) Module["readI53FromI64"] = function () { - abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "readI53FromU64")) Module["readI53FromU64"] = function () { - abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "convertI32PairToI53")) Module["convertI32PairToI53"] = function () { - abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "convertU32PairToI53")) Module["convertU32PairToI53"] = function () { - abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "Browser")) Module["Browser"] = function () { - abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "GL")) Module["GL"] = function () { - abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGet")) Module["emscriptenWebGLGet"] = function () { - abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetTexPixelData")) Module["emscriptenWebGLGetTexPixelData"] = function () { - abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetUniform")) Module["emscriptenWebGLGetUniform"] = function () { - abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetVertexAttrib")) Module["emscriptenWebGLGetVertexAttrib"] = function () { - abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "AL")) Module["AL"] = function () { - abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "SDL_unicode")) Module["SDL_unicode"] = function () { - abort("'SDL_unicode' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "SDL_ttfContext")) Module["SDL_ttfContext"] = function () { - abort("'SDL_ttfContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "SDL_audio")) Module["SDL_audio"] = function () { - abort("'SDL_audio' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "SDL")) Module["SDL"] = function () { - abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "SDL_gfx")) Module["SDL_gfx"] = function () { - abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "GLUT")) Module["GLUT"] = function () { - abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "EGL")) Module["EGL"] = function () { - abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "GLFW_Window")) Module["GLFW_Window"] = function () { - abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "GLFW")) Module["GLFW"] = function () { - abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "GLEW")) Module["GLEW"] = function () { - abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "IDBStore")) Module["IDBStore"] = function () { - abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "runAndAbortIfError")) Module["runAndAbortIfError"] = function () { - abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - Module["PThread"] = PThread; - if (!Object.getOwnPropertyDescriptor(Module, "establishStackSpace")) Module["establishStackSpace"] = function () { - abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "getNoExitRuntime")) Module["getNoExitRuntime"] = function () { - abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "resetPrototype")) Module["resetPrototype"] = function () { - abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "warnOnce")) Module["warnOnce"] = function () { - abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stackSave")) Module["stackSave"] = function () { - abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stackRestore")) Module["stackRestore"] = function () { - abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stackAlloc")) Module["stackAlloc"] = function () { - abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "AsciiToString")) Module["AsciiToString"] = function () { - abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToAscii")) Module["stringToAscii"] = function () { - abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "UTF16ToString")) Module["UTF16ToString"] = function () { - abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF16")) Module["stringToUTF16"] = function () { - abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF16")) Module["lengthBytesUTF16"] = function () { - abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "UTF32ToString")) Module["UTF32ToString"] = function () { - abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF32")) Module["stringToUTF32"] = function () { - abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF32")) Module["lengthBytesUTF32"] = function () { - abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8")) Module["allocateUTF8"] = function () { - abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8OnStack")) Module["allocateUTF8OnStack"] = function () { - abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - }; - Module["writeStackCookie"] = writeStackCookie; - Module["checkStackCookie"] = checkStackCookie; - Module["abortStackOverflow"] = abortStackOverflow; - Module["PThread"] = PThread; - Module["_pthread_self"] = _pthread_self; - Module["wasmMemory"] = wasmMemory; - Module["ExitStatus"] = ExitStatus; - if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NORMAL")) Object.defineProperty(Module, "ALLOC_NORMAL", { - configurable: true, - get: function () { - abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_STACK")) Object.defineProperty(Module, "ALLOC_STACK", { - configurable: true, - get: function () { - abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_DYNAMIC")) Object.defineProperty(Module, "ALLOC_DYNAMIC", { - configurable: true, - get: function () { - abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - } - }); - if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NONE")) Object.defineProperty(Module, "ALLOC_NONE", { - configurable: true, - get: function () { - abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") - } - }); - var calledRun; - Module["then"] = function (func) { - if (calledRun) { - func(Module) - } else { - var old = Module["onRuntimeInitialized"]; - Module["onRuntimeInitialized"] = function () { - if (old) old(); - func(Module) - } - } - return Module - }; - - function ExitStatus(status) { - this.name = "ExitStatus"; - this.message = "Program terminated with exit(" + status + ")"; - this.status = status - } - dependenciesFulfilled = function runCaller() { - if (!calledRun) run(); - if (!calledRun) dependenciesFulfilled = runCaller - }; - - function run(args) { - args = args || arguments_; - if (runDependencies > 0) { - return - } - writeStackCookie(); - preRun(); - if (runDependencies > 0) return; - - function doRun() { - if (calledRun) return; - calledRun = true; - Module["calledRun"] = true; - if (ABORT) return; - initRuntime(); - preMain(); - if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"](); - assert(!Module["_main"], 'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'); - postRun() - } - if (Module["setStatus"]) { - Module["setStatus"]("Running..."); - setTimeout(function () { - setTimeout(function () { - Module["setStatus"]("") - }, 1); - doRun() - }, 1) - } else { - doRun() - } - checkStackCookie() - } - Module["run"] = run; - if (Module["preInit"]) { - if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]]; - while (Module["preInit"].length > 0) { - Module["preInit"].pop()() - } - } - if (!ENVIRONMENT_IS_PTHREAD) noExitRuntime = true; - if (!ENVIRONMENT_IS_PTHREAD) run(); - - - return WasmBackendModule - } - ); -})(); -if (typeof exports === 'object' && typeof module === 'object') - module.exports = WasmBackendModule; -else if (typeof define === 'function' && define['amd']) - define([], function () { - return WasmBackendModule; - }); -else if (typeof exports === 'object') - exports["WasmBackendModule"] = WasmBackendModule; diff --git a/tfjs-core/benchmarks/wasm_4_threads/tfjs-backend-wasm.wasm b/tfjs-core/benchmarks/wasm_4_threads/tfjs-backend-wasm.wasm deleted file mode 100644 index 9fed9e9cc82e0b4ecfeabc2f73f2bba0bc012c44..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 156992 zcmeFa3!Gn7dH1{a-v9e$=0C|KnPdXl|4pnRf<}u0(VE#wNI(#1LF+j!CXoy*V+mst*Cfui?_bE^0w4^tnF)+w%U3@a=yQ3?f+$F zG7;_R=W}}ALrC`C>-wx`J?puxXRW{6F}W*n&IO0^7i|xxr``5|ztQycbTDlXx4p!N z{pYslv!`?0b9z;2%2AJhikcktjW2uNxJ&HLi6Hd?Q4`_k6y?5E4dagcEsOa~1e{F|G;<(AolqisQZ z@ZdpvyIC#q7T%(NgPQ?Aym>mfd3(>?F8XFC@a48Io0sMjy3i?@+HDXtXx2TsO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oUw@*~HMDW5RWCh&=g;}4o})R8^r^c_BRZuJxzF%LrJJ(H_VuCu(dMq4ifoNnD5 zcU<+nidoYuor65MIJWan>`kYpc1lfURoJ!NlrdEeM-U2VzX3<3fyZnBrDlrsm Date: Wed, 3 Jun 2020 09:46:47 -0400 Subject: [PATCH 84/85] setwasmpath --- tfjs-core/benchmarks/index.html | 5 +- tfjs-core/benchmarks/tf-backend-wasm.js | 338 ++++++++++++------------ 2 files changed, 173 insertions(+), 170 deletions(-) diff --git a/tfjs-core/benchmarks/index.html b/tfjs-core/benchmarks/index.html index c07fdf1af5e..30f72de0821 100644 --- a/tfjs-core/benchmarks/index.html +++ b/tfjs-core/benchmarks/index.html @@ -64,7 +64,8 @@

TensorFlow.js Model Benchmark

- + + @@ -75,6 +76,8 @@

TensorFlow.js Model Benchmark

- + --> + +

aO6lFY`k~VPrTuEfBexG9@#kk_n-LN@3^y$9zH@N!N%YD-p*fW z^u6lhBO7md?40rhO2dY;ELDrVr_^MabzJL7qUmrcv0`%g;SvMQkzaalN z*SzF6Ekod1zJC0)-mkvy*h^`W_WlKvdZwGjLC6epD10(v9fT|c zKEpH^?+F7)rWe#K{G;;sSs@%CVU)`kilvGK80qhYD${R=2#}%h{;+XpSSy_{NBNJ1 zjaP@Y;-dKvhK<>dCE&l^csqCl1##3IC(AQj8mGU6aLw)w|WA-mKz8ln} zF#O;e56!Lj?Vx62{Rj5s>m8e0``-fz=x5xkul?xUHogh(tiB^eb7NB0j3q^JoAmD- zOQ|M8;o0CB^6V!=-!b0+JdCl6fVXe%f?1*e&rg1b8 z=XSzIR)lvdwSe}(`&~g?Xllu5y&J35YAU72`L8&c-abVcmJh4bCp98zkPaR+2Ed5h zaM;#gPRgT8b4Zu;*quMw475hYvS6Y}F$p*EzAVYv3JzKeMvTg584Sh7In~byJ6?In zC%Lv{$*p17&73+FQ)ZDGZbDWnndQ zUj0T0qEy6AL@qrTm4#Lz$7<_60b=UM(dM@3QIis$kpxl6;4&RN4FDHPcJ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tUruyu0@~1XO$UR@*BImyGqAc4|E=5>4TYe&wYCkLTUf$w0#ip+tp0R|J$nNiF{>4 zk+e-4NBn!+p)5c4-|&?C-oo<*_^r|RUfcLA%R{oY_Z^dd{HTX>_LGhu=K!2+aC%dK zUon2|@#~0R7yLMT>V;oF{8%76aR7dFsTz&nSo{vd?@0WP!>=5_O8lncHv_*}_|3*| zK7I@FTa4dD_+5ry6Mom=cLRPm;&&Tteyj0&7{ABxdjh||NVjbNv&btetExP;zO1Hp+N?^a8VjLQW>(LWxiFhl*ZO>Oe5u>{ zpKnzP7HMWmKP-0E*7Yl|syb~>c~!rW)syGUs;sK7>sM1-JsscF^{bp!S23gCoSM3N ztWnKka&qmo8m#p8t2?c(zH(N-nbS`0S5toqo>nkkTV8uwnN9bdEb;ft%Ii*pEq3;t z$~l!~th}tcs?2;R_2sowE3q7=rAXDBS!Kwm>ovgH{{ZKpab-tLIB3E_Bg+mxvTQ{3 z&_m0{MUO3u{$})%iG|nBsVbXRRW_>}e-N)n?`?5q)9VCfjG8chMA?yJN0*JCU=t`} z!nlLRA9ZB+*?ophnNu~HM$Cgyd5`33lj|(2sMgj?f2V6##~oWWw|wTb3g;jXE{^TI z6MNICu9;k2Q5kk^H)V8X{Skx$+Hb&7Vc;@1FdOjGFMDlE(iBVb8xT literal 0 HcmV?d00001 diff --git a/tfjs-core/benchmarks/wasm_2_threads/tfjs-backend-wasm.js b/tfjs-core/benchmarks/wasm_2_threads/tfjs-backend-wasm.js new file mode 100755 index 00000000000..90eb60e4a0f --- /dev/null +++ b/tfjs-core/benchmarks/wasm_2_threads/tfjs-backend-wasm.js @@ -0,0 +1,3381 @@ +var WasmBackendModule = (function () { + var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; + if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; + return ( + function (WasmBackendModule) { + WasmBackendModule = WasmBackendModule || {}; + + var Module = typeof WasmBackendModule !== "undefined" ? WasmBackendModule : {}; + var moduleOverrides = {}; + var key; + for (key in Module) { + if (Module.hasOwnProperty(key)) { + moduleOverrides[key] = Module[key] + } + } + var arguments_ = []; + var thisProgram = "./this.program"; + var quit_ = function (status, toThrow) { + throw toThrow + }; + var ENVIRONMENT_IS_WEB = false; + var ENVIRONMENT_IS_WORKER = false; + var ENVIRONMENT_IS_NODE = false; + var ENVIRONMENT_IS_SHELL = false; + ENVIRONMENT_IS_WEB = typeof window === "object"; + ENVIRONMENT_IS_WORKER = typeof importScripts === "function"; + ENVIRONMENT_IS_NODE = typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string"; + ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER; + if (Module["ENVIRONMENT"]) { + throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)") + } + var ENVIRONMENT_IS_PTHREAD = Module["ENVIRONMENT_IS_PTHREAD"] || false; + if (ENVIRONMENT_IS_PTHREAD) { + buffer = Module["buffer"]; + DYNAMIC_BASE = Module["DYNAMIC_BASE"]; + DYNAMICTOP_PTR = Module["DYNAMICTOP_PTR"] + } + var scriptDirectory = ""; + + function locateFile(path) { + if (Module["locateFile"]) { + return Module["locateFile"](path, scriptDirectory) + } + return scriptDirectory + path + } + var read_, readAsync, readBinary, setWindowTitle; + var nodeFS; + var nodePath; + if (ENVIRONMENT_IS_NODE) { + if (ENVIRONMENT_IS_WORKER) { + scriptDirectory = require("path").dirname(scriptDirectory) + "/" + } else { + scriptDirectory = __dirname + "/" + } + read_ = function shell_read(filename, binary) { + if (!nodeFS) nodeFS = require("fs"); + if (!nodePath) nodePath = require("path"); + filename = nodePath["normalize"](filename); + return nodeFS["readFileSync"](filename, binary ? null : "utf8") + }; + readBinary = function readBinary(filename) { + var ret = read_(filename, true); + if (!ret.buffer) { + ret = new Uint8Array(ret) + } + assert(ret.buffer); + return ret + }; + if (process["argv"].length > 1) { + thisProgram = process["argv"][1].replace(/\\/g, "/") + } + arguments_ = process["argv"].slice(2); + process["on"]("uncaughtException", function (ex) { + if (!(ex instanceof ExitStatus)) { + throw ex + } + }); + process["on"]("unhandledRejection", abort); + quit_ = function (status) { + process["exit"](status) + }; + Module["inspect"] = function () { + return "[Emscripten Module object]" + }; + var nodeWorkerThreads; + try { + nodeWorkerThreads = require("worker_threads") + } catch (e) { + console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'); + throw e + } + Worker = nodeWorkerThreads.Worker + } else if (ENVIRONMENT_IS_SHELL) { + if (typeof read != "undefined") { + read_ = function shell_read(f) { + return read(f) + } + } + readBinary = function readBinary(f) { + var data; + if (typeof readbuffer === "function") { + return new Uint8Array(readbuffer(f)) + } + data = read(f, "binary"); + assert(typeof data === "object"); + return data + }; + if (typeof scriptArgs != "undefined") { + arguments_ = scriptArgs + } else if (typeof arguments != "undefined") { + arguments_ = arguments + } + if (typeof quit === "function") { + quit_ = function (status) { + quit(status) + } + } + if (typeof print !== "undefined") { + if (typeof console === "undefined") console = {}; + console.log = print; + console.warn = console.error = typeof printErr !== "undefined" ? printErr : print + } + } else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { + if (ENVIRONMENT_IS_WORKER) { + scriptDirectory = self.location.href + } else if (document.currentScript) { + scriptDirectory = document.currentScript.src + } + if (_scriptDir) { + scriptDirectory = _scriptDir + } + if (scriptDirectory.indexOf("blob:") !== 0) { + scriptDirectory = scriptDirectory.substr(0, scriptDirectory.lastIndexOf("/") + 1) + } else { + scriptDirectory = "" + } + if (ENVIRONMENT_IS_NODE) { + read_ = function shell_read(filename, binary) { + if (!nodeFS) nodeFS = require("fs"); + if (!nodePath) nodePath = require("path"); + filename = nodePath["normalize"](filename); + return nodeFS["readFileSync"](filename, binary ? null : "utf8") + }; + readBinary = function readBinary(filename) { + var ret = read_(filename, true); + if (!ret.buffer) { + ret = new Uint8Array(ret) + } + assert(ret.buffer); + return ret + } + } else { + read_ = function shell_read(url) { + var xhr = new XMLHttpRequest; + xhr.open("GET", url, false); + xhr.send(null); + return xhr.responseText + }; + if (ENVIRONMENT_IS_WORKER) { + readBinary = function readBinary(url) { + var xhr = new XMLHttpRequest; + xhr.open("GET", url, false); + xhr.responseType = "arraybuffer"; + xhr.send(null); + return new Uint8Array(xhr.response) + } + } + readAsync = function readAsync(url, onload, onerror) { + var xhr = new XMLHttpRequest; + xhr.open("GET", url, true); + xhr.responseType = "arraybuffer"; + xhr.onload = function xhr_onload() { + if (xhr.status == 200 || xhr.status == 0 && xhr.response) { + onload(xhr.response); + return + } + onerror() + }; + xhr.onerror = onerror; + xhr.send(null) + } + } + setWindowTitle = function (title) { + document.title = title + } + } else { + throw new Error("environment detection error") + } + if (ENVIRONMENT_IS_NODE) { + if (typeof performance === "undefined") { + performance = require("perf_hooks").performance + } + } + var out = Module["print"] || console.log.bind(console); + var err = Module["printErr"] || console.warn.bind(console); + for (key in moduleOverrides) { + if (moduleOverrides.hasOwnProperty(key)) { + Module[key] = moduleOverrides[key] + } + } + moduleOverrides = null; + if (Module["arguments"]) arguments_ = Module["arguments"]; + if (!Object.getOwnPropertyDescriptor(Module, "arguments")) Object.defineProperty(Module, "arguments", { + configurable: true, + get: function () { + abort("Module.arguments has been replaced with plain arguments_") + } + }); + if (Module["thisProgram"]) thisProgram = Module["thisProgram"]; + if (!Object.getOwnPropertyDescriptor(Module, "thisProgram")) Object.defineProperty(Module, "thisProgram", { + configurable: true, + get: function () { + abort("Module.thisProgram has been replaced with plain thisProgram") + } + }); + if (Module["quit"]) quit_ = Module["quit"]; + if (!Object.getOwnPropertyDescriptor(Module, "quit")) Object.defineProperty(Module, "quit", { + configurable: true, + get: function () { + abort("Module.quit has been replaced with plain quit_") + } + }); + assert(typeof Module["memoryInitializerPrefixURL"] === "undefined", "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["pthreadMainPrefixURL"] === "undefined", "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["cdInitializerPrefixURL"] === "undefined", "Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["filePackagePrefixURL"] === "undefined", "Module.filePackagePrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["read"] === "undefined", "Module.read option was removed (modify read_ in JS)"); + assert(typeof Module["readAsync"] === "undefined", "Module.readAsync option was removed (modify readAsync in JS)"); + assert(typeof Module["readBinary"] === "undefined", "Module.readBinary option was removed (modify readBinary in JS)"); + assert(typeof Module["setWindowTitle"] === "undefined", "Module.setWindowTitle option was removed (modify setWindowTitle in JS)"); + assert(typeof Module["TOTAL_MEMORY"] === "undefined", "Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"); + if (!Object.getOwnPropertyDescriptor(Module, "read")) Object.defineProperty(Module, "read", { + configurable: true, + get: function () { + abort("Module.read has been replaced with plain read_") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "readAsync")) Object.defineProperty(Module, "readAsync", { + configurable: true, + get: function () { + abort("Module.readAsync has been replaced with plain readAsync") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "readBinary")) Object.defineProperty(Module, "readBinary", { + configurable: true, + get: function () { + abort("Module.readBinary has been replaced with plain readBinary") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "setWindowTitle")) Object.defineProperty(Module, "setWindowTitle", { + configurable: true, + get: function () { + abort("Module.setWindowTitle has been replaced with plain setWindowTitle") + } + }); + assert(ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER || ENVIRONMENT_IS_NODE, "Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)"); + var stackSave; + var stackRestore; + var stackAlloc; + stackSave = stackRestore = stackAlloc = function () { + abort("cannot use the stack before compiled code is ready to run, and has provided stack access") + }; + + function warnOnce(text) { + if (!warnOnce.shown) warnOnce.shown = {}; + if (!warnOnce.shown[text]) { + warnOnce.shown[text] = 1; + err(text) + } + } + var Atomics_load = Atomics.load; + var Atomics_store = Atomics.store; + var Atomics_compareExchange = Atomics.compareExchange; + var wasmBinary; + if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"]; + if (!Object.getOwnPropertyDescriptor(Module, "wasmBinary")) Object.defineProperty(Module, "wasmBinary", { + configurable: true, + get: function () { + abort("Module.wasmBinary has been replaced with plain wasmBinary") + } + }); + var noExitRuntime; + if (Module["noExitRuntime"]) noExitRuntime = Module["noExitRuntime"]; + if (!Object.getOwnPropertyDescriptor(Module, "noExitRuntime")) Object.defineProperty(Module, "noExitRuntime", { + configurable: true, + get: function () { + abort("Module.noExitRuntime has been replaced with plain noExitRuntime") + } + }); + if (typeof WebAssembly !== "object") { + abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.") + } + var wasmMemory; + var wasmTable = new WebAssembly.Table({ + "initial": 119, + "maximum": 119 + 0, + "element": "anyfunc" + }); + var wasmModule; + var threadInfoStruct = 0; + var selfThreadId = 0; + var ABORT = false; + var EXITSTATUS = 0; + + function assert(condition, text) { + if (!condition) { + abort("Assertion failed: " + text) + } + } + + function getCFunc(ident) { + var func = Module["_" + ident]; + assert(func, "Cannot call unknown function " + ident + ", make sure it is exported"); + return func + } + + function ccall(ident, returnType, argTypes, args, opts) { + var toC = { + "string": function (str) { + var ret = 0; + if (str !== null && str !== undefined && str !== 0) { + var len = (str.length << 2) + 1; + ret = stackAlloc(len); + stringToUTF8(str, ret, len) + } + return ret + }, + "array": function (arr) { + var ret = stackAlloc(arr.length); + writeArrayToMemory(arr, ret); + return ret + } + }; + + function convertReturnValue(ret) { + if (returnType === "string") return UTF8ToString(ret); + if (returnType === "boolean") return Boolean(ret); + return ret + } + var func = getCFunc(ident); + var cArgs = []; + var stack = 0; + assert(returnType !== "array", 'Return type should not be "array".'); + if (args) { + for (var i = 0; i < args.length; i++) { + var converter = toC[argTypes[i]]; + if (converter) { + if (stack === 0) stack = stackSave(); + cArgs[i] = converter(args[i]) + } else { + cArgs[i] = args[i] + } + } + } + var ret = func.apply(null, cArgs); + ret = convertReturnValue(ret); + if (stack !== 0) stackRestore(stack); + return ret + } + + function cwrap(ident, returnType, argTypes, opts) { + return function () { + return ccall(ident, returnType, argTypes, arguments, opts) + } + } + + function UTF8ArrayToString(heap, idx, maxBytesToRead) { + var endIdx = idx + maxBytesToRead; + var str = ""; + while (!(idx >= endIdx)) { + var u0 = heap[idx++]; + if (!u0) return str; + if (!(u0 & 128)) { + str += String.fromCharCode(u0); + continue + } + var u1 = heap[idx++] & 63; + if ((u0 & 224) == 192) { + str += String.fromCharCode((u0 & 31) << 6 | u1); + continue + } + var u2 = heap[idx++] & 63; + if ((u0 & 240) == 224) { + u0 = (u0 & 15) << 12 | u1 << 6 | u2 + } else { + if ((u0 & 248) != 240) warnOnce("Invalid UTF-8 leading byte 0x" + u0.toString(16) + " encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!"); + u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heap[idx++] & 63 + } + if (u0 < 65536) { + str += String.fromCharCode(u0) + } else { + var ch = u0 - 65536; + str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023) + } + } + return str + } + + function UTF8ToString(ptr, maxBytesToRead) { + return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "" + } + + function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { + if (!(maxBytesToWrite > 0)) return 0; + var startIdx = outIdx; + var endIdx = outIdx + maxBytesToWrite - 1; + for (var i = 0; i < str.length; ++i) { + var u = str.charCodeAt(i); + if (u >= 55296 && u <= 57343) { + var u1 = str.charCodeAt(++i); + u = 65536 + ((u & 1023) << 10) | u1 & 1023 + } + if (u <= 127) { + if (outIdx >= endIdx) break; + heap[outIdx++] = u + } else if (u <= 2047) { + if (outIdx + 1 >= endIdx) break; + heap[outIdx++] = 192 | u >> 6; + heap[outIdx++] = 128 | u & 63 + } else if (u <= 65535) { + if (outIdx + 2 >= endIdx) break; + heap[outIdx++] = 224 | u >> 12; + heap[outIdx++] = 128 | u >> 6 & 63; + heap[outIdx++] = 128 | u & 63 + } else { + if (outIdx + 3 >= endIdx) break; + if (u >= 2097152) warnOnce("Invalid Unicode code point 0x" + u.toString(16) + " encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF)."); + heap[outIdx++] = 240 | u >> 18; + heap[outIdx++] = 128 | u >> 12 & 63; + heap[outIdx++] = 128 | u >> 6 & 63; + heap[outIdx++] = 128 | u & 63 + } + } + heap[outIdx] = 0; + return outIdx - startIdx + } + + function stringToUTF8(str, outPtr, maxBytesToWrite) { + assert(typeof maxBytesToWrite == "number", "stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"); + return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite) + } + + function lengthBytesUTF8(str) { + var len = 0; + for (var i = 0; i < str.length; ++i) { + var u = str.charCodeAt(i); + if (u >= 55296 && u <= 57343) u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; + if (u <= 127) ++len; + else if (u <= 2047) len += 2; + else if (u <= 65535) len += 3; + else len += 4 + } + return len + } + + function writeArrayToMemory(array, buffer) { + assert(array.length >= 0, "writeArrayToMemory array must have a length (should be an array or typed array)"); + HEAP8.set(array, buffer) + } + var WASM_PAGE_SIZE = 65536; + var buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; + + function updateGlobalBufferAndViews(buf) { + buffer = buf; + Module["HEAP8"] = HEAP8 = new Int8Array(buf); + Module["HEAP16"] = HEAP16 = new Int16Array(buf); + Module["HEAP32"] = HEAP32 = new Int32Array(buf); + Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); + Module["HEAPU16"] = HEAPU16 = new Uint16Array(buf); + Module["HEAPU32"] = HEAPU32 = new Uint32Array(buf); + Module["HEAPF32"] = HEAPF32 = new Float32Array(buf); + Module["HEAPF64"] = HEAPF64 = new Float64Array(buf) + } + var STACK_BASE = 5255808, + STACKTOP = STACK_BASE, + STACK_MAX = 12928, + DYNAMIC_BASE = 5255808, + DYNAMICTOP_PTR = 12e3; + assert(STACK_BASE % 16 === 0, "stack must start aligned"); + assert(DYNAMIC_BASE % 16 === 0, "heap must start aligned"); + if (ENVIRONMENT_IS_PTHREAD) { + STACK_MAX = STACKTOP = STACK_MAX = 2147483647 + } + var TOTAL_STACK = 5242880; + if (Module["TOTAL_STACK"]) assert(TOTAL_STACK === Module["TOTAL_STACK"], "the stack size can no longer be determined at runtime"); + var INITIAL_INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 1073741824; + if (!Object.getOwnPropertyDescriptor(Module, "INITIAL_MEMORY")) Object.defineProperty(Module, "INITIAL_MEMORY", { + configurable: true, + get: function () { + abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY") + } + }); + assert(INITIAL_INITIAL_MEMORY >= TOTAL_STACK, "INITIAL_MEMORY should be larger than TOTAL_STACK, was " + INITIAL_INITIAL_MEMORY + "! (TOTAL_STACK=" + TOTAL_STACK + ")"); + assert(typeof Int32Array !== "undefined" && typeof Float64Array !== "undefined" && Int32Array.prototype.subarray !== undefined && Int32Array.prototype.set !== undefined, "JS engine does not provide full typed array support"); + if (ENVIRONMENT_IS_PTHREAD) { + wasmMemory = Module["wasmMemory"]; + buffer = Module["buffer"] + } else { + if (Module["wasmMemory"]) { + wasmMemory = Module["wasmMemory"] + } else { + wasmMemory = new WebAssembly.Memory({ + "initial": INITIAL_INITIAL_MEMORY / WASM_PAGE_SIZE, + "maximum": INITIAL_INITIAL_MEMORY / WASM_PAGE_SIZE, + "shared": true + }); + if (!(wasmMemory.buffer instanceof SharedArrayBuffer)) { + err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"); + if (ENVIRONMENT_IS_NODE) { + console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)") + } + throw Error("bad memory") + } + } + } + if (wasmMemory) { + buffer = wasmMemory.buffer + } + INITIAL_INITIAL_MEMORY = buffer.byteLength; + assert(INITIAL_INITIAL_MEMORY % WASM_PAGE_SIZE === 0); + updateGlobalBufferAndViews(buffer); + if (!ENVIRONMENT_IS_PTHREAD) { + HEAP32[DYNAMICTOP_PTR >> 2] = DYNAMIC_BASE + } + + function writeStackCookie() { + assert((STACK_MAX & 3) == 0); + HEAPU32[(STACK_MAX >> 2) + 1] = 34821223; + HEAPU32[(STACK_MAX >> 2) + 2] = 2310721022; + HEAP32[0] = 1668509029 + } + + function checkStackCookie() { + var cookie1 = HEAPU32[(STACK_MAX >> 2) + 1]; + var cookie2 = HEAPU32[(STACK_MAX >> 2) + 2]; + if (cookie1 != 34821223 || cookie2 != 2310721022) { + abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x" + cookie2.toString(16) + " " + cookie1.toString(16)) + } + if (HEAP32[0] !== 1668509029) abort("Runtime error: The application has corrupted its heap memory area (address zero)!") + } + + function abortStackOverflow(allocSize) { + abort("Stack overflow! Attempted to allocate " + allocSize + " bytes on the stack, but stack has only " + (STACK_MAX - stackSave() + allocSize) + " bytes available!") + }(function () { + var h16 = new Int16Array(1); + var h8 = new Int8Array(h16.buffer); + h16[0] = 25459; + if (h8[0] !== 115 || h8[1] !== 99) throw "Runtime error: expected the system to be little-endian!" + })(); + + function callRuntimeCallbacks(callbacks) { + while (callbacks.length > 0) { + var callback = callbacks.shift(); + if (typeof callback == "function") { + callback(Module); + continue + } + var func = callback.func; + if (typeof func === "number") { + if (callback.arg === undefined) { + Module["dynCall_v"](func) + } else { + Module["dynCall_vi"](func, callback.arg) + } + } else { + func(callback.arg === undefined ? null : callback.arg) + } + } + } + var __ATPRERUN__ = []; + var __ATINIT__ = []; + var __ATMAIN__ = []; + var __ATEXIT__ = []; + var __ATPOSTRUN__ = []; + var runtimeInitialized = false; + var runtimeExited = false; + if (ENVIRONMENT_IS_PTHREAD) runtimeInitialized = true; + + function preRun() { + if (ENVIRONMENT_IS_PTHREAD) return; + if (Module["preRun"]) { + if (typeof Module["preRun"] == "function") Module["preRun"] = [Module["preRun"]]; + while (Module["preRun"].length) { + addOnPreRun(Module["preRun"].shift()) + } + } + callRuntimeCallbacks(__ATPRERUN__) + } + + function initRuntime() { + checkStackCookie(); + assert(!runtimeInitialized); + runtimeInitialized = true; + callRuntimeCallbacks(__ATINIT__) + } + + function preMain() { + checkStackCookie(); + if (ENVIRONMENT_IS_PTHREAD) return; + callRuntimeCallbacks(__ATMAIN__) + } + + function postRun() { + checkStackCookie(); + if (ENVIRONMENT_IS_PTHREAD) return; + if (Module["postRun"]) { + if (typeof Module["postRun"] == "function") Module["postRun"] = [Module["postRun"]]; + while (Module["postRun"].length) { + addOnPostRun(Module["postRun"].shift()) + } + } + callRuntimeCallbacks(__ATPOSTRUN__) + } + + function addOnPreRun(cb) { + __ATPRERUN__.unshift(cb) + } + + function addOnPostRun(cb) { + __ATPOSTRUN__.unshift(cb) + } + assert(Math.imul, "This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + assert(Math.fround, "This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + assert(Math.clz32, "This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + assert(Math.trunc, "This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + var Math_ceil = Math.ceil; + var Math_floor = Math.floor; + var runDependencies = 0; + var runDependencyWatcher = null; + var dependenciesFulfilled = null; + var runDependencyTracking = {}; + + function addRunDependency(id) { + assert(!ENVIRONMENT_IS_PTHREAD, "addRunDependency cannot be used in a pthread worker"); + runDependencies++; + if (Module["monitorRunDependencies"]) { + Module["monitorRunDependencies"](runDependencies) + } + if (id) { + assert(!runDependencyTracking[id]); + runDependencyTracking[id] = 1; + if (runDependencyWatcher === null && typeof setInterval !== "undefined") { + runDependencyWatcher = setInterval(function () { + if (ABORT) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null; + return + } + var shown = false; + for (var dep in runDependencyTracking) { + if (!shown) { + shown = true; + err("still waiting on run dependencies:") + } + err("dependency: " + dep) + } + if (shown) { + err("(end of list)") + } + }, 1e4) + } + } else { + err("warning: run dependency added without ID") + } + } + + function removeRunDependency(id) { + runDependencies--; + if (Module["monitorRunDependencies"]) { + Module["monitorRunDependencies"](runDependencies) + } + if (id) { + assert(runDependencyTracking[id]); + delete runDependencyTracking[id] + } else { + err("warning: run dependency removed without ID") + } + if (runDependencies == 0) { + if (runDependencyWatcher !== null) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null + } + if (dependenciesFulfilled) { + var callback = dependenciesFulfilled; + dependenciesFulfilled = null; + callback() + } + } + } + Module["preloadedImages"] = {}; + Module["preloadedAudios"] = {}; + + function abort(what) { + if (Module["onAbort"]) { + Module["onAbort"](what) + } + if (ENVIRONMENT_IS_PTHREAD) console.error("Pthread aborting at " + (new Error).stack); + what += ""; + out(what); + err(what); + ABORT = true; + EXITSTATUS = 1; + var output = "abort(" + what + ") at " + stackTrace(); + what = output; + throw new WebAssembly.RuntimeError(what) + } + var FS = { + error: function () { + abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1") + }, + init: function () { + FS.error() + }, + createDataFile: function () { + FS.error() + }, + createPreloadedFile: function () { + FS.error() + }, + createLazyFile: function () { + FS.error() + }, + open: function () { + FS.error() + }, + mkdev: function () { + FS.error() + }, + registerDevice: function () { + FS.error() + }, + analyzePath: function () { + FS.error() + }, + loadFilesFromDB: function () { + FS.error() + }, + ErrnoError: function ErrnoError() { + FS.error() + } + }; + Module["FS_createDataFile"] = FS.createDataFile; + Module["FS_createPreloadedFile"] = FS.createPreloadedFile; + + function hasPrefix(str, prefix) { + return String.prototype.startsWith ? str.startsWith(prefix) : str.indexOf(prefix) === 0 + } + var dataURIPrefix = "data:application/octet-stream;base64,"; + + function isDataURI(filename) { + return hasPrefix(filename, dataURIPrefix) + } + var fileURIPrefix = "file://"; + + function isFileURI(filename) { + return hasPrefix(filename, fileURIPrefix) + } + var wasmBinaryFile = "tfjs-backend-wasm.wasm"; + if (!isDataURI(wasmBinaryFile)) { + wasmBinaryFile = locateFile(wasmBinaryFile) + } + + function getBinary() { + try { + if (wasmBinary) { + return new Uint8Array(wasmBinary) + } + if (readBinary) { + return readBinary(wasmBinaryFile) + } else { + throw "both async and sync fetching of the wasm failed" + } + } catch (err) { + abort(err) + } + } + + function getBinaryPromise() { + if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) && typeof fetch === "function" && !isFileURI(wasmBinaryFile)) { + return fetch(wasmBinaryFile, { + credentials: "same-origin" + }).then(function (response) { + if (!response["ok"]) { + throw "failed to load wasm binary file at '" + wasmBinaryFile + "'" + } + return response["arrayBuffer"]() + }).catch(function () { + return getBinary() + }) + } + return new Promise(function (resolve, reject) { + resolve(getBinary()) + }) + } + + function createWasm() { + var info = { + "env": asmLibraryArg, + "wasi_snapshot_preview1": asmLibraryArg + }; + + function receiveInstance(instance, module) { + var exports = instance.exports; + Module["asm"] = exports; + wasmModule = module; + if (!ENVIRONMENT_IS_PTHREAD) { + var numWorkersToLoad = PThread.unusedWorkers.length; + PThread.unusedWorkers.forEach(function (w) { + PThread.loadWasmModuleToWorker(w, function () { + if (!--numWorkersToLoad) removeRunDependency("wasm-instantiate") + }) + }) + } + } + if (!ENVIRONMENT_IS_PTHREAD) { + addRunDependency("wasm-instantiate") + } + var trueModule = Module; + + function receiveInstantiatedSource(output) { + assert(Module === trueModule, "the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"); + trueModule = null; + receiveInstance(output["instance"], output["module"]) + } + + function instantiateArrayBuffer(receiver) { + return getBinaryPromise().then(function (binary) { + return WebAssembly.instantiate(binary, info) + }).then(receiver, function (reason) { + err("failed to asynchronously prepare wasm: " + reason); + abort(reason) + }) + } + + function instantiateAsync() { + if (!wasmBinary && typeof WebAssembly.instantiateStreaming === "function" && !isDataURI(wasmBinaryFile) && !isFileURI(wasmBinaryFile) && typeof fetch === "function") { + fetch(wasmBinaryFile, { + credentials: "same-origin" + }).then(function (response) { + var result = WebAssembly.instantiateStreaming(response, info); + return result.then(receiveInstantiatedSource, function (reason) { + err("wasm streaming compile failed: " + reason); + err("falling back to ArrayBuffer instantiation"); + instantiateArrayBuffer(receiveInstantiatedSource) + }) + }) + } else { + return instantiateArrayBuffer(receiveInstantiatedSource) + } + } + if (Module["instantiateWasm"]) { + try { + var exports = Module["instantiateWasm"](info, receiveInstance); + return exports + } catch (e) { + err("Module.instantiateWasm callback failed with error: " + e); + return false + } + } + instantiateAsync(); + return {} + } + var ASM_CONSTS = {}; + + function initPthreadsJS() { + PThread.initRuntime() + } + if (!ENVIRONMENT_IS_PTHREAD) __ATINIT__.push({ + func: function () { + ___wasm_call_ctors() + } + }); + + function demangle(func) { + warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"); + return func + } + + function demangleAll(text) { + var regex = /\b_Z[\w\d_]+/g; + return text.replace(regex, function (x) { + var y = demangle(x); + return x === y ? x : y + " [" + x + "]" + }) + } + var __pthread_ptr = 0; + var __pthread_is_main_runtime_thread = 0; + var __pthread_is_main_browser_thread = 0; + + function __register_pthread_ptr(pthreadPtr, isMainBrowserThread, isMainRuntimeThread) { + pthreadPtr = pthreadPtr | 0; + isMainBrowserThread = isMainBrowserThread | 0; + isMainRuntimeThread = isMainRuntimeThread | 0; + __pthread_ptr = pthreadPtr; + __pthread_is_main_browser_thread = isMainBrowserThread; + __pthread_is_main_runtime_thread = isMainRuntimeThread + } + Module["__register_pthread_ptr"] = __register_pthread_ptr; + var ERRNO_CODES = { + EPERM: 63, + ENOENT: 44, + ESRCH: 71, + EINTR: 27, + EIO: 29, + ENXIO: 60, + E2BIG: 1, + ENOEXEC: 45, + EBADF: 8, + ECHILD: 12, + EAGAIN: 6, + EWOULDBLOCK: 6, + ENOMEM: 48, + EACCES: 2, + EFAULT: 21, + ENOTBLK: 105, + EBUSY: 10, + EEXIST: 20, + EXDEV: 75, + ENODEV: 43, + ENOTDIR: 54, + EISDIR: 31, + EINVAL: 28, + ENFILE: 41, + EMFILE: 33, + ENOTTY: 59, + ETXTBSY: 74, + EFBIG: 22, + ENOSPC: 51, + ESPIPE: 70, + EROFS: 69, + EMLINK: 34, + EPIPE: 64, + EDOM: 18, + ERANGE: 68, + ENOMSG: 49, + EIDRM: 24, + ECHRNG: 106, + EL2NSYNC: 156, + EL3HLT: 107, + EL3RST: 108, + ELNRNG: 109, + EUNATCH: 110, + ENOCSI: 111, + EL2HLT: 112, + EDEADLK: 16, + ENOLCK: 46, + EBADE: 113, + EBADR: 114, + EXFULL: 115, + ENOANO: 104, + EBADRQC: 103, + EBADSLT: 102, + EDEADLOCK: 16, + EBFONT: 101, + ENOSTR: 100, + ENODATA: 116, + ETIME: 117, + ENOSR: 118, + ENONET: 119, + ENOPKG: 120, + EREMOTE: 121, + ENOLINK: 47, + EADV: 122, + ESRMNT: 123, + ECOMM: 124, + EPROTO: 65, + EMULTIHOP: 36, + EDOTDOT: 125, + EBADMSG: 9, + ENOTUNIQ: 126, + EBADFD: 127, + EREMCHG: 128, + ELIBACC: 129, + ELIBBAD: 130, + ELIBSCN: 131, + ELIBMAX: 132, + ELIBEXEC: 133, + ENOSYS: 52, + ENOTEMPTY: 55, + ENAMETOOLONG: 37, + ELOOP: 32, + EOPNOTSUPP: 138, + EPFNOSUPPORT: 139, + ECONNRESET: 15, + ENOBUFS: 42, + EAFNOSUPPORT: 5, + EPROTOTYPE: 67, + ENOTSOCK: 57, + ENOPROTOOPT: 50, + ESHUTDOWN: 140, + ECONNREFUSED: 14, + EADDRINUSE: 3, + ECONNABORTED: 13, + ENETUNREACH: 40, + ENETDOWN: 38, + ETIMEDOUT: 73, + EHOSTDOWN: 142, + EHOSTUNREACH: 23, + EINPROGRESS: 26, + EALREADY: 7, + EDESTADDRREQ: 17, + EMSGSIZE: 35, + EPROTONOSUPPORT: 66, + ESOCKTNOSUPPORT: 137, + EADDRNOTAVAIL: 4, + ENETRESET: 39, + EISCONN: 30, + ENOTCONN: 53, + ETOOMANYREFS: 141, + EUSERS: 136, + EDQUOT: 19, + ESTALE: 72, + ENOTSUP: 138, + ENOMEDIUM: 148, + EILSEQ: 25, + EOVERFLOW: 61, + ECANCELED: 11, + ENOTRECOVERABLE: 56, + EOWNERDEAD: 62, + ESTRPIPE: 135 + }; + var __main_thread_futex_wait_address = 12912; + + function _emscripten_futex_wake(addr, count) { + if (addr <= 0 || addr > HEAP8.length || addr & 3 != 0 || count < 0) return -28; + if (count == 0) return 0; + if (count >= 2147483647) count = Infinity; + var mainThreadWaitAddress = Atomics.load(HEAP32, __main_thread_futex_wait_address >> 2); + var mainThreadWoken = 0; + if (mainThreadWaitAddress == addr) { + var loadedAddr = Atomics.compareExchange(HEAP32, __main_thread_futex_wait_address >> 2, mainThreadWaitAddress, 0); + if (loadedAddr == mainThreadWaitAddress) { + --count; + mainThreadWoken = 1; + if (count <= 0) return 1 + } + } + var ret = Atomics.notify(HEAP32, addr >> 2, count); + if (ret >= 0) return ret + mainThreadWoken; + throw "Atomics.notify returned an unexpected value " + ret + } + Module["_emscripten_futex_wake"] = _emscripten_futex_wake; + + function __kill_thread(pthread_ptr) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _kill_thread() can only ever be called from main application thread!"; + if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _kill_thread!"; + HEAP32[pthread_ptr + 12 >> 2] = 0; + var pthread = PThread.pthreads[pthread_ptr]; + pthread.worker.terminate(); + PThread.freeThreadData(pthread); + PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker), 1); + pthread.worker.pthread = undefined + } + + function __cancel_thread(pthread_ptr) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _cancel_thread() can only ever be called from main application thread!"; + if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _cancel_thread!"; + var pthread = PThread.pthreads[pthread_ptr]; + pthread.worker.postMessage({ + "cmd": "cancel" + }) + } + + function __cleanup_thread(pthread_ptr) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _cleanup_thread() can only ever be called from main application thread!"; + if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _cleanup_thread!"; + HEAP32[pthread_ptr + 12 >> 2] = 0; + var pthread = PThread.pthreads[pthread_ptr]; + if (pthread) { + var worker = pthread.worker; + PThread.returnWorkerToPool(worker) + } + } + var PThread = { + MAIN_THREAD_ID: 1, + mainThreadInfo: { + schedPolicy: 0, + schedPrio: 0 + }, + unusedWorkers: [], + runningWorkers: [], + initRuntime: function () { + __register_pthread_ptr(PThread.mainThreadBlock, !ENVIRONMENT_IS_WORKER, 1); + _emscripten_register_main_browser_thread_id(PThread.mainThreadBlock) + }, + initMainThreadBlock: function () { + assert(!ENVIRONMENT_IS_PTHREAD); + var pthreadPoolSize = 8; + for (var i = 0; i < pthreadPoolSize; ++i) { + PThread.allocateUnusedWorker() + } + PThread.mainThreadBlock = 12160; + for (var i = 0; i < 232 / 4; ++i) HEAPU32[PThread.mainThreadBlock / 4 + i] = 0; + HEAP32[PThread.mainThreadBlock + 12 >> 2] = PThread.mainThreadBlock; + var headPtr = PThread.mainThreadBlock + 156; + HEAP32[headPtr >> 2] = headPtr; + var tlsMemory = 12400; + for (var i = 0; i < 128; ++i) HEAPU32[tlsMemory / 4 + i] = 0; + Atomics.store(HEAPU32, PThread.mainThreadBlock + 104 >> 2, tlsMemory); + Atomics.store(HEAPU32, PThread.mainThreadBlock + 40 >> 2, PThread.mainThreadBlock); + Atomics.store(HEAPU32, PThread.mainThreadBlock + 44 >> 2, 42) + }, + initWorker: function () {}, + pthreads: {}, + exitHandlers: null, + setThreadStatus: function () {}, + runExitHandlers: function () { + if (PThread.exitHandlers !== null) { + while (PThread.exitHandlers.length > 0) { + PThread.exitHandlers.pop()() + } + PThread.exitHandlers = null + } + if (ENVIRONMENT_IS_PTHREAD && threadInfoStruct) ___pthread_tsd_run_dtors() + }, + threadExit: function (exitCode) { + var tb = _pthread_self(); + if (tb) { + err("Pthread 0x" + tb.toString(16) + " exited."); + Atomics.store(HEAPU32, tb + 4 >> 2, exitCode); + Atomics.store(HEAPU32, tb + 0 >> 2, 1); + Atomics.store(HEAPU32, tb + 60 >> 2, 1); + Atomics.store(HEAPU32, tb + 64 >> 2, 0); + PThread.runExitHandlers(); + _emscripten_futex_wake(tb + 0, 2147483647); + __register_pthread_ptr(0, 0, 0); + threadInfoStruct = 0; + if (ENVIRONMENT_IS_PTHREAD) { + postMessage({ + "cmd": "exit" + }) + } + } + }, + threadCancel: function () { + PThread.runExitHandlers(); + Atomics.store(HEAPU32, threadInfoStruct + 4 >> 2, -1); + Atomics.store(HEAPU32, threadInfoStruct + 0 >> 2, 1); + _emscripten_futex_wake(threadInfoStruct + 0, 2147483647); + threadInfoStruct = selfThreadId = 0; + __register_pthread_ptr(0, 0, 0); + postMessage({ + "cmd": "cancelDone" + }) + }, + terminateAllThreads: function () { + for (var t in PThread.pthreads) { + var pthread = PThread.pthreads[t]; + if (pthread && pthread.worker) { + PThread.returnWorkerToPool(pthread.worker) + } + } + PThread.pthreads = {}; + for (var i = 0; i < PThread.unusedWorkers.length; ++i) { + var worker = PThread.unusedWorkers[i]; + assert(!worker.pthread); + worker.terminate() + } + PThread.unusedWorkers = []; + for (var i = 0; i < PThread.runningWorkers.length; ++i) { + var worker = PThread.runningWorkers[i]; + var pthread = worker.pthread; + assert(pthread, "This Worker should have a pthread it is executing"); + PThread.freeThreadData(pthread); + worker.terminate() + } + PThread.runningWorkers = [] + }, + freeThreadData: function (pthread) { + if (!pthread) return; + if (pthread.threadInfoStruct) { + var tlsMemory = HEAP32[pthread.threadInfoStruct + 104 >> 2]; + HEAP32[pthread.threadInfoStruct + 104 >> 2] = 0; + _free(tlsMemory); + _free(pthread.threadInfoStruct) + } + pthread.threadInfoStruct = 0; + if (pthread.allocatedOwnStack && pthread.stackBase) _free(pthread.stackBase); + pthread.stackBase = 0; + if (pthread.worker) pthread.worker.pthread = null + }, + returnWorkerToPool: function (worker) { + delete PThread.pthreads[worker.pthread.thread]; + PThread.unusedWorkers.push(worker); + PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker), 1); + PThread.freeThreadData(worker.pthread); + worker.pthread = undefined + }, + receiveObjectTransfer: function (data) {}, + loadWasmModuleToWorker: function (worker, onFinishedLoading) { + worker.onmessage = function (e) { + var d = e["data"]; + var cmd = d["cmd"]; + if (worker.pthread) PThread.currentProxiedOperationCallerThread = worker.pthread.threadInfoStruct; + if (d["targetThread"] && d["targetThread"] != _pthread_self()) { + var thread = PThread.pthreads[d.targetThread]; + if (thread) { + thread.worker.postMessage(e.data, d["transferList"]) + } else { + console.error('Internal error! Worker sent a message "' + cmd + '" to target pthread ' + d["targetThread"] + ", but that thread no longer exists!") + } + PThread.currentProxiedOperationCallerThread = undefined; + return + } + if (cmd === "processQueuedMainThreadWork") { + _emscripten_main_thread_process_queued_calls() + } else if (cmd === "spawnThread") { + __spawn_thread(e.data) + } else if (cmd === "cleanupThread") { + __cleanup_thread(d["thread"]) + } else if (cmd === "killThread") { + __kill_thread(d["thread"]) + } else if (cmd === "cancelThread") { + __cancel_thread(d["thread"]) + } else if (cmd === "loaded") { + worker.loaded = true; + if (onFinishedLoading) onFinishedLoading(worker); + if (worker.runPthread) { + worker.runPthread(); + delete worker.runPthread + } + } else if (cmd === "print") { + out("Thread " + d["threadId"] + ": " + d["text"]) + } else if (cmd === "printErr") { + err("Thread " + d["threadId"] + ": " + d["text"]) + } else if (cmd === "alert") { + alert("Thread " + d["threadId"] + ": " + d["text"]) + } else if (cmd === "exit") { + var detached = worker.pthread && Atomics.load(HEAPU32, worker.pthread.thread + 68 >> 2); + if (detached) { + PThread.returnWorkerToPool(worker) + } + } else if (cmd === "cancelDone") { + PThread.returnWorkerToPool(worker) + } else if (cmd === "objectTransfer") { + PThread.receiveObjectTransfer(e.data) + } else if (e.data.target === "setimmediate") { + worker.postMessage(e.data) + } else { + err("worker sent an unknown command " + cmd) + } + PThread.currentProxiedOperationCallerThread = undefined + }; + worker.onerror = function (e) { + err("pthread sent an error! " + e.filename + ":" + e.lineno + ": " + e.message) + }; + if (ENVIRONMENT_IS_NODE) { + worker.on("message", function (data) { + worker.onmessage({ + data: data + }) + }); + worker.on("error", function (data) { + worker.onerror(data) + }); + worker.on("exit", function (data) { + console.log("worker exited - TODO: update the worker queue?") + }) + } + assert(wasmMemory instanceof WebAssembly.Memory, "WebAssembly memory should have been loaded by now!"); + assert(wasmModule instanceof WebAssembly.Module, "WebAssembly Module should have been loaded by now!"); + worker.postMessage({ + "cmd": "load", + "urlOrBlob": Module["mainScriptUrlOrBlob"] || _scriptDir, + "wasmMemory": wasmMemory, + "wasmModule": wasmModule, + "DYNAMIC_BASE": DYNAMIC_BASE, + "DYNAMICTOP_PTR": DYNAMICTOP_PTR + }) + }, + allocateUnusedWorker: function () { + var pthreadMainJs = locateFile("tfjs-backend-wasm.worker.js"); + PThread.unusedWorkers.push(new Worker(pthreadMainJs)) + }, + getNewWorker: function () { + if (PThread.unusedWorkers.length == 0) { + PThread.allocateUnusedWorker(); + PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0]) + } + if (PThread.unusedWorkers.length > 0) return PThread.unusedWorkers.pop(); + else return null + }, + busySpinWait: function (msecs) { + var t = performance.now() + msecs; + while (performance.now() < t) {} + } + }; + + function establishStackSpace(stackTop, stackMax) { + STACK_BASE = STACKTOP = stackTop; + STACK_MAX = stackMax; + ___set_stack_limit(STACK_MAX); + writeStackCookie(); + stackRestore(stackTop) + } + Module["establishStackSpace"] = establishStackSpace; + + function getNoExitRuntime() { + return noExitRuntime + } + Module["getNoExitRuntime"] = getNoExitRuntime; + + function jsStackTrace() { + var err = new Error; + if (!err.stack) { + try { + throw new Error + } catch (e) { + err = e + } + if (!err.stack) { + return "(no stack trace available)" + } + } + return err.stack.toString() + } + + function stackTrace() { + var js = jsStackTrace(); + if (Module["extraStackTrace"]) js += "\n" + Module["extraStackTrace"](); + return demangleAll(js) + } + + function ___assert_fail(condition, filename, line, func) { + abort("Assertion failed: " + UTF8ToString(condition) + ", at: " + [filename ? UTF8ToString(filename) : "unknown filename", line, func ? UTF8ToString(func) : "unknown function"]) + } + var _emscripten_get_now; + if (ENVIRONMENT_IS_NODE) { + _emscripten_get_now = function () { + var t = process["hrtime"](); + return t[0] * 1e3 + t[1] / 1e6 + } + } else if (ENVIRONMENT_IS_PTHREAD) { + _emscripten_get_now = function () { + return performance.now() - Module["__performance_now_clock_drift"] + } + } else if (typeof dateNow !== "undefined") { + _emscripten_get_now = dateNow + } else _emscripten_get_now = function () { + return performance.now() + }; + + function setErrNo(value) { + HEAP32[___errno_location() >> 2] = value; + return value + } + + function _atexit(func, arg) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(1, 1, func, arg); + warnOnce("atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)"); + __ATEXIT__.unshift({ + func: func, + arg: arg + }) + } + + function ___handle_stack_overflow() { + abort("stack overflow") + } + + function __emscripten_notify_thread_queue(targetThreadId, mainThreadId) { + if (targetThreadId == mainThreadId) { + postMessage({ + "cmd": "processQueuedMainThreadWork" + }) + } else if (ENVIRONMENT_IS_PTHREAD) { + postMessage({ + "targetThread": targetThreadId, + "cmd": "processThreadQueue" + }) + } else { + var pthread = PThread.pthreads[targetThreadId]; + var worker = pthread && pthread.worker; + if (!worker) { + err("Cannot send message to thread with ID " + targetThreadId + ", unknown thread ID!"); + return + } + worker.postMessage({ + "cmd": "processThreadQueue" + }) + } + return 1 + } + + function _abort() { + abort() + } + + function _emscripten_conditional_set_current_thread_status(expectedStatus, newStatus) { + expectedStatus = expectedStatus | 0; + newStatus = newStatus | 0 + } + + function _emscripten_futex_wait(addr, val, timeout) { + if (addr <= 0 || addr > HEAP8.length || addr & 3 != 0) return -28; + if (ENVIRONMENT_IS_WORKER) { + var ret = Atomics.wait(HEAP32, addr >> 2, val, timeout); + if (ret === "timed-out") return -73; + if (ret === "not-equal") return -6; + if (ret === "ok") return 0; + throw "Atomics.wait returned an unexpected value " + ret + } else { + var loadedVal = Atomics.load(HEAP32, addr >> 2); + if (val != loadedVal) return -6; + var tNow = performance.now(); + var tEnd = tNow + timeout; + Atomics.store(HEAP32, __main_thread_futex_wait_address >> 2, addr); + var ourWaitAddress = addr; + while (addr == ourWaitAddress) { + tNow = performance.now(); + if (tNow > tEnd) { + return -73 + } + _emscripten_main_thread_process_queued_calls(); + addr = Atomics.load(HEAP32, __main_thread_futex_wait_address >> 2) + } + return 0 + } + } + + function _emscripten_is_main_browser_thread() { + return __pthread_is_main_browser_thread | 0 + } + + function _emscripten_is_main_runtime_thread() { + return __pthread_is_main_runtime_thread | 0 + } + + function _emscripten_memcpy_big(dest, src, num) { + HEAPU8.copyWithin(dest, src, src + num) + } + + function _emscripten_proxy_to_main_thread_js(index, sync) { + var numCallArgs = arguments.length - 2; + if (numCallArgs > 20 - 1) throw "emscripten_proxy_to_main_thread_js: Too many arguments " + numCallArgs + " to proxied function idx=" + index + ", maximum supported is " + (20 - 1) + "!"; + var stack = stackSave(); + var args = stackAlloc(numCallArgs * 8); + var b = args >> 3; + for (var i = 0; i < numCallArgs; i++) { + HEAPF64[b + i] = arguments[2 + i] + } + var ret = _emscripten_run_in_main_runtime_thread_js(index, numCallArgs, args, sync); + stackRestore(stack); + return ret + } + var _emscripten_receive_on_main_thread_js_callArgs = []; + + function readAsmConstArgs(sigPtr, buf) { + if (!readAsmConstArgs.array) { + readAsmConstArgs.array = [] + } + var args = readAsmConstArgs.array; + args.length = 0; + var ch; + while (ch = HEAPU8[sigPtr++]) { + if (ch === 100 || ch === 102) { + buf = buf + 7 & ~7; + args.push(HEAPF64[buf >> 3]); + buf += 8 + } else if (ch === 105) { + buf = buf + 3 & ~3; + args.push(HEAP32[buf >> 2]); + buf += 4 + } else abort("unexpected char in asm const signature " + ch) + } + return args + } + + function _emscripten_receive_on_main_thread_js(index, numCallArgs, args) { + _emscripten_receive_on_main_thread_js_callArgs.length = numCallArgs; + var b = args >> 3; + for (var i = 0; i < numCallArgs; i++) { + _emscripten_receive_on_main_thread_js_callArgs[i] = HEAPF64[b + i] + } + var isEmAsmConst = index < 0; + var func = !isEmAsmConst ? proxiedFunctionTable[index] : ASM_CONSTS[-index - 1]; + if (isEmAsmConst) { + var sigPtr = _emscripten_receive_on_main_thread_js_callArgs[1]; + var varargPtr = _emscripten_receive_on_main_thread_js_callArgs[2]; + var constArgs = readAsmConstArgs(sigPtr, varargPtr); + return func.apply(null, constArgs) + } + assert(func.length == numCallArgs, "Call args mismatch in emscripten_receive_on_main_thread_js"); + return func.apply(null, _emscripten_receive_on_main_thread_js_callArgs) + } + + function abortOnCannotGrowMemory(requestedSize) { + abort("Cannot enlarge memory arrays to size " + requestedSize + " bytes (OOM). Either (1) compile with -s INITIAL_MEMORY=X with X higher than the current value " + HEAP8.length + ", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ") + } + + function _emscripten_resize_heap(requestedSize) { + abortOnCannotGrowMemory(requestedSize) + } + var JSEvents = { + keyEvent: 0, + mouseEvent: 0, + wheelEvent: 0, + uiEvent: 0, + focusEvent: 0, + deviceOrientationEvent: 0, + deviceMotionEvent: 0, + fullscreenChangeEvent: 0, + pointerlockChangeEvent: 0, + visibilityChangeEvent: 0, + touchEvent: 0, + previousFullscreenElement: null, + previousScreenX: null, + previousScreenY: null, + removeEventListenersRegistered: false, + removeAllEventListeners: function () { + for (var i = JSEvents.eventHandlers.length - 1; i >= 0; --i) { + JSEvents._removeHandler(i) + } + JSEvents.eventHandlers = []; + JSEvents.deferredCalls = [] + }, + registerRemoveEventListeners: function () { + if (!JSEvents.removeEventListenersRegistered) { + __ATEXIT__.push(JSEvents.removeAllEventListeners); + JSEvents.removeEventListenersRegistered = true + } + }, + deferredCalls: [], + deferCall: function (targetFunction, precedence, argsList) { + function arraysHaveEqualContent(arrA, arrB) { + if (arrA.length != arrB.length) return false; + for (var i in arrA) { + if (arrA[i] != arrB[i]) return false + } + return true + } + for (var i in JSEvents.deferredCalls) { + var call = JSEvents.deferredCalls[i]; + if (call.targetFunction == targetFunction && arraysHaveEqualContent(call.argsList, argsList)) { + return + } + } + JSEvents.deferredCalls.push({ + targetFunction: targetFunction, + precedence: precedence, + argsList: argsList + }); + JSEvents.deferredCalls.sort(function (x, y) { + return x.precedence < y.precedence + }) + }, + removeDeferredCalls: function (targetFunction) { + for (var i = 0; i < JSEvents.deferredCalls.length; ++i) { + if (JSEvents.deferredCalls[i].targetFunction == targetFunction) { + JSEvents.deferredCalls.splice(i, 1); + --i + } + } + }, + canPerformEventHandlerRequests: function () { + return JSEvents.inEventHandler && JSEvents.currentEventHandler.allowsDeferredCalls + }, + runDeferredCalls: function () { + if (!JSEvents.canPerformEventHandlerRequests()) { + return + } + for (var i = 0; i < JSEvents.deferredCalls.length; ++i) { + var call = JSEvents.deferredCalls[i]; + JSEvents.deferredCalls.splice(i, 1); + --i; + call.targetFunction.apply(null, call.argsList) + } + }, + inEventHandler: 0, + currentEventHandler: null, + eventHandlers: [], + removeAllHandlersOnTarget: function (target, eventTypeString) { + for (var i = 0; i < JSEvents.eventHandlers.length; ++i) { + if (JSEvents.eventHandlers[i].target == target && (!eventTypeString || eventTypeString == JSEvents.eventHandlers[i].eventTypeString)) { + JSEvents._removeHandler(i--) + } + } + }, + _removeHandler: function (i) { + var h = JSEvents.eventHandlers[i]; + h.target.removeEventListener(h.eventTypeString, h.eventListenerFunc, h.useCapture); + JSEvents.eventHandlers.splice(i, 1) + }, + registerOrRemoveHandler: function (eventHandler) { + var jsEventHandler = function jsEventHandler(event) { + ++JSEvents.inEventHandler; + JSEvents.currentEventHandler = eventHandler; + JSEvents.runDeferredCalls(); + eventHandler.handlerFunc(event); + JSEvents.runDeferredCalls(); + --JSEvents.inEventHandler + }; + if (eventHandler.callbackfunc) { + eventHandler.eventListenerFunc = jsEventHandler; + eventHandler.target.addEventListener(eventHandler.eventTypeString, jsEventHandler, eventHandler.useCapture); + JSEvents.eventHandlers.push(eventHandler); + JSEvents.registerRemoveEventListeners() + } else { + for (var i = 0; i < JSEvents.eventHandlers.length; ++i) { + if (JSEvents.eventHandlers[i].target == eventHandler.target && JSEvents.eventHandlers[i].eventTypeString == eventHandler.eventTypeString) { + JSEvents._removeHandler(i--) + } + } + } + }, + queueEventHandlerOnThread_iiii: function (targetThread, eventHandlerFunc, eventTypeId, eventData, userData) { + var stackTop = stackSave(); + var varargs = stackAlloc(12); + HEAP32[varargs >> 2] = eventTypeId; + HEAP32[varargs + 4 >> 2] = eventData; + HEAP32[varargs + 8 >> 2] = userData; + _emscripten_async_queue_on_thread_(targetThread, 637534208, eventHandlerFunc, eventData, varargs); + stackRestore(stackTop) + }, + getTargetThreadForEventCallback: function (targetThread) { + switch (targetThread) { + case 1: + return 0; + case 2: + return PThread.currentProxiedOperationCallerThread; + default: + return targetThread + } + }, + getNodeNameForTarget: function (target) { + if (!target) return ""; + if (target == window) return "#window"; + if (target == screen) return "#screen"; + return target && target.nodeName ? target.nodeName : "" + }, + fullscreenEnabled: function () { + return document.fullscreenEnabled || document.webkitFullscreenEnabled + } + }; + + function stringToNewUTF8(jsString) { + var length = lengthBytesUTF8(jsString) + 1; + var cString = _malloc(length); + stringToUTF8(jsString, cString, length); + return cString + } + + function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread, targetCanvas, width, height) { + var stackTop = stackSave(); + var varargs = stackAlloc(12); + var targetCanvasPtr = 0; + if (targetCanvas) { + targetCanvasPtr = stringToNewUTF8(targetCanvas) + } + HEAP32[varargs >> 2] = targetCanvasPtr; + HEAP32[varargs + 4 >> 2] = width; + HEAP32[varargs + 8 >> 2] = height; + _emscripten_async_queue_on_thread_(targetThread, 657457152, 0, targetCanvasPtr, varargs); + stackRestore(stackTop) + } + + function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread, targetCanvas, width, height) { + targetCanvas = targetCanvas ? UTF8ToString(targetCanvas) : ""; + _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread, targetCanvas, width, height) + } + + function __maybeCStringToJsString(cString) { + return cString === cString + 0 ? UTF8ToString(cString) : cString + } + var __specialEventTargets = [0, typeof document !== "undefined" ? document : 0, typeof window !== "undefined" ? window : 0]; + + function __findEventTarget(target) { + var domElement = __specialEventTargets[target] || (typeof document !== "undefined" ? document.querySelector(__maybeCStringToJsString(target)) : undefined); + return domElement + } + + function __findCanvasEventTarget(target) { + return __findEventTarget(target) + } + + function _emscripten_set_canvas_element_size_calling_thread(target, width, height) { + var canvas = __findCanvasEventTarget(target); + if (!canvas) return -4; + if (canvas.canvasSharedPtr) { + HEAP32[canvas.canvasSharedPtr >> 2] = width; + HEAP32[canvas.canvasSharedPtr + 4 >> 2] = height + } + if (canvas.offscreenCanvas || !canvas.controlTransferredOffscreen) { + if (canvas.offscreenCanvas) canvas = canvas.offscreenCanvas; + var autoResizeViewport = false; + if (canvas.GLctxObject && canvas.GLctxObject.GLctx) { + var prevViewport = canvas.GLctxObject.GLctx.getParameter(2978); + autoResizeViewport = prevViewport[0] === 0 && prevViewport[1] === 0 && prevViewport[2] === canvas.width && prevViewport[3] === canvas.height + } + canvas.width = width; + canvas.height = height; + if (autoResizeViewport) { + canvas.GLctxObject.GLctx.viewport(0, 0, width, height) + } + } else if (canvas.canvasSharedPtr) { + var targetThread = HEAP32[canvas.canvasSharedPtr + 8 >> 2]; + _emscripten_set_offscreencanvas_size_on_target_thread(targetThread, target, width, height); + return 1 + } else { + return -4 + } + return 0 + } + + function _emscripten_set_canvas_element_size_main_thread(target, width, height) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(2, 1, target, width, height); + return _emscripten_set_canvas_element_size_calling_thread(target, width, height) + } + + function _emscripten_set_canvas_element_size(target, width, height) { + var canvas = __findCanvasEventTarget(target); + if (canvas) { + return _emscripten_set_canvas_element_size_calling_thread(target, width, height) + } else { + return _emscripten_set_canvas_element_size_main_thread(target, width, height) + } + } + + function _emscripten_set_current_thread_status(newStatus) { + newStatus = newStatus | 0 + } + + function __webgl_acquireInstancedArraysExtension(ctx) { + var ext = ctx.getExtension("ANGLE_instanced_arrays"); + if (ext) { + ctx["vertexAttribDivisor"] = function (index, divisor) { + ext["vertexAttribDivisorANGLE"](index, divisor) + }; + ctx["drawArraysInstanced"] = function (mode, first, count, primcount) { + ext["drawArraysInstancedANGLE"](mode, first, count, primcount) + }; + ctx["drawElementsInstanced"] = function (mode, count, type, indices, primcount) { + ext["drawElementsInstancedANGLE"](mode, count, type, indices, primcount) + } + } + } + + function __webgl_acquireVertexArrayObjectExtension(ctx) { + var ext = ctx.getExtension("OES_vertex_array_object"); + if (ext) { + ctx["createVertexArray"] = function () { + return ext["createVertexArrayOES"]() + }; + ctx["deleteVertexArray"] = function (vao) { + ext["deleteVertexArrayOES"](vao) + }; + ctx["bindVertexArray"] = function (vao) { + ext["bindVertexArrayOES"](vao) + }; + ctx["isVertexArray"] = function (vao) { + return ext["isVertexArrayOES"](vao) + } + } + } + + function __webgl_acquireDrawBuffersExtension(ctx) { + var ext = ctx.getExtension("WEBGL_draw_buffers"); + if (ext) { + ctx["drawBuffers"] = function (n, bufs) { + ext["drawBuffersWEBGL"](n, bufs) + } + } + } + var GL = { + counter: 1, + lastError: 0, + buffers: [], + mappedBuffers: {}, + programs: [], + framebuffers: [], + renderbuffers: [], + textures: [], + uniforms: [], + shaders: [], + vaos: [], + contexts: {}, + currentContext: null, + offscreenCanvases: {}, + timerQueriesEXT: [], + programInfos: {}, + stringCache: {}, + unpackAlignment: 4, + init: function () { + var miniTempFloatBuffer = new Float32Array(GL.MINI_TEMP_BUFFER_SIZE); + for (var i = 0; i < GL.MINI_TEMP_BUFFER_SIZE; i++) { + GL.miniTempBufferFloatViews[i] = miniTempFloatBuffer.subarray(0, i + 1) + } + var miniTempIntBuffer = new Int32Array(GL.MINI_TEMP_BUFFER_SIZE); + for (var i = 0; i < GL.MINI_TEMP_BUFFER_SIZE; i++) { + GL.miniTempBufferIntViews[i] = miniTempIntBuffer.subarray(0, i + 1) + } + }, + recordError: function recordError(errorCode) { + if (!GL.lastError) { + GL.lastError = errorCode + } + }, + getNewId: function (table) { + var ret = GL.counter++; + for (var i = table.length; i < ret; i++) { + table[i] = null + } + return ret + }, + MINI_TEMP_BUFFER_SIZE: 256, + miniTempBufferFloatViews: [0], + miniTempBufferIntViews: [0], + getSource: function (shader, count, string, length) { + var source = ""; + for (var i = 0; i < count; ++i) { + var len = length ? HEAP32[length + i * 4 >> 2] : -1; + source += UTF8ToString(HEAP32[string + i * 4 >> 2], len < 0 ? undefined : len) + } + return source + }, + createContext: function (canvas, webGLContextAttributes) { + var ctx = canvas.getContext("webgl", webGLContextAttributes); + if (!ctx) return 0; + var handle = GL.registerContext(ctx, webGLContextAttributes); + return handle + }, + registerContext: function (ctx, webGLContextAttributes) { + var handle = _malloc(8); + HEAP32[handle + 4 >> 2] = _pthread_self(); + var context = { + handle: handle, + attributes: webGLContextAttributes, + version: webGLContextAttributes.majorVersion, + GLctx: ctx + }; + if (ctx.canvas) ctx.canvas.GLctxObject = context; + GL.contexts[handle] = context; + if (typeof webGLContextAttributes.enableExtensionsByDefault === "undefined" || webGLContextAttributes.enableExtensionsByDefault) { + GL.initExtensions(context) + } + return handle + }, + makeContextCurrent: function (contextHandle) { + GL.currentContext = GL.contexts[contextHandle]; + Module.ctx = GLctx = GL.currentContext && GL.currentContext.GLctx; + return !(contextHandle && !GLctx) + }, + getContext: function (contextHandle) { + return GL.contexts[contextHandle] + }, + deleteContext: function (contextHandle) { + if (GL.currentContext === GL.contexts[contextHandle]) GL.currentContext = null; + if (typeof JSEvents === "object") JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas); + if (GL.contexts[contextHandle] && GL.contexts[contextHandle].GLctx.canvas) GL.contexts[contextHandle].GLctx.canvas.GLctxObject = undefined; + _free(GL.contexts[contextHandle].handle); + GL.contexts[contextHandle] = null + }, + initExtensions: function (context) { + if (!context) context = GL.currentContext; + if (context.initExtensionsDone) return; + context.initExtensionsDone = true; + var GLctx = context.GLctx; + if (context.version < 2) { + __webgl_acquireInstancedArraysExtension(GLctx); + __webgl_acquireVertexArrayObjectExtension(GLctx); + __webgl_acquireDrawBuffersExtension(GLctx) + } + GLctx.disjointTimerQueryExt = GLctx.getExtension("EXT_disjoint_timer_query"); + var automaticallyEnabledExtensions = ["OES_texture_float", "OES_texture_half_float", "OES_standard_derivatives", "OES_vertex_array_object", "WEBGL_compressed_texture_s3tc", "WEBGL_depth_texture", "OES_element_index_uint", "EXT_texture_filter_anisotropic", "EXT_frag_depth", "WEBGL_draw_buffers", "ANGLE_instanced_arrays", "OES_texture_float_linear", "OES_texture_half_float_linear", "EXT_blend_minmax", "EXT_shader_texture_lod", "EXT_texture_norm16", "WEBGL_compressed_texture_pvrtc", "EXT_color_buffer_half_float", "WEBGL_color_buffer_float", "EXT_sRGB", "WEBGL_compressed_texture_etc1", "EXT_disjoint_timer_query", "WEBGL_compressed_texture_etc", "WEBGL_compressed_texture_astc", "EXT_color_buffer_float", "WEBGL_compressed_texture_s3tc_srgb", "EXT_disjoint_timer_query_webgl2", "WEBKIT_WEBGL_compressed_texture_pvrtc"]; + var exts = GLctx.getSupportedExtensions() || []; + exts.forEach(function (ext) { + if (automaticallyEnabledExtensions.indexOf(ext) != -1) { + GLctx.getExtension(ext) + } + }) + }, + populateUniformTable: function (program) { + var p = GL.programs[program]; + var ptable = GL.programInfos[program] = { + uniforms: {}, + maxUniformLength: 0, + maxAttributeLength: -1, + maxUniformBlockNameLength: -1 + }; + var utable = ptable.uniforms; + var numUniforms = GLctx.getProgramParameter(p, 35718); + for (var i = 0; i < numUniforms; ++i) { + var u = GLctx.getActiveUniform(p, i); + var name = u.name; + ptable.maxUniformLength = Math.max(ptable.maxUniformLength, name.length + 1); + if (name.slice(-1) == "]") { + name = name.slice(0, name.lastIndexOf("[")) + } + var loc = GLctx.getUniformLocation(p, name); + if (loc) { + var id = GL.getNewId(GL.uniforms); + utable[name] = [u.size, id]; + GL.uniforms[id] = loc; + for (var j = 1; j < u.size; ++j) { + var n = name + "[" + j + "]"; + loc = GLctx.getUniformLocation(p, n); + id = GL.getNewId(GL.uniforms); + GL.uniforms[id] = loc + } + } + } + } + }; + var __emscripten_webgl_power_preferences = ["default", "low-power", "high-performance"]; + + function _emscripten_webgl_do_create_context(target, attributes) { + assert(attributes); + var contextAttributes = {}; + var a = attributes >> 2; + contextAttributes["alpha"] = !!HEAP32[a + (0 >> 2)]; + contextAttributes["depth"] = !!HEAP32[a + (4 >> 2)]; + contextAttributes["stencil"] = !!HEAP32[a + (8 >> 2)]; + contextAttributes["antialias"] = !!HEAP32[a + (12 >> 2)]; + contextAttributes["premultipliedAlpha"] = !!HEAP32[a + (16 >> 2)]; + contextAttributes["preserveDrawingBuffer"] = !!HEAP32[a + (20 >> 2)]; + var powerPreference = HEAP32[a + (24 >> 2)]; + contextAttributes["powerPreference"] = __emscripten_webgl_power_preferences[powerPreference]; + contextAttributes["failIfMajorPerformanceCaveat"] = !!HEAP32[a + (28 >> 2)]; + contextAttributes.majorVersion = HEAP32[a + (32 >> 2)]; + contextAttributes.minorVersion = HEAP32[a + (36 >> 2)]; + contextAttributes.enableExtensionsByDefault = HEAP32[a + (40 >> 2)]; + contextAttributes.explicitSwapControl = HEAP32[a + (44 >> 2)]; + contextAttributes.proxyContextToMainThread = HEAP32[a + (48 >> 2)]; + contextAttributes.renderViaOffscreenBackBuffer = HEAP32[a + (52 >> 2)]; + var canvas = __findCanvasEventTarget(target); + if (!canvas) { + return 0 + } + if (contextAttributes.explicitSwapControl) { + return 0 + } + var contextHandle = GL.createContext(canvas, contextAttributes); + return contextHandle + } + + function _emscripten_webgl_create_context(a0, a1) { + return _emscripten_webgl_do_create_context(a0, a1) + } + var PATH = { + splitPath: function (filename) { + var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; + return splitPathRe.exec(filename).slice(1) + }, + normalizeArray: function (parts, allowAboveRoot) { + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === ".") { + parts.splice(i, 1) + } else if (last === "..") { + parts.splice(i, 1); + up++ + } else if (up) { + parts.splice(i, 1); + up-- + } + } + if (allowAboveRoot) { + for (; up; up--) { + parts.unshift("..") + } + } + return parts + }, + normalize: function (path) { + var isAbsolute = path.charAt(0) === "/", + trailingSlash = path.substr(-1) === "/"; + path = PATH.normalizeArray(path.split("/").filter(function (p) { + return !!p + }), !isAbsolute).join("/"); + if (!path && !isAbsolute) { + path = "." + } + if (path && trailingSlash) { + path += "/" + } + return (isAbsolute ? "/" : "") + path + }, + dirname: function (path) { + var result = PATH.splitPath(path), + root = result[0], + dir = result[1]; + if (!root && !dir) { + return "." + } + if (dir) { + dir = dir.substr(0, dir.length - 1) + } + return root + dir + }, + basename: function (path) { + if (path === "/") return "/"; + var lastSlash = path.lastIndexOf("/"); + if (lastSlash === -1) return path; + return path.substr(lastSlash + 1) + }, + extname: function (path) { + return PATH.splitPath(path)[3] + }, + join: function () { + var paths = Array.prototype.slice.call(arguments, 0); + return PATH.normalize(paths.join("/")) + }, + join2: function (l, r) { + return PATH.normalize(l + "/" + r) + } + }; + var SYSCALLS = { + mappings: {}, + buffers: [null, [], + [] + ], + printChar: function (stream, curr) { + var buffer = SYSCALLS.buffers[stream]; + assert(buffer); + if (curr === 0 || curr === 10) { + (stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0)); + buffer.length = 0 + } else { + buffer.push(curr) + } + }, + varargs: undefined, + get: function () { + assert(SYSCALLS.varargs != undefined); + SYSCALLS.varargs += 4; + var ret = HEAP32[SYSCALLS.varargs - 4 >> 2]; + return ret + }, + getStr: function (ptr) { + var ret = UTF8ToString(ptr); + return ret + }, + get64: function (low, high) { + if (low >= 0) assert(high === 0); + else assert(high === -1); + return low + } + }; + + function _fd_close(fd) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(3, 1, fd); + abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM"); + return 0 + } + + function _fd_seek(fd, offset_low, offset_high, whence, newOffset) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(4, 1, fd, offset_low, offset_high, whence, newOffset); + abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM") + } + + function _fd_write(fd, iov, iovcnt, pnum) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(5, 1, fd, iov, iovcnt, pnum); + var num = 0; + for (var i = 0; i < iovcnt; i++) { + var ptr = HEAP32[iov + i * 8 >> 2]; + var len = HEAP32[iov + (i * 8 + 4) >> 2]; + for (var j = 0; j < len; j++) { + SYSCALLS.printChar(fd, HEAPU8[ptr + j]) + } + num += len + } + HEAP32[pnum >> 2] = num; + return 0 + } + + function _pthread_cleanup_pop(execute) { + var routine = PThread.exitHandlers.pop(); + if (execute) routine() + } + + function _pthread_cleanup_push(routine, arg) { + if (PThread.exitHandlers === null) { + PThread.exitHandlers = [] + } + PThread.exitHandlers.push(function () { + dynCall_vi(routine, arg) + }) + } + + function __spawn_thread(threadParams) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _spawn_thread() can only ever be called from main application thread!"; + var worker = PThread.getNewWorker(); + if (worker.pthread !== undefined) throw "Internal error!"; + if (!threadParams.pthread_ptr) throw "Internal error, no pthread ptr!"; + PThread.runningWorkers.push(worker); + var tlsMemory = _malloc(128 * 4); + for (var i = 0; i < 128; ++i) { + HEAP32[tlsMemory + i * 4 >> 2] = 0 + } + var stackHigh = threadParams.stackBase + threadParams.stackSize; + var pthread = PThread.pthreads[threadParams.pthread_ptr] = { + worker: worker, + stackBase: threadParams.stackBase, + stackSize: threadParams.stackSize, + allocatedOwnStack: threadParams.allocatedOwnStack, + thread: threadParams.pthread_ptr, + threadInfoStruct: threadParams.pthread_ptr + }; + var tis = pthread.threadInfoStruct >> 2; + Atomics.store(HEAPU32, tis + (0 >> 2), 0); + Atomics.store(HEAPU32, tis + (4 >> 2), 0); + Atomics.store(HEAPU32, tis + (8 >> 2), 0); + Atomics.store(HEAPU32, tis + (68 >> 2), threadParams.detached); + Atomics.store(HEAPU32, tis + (104 >> 2), tlsMemory); + Atomics.store(HEAPU32, tis + (48 >> 2), 0); + Atomics.store(HEAPU32, tis + (40 >> 2), pthread.threadInfoStruct); + Atomics.store(HEAPU32, tis + (44 >> 2), 42); + Atomics.store(HEAPU32, tis + (108 >> 2), threadParams.stackSize); + Atomics.store(HEAPU32, tis + (84 >> 2), threadParams.stackSize); + Atomics.store(HEAPU32, tis + (80 >> 2), stackHigh); + Atomics.store(HEAPU32, tis + (108 + 8 >> 2), stackHigh); + Atomics.store(HEAPU32, tis + (108 + 12 >> 2), threadParams.detached); + Atomics.store(HEAPU32, tis + (108 + 20 >> 2), threadParams.schedPolicy); + Atomics.store(HEAPU32, tis + (108 + 24 >> 2), threadParams.schedPrio); + var global_libc = _emscripten_get_global_libc(); + var global_locale = global_libc + 40; + Atomics.store(HEAPU32, tis + (176 >> 2), global_locale); + worker.pthread = pthread; + var msg = { + "cmd": "run", + "start_routine": threadParams.startRoutine, + "arg": threadParams.arg, + "threadInfoStruct": threadParams.pthread_ptr, + "selfThreadId": threadParams.pthread_ptr, + "parentThreadId": threadParams.parent_pthread_ptr, + "stackBase": threadParams.stackBase, + "stackSize": threadParams.stackSize + }; + worker.runPthread = function () { + msg.time = performance.now(); + worker.postMessage(msg, threadParams.transferList) + }; + if (worker.loaded) { + worker.runPthread(); + delete worker.runPthread + } + } + + function _pthread_getschedparam(thread, policy, schedparam) { + if (!policy && !schedparam) return ERRNO_CODES.EINVAL; + if (!thread) { + err("pthread_getschedparam called with a null thread pointer!"); + return ERRNO_CODES.ESRCH + } + var self = HEAP32[thread + 12 >> 2]; + if (self !== thread) { + err("pthread_getschedparam attempted on thread " + thread + ", which does not point to a valid thread, or does not exist anymore!"); + return ERRNO_CODES.ESRCH + } + var schedPolicy = Atomics.load(HEAPU32, thread + 108 + 20 >> 2); + var schedPrio = Atomics.load(HEAPU32, thread + 108 + 24 >> 2); + if (policy) HEAP32[policy >> 2] = schedPolicy; + if (schedparam) HEAP32[schedparam >> 2] = schedPrio; + return 0 + } + + function _pthread_self() { + return __pthread_ptr | 0 + } + Module["_pthread_self"] = _pthread_self; + + function _pthread_create(pthread_ptr, attr, start_routine, arg) { + if (typeof SharedArrayBuffer === "undefined") { + err("Current environment does not support SharedArrayBuffer, pthreads are not available!"); + return 6 + } + if (!pthread_ptr) { + err("pthread_create called with a null thread pointer!"); + return 28 + } + var transferList = []; + var error = 0; + if (ENVIRONMENT_IS_PTHREAD && (transferList.length === 0 || error)) { + return _emscripten_sync_run_in_main_thread_4(687865856, pthread_ptr, attr, start_routine, arg) + } + if (error) return error; + var stackSize = 0; + var stackBase = 0; + var detached = 0; + var schedPolicy = 0; + var schedPrio = 0; + if (attr) { + stackSize = HEAP32[attr >> 2]; + stackSize += 81920; + stackBase = HEAP32[attr + 8 >> 2]; + detached = HEAP32[attr + 12 >> 2] !== 0; + var inheritSched = HEAP32[attr + 16 >> 2] === 0; + if (inheritSched) { + var prevSchedPolicy = HEAP32[attr + 20 >> 2]; + var prevSchedPrio = HEAP32[attr + 24 >> 2]; + var parentThreadPtr = PThread.currentProxiedOperationCallerThread ? PThread.currentProxiedOperationCallerThread : _pthread_self(); + _pthread_getschedparam(parentThreadPtr, attr + 20, attr + 24); + schedPolicy = HEAP32[attr + 20 >> 2]; + schedPrio = HEAP32[attr + 24 >> 2]; + HEAP32[attr + 20 >> 2] = prevSchedPolicy; + HEAP32[attr + 24 >> 2] = prevSchedPrio + } else { + schedPolicy = HEAP32[attr + 20 >> 2]; + schedPrio = HEAP32[attr + 24 >> 2] + } + } else { + stackSize = 2097152 + } + var allocatedOwnStack = stackBase == 0; + if (allocatedOwnStack) { + stackBase = _memalign(16, stackSize) + } else { + stackBase -= stackSize; + assert(stackBase > 0) + } + var threadInfoStruct = _malloc(232); + for (var i = 0; i < 232 >> 2; ++i) HEAPU32[(threadInfoStruct >> 2) + i] = 0; + HEAP32[pthread_ptr >> 2] = threadInfoStruct; + HEAP32[threadInfoStruct + 12 >> 2] = threadInfoStruct; + var headPtr = threadInfoStruct + 156; + HEAP32[headPtr >> 2] = headPtr; + var threadParams = { + stackBase: stackBase, + stackSize: stackSize, + allocatedOwnStack: allocatedOwnStack, + schedPolicy: schedPolicy, + schedPrio: schedPrio, + detached: detached, + startRoutine: start_routine, + pthread_ptr: threadInfoStruct, + parent_pthread_ptr: _pthread_self(), + arg: arg, + transferList: transferList + }; + if (ENVIRONMENT_IS_PTHREAD) { + threadParams.cmd = "spawnThread"; + postMessage(threadParams, transferList) + } else { + __spawn_thread(threadParams) + } + return 0 + } + + function _roundf(d) { + d = +d; + return d >= +0 ? +Math_floor(d + +.5) : +Math_ceil(d - +.5) + } + + function _sysconf(name) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(6, 1, name); + switch (name) { + case 30: + return 16384; + case 85: + var maxHeapSize = HEAPU8.length; + return maxHeapSize / 16384; + case 132: + case 133: + case 12: + case 137: + case 138: + case 15: + case 235: + case 16: + case 17: + case 18: + case 19: + case 20: + case 149: + case 13: + case 10: + case 236: + case 153: + case 9: + case 21: + case 22: + case 159: + case 154: + case 14: + case 77: + case 78: + case 139: + case 80: + case 81: + case 82: + case 68: + case 67: + case 164: + case 11: + case 29: + case 47: + case 48: + case 95: + case 52: + case 51: + case 46: + case 79: + return 200809; + case 27: + case 246: + case 127: + case 128: + case 23: + case 24: + case 160: + case 161: + case 181: + case 182: + case 242: + case 183: + case 184: + case 243: + case 244: + case 245: + case 165: + case 178: + case 179: + case 49: + case 50: + case 168: + case 169: + case 175: + case 170: + case 171: + case 172: + case 97: + case 76: + case 32: + case 173: + case 35: + return -1; + case 176: + case 177: + case 7: + case 155: + case 8: + case 157: + case 125: + case 126: + case 92: + case 93: + case 129: + case 130: + case 131: + case 94: + case 91: + return 1; + case 74: + case 60: + case 69: + case 70: + case 4: + return 1024; + case 31: + case 42: + case 72: + return 32; + case 87: + case 26: + case 33: + return 2147483647; + case 34: + case 1: + return 47839; + case 38: + case 36: + return 99; + case 43: + case 37: + return 2048; + case 0: + return 2097152; + case 3: + return 65536; + case 28: + return 32768; + case 44: + return 32767; + case 75: + return 16384; + case 39: + return 1e3; + case 89: + return 700; + case 71: + return 256; + case 40: + return 255; + case 2: + return 100; + case 180: + return 64; + case 25: + return 20; + case 5: + return 16; + case 6: + return 6; + case 73: + return 4; + case 84: { + if (typeof navigator === "object") return navigator["hardwareConcurrency"] || 1; + return 1 + } + } + setErrNo(28); + return -1 + } + if (!ENVIRONMENT_IS_PTHREAD) PThread.initMainThreadBlock(); + else PThread.initWorker(); + var GLctx; + GL.init(); + var proxiedFunctionTable = [null, _atexit, _emscripten_set_canvas_element_size_main_thread, _fd_close, _fd_seek, _fd_write, _sysconf]; + var asmLibraryArg = { + "__assert_fail": ___assert_fail, + "__handle_stack_overflow": ___handle_stack_overflow, + "_emscripten_notify_thread_queue": __emscripten_notify_thread_queue, + "abort": _abort, + "emscripten_conditional_set_current_thread_status": _emscripten_conditional_set_current_thread_status, + "emscripten_futex_wait": _emscripten_futex_wait, + "emscripten_futex_wake": _emscripten_futex_wake, + "emscripten_get_now": _emscripten_get_now, + "emscripten_is_main_browser_thread": _emscripten_is_main_browser_thread, + "emscripten_is_main_runtime_thread": _emscripten_is_main_runtime_thread, + "emscripten_memcpy_big": _emscripten_memcpy_big, + "emscripten_receive_on_main_thread_js": _emscripten_receive_on_main_thread_js, + "emscripten_resize_heap": _emscripten_resize_heap, + "emscripten_set_canvas_element_size": _emscripten_set_canvas_element_size, + "emscripten_set_current_thread_status": _emscripten_set_current_thread_status, + "emscripten_webgl_create_context": _emscripten_webgl_create_context, + "fd_close": _fd_close, + "fd_seek": _fd_seek, + "fd_write": _fd_write, + "initPthreadsJS": initPthreadsJS, + "memory": wasmMemory || Module["wasmMemory"], + "pthread_cleanup_pop": _pthread_cleanup_pop, + "pthread_cleanup_push": _pthread_cleanup_push, + "pthread_create": _pthread_create, + "pthread_self": _pthread_self, + "roundf": _roundf, + "table": wasmTable + }; + var asm = createWasm(); + Module["asm"] = asm; + var ___wasm_call_ctors = Module["___wasm_call_ctors"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__wasm_call_ctors"].apply(null, arguments) + }; + var _init = Module["_init"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["init"].apply(null, arguments) + }; + var _register_tensor = Module["_register_tensor"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["register_tensor"].apply(null, arguments) + }; + var _dispose_data = Module["_dispose_data"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dispose_data"].apply(null, arguments) + }; + var _dispose = Module["_dispose"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dispose"].apply(null, arguments) + }; + var _Abs = Module["_Abs"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Abs"].apply(null, arguments) + }; + var _Add = Module["_Add"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Add"].apply(null, arguments) + }; + var _AddN = Module["_AddN"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["AddN"].apply(null, arguments) + }; + var _ArgMax = Module["_ArgMax"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ArgMax"].apply(null, arguments) + }; + var _AvgPool = Module["_AvgPool"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["AvgPool"].apply(null, arguments) + }; + var _BatchMatMul = Module["_BatchMatMul"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["BatchMatMul"].apply(null, arguments) + }; + var _ClipByValue = Module["_ClipByValue"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ClipByValue"].apply(null, arguments) + }; + var _Conv2D = Module["_Conv2D"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Conv2D"].apply(null, arguments) + }; + var _Cos = Module["_Cos"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Cos"].apply(null, arguments) + }; + var _CropAndResize = Module["_CropAndResize"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["CropAndResize"].apply(null, arguments) + }; + var _DepthwiseConv2dNative = Module["_DepthwiseConv2dNative"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["DepthwiseConv2dNative"].apply(null, arguments) + }; + var _Div = Module["_Div"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Div"].apply(null, arguments) + }; + var _Exp = Module["_Exp"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Exp"].apply(null, arguments) + }; + var _FloorDiv = Module["_FloorDiv"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FloorDiv"].apply(null, arguments) + }; + var _FusedBatchNorm = Module["_FusedBatchNorm"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FusedBatchNorm"].apply(null, arguments) + }; + var _FusedConv2D = Module["_FusedConv2D"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FusedConv2D"].apply(null, arguments) + }; + var _FusedDepthwiseConv2D = Module["_FusedDepthwiseConv2D"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FusedDepthwiseConv2D"].apply(null, arguments) + }; + var _Gather = Module["_Gather"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Gather"].apply(null, arguments) + }; + var _GatherNd = Module["_GatherNd"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["GatherNd"].apply(null, arguments) + }; + var _Greater = Module["_Greater"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Greater"].apply(null, arguments) + }; + var _GreaterEqual = Module["_GreaterEqual"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["GreaterEqual"].apply(null, arguments) + }; + var _Less = Module["_Less"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Less"].apply(null, arguments) + }; + var _LessEqual = Module["_LessEqual"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["LessEqual"].apply(null, arguments) + }; + var _Log = Module["_Log"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Log"].apply(null, arguments) + }; + var _LogicalAnd = Module["_LogicalAnd"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["LogicalAnd"].apply(null, arguments) + }; + var _Max = Module["_Max"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Max"].apply(null, arguments) + }; + var _MaxPool = Module["_MaxPool"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["MaxPool"].apply(null, arguments) + }; + var _Maximum = Module["_Maximum"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Maximum"].apply(null, arguments) + }; + var _Min = Module["_Min"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Min"].apply(null, arguments) + }; + var _Minimum = Module["_Minimum"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Minimum"].apply(null, arguments) + }; + var _Mul = Module["_Mul"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Mul"].apply(null, arguments) + }; + var _Neg = Module["_Neg"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Neg"].apply(null, arguments) + }; + var _NonMaxSuppressionV3 = Module["_NonMaxSuppressionV3"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["NonMaxSuppressionV3"].apply(null, arguments) + }; + var _NonMaxSuppressionV5 = Module["_NonMaxSuppressionV5"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["NonMaxSuppressionV5"].apply(null, arguments) + }; + var _NotEqual = Module["_NotEqual"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["NotEqual"].apply(null, arguments) + }; + var _PadV2 = Module["_PadV2"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["PadV2"].apply(null, arguments) + }; + var _Pow = Module["_Pow"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Pow"].apply(null, arguments) + }; + var _Prelu = Module["_Prelu"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Prelu"].apply(null, arguments) + }; + var _Relu = Module["_Relu"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Relu"].apply(null, arguments) + }; + var _Relu6 = Module["_Relu6"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Relu6"].apply(null, arguments) + }; + var _ResizeBilinear = Module["_ResizeBilinear"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ResizeBilinear"].apply(null, arguments) + }; + var _Rsqrt = Module["_Rsqrt"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Rsqrt"].apply(null, arguments) + }; + var _ScatterNd = Module["_ScatterNd"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ScatterNd"].apply(null, arguments) + }; + var _Sigmoid = Module["_Sigmoid"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sigmoid"].apply(null, arguments) + }; + var _Sin = Module["_Sin"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sin"].apply(null, arguments) + }; + var _Softmax = Module["_Softmax"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Softmax"].apply(null, arguments) + }; + var _Sqrt = Module["_Sqrt"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sqrt"].apply(null, arguments) + }; + var _Square = Module["_Square"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Square"].apply(null, arguments) + }; + var _Sub = Module["_Sub"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sub"].apply(null, arguments) + }; + var _Sum = Module["_Sum"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sum"].apply(null, arguments) + }; + var _Tanh = Module["_Tanh"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Tanh"].apply(null, arguments) + }; + var _Tile = Module["_Tile"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Tile"].apply(null, arguments) + }; + var _Transpose = Module["_Transpose"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Transpose"].apply(null, arguments) + }; + var __FusedMatMul = Module["__FusedMatMul"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["_FusedMatMul"].apply(null, arguments) + }; + var _malloc = Module["_malloc"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["malloc"].apply(null, arguments) + }; + var _free = Module["_free"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["free"].apply(null, arguments) + }; + var ___em_js__initPthreadsJS = Module["___em_js__initPthreadsJS"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__em_js__initPthreadsJS"].apply(null, arguments) + }; + var ___errno_location = Module["___errno_location"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__errno_location"].apply(null, arguments) + }; + var _emscripten_get_global_libc = Module["_emscripten_get_global_libc"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_get_global_libc"].apply(null, arguments) + }; + var _memalign = Module["_memalign"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["memalign"].apply(null, arguments) + }; + var ___pthread_tsd_run_dtors = Module["___pthread_tsd_run_dtors"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__pthread_tsd_run_dtors"].apply(null, arguments) + }; + var _emscripten_main_thread_process_queued_calls = Module["_emscripten_main_thread_process_queued_calls"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null, arguments) + }; + var _emscripten_current_thread_process_queued_calls = Module["_emscripten_current_thread_process_queued_calls"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null, arguments) + }; + var _emscripten_register_main_browser_thread_id = Module["_emscripten_register_main_browser_thread_id"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null, arguments) + }; + var _emscripten_main_browser_thread_id = Module["_emscripten_main_browser_thread_id"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_main_browser_thread_id"].apply(null, arguments) + }; + var _emscripten_async_run_in_main_thread = Module["_emscripten_async_run_in_main_thread"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread = Module["_emscripten_sync_run_in_main_thread"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_0 = Module["_emscripten_sync_run_in_main_thread_0"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_1 = Module["_emscripten_sync_run_in_main_thread_1"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_2 = Module["_emscripten_sync_run_in_main_thread_2"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_xprintf_varargs = Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_3 = Module["_emscripten_sync_run_in_main_thread_3"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_4 = Module["_emscripten_sync_run_in_main_thread_4"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_5 = Module["_emscripten_sync_run_in_main_thread_5"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_6 = Module["_emscripten_sync_run_in_main_thread_6"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_7 = Module["_emscripten_sync_run_in_main_thread_7"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null, arguments) + }; + var _emscripten_run_in_main_runtime_thread_js = Module["_emscripten_run_in_main_runtime_thread_js"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null, arguments) + }; + var _emscripten_async_queue_on_thread_ = Module["_emscripten_async_queue_on_thread_"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null, arguments) + }; + var _emscripten_tls_init = Module["_emscripten_tls_init"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_tls_init"].apply(null, arguments) + }; + var ___set_stack_limit = Module["___set_stack_limit"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__set_stack_limit"].apply(null, arguments) + }; + var stackSave = Module["stackSave"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["stackSave"].apply(null, arguments) + }; + var stackAlloc = Module["stackAlloc"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["stackAlloc"].apply(null, arguments) + }; + var stackRestore = Module["stackRestore"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["stackRestore"].apply(null, arguments) + }; + var dynCall_vi = Module["dynCall_vi"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dynCall_vi"].apply(null, arguments) + }; + var dynCall_v = Module["dynCall_v"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dynCall_v"].apply(null, arguments) + }; + var dynCall_ii = Module["dynCall_ii"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dynCall_ii"].apply(null, arguments) + }; + Module["asm"] = asm; + if (!Object.getOwnPropertyDescriptor(Module, "intArrayFromString")) Module["intArrayFromString"] = function () { + abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "intArrayToString")) Module["intArrayToString"] = function () { + abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "ccall")) Module["ccall"] = function () { + abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + Module["cwrap"] = cwrap; + if (!Object.getOwnPropertyDescriptor(Module, "setValue")) Module["setValue"] = function () { + abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getValue")) Module["getValue"] = function () { + abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "allocate")) Module["allocate"] = function () { + abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getMemory")) Module["getMemory"] = function () { + abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF8ArrayToString")) Module["UTF8ArrayToString"] = function () { + abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF8ToString")) Module["UTF8ToString"] = function () { + abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8Array")) Module["stringToUTF8Array"] = function () { + abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8")) Module["stringToUTF8"] = function () { + abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF8")) Module["lengthBytesUTF8"] = function () { + abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function () { + abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnPreRun")) Module["addOnPreRun"] = function () { + abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnInit")) Module["addOnInit"] = function () { + abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnPreMain")) Module["addOnPreMain"] = function () { + abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnExit")) Module["addOnExit"] = function () { + abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnPostRun")) Module["addOnPostRun"] = function () { + abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeStringToMemory")) Module["writeStringToMemory"] = function () { + abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeArrayToMemory")) Module["writeArrayToMemory"] = function () { + abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeAsciiToMemory")) Module["writeAsciiToMemory"] = function () { + abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addRunDependency")) Module["addRunDependency"] = function () { + abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "removeRunDependency")) Module["removeRunDependency"] = function () { + abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createFolder")) Module["FS_createFolder"] = function () { + abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createPath")) Module["FS_createPath"] = function () { + abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createDataFile")) Module["FS_createDataFile"] = function () { + abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createPreloadedFile")) Module["FS_createPreloadedFile"] = function () { + abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createLazyFile")) Module["FS_createLazyFile"] = function () { + abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createLink")) Module["FS_createLink"] = function () { + abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createDevice")) Module["FS_createDevice"] = function () { + abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_unlink")) Module["FS_unlink"] = function () { + abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "dynamicAlloc")) Module["dynamicAlloc"] = function () { + abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "loadDynamicLibrary")) Module["loadDynamicLibrary"] = function () { + abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "loadWebAssemblyModule")) Module["loadWebAssemblyModule"] = function () { + abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getLEB")) Module["getLEB"] = function () { + abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getFunctionTables")) Module["getFunctionTables"] = function () { + abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "alignFunctionTables")) Module["alignFunctionTables"] = function () { + abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "registerFunctions")) Module["registerFunctions"] = function () { + abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addFunction")) Module["addFunction"] = function () { + abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "removeFunction")) Module["removeFunction"] = function () { + abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getFuncWrapper")) Module["getFuncWrapper"] = function () { + abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "prettyPrint")) Module["prettyPrint"] = function () { + abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "makeBigInt")) Module["makeBigInt"] = function () { + abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "dynCall")) Module["dynCall"] = function () { + abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getCompilerSetting")) Module["getCompilerSetting"] = function () { + abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "print")) Module["print"] = function () { + abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "printErr")) Module["printErr"] = function () { + abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getTempRet0")) Module["getTempRet0"] = function () { + abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "setTempRet0")) Module["setTempRet0"] = function () { + abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "callMain")) Module["callMain"] = function () { + abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "abort")) Module["abort"] = function () { + abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToNewUTF8")) Module["stringToNewUTF8"] = function () { + abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "abortOnCannotGrowMemory")) Module["abortOnCannotGrowMemory"] = function () { + abort("'abortOnCannotGrowMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscripten_realloc_buffer")) Module["emscripten_realloc_buffer"] = function () { + abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "ENV")) Module["ENV"] = function () { + abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "setjmpId")) Module["setjmpId"] = function () { + abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_CODES")) Module["ERRNO_CODES"] = function () { + abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_MESSAGES")) Module["ERRNO_MESSAGES"] = function () { + abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "setErrNo")) Module["setErrNo"] = function () { + abort("'setErrNo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "DNS")) Module["DNS"] = function () { + abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GAI_ERRNO_MESSAGES")) Module["GAI_ERRNO_MESSAGES"] = function () { + abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "Protocols")) Module["Protocols"] = function () { + abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "Sockets")) Module["Sockets"] = function () { + abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UNWIND_CACHE")) Module["UNWIND_CACHE"] = function () { + abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "readAsmConstArgs")) Module["readAsmConstArgs"] = function () { + abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "jstoi_q")) Module["jstoi_q"] = function () { + abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "jstoi_s")) Module["jstoi_s"] = function () { + abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "PATH")) Module["PATH"] = function () { + abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "PATH_FS")) Module["PATH_FS"] = function () { + abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SYSCALLS")) Module["SYSCALLS"] = function () { + abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "syscallMmap2")) Module["syscallMmap2"] = function () { + abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "syscallMunmap")) Module["syscallMunmap"] = function () { + abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "flush_NO_FILESYSTEM")) Module["flush_NO_FILESYSTEM"] = function () { + abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "JSEvents")) Module["JSEvents"] = function () { + abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "demangle")) Module["demangle"] = function () { + abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "demangleAll")) Module["demangleAll"] = function () { + abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "jsStackTrace")) Module["jsStackTrace"] = function () { + abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function () { + abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getEnvStrings")) Module["getEnvStrings"] = function () { + abort("'getEnvStrings' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64")) Module["writeI53ToI64"] = function () { + abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Clamped")) Module["writeI53ToI64Clamped"] = function () { + abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Signaling")) Module["writeI53ToI64Signaling"] = function () { + abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Clamped")) Module["writeI53ToU64Clamped"] = function () { + abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Signaling")) Module["writeI53ToU64Signaling"] = function () { + abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "readI53FromI64")) Module["readI53FromI64"] = function () { + abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "readI53FromU64")) Module["readI53FromU64"] = function () { + abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "convertI32PairToI53")) Module["convertI32PairToI53"] = function () { + abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "convertU32PairToI53")) Module["convertU32PairToI53"] = function () { + abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "Browser")) Module["Browser"] = function () { + abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GL")) Module["GL"] = function () { + abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGet")) Module["emscriptenWebGLGet"] = function () { + abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetTexPixelData")) Module["emscriptenWebGLGetTexPixelData"] = function () { + abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetUniform")) Module["emscriptenWebGLGetUniform"] = function () { + abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetVertexAttrib")) Module["emscriptenWebGLGetVertexAttrib"] = function () { + abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "AL")) Module["AL"] = function () { + abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL_unicode")) Module["SDL_unicode"] = function () { + abort("'SDL_unicode' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL_ttfContext")) Module["SDL_ttfContext"] = function () { + abort("'SDL_ttfContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL_audio")) Module["SDL_audio"] = function () { + abort("'SDL_audio' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL")) Module["SDL"] = function () { + abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL_gfx")) Module["SDL_gfx"] = function () { + abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLUT")) Module["GLUT"] = function () { + abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "EGL")) Module["EGL"] = function () { + abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLFW_Window")) Module["GLFW_Window"] = function () { + abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLFW")) Module["GLFW"] = function () { + abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLEW")) Module["GLEW"] = function () { + abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "IDBStore")) Module["IDBStore"] = function () { + abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "runAndAbortIfError")) Module["runAndAbortIfError"] = function () { + abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + Module["PThread"] = PThread; + if (!Object.getOwnPropertyDescriptor(Module, "establishStackSpace")) Module["establishStackSpace"] = function () { + abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getNoExitRuntime")) Module["getNoExitRuntime"] = function () { + abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "resetPrototype")) Module["resetPrototype"] = function () { + abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "warnOnce")) Module["warnOnce"] = function () { + abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackSave")) Module["stackSave"] = function () { + abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackRestore")) Module["stackRestore"] = function () { + abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackAlloc")) Module["stackAlloc"] = function () { + abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "AsciiToString")) Module["AsciiToString"] = function () { + abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToAscii")) Module["stringToAscii"] = function () { + abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF16ToString")) Module["UTF16ToString"] = function () { + abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF16")) Module["stringToUTF16"] = function () { + abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF16")) Module["lengthBytesUTF16"] = function () { + abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF32ToString")) Module["UTF32ToString"] = function () { + abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF32")) Module["stringToUTF32"] = function () { + abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF32")) Module["lengthBytesUTF32"] = function () { + abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8")) Module["allocateUTF8"] = function () { + abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8OnStack")) Module["allocateUTF8OnStack"] = function () { + abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + Module["writeStackCookie"] = writeStackCookie; + Module["checkStackCookie"] = checkStackCookie; + Module["abortStackOverflow"] = abortStackOverflow; + Module["PThread"] = PThread; + Module["_pthread_self"] = _pthread_self; + Module["wasmMemory"] = wasmMemory; + Module["ExitStatus"] = ExitStatus; + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NORMAL")) Object.defineProperty(Module, "ALLOC_NORMAL", { + configurable: true, + get: function () { + abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_STACK")) Object.defineProperty(Module, "ALLOC_STACK", { + configurable: true, + get: function () { + abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_DYNAMIC")) Object.defineProperty(Module, "ALLOC_DYNAMIC", { + configurable: true, + get: function () { + abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NONE")) Object.defineProperty(Module, "ALLOC_NONE", { + configurable: true, + get: function () { + abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + } + }); + var calledRun; + Module["then"] = function (func) { + if (calledRun) { + func(Module) + } else { + var old = Module["onRuntimeInitialized"]; + Module["onRuntimeInitialized"] = function () { + if (old) old(); + func(Module) + } + } + return Module + }; + + function ExitStatus(status) { + this.name = "ExitStatus"; + this.message = "Program terminated with exit(" + status + ")"; + this.status = status + } + dependenciesFulfilled = function runCaller() { + if (!calledRun) run(); + if (!calledRun) dependenciesFulfilled = runCaller + }; + + function run(args) { + args = args || arguments_; + if (runDependencies > 0) { + return + } + writeStackCookie(); + preRun(); + if (runDependencies > 0) return; + + function doRun() { + if (calledRun) return; + calledRun = true; + Module["calledRun"] = true; + if (ABORT) return; + initRuntime(); + preMain(); + if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"](); + assert(!Module["_main"], 'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'); + postRun() + } + if (Module["setStatus"]) { + Module["setStatus"]("Running..."); + setTimeout(function () { + setTimeout(function () { + Module["setStatus"]("") + }, 1); + doRun() + }, 1) + } else { + doRun() + } + checkStackCookie() + } + Module["run"] = run; + if (Module["preInit"]) { + if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]]; + while (Module["preInit"].length > 0) { + Module["preInit"].pop()() + } + } + if (!ENVIRONMENT_IS_PTHREAD) noExitRuntime = true; + if (!ENVIRONMENT_IS_PTHREAD) run(); + + + return WasmBackendModule + } + ); +})(); +if (typeof exports === 'object' && typeof module === 'object') + module.exports = WasmBackendModule; +else if (typeof define === 'function' && define['amd']) + define([], function () { + return WasmBackendModule; + }); +else if (typeof exports === 'object') + exports["WasmBackendModule"] = WasmBackendModule; diff --git a/tfjs-core/benchmarks/wasm_2_threads/tfjs-backend-wasm.wasm b/tfjs-core/benchmarks/wasm_2_threads/tfjs-backend-wasm.wasm new file mode 100644 index 0000000000000000000000000000000000000000..d58e7a2edf2f399bc4ddf8babda305d4a2698ba1 GIT binary patch literal 156992 zcmeFa3!Gn7dH1{a-v9e$=0C|KnPdXl|4pnRf<}u0(VE#wNI(#1LF+j!CXoy*V+mst*Cfui?_bE^0w4^tnF)+w%U3@a=yQ3?f+$F zG7;_R=W}}ALrC`C>-wx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=b_>LPdZ_HT;P1gHw#5duu zB24ui)i4~v!plZ~xj({_j@WoAw*Sk*MP*xuAROUzJ$*l>-E-d>j8Hm!GJPKeEW4KJ z_-jP$cc?O(Xxk?NEL{_TPwxf48MnDkynmMKYrB1Ir~Y+ zk8=P{HaNX0z^??q4)}G#uPc6>J@v+~KYsimJ8=Mhbg3GH-#GjZ!|zD^j>E44zbgEu z;Wrb%+4#-DZvlRb@LPi4MfhEcUo(DJ;ddQ=*W-5!es|(`7k+E;djP+O@p}}%zvJh_ z@0V)tX{f7pn}3VE9ku%gibvC zuCJWge{OAk1JUkBj zrdK)#d2n%T=bhM_PEGBUn#!uMYr839sv3?U6wrPHj!FZM*#Jt-6zMS!_V}Lr4;?!E z4CnBp6eRtyt<8 literal 0 HcmV?d00001 diff --git a/tfjs-core/benchmarks/wasm_4_threads/tfjs-backend-wasm.js b/tfjs-core/benchmarks/wasm_4_threads/tfjs-backend-wasm.js new file mode 100755 index 00000000000..90eb60e4a0f --- /dev/null +++ b/tfjs-core/benchmarks/wasm_4_threads/tfjs-backend-wasm.js @@ -0,0 +1,3381 @@ +var WasmBackendModule = (function () { + var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; + if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; + return ( + function (WasmBackendModule) { + WasmBackendModule = WasmBackendModule || {}; + + var Module = typeof WasmBackendModule !== "undefined" ? WasmBackendModule : {}; + var moduleOverrides = {}; + var key; + for (key in Module) { + if (Module.hasOwnProperty(key)) { + moduleOverrides[key] = Module[key] + } + } + var arguments_ = []; + var thisProgram = "./this.program"; + var quit_ = function (status, toThrow) { + throw toThrow + }; + var ENVIRONMENT_IS_WEB = false; + var ENVIRONMENT_IS_WORKER = false; + var ENVIRONMENT_IS_NODE = false; + var ENVIRONMENT_IS_SHELL = false; + ENVIRONMENT_IS_WEB = typeof window === "object"; + ENVIRONMENT_IS_WORKER = typeof importScripts === "function"; + ENVIRONMENT_IS_NODE = typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string"; + ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER; + if (Module["ENVIRONMENT"]) { + throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)") + } + var ENVIRONMENT_IS_PTHREAD = Module["ENVIRONMENT_IS_PTHREAD"] || false; + if (ENVIRONMENT_IS_PTHREAD) { + buffer = Module["buffer"]; + DYNAMIC_BASE = Module["DYNAMIC_BASE"]; + DYNAMICTOP_PTR = Module["DYNAMICTOP_PTR"] + } + var scriptDirectory = ""; + + function locateFile(path) { + if (Module["locateFile"]) { + return Module["locateFile"](path, scriptDirectory) + } + return scriptDirectory + path + } + var read_, readAsync, readBinary, setWindowTitle; + var nodeFS; + var nodePath; + if (ENVIRONMENT_IS_NODE) { + if (ENVIRONMENT_IS_WORKER) { + scriptDirectory = require("path").dirname(scriptDirectory) + "/" + } else { + scriptDirectory = __dirname + "/" + } + read_ = function shell_read(filename, binary) { + if (!nodeFS) nodeFS = require("fs"); + if (!nodePath) nodePath = require("path"); + filename = nodePath["normalize"](filename); + return nodeFS["readFileSync"](filename, binary ? null : "utf8") + }; + readBinary = function readBinary(filename) { + var ret = read_(filename, true); + if (!ret.buffer) { + ret = new Uint8Array(ret) + } + assert(ret.buffer); + return ret + }; + if (process["argv"].length > 1) { + thisProgram = process["argv"][1].replace(/\\/g, "/") + } + arguments_ = process["argv"].slice(2); + process["on"]("uncaughtException", function (ex) { + if (!(ex instanceof ExitStatus)) { + throw ex + } + }); + process["on"]("unhandledRejection", abort); + quit_ = function (status) { + process["exit"](status) + }; + Module["inspect"] = function () { + return "[Emscripten Module object]" + }; + var nodeWorkerThreads; + try { + nodeWorkerThreads = require("worker_threads") + } catch (e) { + console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'); + throw e + } + Worker = nodeWorkerThreads.Worker + } else if (ENVIRONMENT_IS_SHELL) { + if (typeof read != "undefined") { + read_ = function shell_read(f) { + return read(f) + } + } + readBinary = function readBinary(f) { + var data; + if (typeof readbuffer === "function") { + return new Uint8Array(readbuffer(f)) + } + data = read(f, "binary"); + assert(typeof data === "object"); + return data + }; + if (typeof scriptArgs != "undefined") { + arguments_ = scriptArgs + } else if (typeof arguments != "undefined") { + arguments_ = arguments + } + if (typeof quit === "function") { + quit_ = function (status) { + quit(status) + } + } + if (typeof print !== "undefined") { + if (typeof console === "undefined") console = {}; + console.log = print; + console.warn = console.error = typeof printErr !== "undefined" ? printErr : print + } + } else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { + if (ENVIRONMENT_IS_WORKER) { + scriptDirectory = self.location.href + } else if (document.currentScript) { + scriptDirectory = document.currentScript.src + } + if (_scriptDir) { + scriptDirectory = _scriptDir + } + if (scriptDirectory.indexOf("blob:") !== 0) { + scriptDirectory = scriptDirectory.substr(0, scriptDirectory.lastIndexOf("/") + 1) + } else { + scriptDirectory = "" + } + if (ENVIRONMENT_IS_NODE) { + read_ = function shell_read(filename, binary) { + if (!nodeFS) nodeFS = require("fs"); + if (!nodePath) nodePath = require("path"); + filename = nodePath["normalize"](filename); + return nodeFS["readFileSync"](filename, binary ? null : "utf8") + }; + readBinary = function readBinary(filename) { + var ret = read_(filename, true); + if (!ret.buffer) { + ret = new Uint8Array(ret) + } + assert(ret.buffer); + return ret + } + } else { + read_ = function shell_read(url) { + var xhr = new XMLHttpRequest; + xhr.open("GET", url, false); + xhr.send(null); + return xhr.responseText + }; + if (ENVIRONMENT_IS_WORKER) { + readBinary = function readBinary(url) { + var xhr = new XMLHttpRequest; + xhr.open("GET", url, false); + xhr.responseType = "arraybuffer"; + xhr.send(null); + return new Uint8Array(xhr.response) + } + } + readAsync = function readAsync(url, onload, onerror) { + var xhr = new XMLHttpRequest; + xhr.open("GET", url, true); + xhr.responseType = "arraybuffer"; + xhr.onload = function xhr_onload() { + if (xhr.status == 200 || xhr.status == 0 && xhr.response) { + onload(xhr.response); + return + } + onerror() + }; + xhr.onerror = onerror; + xhr.send(null) + } + } + setWindowTitle = function (title) { + document.title = title + } + } else { + throw new Error("environment detection error") + } + if (ENVIRONMENT_IS_NODE) { + if (typeof performance === "undefined") { + performance = require("perf_hooks").performance + } + } + var out = Module["print"] || console.log.bind(console); + var err = Module["printErr"] || console.warn.bind(console); + for (key in moduleOverrides) { + if (moduleOverrides.hasOwnProperty(key)) { + Module[key] = moduleOverrides[key] + } + } + moduleOverrides = null; + if (Module["arguments"]) arguments_ = Module["arguments"]; + if (!Object.getOwnPropertyDescriptor(Module, "arguments")) Object.defineProperty(Module, "arguments", { + configurable: true, + get: function () { + abort("Module.arguments has been replaced with plain arguments_") + } + }); + if (Module["thisProgram"]) thisProgram = Module["thisProgram"]; + if (!Object.getOwnPropertyDescriptor(Module, "thisProgram")) Object.defineProperty(Module, "thisProgram", { + configurable: true, + get: function () { + abort("Module.thisProgram has been replaced with plain thisProgram") + } + }); + if (Module["quit"]) quit_ = Module["quit"]; + if (!Object.getOwnPropertyDescriptor(Module, "quit")) Object.defineProperty(Module, "quit", { + configurable: true, + get: function () { + abort("Module.quit has been replaced with plain quit_") + } + }); + assert(typeof Module["memoryInitializerPrefixURL"] === "undefined", "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["pthreadMainPrefixURL"] === "undefined", "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["cdInitializerPrefixURL"] === "undefined", "Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["filePackagePrefixURL"] === "undefined", "Module.filePackagePrefixURL option was removed, use Module.locateFile instead"); + assert(typeof Module["read"] === "undefined", "Module.read option was removed (modify read_ in JS)"); + assert(typeof Module["readAsync"] === "undefined", "Module.readAsync option was removed (modify readAsync in JS)"); + assert(typeof Module["readBinary"] === "undefined", "Module.readBinary option was removed (modify readBinary in JS)"); + assert(typeof Module["setWindowTitle"] === "undefined", "Module.setWindowTitle option was removed (modify setWindowTitle in JS)"); + assert(typeof Module["TOTAL_MEMORY"] === "undefined", "Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"); + if (!Object.getOwnPropertyDescriptor(Module, "read")) Object.defineProperty(Module, "read", { + configurable: true, + get: function () { + abort("Module.read has been replaced with plain read_") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "readAsync")) Object.defineProperty(Module, "readAsync", { + configurable: true, + get: function () { + abort("Module.readAsync has been replaced with plain readAsync") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "readBinary")) Object.defineProperty(Module, "readBinary", { + configurable: true, + get: function () { + abort("Module.readBinary has been replaced with plain readBinary") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "setWindowTitle")) Object.defineProperty(Module, "setWindowTitle", { + configurable: true, + get: function () { + abort("Module.setWindowTitle has been replaced with plain setWindowTitle") + } + }); + assert(ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER || ENVIRONMENT_IS_NODE, "Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)"); + var stackSave; + var stackRestore; + var stackAlloc; + stackSave = stackRestore = stackAlloc = function () { + abort("cannot use the stack before compiled code is ready to run, and has provided stack access") + }; + + function warnOnce(text) { + if (!warnOnce.shown) warnOnce.shown = {}; + if (!warnOnce.shown[text]) { + warnOnce.shown[text] = 1; + err(text) + } + } + var Atomics_load = Atomics.load; + var Atomics_store = Atomics.store; + var Atomics_compareExchange = Atomics.compareExchange; + var wasmBinary; + if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"]; + if (!Object.getOwnPropertyDescriptor(Module, "wasmBinary")) Object.defineProperty(Module, "wasmBinary", { + configurable: true, + get: function () { + abort("Module.wasmBinary has been replaced with plain wasmBinary") + } + }); + var noExitRuntime; + if (Module["noExitRuntime"]) noExitRuntime = Module["noExitRuntime"]; + if (!Object.getOwnPropertyDescriptor(Module, "noExitRuntime")) Object.defineProperty(Module, "noExitRuntime", { + configurable: true, + get: function () { + abort("Module.noExitRuntime has been replaced with plain noExitRuntime") + } + }); + if (typeof WebAssembly !== "object") { + abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.") + } + var wasmMemory; + var wasmTable = new WebAssembly.Table({ + "initial": 119, + "maximum": 119 + 0, + "element": "anyfunc" + }); + var wasmModule; + var threadInfoStruct = 0; + var selfThreadId = 0; + var ABORT = false; + var EXITSTATUS = 0; + + function assert(condition, text) { + if (!condition) { + abort("Assertion failed: " + text) + } + } + + function getCFunc(ident) { + var func = Module["_" + ident]; + assert(func, "Cannot call unknown function " + ident + ", make sure it is exported"); + return func + } + + function ccall(ident, returnType, argTypes, args, opts) { + var toC = { + "string": function (str) { + var ret = 0; + if (str !== null && str !== undefined && str !== 0) { + var len = (str.length << 2) + 1; + ret = stackAlloc(len); + stringToUTF8(str, ret, len) + } + return ret + }, + "array": function (arr) { + var ret = stackAlloc(arr.length); + writeArrayToMemory(arr, ret); + return ret + } + }; + + function convertReturnValue(ret) { + if (returnType === "string") return UTF8ToString(ret); + if (returnType === "boolean") return Boolean(ret); + return ret + } + var func = getCFunc(ident); + var cArgs = []; + var stack = 0; + assert(returnType !== "array", 'Return type should not be "array".'); + if (args) { + for (var i = 0; i < args.length; i++) { + var converter = toC[argTypes[i]]; + if (converter) { + if (stack === 0) stack = stackSave(); + cArgs[i] = converter(args[i]) + } else { + cArgs[i] = args[i] + } + } + } + var ret = func.apply(null, cArgs); + ret = convertReturnValue(ret); + if (stack !== 0) stackRestore(stack); + return ret + } + + function cwrap(ident, returnType, argTypes, opts) { + return function () { + return ccall(ident, returnType, argTypes, arguments, opts) + } + } + + function UTF8ArrayToString(heap, idx, maxBytesToRead) { + var endIdx = idx + maxBytesToRead; + var str = ""; + while (!(idx >= endIdx)) { + var u0 = heap[idx++]; + if (!u0) return str; + if (!(u0 & 128)) { + str += String.fromCharCode(u0); + continue + } + var u1 = heap[idx++] & 63; + if ((u0 & 224) == 192) { + str += String.fromCharCode((u0 & 31) << 6 | u1); + continue + } + var u2 = heap[idx++] & 63; + if ((u0 & 240) == 224) { + u0 = (u0 & 15) << 12 | u1 << 6 | u2 + } else { + if ((u0 & 248) != 240) warnOnce("Invalid UTF-8 leading byte 0x" + u0.toString(16) + " encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!"); + u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heap[idx++] & 63 + } + if (u0 < 65536) { + str += String.fromCharCode(u0) + } else { + var ch = u0 - 65536; + str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023) + } + } + return str + } + + function UTF8ToString(ptr, maxBytesToRead) { + return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "" + } + + function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { + if (!(maxBytesToWrite > 0)) return 0; + var startIdx = outIdx; + var endIdx = outIdx + maxBytesToWrite - 1; + for (var i = 0; i < str.length; ++i) { + var u = str.charCodeAt(i); + if (u >= 55296 && u <= 57343) { + var u1 = str.charCodeAt(++i); + u = 65536 + ((u & 1023) << 10) | u1 & 1023 + } + if (u <= 127) { + if (outIdx >= endIdx) break; + heap[outIdx++] = u + } else if (u <= 2047) { + if (outIdx + 1 >= endIdx) break; + heap[outIdx++] = 192 | u >> 6; + heap[outIdx++] = 128 | u & 63 + } else if (u <= 65535) { + if (outIdx + 2 >= endIdx) break; + heap[outIdx++] = 224 | u >> 12; + heap[outIdx++] = 128 | u >> 6 & 63; + heap[outIdx++] = 128 | u & 63 + } else { + if (outIdx + 3 >= endIdx) break; + if (u >= 2097152) warnOnce("Invalid Unicode code point 0x" + u.toString(16) + " encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF)."); + heap[outIdx++] = 240 | u >> 18; + heap[outIdx++] = 128 | u >> 12 & 63; + heap[outIdx++] = 128 | u >> 6 & 63; + heap[outIdx++] = 128 | u & 63 + } + } + heap[outIdx] = 0; + return outIdx - startIdx + } + + function stringToUTF8(str, outPtr, maxBytesToWrite) { + assert(typeof maxBytesToWrite == "number", "stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"); + return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite) + } + + function lengthBytesUTF8(str) { + var len = 0; + for (var i = 0; i < str.length; ++i) { + var u = str.charCodeAt(i); + if (u >= 55296 && u <= 57343) u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; + if (u <= 127) ++len; + else if (u <= 2047) len += 2; + else if (u <= 65535) len += 3; + else len += 4 + } + return len + } + + function writeArrayToMemory(array, buffer) { + assert(array.length >= 0, "writeArrayToMemory array must have a length (should be an array or typed array)"); + HEAP8.set(array, buffer) + } + var WASM_PAGE_SIZE = 65536; + var buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; + + function updateGlobalBufferAndViews(buf) { + buffer = buf; + Module["HEAP8"] = HEAP8 = new Int8Array(buf); + Module["HEAP16"] = HEAP16 = new Int16Array(buf); + Module["HEAP32"] = HEAP32 = new Int32Array(buf); + Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); + Module["HEAPU16"] = HEAPU16 = new Uint16Array(buf); + Module["HEAPU32"] = HEAPU32 = new Uint32Array(buf); + Module["HEAPF32"] = HEAPF32 = new Float32Array(buf); + Module["HEAPF64"] = HEAPF64 = new Float64Array(buf) + } + var STACK_BASE = 5255808, + STACKTOP = STACK_BASE, + STACK_MAX = 12928, + DYNAMIC_BASE = 5255808, + DYNAMICTOP_PTR = 12e3; + assert(STACK_BASE % 16 === 0, "stack must start aligned"); + assert(DYNAMIC_BASE % 16 === 0, "heap must start aligned"); + if (ENVIRONMENT_IS_PTHREAD) { + STACK_MAX = STACKTOP = STACK_MAX = 2147483647 + } + var TOTAL_STACK = 5242880; + if (Module["TOTAL_STACK"]) assert(TOTAL_STACK === Module["TOTAL_STACK"], "the stack size can no longer be determined at runtime"); + var INITIAL_INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 1073741824; + if (!Object.getOwnPropertyDescriptor(Module, "INITIAL_MEMORY")) Object.defineProperty(Module, "INITIAL_MEMORY", { + configurable: true, + get: function () { + abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY") + } + }); + assert(INITIAL_INITIAL_MEMORY >= TOTAL_STACK, "INITIAL_MEMORY should be larger than TOTAL_STACK, was " + INITIAL_INITIAL_MEMORY + "! (TOTAL_STACK=" + TOTAL_STACK + ")"); + assert(typeof Int32Array !== "undefined" && typeof Float64Array !== "undefined" && Int32Array.prototype.subarray !== undefined && Int32Array.prototype.set !== undefined, "JS engine does not provide full typed array support"); + if (ENVIRONMENT_IS_PTHREAD) { + wasmMemory = Module["wasmMemory"]; + buffer = Module["buffer"] + } else { + if (Module["wasmMemory"]) { + wasmMemory = Module["wasmMemory"] + } else { + wasmMemory = new WebAssembly.Memory({ + "initial": INITIAL_INITIAL_MEMORY / WASM_PAGE_SIZE, + "maximum": INITIAL_INITIAL_MEMORY / WASM_PAGE_SIZE, + "shared": true + }); + if (!(wasmMemory.buffer instanceof SharedArrayBuffer)) { + err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"); + if (ENVIRONMENT_IS_NODE) { + console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)") + } + throw Error("bad memory") + } + } + } + if (wasmMemory) { + buffer = wasmMemory.buffer + } + INITIAL_INITIAL_MEMORY = buffer.byteLength; + assert(INITIAL_INITIAL_MEMORY % WASM_PAGE_SIZE === 0); + updateGlobalBufferAndViews(buffer); + if (!ENVIRONMENT_IS_PTHREAD) { + HEAP32[DYNAMICTOP_PTR >> 2] = DYNAMIC_BASE + } + + function writeStackCookie() { + assert((STACK_MAX & 3) == 0); + HEAPU32[(STACK_MAX >> 2) + 1] = 34821223; + HEAPU32[(STACK_MAX >> 2) + 2] = 2310721022; + HEAP32[0] = 1668509029 + } + + function checkStackCookie() { + var cookie1 = HEAPU32[(STACK_MAX >> 2) + 1]; + var cookie2 = HEAPU32[(STACK_MAX >> 2) + 2]; + if (cookie1 != 34821223 || cookie2 != 2310721022) { + abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x" + cookie2.toString(16) + " " + cookie1.toString(16)) + } + if (HEAP32[0] !== 1668509029) abort("Runtime error: The application has corrupted its heap memory area (address zero)!") + } + + function abortStackOverflow(allocSize) { + abort("Stack overflow! Attempted to allocate " + allocSize + " bytes on the stack, but stack has only " + (STACK_MAX - stackSave() + allocSize) + " bytes available!") + }(function () { + var h16 = new Int16Array(1); + var h8 = new Int8Array(h16.buffer); + h16[0] = 25459; + if (h8[0] !== 115 || h8[1] !== 99) throw "Runtime error: expected the system to be little-endian!" + })(); + + function callRuntimeCallbacks(callbacks) { + while (callbacks.length > 0) { + var callback = callbacks.shift(); + if (typeof callback == "function") { + callback(Module); + continue + } + var func = callback.func; + if (typeof func === "number") { + if (callback.arg === undefined) { + Module["dynCall_v"](func) + } else { + Module["dynCall_vi"](func, callback.arg) + } + } else { + func(callback.arg === undefined ? null : callback.arg) + } + } + } + var __ATPRERUN__ = []; + var __ATINIT__ = []; + var __ATMAIN__ = []; + var __ATEXIT__ = []; + var __ATPOSTRUN__ = []; + var runtimeInitialized = false; + var runtimeExited = false; + if (ENVIRONMENT_IS_PTHREAD) runtimeInitialized = true; + + function preRun() { + if (ENVIRONMENT_IS_PTHREAD) return; + if (Module["preRun"]) { + if (typeof Module["preRun"] == "function") Module["preRun"] = [Module["preRun"]]; + while (Module["preRun"].length) { + addOnPreRun(Module["preRun"].shift()) + } + } + callRuntimeCallbacks(__ATPRERUN__) + } + + function initRuntime() { + checkStackCookie(); + assert(!runtimeInitialized); + runtimeInitialized = true; + callRuntimeCallbacks(__ATINIT__) + } + + function preMain() { + checkStackCookie(); + if (ENVIRONMENT_IS_PTHREAD) return; + callRuntimeCallbacks(__ATMAIN__) + } + + function postRun() { + checkStackCookie(); + if (ENVIRONMENT_IS_PTHREAD) return; + if (Module["postRun"]) { + if (typeof Module["postRun"] == "function") Module["postRun"] = [Module["postRun"]]; + while (Module["postRun"].length) { + addOnPostRun(Module["postRun"].shift()) + } + } + callRuntimeCallbacks(__ATPOSTRUN__) + } + + function addOnPreRun(cb) { + __ATPRERUN__.unshift(cb) + } + + function addOnPostRun(cb) { + __ATPOSTRUN__.unshift(cb) + } + assert(Math.imul, "This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + assert(Math.fround, "This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + assert(Math.clz32, "This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + assert(Math.trunc, "This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); + var Math_ceil = Math.ceil; + var Math_floor = Math.floor; + var runDependencies = 0; + var runDependencyWatcher = null; + var dependenciesFulfilled = null; + var runDependencyTracking = {}; + + function addRunDependency(id) { + assert(!ENVIRONMENT_IS_PTHREAD, "addRunDependency cannot be used in a pthread worker"); + runDependencies++; + if (Module["monitorRunDependencies"]) { + Module["monitorRunDependencies"](runDependencies) + } + if (id) { + assert(!runDependencyTracking[id]); + runDependencyTracking[id] = 1; + if (runDependencyWatcher === null && typeof setInterval !== "undefined") { + runDependencyWatcher = setInterval(function () { + if (ABORT) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null; + return + } + var shown = false; + for (var dep in runDependencyTracking) { + if (!shown) { + shown = true; + err("still waiting on run dependencies:") + } + err("dependency: " + dep) + } + if (shown) { + err("(end of list)") + } + }, 1e4) + } + } else { + err("warning: run dependency added without ID") + } + } + + function removeRunDependency(id) { + runDependencies--; + if (Module["monitorRunDependencies"]) { + Module["monitorRunDependencies"](runDependencies) + } + if (id) { + assert(runDependencyTracking[id]); + delete runDependencyTracking[id] + } else { + err("warning: run dependency removed without ID") + } + if (runDependencies == 0) { + if (runDependencyWatcher !== null) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null + } + if (dependenciesFulfilled) { + var callback = dependenciesFulfilled; + dependenciesFulfilled = null; + callback() + } + } + } + Module["preloadedImages"] = {}; + Module["preloadedAudios"] = {}; + + function abort(what) { + if (Module["onAbort"]) { + Module["onAbort"](what) + } + if (ENVIRONMENT_IS_PTHREAD) console.error("Pthread aborting at " + (new Error).stack); + what += ""; + out(what); + err(what); + ABORT = true; + EXITSTATUS = 1; + var output = "abort(" + what + ") at " + stackTrace(); + what = output; + throw new WebAssembly.RuntimeError(what) + } + var FS = { + error: function () { + abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1") + }, + init: function () { + FS.error() + }, + createDataFile: function () { + FS.error() + }, + createPreloadedFile: function () { + FS.error() + }, + createLazyFile: function () { + FS.error() + }, + open: function () { + FS.error() + }, + mkdev: function () { + FS.error() + }, + registerDevice: function () { + FS.error() + }, + analyzePath: function () { + FS.error() + }, + loadFilesFromDB: function () { + FS.error() + }, + ErrnoError: function ErrnoError() { + FS.error() + } + }; + Module["FS_createDataFile"] = FS.createDataFile; + Module["FS_createPreloadedFile"] = FS.createPreloadedFile; + + function hasPrefix(str, prefix) { + return String.prototype.startsWith ? str.startsWith(prefix) : str.indexOf(prefix) === 0 + } + var dataURIPrefix = "data:application/octet-stream;base64,"; + + function isDataURI(filename) { + return hasPrefix(filename, dataURIPrefix) + } + var fileURIPrefix = "file://"; + + function isFileURI(filename) { + return hasPrefix(filename, fileURIPrefix) + } + var wasmBinaryFile = "tfjs-backend-wasm.wasm"; + if (!isDataURI(wasmBinaryFile)) { + wasmBinaryFile = locateFile(wasmBinaryFile) + } + + function getBinary() { + try { + if (wasmBinary) { + return new Uint8Array(wasmBinary) + } + if (readBinary) { + return readBinary(wasmBinaryFile) + } else { + throw "both async and sync fetching of the wasm failed" + } + } catch (err) { + abort(err) + } + } + + function getBinaryPromise() { + if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) && typeof fetch === "function" && !isFileURI(wasmBinaryFile)) { + return fetch(wasmBinaryFile, { + credentials: "same-origin" + }).then(function (response) { + if (!response["ok"]) { + throw "failed to load wasm binary file at '" + wasmBinaryFile + "'" + } + return response["arrayBuffer"]() + }).catch(function () { + return getBinary() + }) + } + return new Promise(function (resolve, reject) { + resolve(getBinary()) + }) + } + + function createWasm() { + var info = { + "env": asmLibraryArg, + "wasi_snapshot_preview1": asmLibraryArg + }; + + function receiveInstance(instance, module) { + var exports = instance.exports; + Module["asm"] = exports; + wasmModule = module; + if (!ENVIRONMENT_IS_PTHREAD) { + var numWorkersToLoad = PThread.unusedWorkers.length; + PThread.unusedWorkers.forEach(function (w) { + PThread.loadWasmModuleToWorker(w, function () { + if (!--numWorkersToLoad) removeRunDependency("wasm-instantiate") + }) + }) + } + } + if (!ENVIRONMENT_IS_PTHREAD) { + addRunDependency("wasm-instantiate") + } + var trueModule = Module; + + function receiveInstantiatedSource(output) { + assert(Module === trueModule, "the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"); + trueModule = null; + receiveInstance(output["instance"], output["module"]) + } + + function instantiateArrayBuffer(receiver) { + return getBinaryPromise().then(function (binary) { + return WebAssembly.instantiate(binary, info) + }).then(receiver, function (reason) { + err("failed to asynchronously prepare wasm: " + reason); + abort(reason) + }) + } + + function instantiateAsync() { + if (!wasmBinary && typeof WebAssembly.instantiateStreaming === "function" && !isDataURI(wasmBinaryFile) && !isFileURI(wasmBinaryFile) && typeof fetch === "function") { + fetch(wasmBinaryFile, { + credentials: "same-origin" + }).then(function (response) { + var result = WebAssembly.instantiateStreaming(response, info); + return result.then(receiveInstantiatedSource, function (reason) { + err("wasm streaming compile failed: " + reason); + err("falling back to ArrayBuffer instantiation"); + instantiateArrayBuffer(receiveInstantiatedSource) + }) + }) + } else { + return instantiateArrayBuffer(receiveInstantiatedSource) + } + } + if (Module["instantiateWasm"]) { + try { + var exports = Module["instantiateWasm"](info, receiveInstance); + return exports + } catch (e) { + err("Module.instantiateWasm callback failed with error: " + e); + return false + } + } + instantiateAsync(); + return {} + } + var ASM_CONSTS = {}; + + function initPthreadsJS() { + PThread.initRuntime() + } + if (!ENVIRONMENT_IS_PTHREAD) __ATINIT__.push({ + func: function () { + ___wasm_call_ctors() + } + }); + + function demangle(func) { + warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"); + return func + } + + function demangleAll(text) { + var regex = /\b_Z[\w\d_]+/g; + return text.replace(regex, function (x) { + var y = demangle(x); + return x === y ? x : y + " [" + x + "]" + }) + } + var __pthread_ptr = 0; + var __pthread_is_main_runtime_thread = 0; + var __pthread_is_main_browser_thread = 0; + + function __register_pthread_ptr(pthreadPtr, isMainBrowserThread, isMainRuntimeThread) { + pthreadPtr = pthreadPtr | 0; + isMainBrowserThread = isMainBrowserThread | 0; + isMainRuntimeThread = isMainRuntimeThread | 0; + __pthread_ptr = pthreadPtr; + __pthread_is_main_browser_thread = isMainBrowserThread; + __pthread_is_main_runtime_thread = isMainRuntimeThread + } + Module["__register_pthread_ptr"] = __register_pthread_ptr; + var ERRNO_CODES = { + EPERM: 63, + ENOENT: 44, + ESRCH: 71, + EINTR: 27, + EIO: 29, + ENXIO: 60, + E2BIG: 1, + ENOEXEC: 45, + EBADF: 8, + ECHILD: 12, + EAGAIN: 6, + EWOULDBLOCK: 6, + ENOMEM: 48, + EACCES: 2, + EFAULT: 21, + ENOTBLK: 105, + EBUSY: 10, + EEXIST: 20, + EXDEV: 75, + ENODEV: 43, + ENOTDIR: 54, + EISDIR: 31, + EINVAL: 28, + ENFILE: 41, + EMFILE: 33, + ENOTTY: 59, + ETXTBSY: 74, + EFBIG: 22, + ENOSPC: 51, + ESPIPE: 70, + EROFS: 69, + EMLINK: 34, + EPIPE: 64, + EDOM: 18, + ERANGE: 68, + ENOMSG: 49, + EIDRM: 24, + ECHRNG: 106, + EL2NSYNC: 156, + EL3HLT: 107, + EL3RST: 108, + ELNRNG: 109, + EUNATCH: 110, + ENOCSI: 111, + EL2HLT: 112, + EDEADLK: 16, + ENOLCK: 46, + EBADE: 113, + EBADR: 114, + EXFULL: 115, + ENOANO: 104, + EBADRQC: 103, + EBADSLT: 102, + EDEADLOCK: 16, + EBFONT: 101, + ENOSTR: 100, + ENODATA: 116, + ETIME: 117, + ENOSR: 118, + ENONET: 119, + ENOPKG: 120, + EREMOTE: 121, + ENOLINK: 47, + EADV: 122, + ESRMNT: 123, + ECOMM: 124, + EPROTO: 65, + EMULTIHOP: 36, + EDOTDOT: 125, + EBADMSG: 9, + ENOTUNIQ: 126, + EBADFD: 127, + EREMCHG: 128, + ELIBACC: 129, + ELIBBAD: 130, + ELIBSCN: 131, + ELIBMAX: 132, + ELIBEXEC: 133, + ENOSYS: 52, + ENOTEMPTY: 55, + ENAMETOOLONG: 37, + ELOOP: 32, + EOPNOTSUPP: 138, + EPFNOSUPPORT: 139, + ECONNRESET: 15, + ENOBUFS: 42, + EAFNOSUPPORT: 5, + EPROTOTYPE: 67, + ENOTSOCK: 57, + ENOPROTOOPT: 50, + ESHUTDOWN: 140, + ECONNREFUSED: 14, + EADDRINUSE: 3, + ECONNABORTED: 13, + ENETUNREACH: 40, + ENETDOWN: 38, + ETIMEDOUT: 73, + EHOSTDOWN: 142, + EHOSTUNREACH: 23, + EINPROGRESS: 26, + EALREADY: 7, + EDESTADDRREQ: 17, + EMSGSIZE: 35, + EPROTONOSUPPORT: 66, + ESOCKTNOSUPPORT: 137, + EADDRNOTAVAIL: 4, + ENETRESET: 39, + EISCONN: 30, + ENOTCONN: 53, + ETOOMANYREFS: 141, + EUSERS: 136, + EDQUOT: 19, + ESTALE: 72, + ENOTSUP: 138, + ENOMEDIUM: 148, + EILSEQ: 25, + EOVERFLOW: 61, + ECANCELED: 11, + ENOTRECOVERABLE: 56, + EOWNERDEAD: 62, + ESTRPIPE: 135 + }; + var __main_thread_futex_wait_address = 12912; + + function _emscripten_futex_wake(addr, count) { + if (addr <= 0 || addr > HEAP8.length || addr & 3 != 0 || count < 0) return -28; + if (count == 0) return 0; + if (count >= 2147483647) count = Infinity; + var mainThreadWaitAddress = Atomics.load(HEAP32, __main_thread_futex_wait_address >> 2); + var mainThreadWoken = 0; + if (mainThreadWaitAddress == addr) { + var loadedAddr = Atomics.compareExchange(HEAP32, __main_thread_futex_wait_address >> 2, mainThreadWaitAddress, 0); + if (loadedAddr == mainThreadWaitAddress) { + --count; + mainThreadWoken = 1; + if (count <= 0) return 1 + } + } + var ret = Atomics.notify(HEAP32, addr >> 2, count); + if (ret >= 0) return ret + mainThreadWoken; + throw "Atomics.notify returned an unexpected value " + ret + } + Module["_emscripten_futex_wake"] = _emscripten_futex_wake; + + function __kill_thread(pthread_ptr) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _kill_thread() can only ever be called from main application thread!"; + if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _kill_thread!"; + HEAP32[pthread_ptr + 12 >> 2] = 0; + var pthread = PThread.pthreads[pthread_ptr]; + pthread.worker.terminate(); + PThread.freeThreadData(pthread); + PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker), 1); + pthread.worker.pthread = undefined + } + + function __cancel_thread(pthread_ptr) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _cancel_thread() can only ever be called from main application thread!"; + if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _cancel_thread!"; + var pthread = PThread.pthreads[pthread_ptr]; + pthread.worker.postMessage({ + "cmd": "cancel" + }) + } + + function __cleanup_thread(pthread_ptr) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _cleanup_thread() can only ever be called from main application thread!"; + if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in _cleanup_thread!"; + HEAP32[pthread_ptr + 12 >> 2] = 0; + var pthread = PThread.pthreads[pthread_ptr]; + if (pthread) { + var worker = pthread.worker; + PThread.returnWorkerToPool(worker) + } + } + var PThread = { + MAIN_THREAD_ID: 1, + mainThreadInfo: { + schedPolicy: 0, + schedPrio: 0 + }, + unusedWorkers: [], + runningWorkers: [], + initRuntime: function () { + __register_pthread_ptr(PThread.mainThreadBlock, !ENVIRONMENT_IS_WORKER, 1); + _emscripten_register_main_browser_thread_id(PThread.mainThreadBlock) + }, + initMainThreadBlock: function () { + assert(!ENVIRONMENT_IS_PTHREAD); + var pthreadPoolSize = 8; + for (var i = 0; i < pthreadPoolSize; ++i) { + PThread.allocateUnusedWorker() + } + PThread.mainThreadBlock = 12160; + for (var i = 0; i < 232 / 4; ++i) HEAPU32[PThread.mainThreadBlock / 4 + i] = 0; + HEAP32[PThread.mainThreadBlock + 12 >> 2] = PThread.mainThreadBlock; + var headPtr = PThread.mainThreadBlock + 156; + HEAP32[headPtr >> 2] = headPtr; + var tlsMemory = 12400; + for (var i = 0; i < 128; ++i) HEAPU32[tlsMemory / 4 + i] = 0; + Atomics.store(HEAPU32, PThread.mainThreadBlock + 104 >> 2, tlsMemory); + Atomics.store(HEAPU32, PThread.mainThreadBlock + 40 >> 2, PThread.mainThreadBlock); + Atomics.store(HEAPU32, PThread.mainThreadBlock + 44 >> 2, 42) + }, + initWorker: function () {}, + pthreads: {}, + exitHandlers: null, + setThreadStatus: function () {}, + runExitHandlers: function () { + if (PThread.exitHandlers !== null) { + while (PThread.exitHandlers.length > 0) { + PThread.exitHandlers.pop()() + } + PThread.exitHandlers = null + } + if (ENVIRONMENT_IS_PTHREAD && threadInfoStruct) ___pthread_tsd_run_dtors() + }, + threadExit: function (exitCode) { + var tb = _pthread_self(); + if (tb) { + err("Pthread 0x" + tb.toString(16) + " exited."); + Atomics.store(HEAPU32, tb + 4 >> 2, exitCode); + Atomics.store(HEAPU32, tb + 0 >> 2, 1); + Atomics.store(HEAPU32, tb + 60 >> 2, 1); + Atomics.store(HEAPU32, tb + 64 >> 2, 0); + PThread.runExitHandlers(); + _emscripten_futex_wake(tb + 0, 2147483647); + __register_pthread_ptr(0, 0, 0); + threadInfoStruct = 0; + if (ENVIRONMENT_IS_PTHREAD) { + postMessage({ + "cmd": "exit" + }) + } + } + }, + threadCancel: function () { + PThread.runExitHandlers(); + Atomics.store(HEAPU32, threadInfoStruct + 4 >> 2, -1); + Atomics.store(HEAPU32, threadInfoStruct + 0 >> 2, 1); + _emscripten_futex_wake(threadInfoStruct + 0, 2147483647); + threadInfoStruct = selfThreadId = 0; + __register_pthread_ptr(0, 0, 0); + postMessage({ + "cmd": "cancelDone" + }) + }, + terminateAllThreads: function () { + for (var t in PThread.pthreads) { + var pthread = PThread.pthreads[t]; + if (pthread && pthread.worker) { + PThread.returnWorkerToPool(pthread.worker) + } + } + PThread.pthreads = {}; + for (var i = 0; i < PThread.unusedWorkers.length; ++i) { + var worker = PThread.unusedWorkers[i]; + assert(!worker.pthread); + worker.terminate() + } + PThread.unusedWorkers = []; + for (var i = 0; i < PThread.runningWorkers.length; ++i) { + var worker = PThread.runningWorkers[i]; + var pthread = worker.pthread; + assert(pthread, "This Worker should have a pthread it is executing"); + PThread.freeThreadData(pthread); + worker.terminate() + } + PThread.runningWorkers = [] + }, + freeThreadData: function (pthread) { + if (!pthread) return; + if (pthread.threadInfoStruct) { + var tlsMemory = HEAP32[pthread.threadInfoStruct + 104 >> 2]; + HEAP32[pthread.threadInfoStruct + 104 >> 2] = 0; + _free(tlsMemory); + _free(pthread.threadInfoStruct) + } + pthread.threadInfoStruct = 0; + if (pthread.allocatedOwnStack && pthread.stackBase) _free(pthread.stackBase); + pthread.stackBase = 0; + if (pthread.worker) pthread.worker.pthread = null + }, + returnWorkerToPool: function (worker) { + delete PThread.pthreads[worker.pthread.thread]; + PThread.unusedWorkers.push(worker); + PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker), 1); + PThread.freeThreadData(worker.pthread); + worker.pthread = undefined + }, + receiveObjectTransfer: function (data) {}, + loadWasmModuleToWorker: function (worker, onFinishedLoading) { + worker.onmessage = function (e) { + var d = e["data"]; + var cmd = d["cmd"]; + if (worker.pthread) PThread.currentProxiedOperationCallerThread = worker.pthread.threadInfoStruct; + if (d["targetThread"] && d["targetThread"] != _pthread_self()) { + var thread = PThread.pthreads[d.targetThread]; + if (thread) { + thread.worker.postMessage(e.data, d["transferList"]) + } else { + console.error('Internal error! Worker sent a message "' + cmd + '" to target pthread ' + d["targetThread"] + ", but that thread no longer exists!") + } + PThread.currentProxiedOperationCallerThread = undefined; + return + } + if (cmd === "processQueuedMainThreadWork") { + _emscripten_main_thread_process_queued_calls() + } else if (cmd === "spawnThread") { + __spawn_thread(e.data) + } else if (cmd === "cleanupThread") { + __cleanup_thread(d["thread"]) + } else if (cmd === "killThread") { + __kill_thread(d["thread"]) + } else if (cmd === "cancelThread") { + __cancel_thread(d["thread"]) + } else if (cmd === "loaded") { + worker.loaded = true; + if (onFinishedLoading) onFinishedLoading(worker); + if (worker.runPthread) { + worker.runPthread(); + delete worker.runPthread + } + } else if (cmd === "print") { + out("Thread " + d["threadId"] + ": " + d["text"]) + } else if (cmd === "printErr") { + err("Thread " + d["threadId"] + ": " + d["text"]) + } else if (cmd === "alert") { + alert("Thread " + d["threadId"] + ": " + d["text"]) + } else if (cmd === "exit") { + var detached = worker.pthread && Atomics.load(HEAPU32, worker.pthread.thread + 68 >> 2); + if (detached) { + PThread.returnWorkerToPool(worker) + } + } else if (cmd === "cancelDone") { + PThread.returnWorkerToPool(worker) + } else if (cmd === "objectTransfer") { + PThread.receiveObjectTransfer(e.data) + } else if (e.data.target === "setimmediate") { + worker.postMessage(e.data) + } else { + err("worker sent an unknown command " + cmd) + } + PThread.currentProxiedOperationCallerThread = undefined + }; + worker.onerror = function (e) { + err("pthread sent an error! " + e.filename + ":" + e.lineno + ": " + e.message) + }; + if (ENVIRONMENT_IS_NODE) { + worker.on("message", function (data) { + worker.onmessage({ + data: data + }) + }); + worker.on("error", function (data) { + worker.onerror(data) + }); + worker.on("exit", function (data) { + console.log("worker exited - TODO: update the worker queue?") + }) + } + assert(wasmMemory instanceof WebAssembly.Memory, "WebAssembly memory should have been loaded by now!"); + assert(wasmModule instanceof WebAssembly.Module, "WebAssembly Module should have been loaded by now!"); + worker.postMessage({ + "cmd": "load", + "urlOrBlob": Module["mainScriptUrlOrBlob"] || _scriptDir, + "wasmMemory": wasmMemory, + "wasmModule": wasmModule, + "DYNAMIC_BASE": DYNAMIC_BASE, + "DYNAMICTOP_PTR": DYNAMICTOP_PTR + }) + }, + allocateUnusedWorker: function () { + var pthreadMainJs = locateFile("tfjs-backend-wasm.worker.js"); + PThread.unusedWorkers.push(new Worker(pthreadMainJs)) + }, + getNewWorker: function () { + if (PThread.unusedWorkers.length == 0) { + PThread.allocateUnusedWorker(); + PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0]) + } + if (PThread.unusedWorkers.length > 0) return PThread.unusedWorkers.pop(); + else return null + }, + busySpinWait: function (msecs) { + var t = performance.now() + msecs; + while (performance.now() < t) {} + } + }; + + function establishStackSpace(stackTop, stackMax) { + STACK_BASE = STACKTOP = stackTop; + STACK_MAX = stackMax; + ___set_stack_limit(STACK_MAX); + writeStackCookie(); + stackRestore(stackTop) + } + Module["establishStackSpace"] = establishStackSpace; + + function getNoExitRuntime() { + return noExitRuntime + } + Module["getNoExitRuntime"] = getNoExitRuntime; + + function jsStackTrace() { + var err = new Error; + if (!err.stack) { + try { + throw new Error + } catch (e) { + err = e + } + if (!err.stack) { + return "(no stack trace available)" + } + } + return err.stack.toString() + } + + function stackTrace() { + var js = jsStackTrace(); + if (Module["extraStackTrace"]) js += "\n" + Module["extraStackTrace"](); + return demangleAll(js) + } + + function ___assert_fail(condition, filename, line, func) { + abort("Assertion failed: " + UTF8ToString(condition) + ", at: " + [filename ? UTF8ToString(filename) : "unknown filename", line, func ? UTF8ToString(func) : "unknown function"]) + } + var _emscripten_get_now; + if (ENVIRONMENT_IS_NODE) { + _emscripten_get_now = function () { + var t = process["hrtime"](); + return t[0] * 1e3 + t[1] / 1e6 + } + } else if (ENVIRONMENT_IS_PTHREAD) { + _emscripten_get_now = function () { + return performance.now() - Module["__performance_now_clock_drift"] + } + } else if (typeof dateNow !== "undefined") { + _emscripten_get_now = dateNow + } else _emscripten_get_now = function () { + return performance.now() + }; + + function setErrNo(value) { + HEAP32[___errno_location() >> 2] = value; + return value + } + + function _atexit(func, arg) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(1, 1, func, arg); + warnOnce("atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)"); + __ATEXIT__.unshift({ + func: func, + arg: arg + }) + } + + function ___handle_stack_overflow() { + abort("stack overflow") + } + + function __emscripten_notify_thread_queue(targetThreadId, mainThreadId) { + if (targetThreadId == mainThreadId) { + postMessage({ + "cmd": "processQueuedMainThreadWork" + }) + } else if (ENVIRONMENT_IS_PTHREAD) { + postMessage({ + "targetThread": targetThreadId, + "cmd": "processThreadQueue" + }) + } else { + var pthread = PThread.pthreads[targetThreadId]; + var worker = pthread && pthread.worker; + if (!worker) { + err("Cannot send message to thread with ID " + targetThreadId + ", unknown thread ID!"); + return + } + worker.postMessage({ + "cmd": "processThreadQueue" + }) + } + return 1 + } + + function _abort() { + abort() + } + + function _emscripten_conditional_set_current_thread_status(expectedStatus, newStatus) { + expectedStatus = expectedStatus | 0; + newStatus = newStatus | 0 + } + + function _emscripten_futex_wait(addr, val, timeout) { + if (addr <= 0 || addr > HEAP8.length || addr & 3 != 0) return -28; + if (ENVIRONMENT_IS_WORKER) { + var ret = Atomics.wait(HEAP32, addr >> 2, val, timeout); + if (ret === "timed-out") return -73; + if (ret === "not-equal") return -6; + if (ret === "ok") return 0; + throw "Atomics.wait returned an unexpected value " + ret + } else { + var loadedVal = Atomics.load(HEAP32, addr >> 2); + if (val != loadedVal) return -6; + var tNow = performance.now(); + var tEnd = tNow + timeout; + Atomics.store(HEAP32, __main_thread_futex_wait_address >> 2, addr); + var ourWaitAddress = addr; + while (addr == ourWaitAddress) { + tNow = performance.now(); + if (tNow > tEnd) { + return -73 + } + _emscripten_main_thread_process_queued_calls(); + addr = Atomics.load(HEAP32, __main_thread_futex_wait_address >> 2) + } + return 0 + } + } + + function _emscripten_is_main_browser_thread() { + return __pthread_is_main_browser_thread | 0 + } + + function _emscripten_is_main_runtime_thread() { + return __pthread_is_main_runtime_thread | 0 + } + + function _emscripten_memcpy_big(dest, src, num) { + HEAPU8.copyWithin(dest, src, src + num) + } + + function _emscripten_proxy_to_main_thread_js(index, sync) { + var numCallArgs = arguments.length - 2; + if (numCallArgs > 20 - 1) throw "emscripten_proxy_to_main_thread_js: Too many arguments " + numCallArgs + " to proxied function idx=" + index + ", maximum supported is " + (20 - 1) + "!"; + var stack = stackSave(); + var args = stackAlloc(numCallArgs * 8); + var b = args >> 3; + for (var i = 0; i < numCallArgs; i++) { + HEAPF64[b + i] = arguments[2 + i] + } + var ret = _emscripten_run_in_main_runtime_thread_js(index, numCallArgs, args, sync); + stackRestore(stack); + return ret + } + var _emscripten_receive_on_main_thread_js_callArgs = []; + + function readAsmConstArgs(sigPtr, buf) { + if (!readAsmConstArgs.array) { + readAsmConstArgs.array = [] + } + var args = readAsmConstArgs.array; + args.length = 0; + var ch; + while (ch = HEAPU8[sigPtr++]) { + if (ch === 100 || ch === 102) { + buf = buf + 7 & ~7; + args.push(HEAPF64[buf >> 3]); + buf += 8 + } else if (ch === 105) { + buf = buf + 3 & ~3; + args.push(HEAP32[buf >> 2]); + buf += 4 + } else abort("unexpected char in asm const signature " + ch) + } + return args + } + + function _emscripten_receive_on_main_thread_js(index, numCallArgs, args) { + _emscripten_receive_on_main_thread_js_callArgs.length = numCallArgs; + var b = args >> 3; + for (var i = 0; i < numCallArgs; i++) { + _emscripten_receive_on_main_thread_js_callArgs[i] = HEAPF64[b + i] + } + var isEmAsmConst = index < 0; + var func = !isEmAsmConst ? proxiedFunctionTable[index] : ASM_CONSTS[-index - 1]; + if (isEmAsmConst) { + var sigPtr = _emscripten_receive_on_main_thread_js_callArgs[1]; + var varargPtr = _emscripten_receive_on_main_thread_js_callArgs[2]; + var constArgs = readAsmConstArgs(sigPtr, varargPtr); + return func.apply(null, constArgs) + } + assert(func.length == numCallArgs, "Call args mismatch in emscripten_receive_on_main_thread_js"); + return func.apply(null, _emscripten_receive_on_main_thread_js_callArgs) + } + + function abortOnCannotGrowMemory(requestedSize) { + abort("Cannot enlarge memory arrays to size " + requestedSize + " bytes (OOM). Either (1) compile with -s INITIAL_MEMORY=X with X higher than the current value " + HEAP8.length + ", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ") + } + + function _emscripten_resize_heap(requestedSize) { + abortOnCannotGrowMemory(requestedSize) + } + var JSEvents = { + keyEvent: 0, + mouseEvent: 0, + wheelEvent: 0, + uiEvent: 0, + focusEvent: 0, + deviceOrientationEvent: 0, + deviceMotionEvent: 0, + fullscreenChangeEvent: 0, + pointerlockChangeEvent: 0, + visibilityChangeEvent: 0, + touchEvent: 0, + previousFullscreenElement: null, + previousScreenX: null, + previousScreenY: null, + removeEventListenersRegistered: false, + removeAllEventListeners: function () { + for (var i = JSEvents.eventHandlers.length - 1; i >= 0; --i) { + JSEvents._removeHandler(i) + } + JSEvents.eventHandlers = []; + JSEvents.deferredCalls = [] + }, + registerRemoveEventListeners: function () { + if (!JSEvents.removeEventListenersRegistered) { + __ATEXIT__.push(JSEvents.removeAllEventListeners); + JSEvents.removeEventListenersRegistered = true + } + }, + deferredCalls: [], + deferCall: function (targetFunction, precedence, argsList) { + function arraysHaveEqualContent(arrA, arrB) { + if (arrA.length != arrB.length) return false; + for (var i in arrA) { + if (arrA[i] != arrB[i]) return false + } + return true + } + for (var i in JSEvents.deferredCalls) { + var call = JSEvents.deferredCalls[i]; + if (call.targetFunction == targetFunction && arraysHaveEqualContent(call.argsList, argsList)) { + return + } + } + JSEvents.deferredCalls.push({ + targetFunction: targetFunction, + precedence: precedence, + argsList: argsList + }); + JSEvents.deferredCalls.sort(function (x, y) { + return x.precedence < y.precedence + }) + }, + removeDeferredCalls: function (targetFunction) { + for (var i = 0; i < JSEvents.deferredCalls.length; ++i) { + if (JSEvents.deferredCalls[i].targetFunction == targetFunction) { + JSEvents.deferredCalls.splice(i, 1); + --i + } + } + }, + canPerformEventHandlerRequests: function () { + return JSEvents.inEventHandler && JSEvents.currentEventHandler.allowsDeferredCalls + }, + runDeferredCalls: function () { + if (!JSEvents.canPerformEventHandlerRequests()) { + return + } + for (var i = 0; i < JSEvents.deferredCalls.length; ++i) { + var call = JSEvents.deferredCalls[i]; + JSEvents.deferredCalls.splice(i, 1); + --i; + call.targetFunction.apply(null, call.argsList) + } + }, + inEventHandler: 0, + currentEventHandler: null, + eventHandlers: [], + removeAllHandlersOnTarget: function (target, eventTypeString) { + for (var i = 0; i < JSEvents.eventHandlers.length; ++i) { + if (JSEvents.eventHandlers[i].target == target && (!eventTypeString || eventTypeString == JSEvents.eventHandlers[i].eventTypeString)) { + JSEvents._removeHandler(i--) + } + } + }, + _removeHandler: function (i) { + var h = JSEvents.eventHandlers[i]; + h.target.removeEventListener(h.eventTypeString, h.eventListenerFunc, h.useCapture); + JSEvents.eventHandlers.splice(i, 1) + }, + registerOrRemoveHandler: function (eventHandler) { + var jsEventHandler = function jsEventHandler(event) { + ++JSEvents.inEventHandler; + JSEvents.currentEventHandler = eventHandler; + JSEvents.runDeferredCalls(); + eventHandler.handlerFunc(event); + JSEvents.runDeferredCalls(); + --JSEvents.inEventHandler + }; + if (eventHandler.callbackfunc) { + eventHandler.eventListenerFunc = jsEventHandler; + eventHandler.target.addEventListener(eventHandler.eventTypeString, jsEventHandler, eventHandler.useCapture); + JSEvents.eventHandlers.push(eventHandler); + JSEvents.registerRemoveEventListeners() + } else { + for (var i = 0; i < JSEvents.eventHandlers.length; ++i) { + if (JSEvents.eventHandlers[i].target == eventHandler.target && JSEvents.eventHandlers[i].eventTypeString == eventHandler.eventTypeString) { + JSEvents._removeHandler(i--) + } + } + } + }, + queueEventHandlerOnThread_iiii: function (targetThread, eventHandlerFunc, eventTypeId, eventData, userData) { + var stackTop = stackSave(); + var varargs = stackAlloc(12); + HEAP32[varargs >> 2] = eventTypeId; + HEAP32[varargs + 4 >> 2] = eventData; + HEAP32[varargs + 8 >> 2] = userData; + _emscripten_async_queue_on_thread_(targetThread, 637534208, eventHandlerFunc, eventData, varargs); + stackRestore(stackTop) + }, + getTargetThreadForEventCallback: function (targetThread) { + switch (targetThread) { + case 1: + return 0; + case 2: + return PThread.currentProxiedOperationCallerThread; + default: + return targetThread + } + }, + getNodeNameForTarget: function (target) { + if (!target) return ""; + if (target == window) return "#window"; + if (target == screen) return "#screen"; + return target && target.nodeName ? target.nodeName : "" + }, + fullscreenEnabled: function () { + return document.fullscreenEnabled || document.webkitFullscreenEnabled + } + }; + + function stringToNewUTF8(jsString) { + var length = lengthBytesUTF8(jsString) + 1; + var cString = _malloc(length); + stringToUTF8(jsString, cString, length); + return cString + } + + function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread, targetCanvas, width, height) { + var stackTop = stackSave(); + var varargs = stackAlloc(12); + var targetCanvasPtr = 0; + if (targetCanvas) { + targetCanvasPtr = stringToNewUTF8(targetCanvas) + } + HEAP32[varargs >> 2] = targetCanvasPtr; + HEAP32[varargs + 4 >> 2] = width; + HEAP32[varargs + 8 >> 2] = height; + _emscripten_async_queue_on_thread_(targetThread, 657457152, 0, targetCanvasPtr, varargs); + stackRestore(stackTop) + } + + function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread, targetCanvas, width, height) { + targetCanvas = targetCanvas ? UTF8ToString(targetCanvas) : ""; + _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread, targetCanvas, width, height) + } + + function __maybeCStringToJsString(cString) { + return cString === cString + 0 ? UTF8ToString(cString) : cString + } + var __specialEventTargets = [0, typeof document !== "undefined" ? document : 0, typeof window !== "undefined" ? window : 0]; + + function __findEventTarget(target) { + var domElement = __specialEventTargets[target] || (typeof document !== "undefined" ? document.querySelector(__maybeCStringToJsString(target)) : undefined); + return domElement + } + + function __findCanvasEventTarget(target) { + return __findEventTarget(target) + } + + function _emscripten_set_canvas_element_size_calling_thread(target, width, height) { + var canvas = __findCanvasEventTarget(target); + if (!canvas) return -4; + if (canvas.canvasSharedPtr) { + HEAP32[canvas.canvasSharedPtr >> 2] = width; + HEAP32[canvas.canvasSharedPtr + 4 >> 2] = height + } + if (canvas.offscreenCanvas || !canvas.controlTransferredOffscreen) { + if (canvas.offscreenCanvas) canvas = canvas.offscreenCanvas; + var autoResizeViewport = false; + if (canvas.GLctxObject && canvas.GLctxObject.GLctx) { + var prevViewport = canvas.GLctxObject.GLctx.getParameter(2978); + autoResizeViewport = prevViewport[0] === 0 && prevViewport[1] === 0 && prevViewport[2] === canvas.width && prevViewport[3] === canvas.height + } + canvas.width = width; + canvas.height = height; + if (autoResizeViewport) { + canvas.GLctxObject.GLctx.viewport(0, 0, width, height) + } + } else if (canvas.canvasSharedPtr) { + var targetThread = HEAP32[canvas.canvasSharedPtr + 8 >> 2]; + _emscripten_set_offscreencanvas_size_on_target_thread(targetThread, target, width, height); + return 1 + } else { + return -4 + } + return 0 + } + + function _emscripten_set_canvas_element_size_main_thread(target, width, height) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(2, 1, target, width, height); + return _emscripten_set_canvas_element_size_calling_thread(target, width, height) + } + + function _emscripten_set_canvas_element_size(target, width, height) { + var canvas = __findCanvasEventTarget(target); + if (canvas) { + return _emscripten_set_canvas_element_size_calling_thread(target, width, height) + } else { + return _emscripten_set_canvas_element_size_main_thread(target, width, height) + } + } + + function _emscripten_set_current_thread_status(newStatus) { + newStatus = newStatus | 0 + } + + function __webgl_acquireInstancedArraysExtension(ctx) { + var ext = ctx.getExtension("ANGLE_instanced_arrays"); + if (ext) { + ctx["vertexAttribDivisor"] = function (index, divisor) { + ext["vertexAttribDivisorANGLE"](index, divisor) + }; + ctx["drawArraysInstanced"] = function (mode, first, count, primcount) { + ext["drawArraysInstancedANGLE"](mode, first, count, primcount) + }; + ctx["drawElementsInstanced"] = function (mode, count, type, indices, primcount) { + ext["drawElementsInstancedANGLE"](mode, count, type, indices, primcount) + } + } + } + + function __webgl_acquireVertexArrayObjectExtension(ctx) { + var ext = ctx.getExtension("OES_vertex_array_object"); + if (ext) { + ctx["createVertexArray"] = function () { + return ext["createVertexArrayOES"]() + }; + ctx["deleteVertexArray"] = function (vao) { + ext["deleteVertexArrayOES"](vao) + }; + ctx["bindVertexArray"] = function (vao) { + ext["bindVertexArrayOES"](vao) + }; + ctx["isVertexArray"] = function (vao) { + return ext["isVertexArrayOES"](vao) + } + } + } + + function __webgl_acquireDrawBuffersExtension(ctx) { + var ext = ctx.getExtension("WEBGL_draw_buffers"); + if (ext) { + ctx["drawBuffers"] = function (n, bufs) { + ext["drawBuffersWEBGL"](n, bufs) + } + } + } + var GL = { + counter: 1, + lastError: 0, + buffers: [], + mappedBuffers: {}, + programs: [], + framebuffers: [], + renderbuffers: [], + textures: [], + uniforms: [], + shaders: [], + vaos: [], + contexts: {}, + currentContext: null, + offscreenCanvases: {}, + timerQueriesEXT: [], + programInfos: {}, + stringCache: {}, + unpackAlignment: 4, + init: function () { + var miniTempFloatBuffer = new Float32Array(GL.MINI_TEMP_BUFFER_SIZE); + for (var i = 0; i < GL.MINI_TEMP_BUFFER_SIZE; i++) { + GL.miniTempBufferFloatViews[i] = miniTempFloatBuffer.subarray(0, i + 1) + } + var miniTempIntBuffer = new Int32Array(GL.MINI_TEMP_BUFFER_SIZE); + for (var i = 0; i < GL.MINI_TEMP_BUFFER_SIZE; i++) { + GL.miniTempBufferIntViews[i] = miniTempIntBuffer.subarray(0, i + 1) + } + }, + recordError: function recordError(errorCode) { + if (!GL.lastError) { + GL.lastError = errorCode + } + }, + getNewId: function (table) { + var ret = GL.counter++; + for (var i = table.length; i < ret; i++) { + table[i] = null + } + return ret + }, + MINI_TEMP_BUFFER_SIZE: 256, + miniTempBufferFloatViews: [0], + miniTempBufferIntViews: [0], + getSource: function (shader, count, string, length) { + var source = ""; + for (var i = 0; i < count; ++i) { + var len = length ? HEAP32[length + i * 4 >> 2] : -1; + source += UTF8ToString(HEAP32[string + i * 4 >> 2], len < 0 ? undefined : len) + } + return source + }, + createContext: function (canvas, webGLContextAttributes) { + var ctx = canvas.getContext("webgl", webGLContextAttributes); + if (!ctx) return 0; + var handle = GL.registerContext(ctx, webGLContextAttributes); + return handle + }, + registerContext: function (ctx, webGLContextAttributes) { + var handle = _malloc(8); + HEAP32[handle + 4 >> 2] = _pthread_self(); + var context = { + handle: handle, + attributes: webGLContextAttributes, + version: webGLContextAttributes.majorVersion, + GLctx: ctx + }; + if (ctx.canvas) ctx.canvas.GLctxObject = context; + GL.contexts[handle] = context; + if (typeof webGLContextAttributes.enableExtensionsByDefault === "undefined" || webGLContextAttributes.enableExtensionsByDefault) { + GL.initExtensions(context) + } + return handle + }, + makeContextCurrent: function (contextHandle) { + GL.currentContext = GL.contexts[contextHandle]; + Module.ctx = GLctx = GL.currentContext && GL.currentContext.GLctx; + return !(contextHandle && !GLctx) + }, + getContext: function (contextHandle) { + return GL.contexts[contextHandle] + }, + deleteContext: function (contextHandle) { + if (GL.currentContext === GL.contexts[contextHandle]) GL.currentContext = null; + if (typeof JSEvents === "object") JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas); + if (GL.contexts[contextHandle] && GL.contexts[contextHandle].GLctx.canvas) GL.contexts[contextHandle].GLctx.canvas.GLctxObject = undefined; + _free(GL.contexts[contextHandle].handle); + GL.contexts[contextHandle] = null + }, + initExtensions: function (context) { + if (!context) context = GL.currentContext; + if (context.initExtensionsDone) return; + context.initExtensionsDone = true; + var GLctx = context.GLctx; + if (context.version < 2) { + __webgl_acquireInstancedArraysExtension(GLctx); + __webgl_acquireVertexArrayObjectExtension(GLctx); + __webgl_acquireDrawBuffersExtension(GLctx) + } + GLctx.disjointTimerQueryExt = GLctx.getExtension("EXT_disjoint_timer_query"); + var automaticallyEnabledExtensions = ["OES_texture_float", "OES_texture_half_float", "OES_standard_derivatives", "OES_vertex_array_object", "WEBGL_compressed_texture_s3tc", "WEBGL_depth_texture", "OES_element_index_uint", "EXT_texture_filter_anisotropic", "EXT_frag_depth", "WEBGL_draw_buffers", "ANGLE_instanced_arrays", "OES_texture_float_linear", "OES_texture_half_float_linear", "EXT_blend_minmax", "EXT_shader_texture_lod", "EXT_texture_norm16", "WEBGL_compressed_texture_pvrtc", "EXT_color_buffer_half_float", "WEBGL_color_buffer_float", "EXT_sRGB", "WEBGL_compressed_texture_etc1", "EXT_disjoint_timer_query", "WEBGL_compressed_texture_etc", "WEBGL_compressed_texture_astc", "EXT_color_buffer_float", "WEBGL_compressed_texture_s3tc_srgb", "EXT_disjoint_timer_query_webgl2", "WEBKIT_WEBGL_compressed_texture_pvrtc"]; + var exts = GLctx.getSupportedExtensions() || []; + exts.forEach(function (ext) { + if (automaticallyEnabledExtensions.indexOf(ext) != -1) { + GLctx.getExtension(ext) + } + }) + }, + populateUniformTable: function (program) { + var p = GL.programs[program]; + var ptable = GL.programInfos[program] = { + uniforms: {}, + maxUniformLength: 0, + maxAttributeLength: -1, + maxUniformBlockNameLength: -1 + }; + var utable = ptable.uniforms; + var numUniforms = GLctx.getProgramParameter(p, 35718); + for (var i = 0; i < numUniforms; ++i) { + var u = GLctx.getActiveUniform(p, i); + var name = u.name; + ptable.maxUniformLength = Math.max(ptable.maxUniformLength, name.length + 1); + if (name.slice(-1) == "]") { + name = name.slice(0, name.lastIndexOf("[")) + } + var loc = GLctx.getUniformLocation(p, name); + if (loc) { + var id = GL.getNewId(GL.uniforms); + utable[name] = [u.size, id]; + GL.uniforms[id] = loc; + for (var j = 1; j < u.size; ++j) { + var n = name + "[" + j + "]"; + loc = GLctx.getUniformLocation(p, n); + id = GL.getNewId(GL.uniforms); + GL.uniforms[id] = loc + } + } + } + } + }; + var __emscripten_webgl_power_preferences = ["default", "low-power", "high-performance"]; + + function _emscripten_webgl_do_create_context(target, attributes) { + assert(attributes); + var contextAttributes = {}; + var a = attributes >> 2; + contextAttributes["alpha"] = !!HEAP32[a + (0 >> 2)]; + contextAttributes["depth"] = !!HEAP32[a + (4 >> 2)]; + contextAttributes["stencil"] = !!HEAP32[a + (8 >> 2)]; + contextAttributes["antialias"] = !!HEAP32[a + (12 >> 2)]; + contextAttributes["premultipliedAlpha"] = !!HEAP32[a + (16 >> 2)]; + contextAttributes["preserveDrawingBuffer"] = !!HEAP32[a + (20 >> 2)]; + var powerPreference = HEAP32[a + (24 >> 2)]; + contextAttributes["powerPreference"] = __emscripten_webgl_power_preferences[powerPreference]; + contextAttributes["failIfMajorPerformanceCaveat"] = !!HEAP32[a + (28 >> 2)]; + contextAttributes.majorVersion = HEAP32[a + (32 >> 2)]; + contextAttributes.minorVersion = HEAP32[a + (36 >> 2)]; + contextAttributes.enableExtensionsByDefault = HEAP32[a + (40 >> 2)]; + contextAttributes.explicitSwapControl = HEAP32[a + (44 >> 2)]; + contextAttributes.proxyContextToMainThread = HEAP32[a + (48 >> 2)]; + contextAttributes.renderViaOffscreenBackBuffer = HEAP32[a + (52 >> 2)]; + var canvas = __findCanvasEventTarget(target); + if (!canvas) { + return 0 + } + if (contextAttributes.explicitSwapControl) { + return 0 + } + var contextHandle = GL.createContext(canvas, contextAttributes); + return contextHandle + } + + function _emscripten_webgl_create_context(a0, a1) { + return _emscripten_webgl_do_create_context(a0, a1) + } + var PATH = { + splitPath: function (filename) { + var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; + return splitPathRe.exec(filename).slice(1) + }, + normalizeArray: function (parts, allowAboveRoot) { + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === ".") { + parts.splice(i, 1) + } else if (last === "..") { + parts.splice(i, 1); + up++ + } else if (up) { + parts.splice(i, 1); + up-- + } + } + if (allowAboveRoot) { + for (; up; up--) { + parts.unshift("..") + } + } + return parts + }, + normalize: function (path) { + var isAbsolute = path.charAt(0) === "/", + trailingSlash = path.substr(-1) === "/"; + path = PATH.normalizeArray(path.split("/").filter(function (p) { + return !!p + }), !isAbsolute).join("/"); + if (!path && !isAbsolute) { + path = "." + } + if (path && trailingSlash) { + path += "/" + } + return (isAbsolute ? "/" : "") + path + }, + dirname: function (path) { + var result = PATH.splitPath(path), + root = result[0], + dir = result[1]; + if (!root && !dir) { + return "." + } + if (dir) { + dir = dir.substr(0, dir.length - 1) + } + return root + dir + }, + basename: function (path) { + if (path === "/") return "/"; + var lastSlash = path.lastIndexOf("/"); + if (lastSlash === -1) return path; + return path.substr(lastSlash + 1) + }, + extname: function (path) { + return PATH.splitPath(path)[3] + }, + join: function () { + var paths = Array.prototype.slice.call(arguments, 0); + return PATH.normalize(paths.join("/")) + }, + join2: function (l, r) { + return PATH.normalize(l + "/" + r) + } + }; + var SYSCALLS = { + mappings: {}, + buffers: [null, [], + [] + ], + printChar: function (stream, curr) { + var buffer = SYSCALLS.buffers[stream]; + assert(buffer); + if (curr === 0 || curr === 10) { + (stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0)); + buffer.length = 0 + } else { + buffer.push(curr) + } + }, + varargs: undefined, + get: function () { + assert(SYSCALLS.varargs != undefined); + SYSCALLS.varargs += 4; + var ret = HEAP32[SYSCALLS.varargs - 4 >> 2]; + return ret + }, + getStr: function (ptr) { + var ret = UTF8ToString(ptr); + return ret + }, + get64: function (low, high) { + if (low >= 0) assert(high === 0); + else assert(high === -1); + return low + } + }; + + function _fd_close(fd) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(3, 1, fd); + abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM"); + return 0 + } + + function _fd_seek(fd, offset_low, offset_high, whence, newOffset) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(4, 1, fd, offset_low, offset_high, whence, newOffset); + abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM") + } + + function _fd_write(fd, iov, iovcnt, pnum) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(5, 1, fd, iov, iovcnt, pnum); + var num = 0; + for (var i = 0; i < iovcnt; i++) { + var ptr = HEAP32[iov + i * 8 >> 2]; + var len = HEAP32[iov + (i * 8 + 4) >> 2]; + for (var j = 0; j < len; j++) { + SYSCALLS.printChar(fd, HEAPU8[ptr + j]) + } + num += len + } + HEAP32[pnum >> 2] = num; + return 0 + } + + function _pthread_cleanup_pop(execute) { + var routine = PThread.exitHandlers.pop(); + if (execute) routine() + } + + function _pthread_cleanup_push(routine, arg) { + if (PThread.exitHandlers === null) { + PThread.exitHandlers = [] + } + PThread.exitHandlers.push(function () { + dynCall_vi(routine, arg) + }) + } + + function __spawn_thread(threadParams) { + if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! _spawn_thread() can only ever be called from main application thread!"; + var worker = PThread.getNewWorker(); + if (worker.pthread !== undefined) throw "Internal error!"; + if (!threadParams.pthread_ptr) throw "Internal error, no pthread ptr!"; + PThread.runningWorkers.push(worker); + var tlsMemory = _malloc(128 * 4); + for (var i = 0; i < 128; ++i) { + HEAP32[tlsMemory + i * 4 >> 2] = 0 + } + var stackHigh = threadParams.stackBase + threadParams.stackSize; + var pthread = PThread.pthreads[threadParams.pthread_ptr] = { + worker: worker, + stackBase: threadParams.stackBase, + stackSize: threadParams.stackSize, + allocatedOwnStack: threadParams.allocatedOwnStack, + thread: threadParams.pthread_ptr, + threadInfoStruct: threadParams.pthread_ptr + }; + var tis = pthread.threadInfoStruct >> 2; + Atomics.store(HEAPU32, tis + (0 >> 2), 0); + Atomics.store(HEAPU32, tis + (4 >> 2), 0); + Atomics.store(HEAPU32, tis + (8 >> 2), 0); + Atomics.store(HEAPU32, tis + (68 >> 2), threadParams.detached); + Atomics.store(HEAPU32, tis + (104 >> 2), tlsMemory); + Atomics.store(HEAPU32, tis + (48 >> 2), 0); + Atomics.store(HEAPU32, tis + (40 >> 2), pthread.threadInfoStruct); + Atomics.store(HEAPU32, tis + (44 >> 2), 42); + Atomics.store(HEAPU32, tis + (108 >> 2), threadParams.stackSize); + Atomics.store(HEAPU32, tis + (84 >> 2), threadParams.stackSize); + Atomics.store(HEAPU32, tis + (80 >> 2), stackHigh); + Atomics.store(HEAPU32, tis + (108 + 8 >> 2), stackHigh); + Atomics.store(HEAPU32, tis + (108 + 12 >> 2), threadParams.detached); + Atomics.store(HEAPU32, tis + (108 + 20 >> 2), threadParams.schedPolicy); + Atomics.store(HEAPU32, tis + (108 + 24 >> 2), threadParams.schedPrio); + var global_libc = _emscripten_get_global_libc(); + var global_locale = global_libc + 40; + Atomics.store(HEAPU32, tis + (176 >> 2), global_locale); + worker.pthread = pthread; + var msg = { + "cmd": "run", + "start_routine": threadParams.startRoutine, + "arg": threadParams.arg, + "threadInfoStruct": threadParams.pthread_ptr, + "selfThreadId": threadParams.pthread_ptr, + "parentThreadId": threadParams.parent_pthread_ptr, + "stackBase": threadParams.stackBase, + "stackSize": threadParams.stackSize + }; + worker.runPthread = function () { + msg.time = performance.now(); + worker.postMessage(msg, threadParams.transferList) + }; + if (worker.loaded) { + worker.runPthread(); + delete worker.runPthread + } + } + + function _pthread_getschedparam(thread, policy, schedparam) { + if (!policy && !schedparam) return ERRNO_CODES.EINVAL; + if (!thread) { + err("pthread_getschedparam called with a null thread pointer!"); + return ERRNO_CODES.ESRCH + } + var self = HEAP32[thread + 12 >> 2]; + if (self !== thread) { + err("pthread_getschedparam attempted on thread " + thread + ", which does not point to a valid thread, or does not exist anymore!"); + return ERRNO_CODES.ESRCH + } + var schedPolicy = Atomics.load(HEAPU32, thread + 108 + 20 >> 2); + var schedPrio = Atomics.load(HEAPU32, thread + 108 + 24 >> 2); + if (policy) HEAP32[policy >> 2] = schedPolicy; + if (schedparam) HEAP32[schedparam >> 2] = schedPrio; + return 0 + } + + function _pthread_self() { + return __pthread_ptr | 0 + } + Module["_pthread_self"] = _pthread_self; + + function _pthread_create(pthread_ptr, attr, start_routine, arg) { + if (typeof SharedArrayBuffer === "undefined") { + err("Current environment does not support SharedArrayBuffer, pthreads are not available!"); + return 6 + } + if (!pthread_ptr) { + err("pthread_create called with a null thread pointer!"); + return 28 + } + var transferList = []; + var error = 0; + if (ENVIRONMENT_IS_PTHREAD && (transferList.length === 0 || error)) { + return _emscripten_sync_run_in_main_thread_4(687865856, pthread_ptr, attr, start_routine, arg) + } + if (error) return error; + var stackSize = 0; + var stackBase = 0; + var detached = 0; + var schedPolicy = 0; + var schedPrio = 0; + if (attr) { + stackSize = HEAP32[attr >> 2]; + stackSize += 81920; + stackBase = HEAP32[attr + 8 >> 2]; + detached = HEAP32[attr + 12 >> 2] !== 0; + var inheritSched = HEAP32[attr + 16 >> 2] === 0; + if (inheritSched) { + var prevSchedPolicy = HEAP32[attr + 20 >> 2]; + var prevSchedPrio = HEAP32[attr + 24 >> 2]; + var parentThreadPtr = PThread.currentProxiedOperationCallerThread ? PThread.currentProxiedOperationCallerThread : _pthread_self(); + _pthread_getschedparam(parentThreadPtr, attr + 20, attr + 24); + schedPolicy = HEAP32[attr + 20 >> 2]; + schedPrio = HEAP32[attr + 24 >> 2]; + HEAP32[attr + 20 >> 2] = prevSchedPolicy; + HEAP32[attr + 24 >> 2] = prevSchedPrio + } else { + schedPolicy = HEAP32[attr + 20 >> 2]; + schedPrio = HEAP32[attr + 24 >> 2] + } + } else { + stackSize = 2097152 + } + var allocatedOwnStack = stackBase == 0; + if (allocatedOwnStack) { + stackBase = _memalign(16, stackSize) + } else { + stackBase -= stackSize; + assert(stackBase > 0) + } + var threadInfoStruct = _malloc(232); + for (var i = 0; i < 232 >> 2; ++i) HEAPU32[(threadInfoStruct >> 2) + i] = 0; + HEAP32[pthread_ptr >> 2] = threadInfoStruct; + HEAP32[threadInfoStruct + 12 >> 2] = threadInfoStruct; + var headPtr = threadInfoStruct + 156; + HEAP32[headPtr >> 2] = headPtr; + var threadParams = { + stackBase: stackBase, + stackSize: stackSize, + allocatedOwnStack: allocatedOwnStack, + schedPolicy: schedPolicy, + schedPrio: schedPrio, + detached: detached, + startRoutine: start_routine, + pthread_ptr: threadInfoStruct, + parent_pthread_ptr: _pthread_self(), + arg: arg, + transferList: transferList + }; + if (ENVIRONMENT_IS_PTHREAD) { + threadParams.cmd = "spawnThread"; + postMessage(threadParams, transferList) + } else { + __spawn_thread(threadParams) + } + return 0 + } + + function _roundf(d) { + d = +d; + return d >= +0 ? +Math_floor(d + +.5) : +Math_ceil(d - +.5) + } + + function _sysconf(name) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(6, 1, name); + switch (name) { + case 30: + return 16384; + case 85: + var maxHeapSize = HEAPU8.length; + return maxHeapSize / 16384; + case 132: + case 133: + case 12: + case 137: + case 138: + case 15: + case 235: + case 16: + case 17: + case 18: + case 19: + case 20: + case 149: + case 13: + case 10: + case 236: + case 153: + case 9: + case 21: + case 22: + case 159: + case 154: + case 14: + case 77: + case 78: + case 139: + case 80: + case 81: + case 82: + case 68: + case 67: + case 164: + case 11: + case 29: + case 47: + case 48: + case 95: + case 52: + case 51: + case 46: + case 79: + return 200809; + case 27: + case 246: + case 127: + case 128: + case 23: + case 24: + case 160: + case 161: + case 181: + case 182: + case 242: + case 183: + case 184: + case 243: + case 244: + case 245: + case 165: + case 178: + case 179: + case 49: + case 50: + case 168: + case 169: + case 175: + case 170: + case 171: + case 172: + case 97: + case 76: + case 32: + case 173: + case 35: + return -1; + case 176: + case 177: + case 7: + case 155: + case 8: + case 157: + case 125: + case 126: + case 92: + case 93: + case 129: + case 130: + case 131: + case 94: + case 91: + return 1; + case 74: + case 60: + case 69: + case 70: + case 4: + return 1024; + case 31: + case 42: + case 72: + return 32; + case 87: + case 26: + case 33: + return 2147483647; + case 34: + case 1: + return 47839; + case 38: + case 36: + return 99; + case 43: + case 37: + return 2048; + case 0: + return 2097152; + case 3: + return 65536; + case 28: + return 32768; + case 44: + return 32767; + case 75: + return 16384; + case 39: + return 1e3; + case 89: + return 700; + case 71: + return 256; + case 40: + return 255; + case 2: + return 100; + case 180: + return 64; + case 25: + return 20; + case 5: + return 16; + case 6: + return 6; + case 73: + return 4; + case 84: { + if (typeof navigator === "object") return navigator["hardwareConcurrency"] || 1; + return 1 + } + } + setErrNo(28); + return -1 + } + if (!ENVIRONMENT_IS_PTHREAD) PThread.initMainThreadBlock(); + else PThread.initWorker(); + var GLctx; + GL.init(); + var proxiedFunctionTable = [null, _atexit, _emscripten_set_canvas_element_size_main_thread, _fd_close, _fd_seek, _fd_write, _sysconf]; + var asmLibraryArg = { + "__assert_fail": ___assert_fail, + "__handle_stack_overflow": ___handle_stack_overflow, + "_emscripten_notify_thread_queue": __emscripten_notify_thread_queue, + "abort": _abort, + "emscripten_conditional_set_current_thread_status": _emscripten_conditional_set_current_thread_status, + "emscripten_futex_wait": _emscripten_futex_wait, + "emscripten_futex_wake": _emscripten_futex_wake, + "emscripten_get_now": _emscripten_get_now, + "emscripten_is_main_browser_thread": _emscripten_is_main_browser_thread, + "emscripten_is_main_runtime_thread": _emscripten_is_main_runtime_thread, + "emscripten_memcpy_big": _emscripten_memcpy_big, + "emscripten_receive_on_main_thread_js": _emscripten_receive_on_main_thread_js, + "emscripten_resize_heap": _emscripten_resize_heap, + "emscripten_set_canvas_element_size": _emscripten_set_canvas_element_size, + "emscripten_set_current_thread_status": _emscripten_set_current_thread_status, + "emscripten_webgl_create_context": _emscripten_webgl_create_context, + "fd_close": _fd_close, + "fd_seek": _fd_seek, + "fd_write": _fd_write, + "initPthreadsJS": initPthreadsJS, + "memory": wasmMemory || Module["wasmMemory"], + "pthread_cleanup_pop": _pthread_cleanup_pop, + "pthread_cleanup_push": _pthread_cleanup_push, + "pthread_create": _pthread_create, + "pthread_self": _pthread_self, + "roundf": _roundf, + "table": wasmTable + }; + var asm = createWasm(); + Module["asm"] = asm; + var ___wasm_call_ctors = Module["___wasm_call_ctors"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__wasm_call_ctors"].apply(null, arguments) + }; + var _init = Module["_init"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["init"].apply(null, arguments) + }; + var _register_tensor = Module["_register_tensor"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["register_tensor"].apply(null, arguments) + }; + var _dispose_data = Module["_dispose_data"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dispose_data"].apply(null, arguments) + }; + var _dispose = Module["_dispose"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dispose"].apply(null, arguments) + }; + var _Abs = Module["_Abs"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Abs"].apply(null, arguments) + }; + var _Add = Module["_Add"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Add"].apply(null, arguments) + }; + var _AddN = Module["_AddN"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["AddN"].apply(null, arguments) + }; + var _ArgMax = Module["_ArgMax"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ArgMax"].apply(null, arguments) + }; + var _AvgPool = Module["_AvgPool"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["AvgPool"].apply(null, arguments) + }; + var _BatchMatMul = Module["_BatchMatMul"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["BatchMatMul"].apply(null, arguments) + }; + var _ClipByValue = Module["_ClipByValue"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ClipByValue"].apply(null, arguments) + }; + var _Conv2D = Module["_Conv2D"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Conv2D"].apply(null, arguments) + }; + var _Cos = Module["_Cos"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Cos"].apply(null, arguments) + }; + var _CropAndResize = Module["_CropAndResize"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["CropAndResize"].apply(null, arguments) + }; + var _DepthwiseConv2dNative = Module["_DepthwiseConv2dNative"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["DepthwiseConv2dNative"].apply(null, arguments) + }; + var _Div = Module["_Div"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Div"].apply(null, arguments) + }; + var _Exp = Module["_Exp"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Exp"].apply(null, arguments) + }; + var _FloorDiv = Module["_FloorDiv"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FloorDiv"].apply(null, arguments) + }; + var _FusedBatchNorm = Module["_FusedBatchNorm"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FusedBatchNorm"].apply(null, arguments) + }; + var _FusedConv2D = Module["_FusedConv2D"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FusedConv2D"].apply(null, arguments) + }; + var _FusedDepthwiseConv2D = Module["_FusedDepthwiseConv2D"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["FusedDepthwiseConv2D"].apply(null, arguments) + }; + var _Gather = Module["_Gather"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Gather"].apply(null, arguments) + }; + var _GatherNd = Module["_GatherNd"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["GatherNd"].apply(null, arguments) + }; + var _Greater = Module["_Greater"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Greater"].apply(null, arguments) + }; + var _GreaterEqual = Module["_GreaterEqual"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["GreaterEqual"].apply(null, arguments) + }; + var _Less = Module["_Less"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Less"].apply(null, arguments) + }; + var _LessEqual = Module["_LessEqual"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["LessEqual"].apply(null, arguments) + }; + var _Log = Module["_Log"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Log"].apply(null, arguments) + }; + var _LogicalAnd = Module["_LogicalAnd"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["LogicalAnd"].apply(null, arguments) + }; + var _Max = Module["_Max"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Max"].apply(null, arguments) + }; + var _MaxPool = Module["_MaxPool"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["MaxPool"].apply(null, arguments) + }; + var _Maximum = Module["_Maximum"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Maximum"].apply(null, arguments) + }; + var _Min = Module["_Min"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Min"].apply(null, arguments) + }; + var _Minimum = Module["_Minimum"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Minimum"].apply(null, arguments) + }; + var _Mul = Module["_Mul"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Mul"].apply(null, arguments) + }; + var _Neg = Module["_Neg"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Neg"].apply(null, arguments) + }; + var _NonMaxSuppressionV3 = Module["_NonMaxSuppressionV3"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["NonMaxSuppressionV3"].apply(null, arguments) + }; + var _NonMaxSuppressionV5 = Module["_NonMaxSuppressionV5"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["NonMaxSuppressionV5"].apply(null, arguments) + }; + var _NotEqual = Module["_NotEqual"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["NotEqual"].apply(null, arguments) + }; + var _PadV2 = Module["_PadV2"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["PadV2"].apply(null, arguments) + }; + var _Pow = Module["_Pow"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Pow"].apply(null, arguments) + }; + var _Prelu = Module["_Prelu"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Prelu"].apply(null, arguments) + }; + var _Relu = Module["_Relu"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Relu"].apply(null, arguments) + }; + var _Relu6 = Module["_Relu6"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Relu6"].apply(null, arguments) + }; + var _ResizeBilinear = Module["_ResizeBilinear"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ResizeBilinear"].apply(null, arguments) + }; + var _Rsqrt = Module["_Rsqrt"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Rsqrt"].apply(null, arguments) + }; + var _ScatterNd = Module["_ScatterNd"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["ScatterNd"].apply(null, arguments) + }; + var _Sigmoid = Module["_Sigmoid"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sigmoid"].apply(null, arguments) + }; + var _Sin = Module["_Sin"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sin"].apply(null, arguments) + }; + var _Softmax = Module["_Softmax"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Softmax"].apply(null, arguments) + }; + var _Sqrt = Module["_Sqrt"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sqrt"].apply(null, arguments) + }; + var _Square = Module["_Square"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Square"].apply(null, arguments) + }; + var _Sub = Module["_Sub"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sub"].apply(null, arguments) + }; + var _Sum = Module["_Sum"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Sum"].apply(null, arguments) + }; + var _Tanh = Module["_Tanh"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Tanh"].apply(null, arguments) + }; + var _Tile = Module["_Tile"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Tile"].apply(null, arguments) + }; + var _Transpose = Module["_Transpose"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["Transpose"].apply(null, arguments) + }; + var __FusedMatMul = Module["__FusedMatMul"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["_FusedMatMul"].apply(null, arguments) + }; + var _malloc = Module["_malloc"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["malloc"].apply(null, arguments) + }; + var _free = Module["_free"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["free"].apply(null, arguments) + }; + var ___em_js__initPthreadsJS = Module["___em_js__initPthreadsJS"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__em_js__initPthreadsJS"].apply(null, arguments) + }; + var ___errno_location = Module["___errno_location"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__errno_location"].apply(null, arguments) + }; + var _emscripten_get_global_libc = Module["_emscripten_get_global_libc"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_get_global_libc"].apply(null, arguments) + }; + var _memalign = Module["_memalign"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["memalign"].apply(null, arguments) + }; + var ___pthread_tsd_run_dtors = Module["___pthread_tsd_run_dtors"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__pthread_tsd_run_dtors"].apply(null, arguments) + }; + var _emscripten_main_thread_process_queued_calls = Module["_emscripten_main_thread_process_queued_calls"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null, arguments) + }; + var _emscripten_current_thread_process_queued_calls = Module["_emscripten_current_thread_process_queued_calls"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null, arguments) + }; + var _emscripten_register_main_browser_thread_id = Module["_emscripten_register_main_browser_thread_id"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null, arguments) + }; + var _emscripten_main_browser_thread_id = Module["_emscripten_main_browser_thread_id"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_main_browser_thread_id"].apply(null, arguments) + }; + var _emscripten_async_run_in_main_thread = Module["_emscripten_async_run_in_main_thread"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread = Module["_emscripten_sync_run_in_main_thread"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_0 = Module["_emscripten_sync_run_in_main_thread_0"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_1 = Module["_emscripten_sync_run_in_main_thread_1"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_2 = Module["_emscripten_sync_run_in_main_thread_2"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_xprintf_varargs = Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_3 = Module["_emscripten_sync_run_in_main_thread_3"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_4 = Module["_emscripten_sync_run_in_main_thread_4"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_5 = Module["_emscripten_sync_run_in_main_thread_5"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_6 = Module["_emscripten_sync_run_in_main_thread_6"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null, arguments) + }; + var _emscripten_sync_run_in_main_thread_7 = Module["_emscripten_sync_run_in_main_thread_7"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null, arguments) + }; + var _emscripten_run_in_main_runtime_thread_js = Module["_emscripten_run_in_main_runtime_thread_js"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null, arguments) + }; + var _emscripten_async_queue_on_thread_ = Module["_emscripten_async_queue_on_thread_"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null, arguments) + }; + var _emscripten_tls_init = Module["_emscripten_tls_init"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["emscripten_tls_init"].apply(null, arguments) + }; + var ___set_stack_limit = Module["___set_stack_limit"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["__set_stack_limit"].apply(null, arguments) + }; + var stackSave = Module["stackSave"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["stackSave"].apply(null, arguments) + }; + var stackAlloc = Module["stackAlloc"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["stackAlloc"].apply(null, arguments) + }; + var stackRestore = Module["stackRestore"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["stackRestore"].apply(null, arguments) + }; + var dynCall_vi = Module["dynCall_vi"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dynCall_vi"].apply(null, arguments) + }; + var dynCall_v = Module["dynCall_v"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dynCall_v"].apply(null, arguments) + }; + var dynCall_ii = Module["dynCall_ii"] = function () { + assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)"); + assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"); + return Module["asm"]["dynCall_ii"].apply(null, arguments) + }; + Module["asm"] = asm; + if (!Object.getOwnPropertyDescriptor(Module, "intArrayFromString")) Module["intArrayFromString"] = function () { + abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "intArrayToString")) Module["intArrayToString"] = function () { + abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "ccall")) Module["ccall"] = function () { + abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + Module["cwrap"] = cwrap; + if (!Object.getOwnPropertyDescriptor(Module, "setValue")) Module["setValue"] = function () { + abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getValue")) Module["getValue"] = function () { + abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "allocate")) Module["allocate"] = function () { + abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getMemory")) Module["getMemory"] = function () { + abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF8ArrayToString")) Module["UTF8ArrayToString"] = function () { + abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF8ToString")) Module["UTF8ToString"] = function () { + abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8Array")) Module["stringToUTF8Array"] = function () { + abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8")) Module["stringToUTF8"] = function () { + abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF8")) Module["lengthBytesUTF8"] = function () { + abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function () { + abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnPreRun")) Module["addOnPreRun"] = function () { + abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnInit")) Module["addOnInit"] = function () { + abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnPreMain")) Module["addOnPreMain"] = function () { + abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnExit")) Module["addOnExit"] = function () { + abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addOnPostRun")) Module["addOnPostRun"] = function () { + abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeStringToMemory")) Module["writeStringToMemory"] = function () { + abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeArrayToMemory")) Module["writeArrayToMemory"] = function () { + abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeAsciiToMemory")) Module["writeAsciiToMemory"] = function () { + abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addRunDependency")) Module["addRunDependency"] = function () { + abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "removeRunDependency")) Module["removeRunDependency"] = function () { + abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createFolder")) Module["FS_createFolder"] = function () { + abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createPath")) Module["FS_createPath"] = function () { + abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createDataFile")) Module["FS_createDataFile"] = function () { + abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createPreloadedFile")) Module["FS_createPreloadedFile"] = function () { + abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createLazyFile")) Module["FS_createLazyFile"] = function () { + abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createLink")) Module["FS_createLink"] = function () { + abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_createDevice")) Module["FS_createDevice"] = function () { + abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "FS_unlink")) Module["FS_unlink"] = function () { + abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") + }; + if (!Object.getOwnPropertyDescriptor(Module, "dynamicAlloc")) Module["dynamicAlloc"] = function () { + abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "loadDynamicLibrary")) Module["loadDynamicLibrary"] = function () { + abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "loadWebAssemblyModule")) Module["loadWebAssemblyModule"] = function () { + abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getLEB")) Module["getLEB"] = function () { + abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getFunctionTables")) Module["getFunctionTables"] = function () { + abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "alignFunctionTables")) Module["alignFunctionTables"] = function () { + abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "registerFunctions")) Module["registerFunctions"] = function () { + abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "addFunction")) Module["addFunction"] = function () { + abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "removeFunction")) Module["removeFunction"] = function () { + abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getFuncWrapper")) Module["getFuncWrapper"] = function () { + abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "prettyPrint")) Module["prettyPrint"] = function () { + abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "makeBigInt")) Module["makeBigInt"] = function () { + abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "dynCall")) Module["dynCall"] = function () { + abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getCompilerSetting")) Module["getCompilerSetting"] = function () { + abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "print")) Module["print"] = function () { + abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "printErr")) Module["printErr"] = function () { + abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getTempRet0")) Module["getTempRet0"] = function () { + abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "setTempRet0")) Module["setTempRet0"] = function () { + abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "callMain")) Module["callMain"] = function () { + abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "abort")) Module["abort"] = function () { + abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToNewUTF8")) Module["stringToNewUTF8"] = function () { + abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "abortOnCannotGrowMemory")) Module["abortOnCannotGrowMemory"] = function () { + abort("'abortOnCannotGrowMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscripten_realloc_buffer")) Module["emscripten_realloc_buffer"] = function () { + abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "ENV")) Module["ENV"] = function () { + abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "setjmpId")) Module["setjmpId"] = function () { + abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_CODES")) Module["ERRNO_CODES"] = function () { + abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_MESSAGES")) Module["ERRNO_MESSAGES"] = function () { + abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "setErrNo")) Module["setErrNo"] = function () { + abort("'setErrNo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "DNS")) Module["DNS"] = function () { + abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GAI_ERRNO_MESSAGES")) Module["GAI_ERRNO_MESSAGES"] = function () { + abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "Protocols")) Module["Protocols"] = function () { + abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "Sockets")) Module["Sockets"] = function () { + abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UNWIND_CACHE")) Module["UNWIND_CACHE"] = function () { + abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "readAsmConstArgs")) Module["readAsmConstArgs"] = function () { + abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "jstoi_q")) Module["jstoi_q"] = function () { + abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "jstoi_s")) Module["jstoi_s"] = function () { + abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "PATH")) Module["PATH"] = function () { + abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "PATH_FS")) Module["PATH_FS"] = function () { + abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SYSCALLS")) Module["SYSCALLS"] = function () { + abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "syscallMmap2")) Module["syscallMmap2"] = function () { + abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "syscallMunmap")) Module["syscallMunmap"] = function () { + abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "flush_NO_FILESYSTEM")) Module["flush_NO_FILESYSTEM"] = function () { + abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "JSEvents")) Module["JSEvents"] = function () { + abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "demangle")) Module["demangle"] = function () { + abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "demangleAll")) Module["demangleAll"] = function () { + abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "jsStackTrace")) Module["jsStackTrace"] = function () { + abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function () { + abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getEnvStrings")) Module["getEnvStrings"] = function () { + abort("'getEnvStrings' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64")) Module["writeI53ToI64"] = function () { + abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Clamped")) Module["writeI53ToI64Clamped"] = function () { + abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Signaling")) Module["writeI53ToI64Signaling"] = function () { + abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Clamped")) Module["writeI53ToU64Clamped"] = function () { + abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Signaling")) Module["writeI53ToU64Signaling"] = function () { + abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "readI53FromI64")) Module["readI53FromI64"] = function () { + abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "readI53FromU64")) Module["readI53FromU64"] = function () { + abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "convertI32PairToI53")) Module["convertI32PairToI53"] = function () { + abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "convertU32PairToI53")) Module["convertU32PairToI53"] = function () { + abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "Browser")) Module["Browser"] = function () { + abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GL")) Module["GL"] = function () { + abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGet")) Module["emscriptenWebGLGet"] = function () { + abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetTexPixelData")) Module["emscriptenWebGLGetTexPixelData"] = function () { + abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetUniform")) Module["emscriptenWebGLGetUniform"] = function () { + abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetVertexAttrib")) Module["emscriptenWebGLGetVertexAttrib"] = function () { + abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "AL")) Module["AL"] = function () { + abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL_unicode")) Module["SDL_unicode"] = function () { + abort("'SDL_unicode' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL_ttfContext")) Module["SDL_ttfContext"] = function () { + abort("'SDL_ttfContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL_audio")) Module["SDL_audio"] = function () { + abort("'SDL_audio' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL")) Module["SDL"] = function () { + abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "SDL_gfx")) Module["SDL_gfx"] = function () { + abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLUT")) Module["GLUT"] = function () { + abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "EGL")) Module["EGL"] = function () { + abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLFW_Window")) Module["GLFW_Window"] = function () { + abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLFW")) Module["GLFW"] = function () { + abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "GLEW")) Module["GLEW"] = function () { + abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "IDBStore")) Module["IDBStore"] = function () { + abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "runAndAbortIfError")) Module["runAndAbortIfError"] = function () { + abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + Module["PThread"] = PThread; + if (!Object.getOwnPropertyDescriptor(Module, "establishStackSpace")) Module["establishStackSpace"] = function () { + abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "getNoExitRuntime")) Module["getNoExitRuntime"] = function () { + abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "resetPrototype")) Module["resetPrototype"] = function () { + abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "warnOnce")) Module["warnOnce"] = function () { + abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackSave")) Module["stackSave"] = function () { + abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackRestore")) Module["stackRestore"] = function () { + abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stackAlloc")) Module["stackAlloc"] = function () { + abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "AsciiToString")) Module["AsciiToString"] = function () { + abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToAscii")) Module["stringToAscii"] = function () { + abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF16ToString")) Module["UTF16ToString"] = function () { + abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF16")) Module["stringToUTF16"] = function () { + abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF16")) Module["lengthBytesUTF16"] = function () { + abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "UTF32ToString")) Module["UTF32ToString"] = function () { + abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF32")) Module["stringToUTF32"] = function () { + abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF32")) Module["lengthBytesUTF32"] = function () { + abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8")) Module["allocateUTF8"] = function () { + abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8OnStack")) Module["allocateUTF8OnStack"] = function () { + abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + }; + Module["writeStackCookie"] = writeStackCookie; + Module["checkStackCookie"] = checkStackCookie; + Module["abortStackOverflow"] = abortStackOverflow; + Module["PThread"] = PThread; + Module["_pthread_self"] = _pthread_self; + Module["wasmMemory"] = wasmMemory; + Module["ExitStatus"] = ExitStatus; + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NORMAL")) Object.defineProperty(Module, "ALLOC_NORMAL", { + configurable: true, + get: function () { + abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_STACK")) Object.defineProperty(Module, "ALLOC_STACK", { + configurable: true, + get: function () { + abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_DYNAMIC")) Object.defineProperty(Module, "ALLOC_DYNAMIC", { + configurable: true, + get: function () { + abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + } + }); + if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NONE")) Object.defineProperty(Module, "ALLOC_NONE", { + configurable: true, + get: function () { + abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") + } + }); + var calledRun; + Module["then"] = function (func) { + if (calledRun) { + func(Module) + } else { + var old = Module["onRuntimeInitialized"]; + Module["onRuntimeInitialized"] = function () { + if (old) old(); + func(Module) + } + } + return Module + }; + + function ExitStatus(status) { + this.name = "ExitStatus"; + this.message = "Program terminated with exit(" + status + ")"; + this.status = status + } + dependenciesFulfilled = function runCaller() { + if (!calledRun) run(); + if (!calledRun) dependenciesFulfilled = runCaller + }; + + function run(args) { + args = args || arguments_; + if (runDependencies > 0) { + return + } + writeStackCookie(); + preRun(); + if (runDependencies > 0) return; + + function doRun() { + if (calledRun) return; + calledRun = true; + Module["calledRun"] = true; + if (ABORT) return; + initRuntime(); + preMain(); + if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"](); + assert(!Module["_main"], 'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'); + postRun() + } + if (Module["setStatus"]) { + Module["setStatus"]("Running..."); + setTimeout(function () { + setTimeout(function () { + Module["setStatus"]("") + }, 1); + doRun() + }, 1) + } else { + doRun() + } + checkStackCookie() + } + Module["run"] = run; + if (Module["preInit"]) { + if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]]; + while (Module["preInit"].length > 0) { + Module["preInit"].pop()() + } + } + if (!ENVIRONMENT_IS_PTHREAD) noExitRuntime = true; + if (!ENVIRONMENT_IS_PTHREAD) run(); + + + return WasmBackendModule + } + ); +})(); +if (typeof exports === 'object' && typeof module === 'object') + module.exports = WasmBackendModule; +else if (typeof define === 'function' && define['amd']) + define([], function () { + return WasmBackendModule; + }); +else if (typeof exports === 'object') + exports["WasmBackendModule"] = WasmBackendModule; diff --git a/tfjs-core/benchmarks/wasm_4_threads/tfjs-backend-wasm.wasm b/tfjs-core/benchmarks/wasm_4_threads/tfjs-backend-wasm.wasm new file mode 100644 index 0000000000000000000000000000000000000000..9fed9e9cc82e0b4ecfeabc2f73f2bba0bc012c44 GIT binary patch literal 156992 zcmeFa3!Gn7dH1{a-v9e$=0C|KnPdXl|4pnRf<}u0(VE#wNI(#1LF+j!CXoy*V+mst*Cfui?_bE^0w4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Ok(= z;(IsBx!v}YC*Hk6j>ujim+y7E-0)%>nVvdUs_xh-3og7~EAq!(O#jCg`F&GcS=sYaIpwJylJVgx8FjTI z6E1r~YR{b_XP?#LjO+}B@_fxOIq~pgq04E!q-W1?hf?o&xI^ow9KhBd4|MiFz&U7q z`4JNjnt0Ht@`H~o9~nLL(DL!oW6Ptz8gpdg$Lr=+mrt)QpIw1Jh&Q13_H*Sk>IL5z zJ#oUw@*~HMDW5RWCh&=g;}4o})R8^r^c_BRZuJxzF%LrJJ(H_VuCu(dMq4ifoNnD5 zcU<+nidoYuor65MIJWan>`kYpc1lfURoJ!NlrdEeM-U2VzX3<3fyZnBrDlrsm Date: Mon, 11 May 2020 15:55:45 -0400 Subject: [PATCH 71/85] fix --- tfjs-backend-wasm/src/backend_wasm.ts | 15 +- tfjs-core/benchmarks/tf-backend-wasm.js | 376 ++++++++++---------- tfjs-core/benchmarks/tfjs-backend-wasm.js | 2 +- tfjs-core/benchmarks/tfjs-backend-wasm.wasm | Bin 157093 -> 158031 bytes 4 files changed, 211 insertions(+), 182 deletions(-) diff --git a/tfjs-backend-wasm/src/backend_wasm.ts b/tfjs-backend-wasm/src/backend_wasm.ts index ef2b88f16df..fdf57505551 100644 --- a/tfjs-backend-wasm/src/backend_wasm.ts +++ b/tfjs-backend-wasm/src/backend_wasm.ts @@ -202,12 +202,25 @@ function createInstantiateWasmFunc(path: string) { export async function init(): Promise<{wasm: BackendWasmModule}> { return new Promise((resolve, reject) => { const factoryConfig: WasmFactoryConfig = {}; + + const locateFile = (path: string, prefix: string) => { + if (path.endsWith('.worker.js')) { + const response = + 'var threadInfoStruct=0;var selfThreadId=0;var parentThreadId=0;var Module={};function assert(condition,text){if(!condition)abort("Assertion failed: "+text)}function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:selfThreadId})}var out=function(){throw"out() is not defined in worker.js."};var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);Module["wasmModule"]=null;receiveInstance(instance);return instance.exports};this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["DYNAMIC_BASE"]=e.data.DYNAMIC_BASE;Module["DYNAMICTOP_PTR"]=e.data.DYNAMICTOP_PTR;Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}Module=WasmBackendModule(Module);postMessage({"cmd":"loaded"})}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;threadInfoStruct=e.data.threadInfoStruct;Module["__register_pthread_ptr"](threadInfoStruct,0,0);selfThreadId=e.data.selfThreadId;parentThreadId=e.data.parentThreadId;var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;assert(threadInfoStruct);assert(selfThreadId);assert(parentThreadId);assert(top!=0);assert(max!=0);assert(top>max);Module["establishStackSpace"](top,max);Module["_emscripten_tls_init"]();Module["writeStackCookie"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].setThreadStatus(Module["_pthread_self"](),1);try{var result=Module["dynCall_ii"](e.data.start_routine,e.data.arg);Module["checkStackCookie"]();if(!Module["getNoExitRuntime"]())Module["PThread"].threadExit(result)}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){Atomics.store(Module["HEAPU32"],threadInfoStruct+4>>2,ex instanceof Module["ExitStatus"]?ex.status:-2);Atomics.store(Module["HEAPU32"],threadInfoStruct+0>>2,1);if(typeof Module["_emscripten_futex_wake"]!=="function"){err("Thread Initialisation failed.");throw ex}Module["_emscripten_futex_wake"](threadInfoStruct+0,2147483647);if(!(ex instanceof Module["ExitStatus"]))throw ex}else{err("Pthread 0x"+threadInfoStruct.toString(16)+" completed its pthread main entry point with an unwind, keeping the pthread worker alive for asynchronous operation.")}}}else if(e.data.cmd==="cancel"){if(threadInfoStruct){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(threadInfoStruct){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}}'; + const blob = new Blob([response], {type: 'application/javascript'}); + return URL.createObjectURL(blob); + } + return prefix + path; + }; + + factoryConfig.locateFile = locateFile; + if (wasmPath != null) { factoryConfig.locateFile = (path, prefix) => { if (path.endsWith('.wasm')) { return wasmPath; } - return prefix + path; + return locateFile(path, prefix); }; // use wasm instantiateWasm override when system fetch is not available. // For detail references diff --git a/tfjs-core/benchmarks/tf-backend-wasm.js b/tfjs-core/benchmarks/tf-backend-wasm.js index 20941b13a09..255bfc3911b 100644 --- a/tfjs-core/benchmarks/tf-backend-wasm.js +++ b/tfjs-core/benchmarks/tf-backend-wasm.js @@ -1,27 +1,27 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tensorflow/tfjs-core'), require('../wasm-out/tfjs-backend-wasm.js')) : - typeof define === 'function' && define.amd ? define(['exports', '@tensorflow/tfjs-core', '../wasm-out/tfjs-backend-wasm.js'], factory) : - (global = global || self, factory((global.tf = global.tf || {}, global.tf.wasm = global.tf.wasm || {}), global.tf, global.WasmBackendModule)); -}(this, (function (exports, tfjsCore, WasmBackendModule) { 'use strict'; - - WasmBackendModule = WasmBackendModule && WasmBackendModule.hasOwnProperty('default') ? WasmBackendModule['default'] : WasmBackendModule; - +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tensorflow/tfjs-core'), require('../wasm-out/tfjs-backend-wasm.js')) : + typeof define === 'function' && define.amd ? define(['exports', '@tensorflow/tfjs-core', '../wasm-out/tfjs-backend-wasm.js'], factory) : + (global = global || self, factory((global.tf = global.tf || {}, global.tf.wasm = global.tf.wasm || {}), global.tf, global.WasmBackendModule)); +}(this, (function (exports, tfjsCore, WasmBackendModule) { 'use strict'; + + WasmBackendModule = WasmBackendModule && WasmBackendModule.hasOwnProperty('default') ? WasmBackendModule['default'] : WasmBackendModule; + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -54,8 +54,8 @@ FusableActivation[FusableActivation["relu"] = 1] = "relu"; FusableActivation[FusableActivation["relu6"] = 2] = "relu6"; FusableActivation[FusableActivation["prelu"] = 3] = "prelu"; - })(FusableActivation || (FusableActivation = {})); - + })(FusableActivation || (FusableActivation = {})); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -130,8 +130,8 @@ backendName: 'wasm', setupFunc: setup, kernelFunc: fusedBatchMatMul - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -167,8 +167,8 @@ return out; } tfjsCore.registerKernel({ kernelName, backendName: 'wasm', setupFunc, kernelFunc }); - } - + } + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -185,8 +185,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Abs'); - + registerUnaryKernel('Abs'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -251,8 +251,8 @@ } } tfjsCore.registerKernel({ kernelName, backendName: 'wasm', setupFunc, kernelFunc }); - } - + } + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -270,8 +270,8 @@ * ============================================================================= */ const supportsFullBroadcast = true; - registerBinaryKernel('Add', supportsFullBroadcast); - + registerBinaryKernel('Add', supportsFullBroadcast); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -315,8 +315,8 @@ backendName: 'wasm', setupFunc, kernelFunc: addn, - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -359,8 +359,8 @@ backendName: 'wasm', kernelFunc: argmax, setupFunc: setup$1 - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -428,8 +428,8 @@ backendName: 'wasm', setupFunc: setup$2, kernelFunc: avgPool - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -484,8 +484,8 @@ backendName: 'wasm', setupFunc: setup$3, kernelFunc: batchMatMul - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -514,8 +514,8 @@ kernelName: 'Cast', backendName: 'wasm', kernelFunc: cast, - }); - + }); + /** * @license * Copyright 2019 Google LLC. All Rights Reserved. @@ -556,8 +556,8 @@ backendName: 'wasm', setupFunc: setup$4, kernelFunc: clip - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -603,8 +603,8 @@ kernelName: 'Concat', backendName: 'wasm', kernelFunc: concat, - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -647,10 +647,12 @@ } function conv2d(args) { const { inputs, attrs, backend } = args; - const convInfo = attrs; const { x, filter } = inputs; const xId = backend.dataIdMap.get(x.dataId).id; const filterId = backend.dataIdMap.get(filter.dataId).id; + const { strides, dilations, pad, dimRoundingMode, dataFormat } = attrs; + const $dataFormat = tfjsCore.backend_util.convertConv2DDataFormat(dataFormat); + const convInfo = tfjsCore.backend_util.computeConv2DInfo(x.shape, filter.shape, strides, dilations, pad, dimRoundingMode, false, $dataFormat); const filterHeight = convInfo.filterHeight; const filterWidth = convInfo.filterWidth; const padTop = convInfo.padInfo.top; @@ -678,8 +680,8 @@ backendName: 'wasm', setupFunc: setup$5, kernelFunc: conv2d - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -696,8 +698,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Cos'); - + registerUnaryKernel('Cos'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -766,8 +768,8 @@ backendName: 'wasm', setupFunc: setup$6, kernelFunc: cropAndResize - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -811,10 +813,12 @@ } function depthwiseConv2d(args) { const { inputs, attrs, backend } = args; - const convInfo = attrs; const { x, filter } = inputs; const xId = backend.dataIdMap.get(x.dataId).id; const filterId = backend.dataIdMap.get(filter.dataId).id; + const { strides, dilations, pad, dimRoundingMode } = attrs; + const $dilations = dilations == null ? [1, 1] : dilations; + const convInfo = tfjsCore.backend_util.computeConv2DInfo(x.shape, filter.shape, strides, $dilations, pad, dimRoundingMode, true /* depthwise */); const filterHeight = convInfo.filterHeight; const filterWidth = convInfo.filterWidth; const padTop = convInfo.padInfo.top; @@ -842,8 +846,8 @@ backendName: 'wasm', setupFunc: setup$7, kernelFunc: depthwiseConv2d - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -861,8 +865,8 @@ * ============================================================================= */ const supportsFullBroadcast$1 = false; - registerBinaryKernel('Div', supportsFullBroadcast$1); - + registerBinaryKernel('Div', supportsFullBroadcast$1); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -879,8 +883,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Exp'); - + registerUnaryKernel('Exp'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -898,8 +902,8 @@ * ============================================================================= */ const supportsFullBroadcast$2 = false; - registerBinaryKernel('FloorDiv', supportsFullBroadcast$2); - + registerBinaryKernel('FloorDiv', supportsFullBroadcast$2); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -943,8 +947,8 @@ backendName: 'wasm', setupFunc: setup$8, kernelFunc: fusedBatchNorm - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1045,8 +1049,8 @@ backendName: 'wasm', setupFunc: setup$9, kernelFunc: fusedConv2d - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1148,8 +1152,8 @@ backendName: 'wasm', setupFunc: setup$a, kernelFunc: fusedDepthwiseConv2d - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1205,8 +1209,8 @@ backendName: 'wasm', setupFunc: setup$b, kernelFunc: gather - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1260,8 +1264,8 @@ backendName: 'wasm', setupFunc: setup$c, kernelFunc: gatherNd - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1279,8 +1283,8 @@ * ============================================================================= */ const supportsFullBroadcast$3 = false; - registerBinaryKernel('Greater', supportsFullBroadcast$3, 'bool'); - + registerBinaryKernel('Greater', supportsFullBroadcast$3, 'bool'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1298,8 +1302,8 @@ * ============================================================================= */ const supportsFullBroadcast$4 = false; - registerBinaryKernel('GreaterEqual', supportsFullBroadcast$4, 'bool'); - + registerBinaryKernel('GreaterEqual', supportsFullBroadcast$4, 'bool'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1317,8 +1321,8 @@ * ============================================================================= */ const supportsFullBroadcast$5 = false; - registerBinaryKernel('Less', supportsFullBroadcast$5, 'bool'); - + registerBinaryKernel('Less', supportsFullBroadcast$5, 'bool'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1336,8 +1340,8 @@ * ============================================================================= */ const supportsFullBroadcast$6 = false; - registerBinaryKernel('LessEqual', supportsFullBroadcast$6, 'bool'); - + registerBinaryKernel('LessEqual', supportsFullBroadcast$6, 'bool'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1354,8 +1358,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Log'); - + registerUnaryKernel('Log'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1373,8 +1377,8 @@ * ============================================================================= */ const supportsFullBroadcast$7 = false; - registerBinaryKernel('LogicalAnd', supportsFullBroadcast$7, 'bool'); - + registerBinaryKernel('LogicalAnd', supportsFullBroadcast$7, 'bool'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1398,11 +1402,12 @@ } function max(args) { const { backend, inputs, attrs } = args; - const { axes } = attrs; + const { reductionIndices } = attrs; const { x } = inputs; const xId = backend.dataIdMap.get(x.dataId).id; - tfjsCore.backend_util.assertAxesAreInnerMostDims('max', axes, x.shape.length); - const [outShape, reduceShape] = tfjsCore.backend_util.computeOutAndReduceShapes(x.shape, axes); + const origAxes = tfjsCore.util.parseAxisParam(reductionIndices, x.shape); + tfjsCore.backend_util.assertAxesAreInnerMostDims('max', origAxes, x.shape.length); + const [outShape, reduceShape] = tfjsCore.backend_util.computeOutAndReduceShapes(x.shape, origAxes); const reduceSize = tfjsCore.util.sizeFromShape(reduceShape); const out = backend.makeOutput(outShape, x.dtype); if (tfjsCore.util.sizeFromShape(x.shape) === 0) { @@ -1412,13 +1417,8 @@ wasmMax(xId, reduceSize, outId); return out; } - tfjsCore.registerKernel({ - kernelName: 'Max', - backendName: 'wasm', - setupFunc: setup$d, - kernelFunc: max - }); - + tfjsCore.registerKernel({ kernelName: tfjsCore.Max, backendName: 'wasm', setupFunc: setup$d, kernelFunc: max }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1436,8 +1436,8 @@ * ============================================================================= */ const supportsFullBroadcast$8 = false; - registerBinaryKernel('Maximum', supportsFullBroadcast$8); - + registerBinaryKernel('Maximum', supportsFullBroadcast$8); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1507,8 +1507,8 @@ backendName: 'wasm', setupFunc: setup$e, kernelFunc: maxPool - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1551,8 +1551,8 @@ backendName: 'wasm', setupFunc: setup$f, kernelFunc: min - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1570,8 +1570,8 @@ * ============================================================================= */ const supportsFullBroadcast$9 = false; - registerBinaryKernel('Minimum', supportsFullBroadcast$9); - + registerBinaryKernel('Minimum', supportsFullBroadcast$9); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1589,8 +1589,8 @@ * ============================================================================= */ const supportsFullBroadcast$a = true; - registerBinaryKernel('Mul', supportsFullBroadcast$a); - + registerBinaryKernel('Mul', supportsFullBroadcast$a); + /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -1607,8 +1607,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Neg'); - + registerUnaryKernel('Neg'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1637,8 +1637,8 @@ // Since the result was allocated on the heap, we have to delete it. backend.wasm._free(resOffset); return { pSelectedIndices, selectedSize, pSelectedScores }; - } - + } + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1684,8 +1684,8 @@ backendName: 'wasm', setupFunc: setup$g, kernelFunc, - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1731,8 +1731,8 @@ backendName: 'wasm', setupFunc: setup$h, kernelFunc: kernelFunc$1, - }); - + }); + /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -1750,8 +1750,8 @@ * ============================================================================= */ const supportsFullBroadcast$b = false; - registerBinaryKernel('NotEqual', supportsFullBroadcast$b, 'bool'); - + registerBinaryKernel('NotEqual', supportsFullBroadcast$b, 'bool'); + /** * @license * Copyright 2020 Google Inc. All Rights Reserved. @@ -1779,8 +1779,8 @@ kernelName: 'OnesLike', backendName: 'wasm', kernelFunc: onesLike, - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1826,8 +1826,8 @@ backendName: 'wasm', kernelFunc: pad, setupFunc: setup$i - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1845,8 +1845,8 @@ * ============================================================================= */ const supportsFullBroadcast$c = false; - registerBinaryKernel('Pow', supportsFullBroadcast$c); - + registerBinaryKernel('Pow', supportsFullBroadcast$c); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1886,8 +1886,8 @@ backendName: 'wasm', setupFunc: setup$j, kernelFunc: prelu - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1904,8 +1904,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Relu'); - + registerUnaryKernel('Relu'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1922,8 +1922,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Relu6'); - + registerUnaryKernel('Relu6'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -1948,8 +1948,8 @@ kernelName: 'Reshape', backendName: 'wasm', kernelFunc: reshape, - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2009,8 +2009,8 @@ backendName: 'wasm', setupFunc: setup$k, kernelFunc: resizeBilinear - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2027,8 +2027,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Rsqrt'); - + registerUnaryKernel('Rsqrt'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2082,8 +2082,8 @@ backendName: 'wasm', setupFunc: setup$l, kernelFunc: scatterNd - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2122,8 +2122,8 @@ backendName: 'wasm', setupFunc: setup$m, kernelFunc: sigmoid - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2140,8 +2140,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Sin'); - + registerUnaryKernel('Sin'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2243,8 +2243,8 @@ kernelName: 'Slice', backendName: 'wasm', kernelFunc: slice, - }); - + }); + /** * @license * Copyright 2020 Google LLC. All Rights Reserved. @@ -2289,8 +2289,8 @@ backendName: 'wasm', setupFunc: setup$n, kernelFunc: softmax - }); - + }); + /** * @license * Copyright 2020 Google Inc. All Rights Reserved. @@ -2308,7 +2308,9 @@ * ============================================================================= */ function split(args) { - const { inputs: { x }, attrs: { numOrSizeSplits, axis }, backend } = args; + const { inputs, attrs, backend } = args; + const { x } = inputs; + const { numOrSizeSplits, axis } = attrs; const $axis = tfjsCore.util.parseAxisParam(axis, x.shape)[0]; let splitSizes; if (typeof (numOrSizeSplits) === 'number') { @@ -2328,8 +2330,8 @@ return xSlice; }); } - tfjsCore.registerKernel({ kernelName: 'SplitV', backendName: 'wasm', kernelFunc: split }); - + tfjsCore.registerKernel({ kernelName: tfjsCore.SplitV, backendName: 'wasm', kernelFunc: split }); + /** * @license * Copyright 2020 Google Inc. All Rights Reserved. @@ -2346,8 +2348,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Sqrt'); - + registerUnaryKernel('Sqrt'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2364,8 +2366,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Square'); - + registerUnaryKernel('Square'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2383,8 +2385,8 @@ * ============================================================================= */ const supportsFullBroadcast$d = true; - registerBinaryKernel('Sub', supportsFullBroadcast$d); - + registerBinaryKernel('Sub', supportsFullBroadcast$d); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2427,8 +2429,8 @@ backendName: 'wasm', setupFunc: setup$o, kernelFunc: sum - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2445,8 +2447,8 @@ * limitations under the License. * ============================================================================= */ - registerUnaryKernel('Tanh'); - + registerUnaryKernel('Tanh'); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2495,8 +2497,8 @@ backendName: 'wasm', setupFunc: setup$p, kernelFunc: tile - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2588,8 +2590,8 @@ backendName: 'wasm', kernelFunc: transpose, setupFunc: setup$q, - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2631,8 +2633,8 @@ kernelName: 'Unpack', backendName: 'wasm', kernelFunc: unpack, - }); - + }); + /** * @license * Copyright 2020 Google Inc. All Rights Reserved. @@ -2660,8 +2662,8 @@ kernelName: 'ZerosLike', backendName: 'wasm', kernelFunc: zerosLike, - }); - + }); + /** * @license * Copyright 2019 Google Inc. All Rights Reserved. @@ -2678,6 +2680,7 @@ * limitations under the License. * ============================================================================= */ + const threadWorker = require('../wasm-out/tfjs-backend-wasm.worker.js'); const WASM_PRIORITY = 2; class BackendWasm extends tfjsCore.KernelBackend { constructor(wasm) { @@ -2814,14 +2817,27 @@ * in Chrome 76). */ async function init() { + console.log('INITIALIZING'); + // ts-lint:disable-next-line:no-any + window.threadWorker = threadWorker; + console.log(threadWorker); return new Promise((resolve, reject) => { const factoryConfig = {}; + const locateFile = (path, prefix) => { + if (path.endsWith('.worker.js')) { + const response = 'var threadInfoStruct=0;var selfThreadId=0;var parentThreadId=0;var Module={};function assert(condition,text){if(!condition)abort("Assertion failed: "+text)}function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:selfThreadId})}var out=function(){throw"out() is not defined in worker.js."};var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);Module["wasmModule"]=null;receiveInstance(instance);return instance.exports};this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["DYNAMIC_BASE"]=e.data.DYNAMIC_BASE;Module["DYNAMICTOP_PTR"]=e.data.DYNAMICTOP_PTR;Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}Module=WasmBackendModule(Module);postMessage({"cmd":"loaded"})}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;threadInfoStruct=e.data.threadInfoStruct;Module["__register_pthread_ptr"](threadInfoStruct,0,0);selfThreadId=e.data.selfThreadId;parentThreadId=e.data.parentThreadId;var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;assert(threadInfoStruct);assert(selfThreadId);assert(parentThreadId);assert(top!=0);assert(max!=0);assert(top>max);Module["establishStackSpace"](top,max);Module["_emscripten_tls_init"]();Module["writeStackCookie"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].setThreadStatus(Module["_pthread_self"](),1);try{var result=Module["dynCall_ii"](e.data.start_routine,e.data.arg);Module["checkStackCookie"]();if(!Module["getNoExitRuntime"]())Module["PThread"].threadExit(result)}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){Atomics.store(Module["HEAPU32"],threadInfoStruct+4>>2,ex instanceof Module["ExitStatus"]?ex.status:-2);Atomics.store(Module["HEAPU32"],threadInfoStruct+0>>2,1);if(typeof Module["_emscripten_futex_wake"]!=="function"){err("Thread Initialisation failed.");throw ex}Module["_emscripten_futex_wake"](threadInfoStruct+0,2147483647);if(!(ex instanceof Module["ExitStatus"]))throw ex}else{err("Pthread 0x"+threadInfoStruct.toString(16)+" completed its pthread main entry point with an unwind, keeping the pthread worker alive for asynchronous operation.")}}}else if(e.data.cmd==="cancel"){if(threadInfoStruct){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(threadInfoStruct){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}}'; + const blob = new Blob([response], { type: 'application/javascript' }); + return URL.createObjectURL(blob); + } + return prefix + path; + }; + factoryConfig.locateFile = locateFile; if (wasmPath != null) { factoryConfig.locateFile = (path, prefix) => { if (path.endsWith('.wasm')) { return wasmPath; } - return prefix + path; + return locateFile(path, prefix); }; // use wasm instantiateWasm override when system fetch is not available. // For detail references @@ -2898,17 +2914,17 @@ } wasmPath = path; customFetch = usePlatformFetch; - } - + } + /** @license See the LICENSE file. */ // This code is auto-generated, do not modify this file! - const version = '0.0.0'; - - exports.BackendWasm = BackendWasm; - exports.setWasmPath = setWasmPath; - exports.version_wasm = version; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}))); -//# sourceMappingURL=tf-backend-wasm.js.map + const version = '0.0.0'; + + exports.BackendWasm = BackendWasm; + exports.setWasmPath = setWasmPath; + exports.version_wasm = version; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=tf-backend-wasm.js.map diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.js b/tfjs-core/benchmarks/tfjs-backend-wasm.js index 4411a9a4b90..dd9b95c935f 100755 --- a/tfjs-core/benchmarks/tfjs-backend-wasm.js +++ b/tfjs-core/benchmarks/tfjs-backend-wasm.js @@ -6,7 +6,7 @@ var WasmBackendModule = (function() { function(WasmBackendModule) { WasmBackendModule = WasmBackendModule || {}; -var Module=typeof WasmBackendModule!=="undefined"?WasmBackendModule:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(Module["ENVIRONMENT"]){throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)")}var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"];DYNAMIC_BASE=Module["DYNAMIC_BASE"];DYNAMICTOP_PTR=Module["DYNAMICTOP_PTR"]}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{throw new Error("environment detection error")}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(!Object.getOwnPropertyDescriptor(Module,"arguments"))Object.defineProperty(Module,"arguments",{configurable:true,get:function(){abort("Module.arguments has been replaced with plain arguments_")}});if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(!Object.getOwnPropertyDescriptor(Module,"thisProgram"))Object.defineProperty(Module,"thisProgram",{configurable:true,get:function(){abort("Module.thisProgram has been replaced with plain thisProgram")}});if(Module["quit"])quit_=Module["quit"];if(!Object.getOwnPropertyDescriptor(Module,"quit"))Object.defineProperty(Module,"quit",{configurable:true,get:function(){abort("Module.quit has been replaced with plain quit_")}});assert(typeof Module["memoryInitializerPrefixURL"]==="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["pthreadMainPrefixURL"]==="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["cdInitializerPrefixURL"]==="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["filePackagePrefixURL"]==="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["read"]==="undefined","Module.read option was removed (modify read_ in JS)");assert(typeof Module["readAsync"]==="undefined","Module.readAsync option was removed (modify readAsync in JS)");assert(typeof Module["readBinary"]==="undefined","Module.readBinary option was removed (modify readBinary in JS)");assert(typeof Module["setWindowTitle"]==="undefined","Module.setWindowTitle option was removed (modify setWindowTitle in JS)");assert(typeof Module["TOTAL_MEMORY"]==="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY");if(!Object.getOwnPropertyDescriptor(Module,"read"))Object.defineProperty(Module,"read",{configurable:true,get:function(){abort("Module.read has been replaced with plain read_")}});if(!Object.getOwnPropertyDescriptor(Module,"readAsync"))Object.defineProperty(Module,"readAsync",{configurable:true,get:function(){abort("Module.readAsync has been replaced with plain readAsync")}});if(!Object.getOwnPropertyDescriptor(Module,"readBinary"))Object.defineProperty(Module,"readBinary",{configurable:true,get:function(){abort("Module.readBinary has been replaced with plain readBinary")}});if(!Object.getOwnPropertyDescriptor(Module,"setWindowTitle"))Object.defineProperty(Module,"setWindowTitle",{configurable:true,get:function(){abort("Module.setWindowTitle has been replaced with plain setWindowTitle")}});assert(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER||ENVIRONMENT_IS_NODE,"Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)");var stackSave;var stackRestore;var stackAlloc;stackSave=stackRestore=stackAlloc=function(){abort("cannot use the stack before compiled code is ready to run, and has provided stack access")};function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(!Object.getOwnPropertyDescriptor(Module,"wasmBinary"))Object.defineProperty(Module,"wasmBinary",{configurable:true,get:function(){abort("Module.wasmBinary has been replaced with plain wasmBinary")}});var noExitRuntime;if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(!Object.getOwnPropertyDescriptor(Module,"noExitRuntime"))Object.defineProperty(Module,"noExitRuntime",{configurable:true,get:function(){abort("Module.noExitRuntime has been replaced with plain noExitRuntime")}});if(typeof WebAssembly!=="object"){abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.")}var wasmMemory;var wasmTable=new WebAssembly.Table({"initial":120,"maximum":120+0,"element":"anyfunc"});var wasmModule;var threadInfoStruct=0;var selfThreadId=0;var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string")return UTF8ToString(ret);if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{if((u0&248)!=240)warnOnce("Invalid UTF-8 leading byte 0x"+u0.toString(16)+" encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!");u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;if(u>=2097152)warnOnce("Invalid Unicode code point 0x"+u.toString(16)+" encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF).");heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");HEAP8.set(array,buffer)}var WASM_PAGE_SIZE=65536;var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var STACK_BASE=5255840,STACKTOP=STACK_BASE,STACK_MAX=12960,DYNAMIC_BASE=5255840,DYNAMICTOP_PTR=12032;assert(STACK_BASE%16===0,"stack must start aligned");assert(DYNAMIC_BASE%16===0,"heap must start aligned");if(ENVIRONMENT_IS_PTHREAD){STACK_MAX=STACKTOP=STACK_MAX=2147483647}var TOTAL_STACK=5242880;if(Module["TOTAL_STACK"])assert(TOTAL_STACK===Module["TOTAL_STACK"],"the stack size can no longer be determined at runtime");var INITIAL_INITIAL_MEMORY=Module["INITIAL_MEMORY"]||524288e3;if(!Object.getOwnPropertyDescriptor(Module,"INITIAL_MEMORY"))Object.defineProperty(Module,"INITIAL_MEMORY",{configurable:true,get:function(){abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY")}});assert(INITIAL_INITIAL_MEMORY>=TOTAL_STACK,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+INITIAL_INITIAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");assert(typeof Int32Array!=="undefined"&&typeof Float64Array!=="undefined"&&Int32Array.prototype.subarray!==undefined&&Int32Array.prototype.set!==undefined,"JS engine does not provide full typed array support");if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,"maximum":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_INITIAL_MEMORY=buffer.byteLength;assert(INITIAL_INITIAL_MEMORY%WASM_PAGE_SIZE===0);updateGlobalBufferAndViews(buffer);if(!ENVIRONMENT_IS_PTHREAD){HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE}function writeStackCookie(){assert((STACK_MAX&3)==0);HEAPU32[(STACK_MAX>>2)+1]=34821223;HEAPU32[(STACK_MAX>>2)+2]=2310721022;HEAP32[0]=1668509029}function checkStackCookie(){var cookie1=HEAPU32[(STACK_MAX>>2)+1];var cookie2=HEAPU32[(STACK_MAX>>2)+2];if(cookie1!=34821223||cookie2!=2310721022){abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+cookie2.toString(16)+" "+cookie1.toString(16))}if(HEAP32[0]!==1668509029)abort("Runtime error: The application has corrupted its heap memory area (address zero)!")}function abortStackOverflow(allocSize){abort("Stack overflow! Attempted to allocate "+allocSize+" bytes on the stack, but stack has only "+(STACK_MAX-stackSave()+allocSize)+" bytes available!")}(function(){var h16=new Int16Array(1);var h8=new Int8Array(h16.buffer);h16[0]=25459;if(h8[0]!==115||h8[1]!==99)throw"Runtime error: expected the system to be little-endian!"})();function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;if(ENVIRONMENT_IS_PTHREAD)runtimeInitialized=true;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){checkStackCookie();assert(!runtimeInitialized);runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATMAIN__)}function postRun(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Math_ceil=Math.ceil;var Math_floor=Math.floor;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!=="undefined"){runDependencyWatcher=setInterval(function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;err("still waiting on run dependencies:")}err("dependency: "+dep)}if(shown){err("(end of list)")}},1e4)}}else{err("warning: run dependency added without ID")}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id]}else{err("warning: run dependency removed without ID")}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";out(what);err(what);ABORT=true;EXITSTATUS=1;var output="abort("+what+") at "+stackTrace();what=output;throw new WebAssembly.RuntimeError(what)}var FS={error:function(){abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1")},init:function(){FS.error()},createDataFile:function(){FS.error()},createPreloadedFile:function(){FS.error()},createLazyFile:function(){FS.error()},open:function(){FS.error()},mkdev:function(){FS.error()},registerDevice:function(){FS.error()},analyzePath:function(){FS.error()},loadFilesFromDB:function(){FS.error()},ErrnoError:function ErrnoError(){FS.error()}};Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;function hasPrefix(str,prefix){return String.prototype.startsWith?str.startsWith(prefix):str.indexOf(prefix)===0}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return hasPrefix(filename,dataURIPrefix)}var fileURIPrefix="file://";function isFileURI(filename){return hasPrefix(filename,fileURIPrefix)}var wasmBinaryFile="tfjs-backend-wasm.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(){try{if(wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(wasmBinaryFile)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary()})}return new Promise(function(resolve,reject){resolve(getBinary())})}function createWasm(){var info={"env":asmLibraryArg,"wasi_snapshot_preview1":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){var numWorkersToLoad=PThread.unusedWorkers.length;PThread.unusedWorkers.forEach(function(w){PThread.loadWasmModuleToWorker(w,function(){if(!--numWorkersToLoad)removeRunDependency("wasm-instantiate")})})}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}var trueModule=Module;function receiveInstantiatedSource(output){assert(Module===trueModule,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");trueModule=null;receiveInstance(output["instance"],output["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var ASM_CONSTS={};function initPthreadsJS(){PThread.initRuntime()}if(!ENVIRONMENT_IS_PTHREAD)__ATINIT__.push({func:function(){___wasm_call_ctors()}});function demangle(func){warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return func}function demangleAll(text){var regex=/\b_Z[\w\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"})}var __pthread_ptr=0;var __pthread_is_main_runtime_thread=0;var __pthread_is_main_browser_thread=0;function __register_pthread_ptr(pthreadPtr,isMainBrowserThread,isMainRuntimeThread){pthreadPtr=pthreadPtr|0;isMainBrowserThread=isMainBrowserThread|0;isMainRuntimeThread=isMainRuntimeThread|0;__pthread_ptr=pthreadPtr;__pthread_is_main_browser_thread=isMainBrowserThread;__pthread_is_main_runtime_thread=isMainRuntimeThread}Module["__register_pthread_ptr"]=__register_pthread_ptr;var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var __main_thread_futex_wait_address=12944;function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__main_thread_futex_wait_address>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__main_thread_futex_wait_address>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function __kill_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _kill_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _kill_thread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function __cancel_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cancel_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cancel_thread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function __cleanup_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cleanup_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cleanup_thread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];if(pthread){var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={MAIN_THREAD_ID:1,mainThreadInfo:{schedPolicy:0,schedPrio:0},unusedWorkers:[],runningWorkers:[],initRuntime:function(){__register_pthread_ptr(PThread.mainThreadBlock,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(PThread.mainThreadBlock)},initMainThreadBlock:function(){assert(!ENVIRONMENT_IS_PTHREAD);var pthreadPoolSize=8;for(var i=0;i>2]=PThread.mainThreadBlock;var headPtr=PThread.mainThreadBlock+156;HEAP32[headPtr>>2]=headPtr;var tlsMemory=12432;for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,PThread.mainThreadBlock+104>>2,tlsMemory);Atomics.store(HEAPU32,PThread.mainThreadBlock+40>>2,PThread.mainThreadBlock);Atomics.store(HEAPU32,PThread.mainThreadBlock+44>>2,42)},initWorker:function(){},pthreads:{},exitHandlers:null,setThreadStatus:function(){},runExitHandlers:function(){if(PThread.exitHandlers!==null){while(PThread.exitHandlers.length>0){PThread.exitHandlers.pop()()}PThread.exitHandlers=null}if(ENVIRONMENT_IS_PTHREAD&&threadInfoStruct)___pthread_tsd_run_dtors()},threadExit:function(exitCode){var tb=_pthread_self();if(tb){err("Pthread 0x"+tb.toString(16)+" exited.");Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);Atomics.store(HEAPU32,tb+60>>2,1);Atomics.store(HEAPU32,tb+64>>2,0);PThread.runExitHandlers();_emscripten_futex_wake(tb+0,2147483647);__register_pthread_ptr(0,0,0);threadInfoStruct=0;if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlers();Atomics.store(HEAPU32,threadInfoStruct+4>>2,-1);Atomics.store(HEAPU32,threadInfoStruct+0>>2,1);_emscripten_futex_wake(threadInfoStruct+0,2147483647);threadInfoStruct=selfThreadId=0;__register_pthread_ptr(0,0,0);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+104>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){delete PThread.pthreads[worker.pthread.thread];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined},receiveObjectTransfer:function(data){},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){__spawn_thread(e.data)}else if(cmd==="cleanupThread"){__cleanup_thread(d["thread"])}else if(cmd==="killThread"){__kill_thread(d["thread"])}else if(cmd==="cancelThread"){__cancel_thread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.thread+68>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){console.log("worker exited - TODO: update the worker queue?")})}assert(wasmMemory instanceof WebAssembly.Memory,"WebAssembly memory should have been loaded by now!");assert(wasmModule instanceof WebAssembly.Module,"WebAssembly Module should have been loaded by now!");worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule,"DYNAMIC_BASE":DYNAMIC_BASE,"DYNAMICTOP_PTR":DYNAMICTOP_PTR})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("tfjs-backend-wasm.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}if(PThread.unusedWorkers.length>0)return PThread.unusedWorkers.pop();else return null},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()>2]=value;return value}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg);warnOnce("atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)");__ATEXIT__.unshift({func:func,arg:arg})}function ___handle_stack_overflow(){abort("stack overflow")}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){err("Cannot send message to thread with ID "+targetThreadId+", unknown thread ID!");return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){expectedStatus=expectedStatus|0;newStatus=newStatus|0}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(ENVIRONMENT_IS_WORKER){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{var loadedVal=Atomics.load(HEAP32,addr>>2);if(val!=loadedVal)return-6;var tNow=performance.now();var tEnd=tNow+timeout;Atomics.store(HEAP32,__main_thread_futex_wait_address>>2,addr);var ourWaitAddress=addr;while(addr==ourWaitAddress){tNow=performance.now();if(tNow>tEnd){return-73}_emscripten_main_thread_process_queued_calls();addr=Atomics.load(HEAP32,__main_thread_futex_wait_address>>2)}return 0}}function _emscripten_is_main_browser_thread(){return __pthread_is_main_browser_thread|0}function _emscripten_is_main_runtime_thread(){return __pthread_is_main_runtime_thread|0}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;if(numCallArgs>20-1)throw"emscripten_proxy_to_main_thread_js: Too many arguments "+numCallArgs+" to proxied function idx="+index+", maximum supported is "+(20-1)+"!";var stack=stackSave();var args=stackAlloc(numCallArgs*8);var b=args>>3;for(var i=0;i>3]);buf+=8}else if(ch===105){buf=buf+3&~3;args.push(HEAP32[buf>>2]);buf+=4}else abort("unexpected char in asm const signature "+ch)}return args}function _emscripten_receive_on_main_thread_js(index,numCallArgs,args){_emscripten_receive_on_main_thread_js_callArgs.length=numCallArgs;var b=args>>3;for(var i=0;i=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;_emscripten_async_queue_on_thread_(targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;_emscripten_async_queue_on_thread_(targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function __maybeCStringToJsString(cString){return cString===cString+0?UTF8ToString(cString):cString}var __specialEventTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function __findEventTarget(target){var domElement=__specialEventTargets[target]||(typeof document!=="undefined"?document.querySelector(__maybeCStringToJsString(target)):undefined);return domElement}function __findCanvasEventTarget(target){return __findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=__findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=__findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){newStatus=newStatus|0}function _emscripten_set_thread_name(threadId,name){threadId=threadId|0;name=name|0}function __webgl_acquireInstancedArraysExtension(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)}}}function __webgl_acquireVertexArrayObjectExtension(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)}}}function __webgl_acquireDrawBuffersExtension(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)}}}var GL={counter:1,lastError:0,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},currentContext:null,offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,init:function(){var miniTempFloatBuffer=new Float32Array(GL.MINI_TEMP_BUFFER_SIZE);for(var i=0;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;if(context.version<2){__webgl_acquireInstancedArraysExtension(GLctx);__webgl_acquireVertexArrayObjectExtension(GLctx);__webgl_acquireDrawBuffersExtension(GLctx)}GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query");var automaticallyEnabledExtensions=["OES_texture_float","OES_texture_half_float","OES_standard_derivatives","OES_vertex_array_object","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","OES_element_index_uint","EXT_texture_filter_anisotropic","EXT_frag_depth","WEBGL_draw_buffers","ANGLE_instanced_arrays","OES_texture_float_linear","OES_texture_half_float_linear","EXT_blend_minmax","EXT_shader_texture_lod","EXT_texture_norm16","WEBGL_compressed_texture_pvrtc","EXT_color_buffer_half_float","WEBGL_color_buffer_float","EXT_sRGB","WEBGL_compressed_texture_etc1","EXT_disjoint_timer_query","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_astc","EXT_color_buffer_float","WEBGL_compressed_texture_s3tc_srgb","EXT_disjoint_timer_query_webgl2","WEBKIT_WEBGL_compressed_texture_pvrtc"];var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(automaticallyEnabledExtensions.indexOf(ext)!=-1){GLctx.getExtension(ext)}})},populateUniformTable:function(program){var p=GL.programs[program];var ptable=GL.programInfos[program]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1};var utable=ptable.uniforms;var numUniforms=GLctx.getProgramParameter(p,35718);for(var i=0;i>2;contextAttributes["alpha"]=!!HEAP32[a+(0>>2)];contextAttributes["depth"]=!!HEAP32[a+(4>>2)];contextAttributes["stencil"]=!!HEAP32[a+(8>>2)];contextAttributes["antialias"]=!!HEAP32[a+(12>>2)];contextAttributes["premultipliedAlpha"]=!!HEAP32[a+(16>>2)];contextAttributes["preserveDrawingBuffer"]=!!HEAP32[a+(20>>2)];var powerPreference=HEAP32[a+(24>>2)];contextAttributes["powerPreference"]=__emscripten_webgl_power_preferences[powerPreference];contextAttributes["failIfMajorPerformanceCaveat"]=!!HEAP32[a+(28>>2)];contextAttributes.majorVersion=HEAP32[a+(32>>2)];contextAttributes.minorVersion=HEAP32[a+(36>>2)];contextAttributes.enableExtensionsByDefault=HEAP32[a+(40>>2)];contextAttributes.explicitSwapControl=HEAP32[a+(44>>2)];contextAttributes.proxyContextToMainThread=HEAP32[a+(48>>2)];contextAttributes.renderViaOffscreenBackBuffer=HEAP32[a+(52>>2)];var canvas=__findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];assert(buffer);if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:undefined,get:function(){assert(SYSCALLS.varargs!=undefined);SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){if(low>=0)assert(high===0);else assert(high===-1);return low}};function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,fd);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM");return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,fd,offset_low,offset_high,whence,newOffset);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM")}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd,iov,iovcnt,pnum);var num=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}function _pthread_cleanup_pop(execute){var routine=PThread.exitHandlers.pop();if(execute)routine()}function _pthread_cleanup_push(routine,arg){if(PThread.exitHandlers===null){PThread.exitHandlers=[]}PThread.exitHandlers.push(function(){dynCall_vi(routine,arg)})}function __spawn_thread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _spawn_thread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,thread:threadParams.pthread_ptr,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(0>>2),0);Atomics.store(HEAPU32,tis+(4>>2),0);Atomics.store(HEAPU32,tis+(8>>2),0);Atomics.store(HEAPU32,tis+(68>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(104>>2),tlsMemory);Atomics.store(HEAPU32,tis+(48>>2),0);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(44>>2),42);Atomics.store(HEAPU32,tis+(108>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(84>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(80>>2),stackHigh);Atomics.store(HEAPU32,tis+(108+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(108+12>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(108+20>>2),threadParams.schedPolicy);Atomics.store(HEAPU32,tis+(108+24>>2),threadParams.schedPrio);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(176>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"selfThreadId":threadParams.pthread_ptr,"parentThreadId":threadParams.parent_pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}}function _pthread_getschedparam(thread,policy,schedparam){if(!policy&&!schedparam)return ERRNO_CODES.EINVAL;if(!thread){err("pthread_getschedparam called with a null thread pointer!");return ERRNO_CODES.ESRCH}var self=HEAP32[thread+12>>2];if(self!==thread){err("pthread_getschedparam attempted on thread "+thread+", which does not point to a valid thread, or does not exist anymore!");return ERRNO_CODES.ESRCH}var schedPolicy=Atomics.load(HEAPU32,thread+108+20>>2);var schedPrio=Atomics.load(HEAPU32,thread+108+24>>2);if(policy)HEAP32[policy>>2]=schedPolicy;if(schedparam)HEAP32[schedparam>>2]=schedPrio;return 0}function _pthread_self(){return __pthread_ptr|0}Module["_pthread_self"]=_pthread_self;function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;var schedPolicy=0;var schedPrio=0;if(attr){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0;var inheritSched=HEAP32[attr+16>>2]===0;if(inheritSched){var prevSchedPolicy=HEAP32[attr+20>>2];var prevSchedPrio=HEAP32[attr+24>>2];var parentThreadPtr=PThread.currentProxiedOperationCallerThread?PThread.currentProxiedOperationCallerThread:_pthread_self();_pthread_getschedparam(parentThreadPtr,attr+20,attr+24);schedPolicy=HEAP32[attr+20>>2];schedPrio=HEAP32[attr+24>>2];HEAP32[attr+20>>2]=prevSchedPolicy;HEAP32[attr+24>>2]=prevSchedPrio}else{schedPolicy=HEAP32[attr+20>>2];schedPrio=HEAP32[attr+24>>2]}}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(232);for(var i=0;i<232>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+156;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,schedPolicy:schedPolicy,schedPrio:schedPrio,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,parent_pthread_ptr:_pthread_self(),arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList)}else{__spawn_thread(threadParams)}return 0}function _roundf(d){d=+d;return d>=+0?+Math_floor(d+ +.5):+Math_ceil(d-+.5)}function _sysconf(name){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,name);switch(name){case 30:return 16384;case 85:var maxHeapSize=HEAPU8.length;return maxHeapSize/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:case 79:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator==="object")return navigator["hardwareConcurrency"]||1;return 1}}setErrNo(28);return-1}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();else PThread.initWorker();var GLctx;GL.init();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_fd_close,_fd_seek,_fd_write,_sysconf];var asmLibraryArg={"__assert_fail":___assert_fail,"__call_main":___call_main,"__handle_stack_overflow":___handle_stack_overflow,"_emscripten_notify_thread_queue":__emscripten_notify_thread_queue,"abort":_abort,"emscripten_conditional_set_current_thread_status":_emscripten_conditional_set_current_thread_status,"emscripten_futex_wait":_emscripten_futex_wait,"emscripten_futex_wake":_emscripten_futex_wake,"emscripten_get_now":_emscripten_get_now,"emscripten_is_main_browser_thread":_emscripten_is_main_browser_thread,"emscripten_is_main_runtime_thread":_emscripten_is_main_runtime_thread,"emscripten_memcpy_big":_emscripten_memcpy_big,"emscripten_receive_on_main_thread_js":_emscripten_receive_on_main_thread_js,"emscripten_resize_heap":_emscripten_resize_heap,"emscripten_set_canvas_element_size":_emscripten_set_canvas_element_size,"emscripten_set_current_thread_status":_emscripten_set_current_thread_status,"emscripten_set_thread_name":_emscripten_set_thread_name,"emscripten_webgl_create_context":_emscripten_webgl_create_context,"fd_close":_fd_close,"fd_seek":_fd_seek,"fd_write":_fd_write,"initPthreadsJS":initPthreadsJS,"memory":wasmMemory||Module["wasmMemory"],"pthread_cleanup_pop":_pthread_cleanup_pop,"pthread_cleanup_push":_pthread_cleanup_push,"pthread_create":_pthread_create,"pthread_self":_pthread_self,"roundf":_roundf,"table":wasmTable};var asm=createWasm();Module["asm"]=asm;var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__wasm_call_ctors"].apply(null,arguments)};var _init=Module["_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["init"].apply(null,arguments)};var _register_tensor=Module["_register_tensor"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["register_tensor"].apply(null,arguments)};var _dispose_data=Module["_dispose_data"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose_data"].apply(null,arguments)};var _dispose=Module["_dispose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose"].apply(null,arguments)};var _Abs=Module["_Abs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Abs"].apply(null,arguments)};var _Add=Module["_Add"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Add"].apply(null,arguments)};var _AddN=Module["_AddN"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AddN"].apply(null,arguments)};var _ArgMax=Module["_ArgMax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ArgMax"].apply(null,arguments)};var _AvgPool=Module["_AvgPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AvgPool"].apply(null,arguments)};var _BatchMatMul=Module["_BatchMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["BatchMatMul"].apply(null,arguments)};var _ClipByValue=Module["_ClipByValue"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ClipByValue"].apply(null,arguments)};var _Conv2D=Module["_Conv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Conv2D"].apply(null,arguments)};var _Cos=Module["_Cos"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Cos"].apply(null,arguments)};var _CropAndResize=Module["_CropAndResize"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["CropAndResize"].apply(null,arguments)};var _DepthwiseConv2dNative=Module["_DepthwiseConv2dNative"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["DepthwiseConv2dNative"].apply(null,arguments)};var _Div=Module["_Div"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Div"].apply(null,arguments)};var _Exp=Module["_Exp"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Exp"].apply(null,arguments)};var _FloorDiv=Module["_FloorDiv"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FloorDiv"].apply(null,arguments)};var _FusedBatchNorm=Module["_FusedBatchNorm"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedBatchNorm"].apply(null,arguments)};var _FusedConv2D=Module["_FusedConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedConv2D"].apply(null,arguments)};var _FusedDepthwiseConv2D=Module["_FusedDepthwiseConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedDepthwiseConv2D"].apply(null,arguments)};var _Gather=Module["_Gather"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Gather"].apply(null,arguments)};var _GatherNd=Module["_GatherNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GatherNd"].apply(null,arguments)};var _Greater=Module["_Greater"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Greater"].apply(null,arguments)};var _GreaterEqual=Module["_GreaterEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GreaterEqual"].apply(null,arguments)};var _Less=Module["_Less"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Less"].apply(null,arguments)};var _LessEqual=Module["_LessEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LessEqual"].apply(null,arguments)};var _Log=Module["_Log"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Log"].apply(null,arguments)};var _LogicalAnd=Module["_LogicalAnd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LogicalAnd"].apply(null,arguments)};var _Max=Module["_Max"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Max"].apply(null,arguments)};var _MaxPool=Module["_MaxPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["MaxPool"].apply(null,arguments)};var _Maximum=Module["_Maximum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Maximum"].apply(null,arguments)};var _Min=Module["_Min"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Min"].apply(null,arguments)};var _Minimum=Module["_Minimum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Minimum"].apply(null,arguments)};var _Mul=Module["_Mul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Mul"].apply(null,arguments)};var _Neg=Module["_Neg"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Neg"].apply(null,arguments)};var _NonMaxSuppressionV3=Module["_NonMaxSuppressionV3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV3"].apply(null,arguments)};var _NonMaxSuppressionV5=Module["_NonMaxSuppressionV5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV5"].apply(null,arguments)};var _NotEqual=Module["_NotEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NotEqual"].apply(null,arguments)};var _PadV2=Module["_PadV2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["PadV2"].apply(null,arguments)};var _Pow=Module["_Pow"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Pow"].apply(null,arguments)};var _Prelu=Module["_Prelu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Prelu"].apply(null,arguments)};var _Relu=Module["_Relu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu"].apply(null,arguments)};var _Relu6=Module["_Relu6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu6"].apply(null,arguments)};var _ResizeBilinear=Module["_ResizeBilinear"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ResizeBilinear"].apply(null,arguments)};var _Rsqrt=Module["_Rsqrt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Rsqrt"].apply(null,arguments)};var _ScatterNd=Module["_ScatterNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ScatterNd"].apply(null,arguments)};var _Sigmoid=Module["_Sigmoid"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sigmoid"].apply(null,arguments)};var _Sin=Module["_Sin"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sin"].apply(null,arguments)};var _Softmax=Module["_Softmax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Softmax"].apply(null,arguments)};var _Sqrt=Module["_Sqrt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sqrt"].apply(null,arguments)};var _Square=Module["_Square"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Square"].apply(null,arguments)};var _Sub=Module["_Sub"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sub"].apply(null,arguments)};var _Sum=Module["_Sum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sum"].apply(null,arguments)};var _Tanh=Module["_Tanh"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tanh"].apply(null,arguments)};var _Tile=Module["_Tile"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tile"].apply(null,arguments)};var _Transpose=Module["_Transpose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Transpose"].apply(null,arguments)};var __FusedMatMul=Module["__FusedMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_FusedMatMul"].apply(null,arguments)};var _malloc=Module["_malloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["malloc"].apply(null,arguments)};var _free=Module["_free"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["free"].apply(null,arguments)};var ___em_js__initPthreadsJS=Module["___em_js__initPthreadsJS"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__em_js__initPthreadsJS"].apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__errno_location"].apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_get_global_libc"].apply(null,arguments)};var _memalign=Module["_memalign"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["memalign"].apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__pthread_tsd_run_dtors"].apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null,arguments)};var _emscripten_main_browser_thread_id=Module["_emscripten_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_browser_thread_id"].apply(null,arguments)};var _emscripten_async_run_in_main_thread=Module["_emscripten_async_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread=Module["_emscripten_sync_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_0=Module["_emscripten_sync_run_in_main_thread_0"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_1=Module["_emscripten_sync_run_in_main_thread_1"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_2=Module["_emscripten_sync_run_in_main_thread_2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_xprintf_varargs=Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_3=Module["_emscripten_sync_run_in_main_thread_3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_5=Module["_emscripten_sync_run_in_main_thread_5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_6=Module["_emscripten_sync_run_in_main_thread_6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_7=Module["_emscripten_sync_run_in_main_thread_7"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null,arguments)};var _emscripten_async_queue_on_thread_=Module["_emscripten_async_queue_on_thread_"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_tls_init"].apply(null,arguments)};var ___set_stack_limit=Module["___set_stack_limit"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__set_stack_limit"].apply(null,arguments)};var stackSave=Module["stackSave"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackSave"].apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackAlloc"].apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackRestore"].apply(null,arguments)};var dynCall_vi=Module["dynCall_vi"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_vi"].apply(null,arguments)};var dynCall_v=Module["dynCall_v"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_v"].apply(null,arguments)};var dynCall_ii=Module["dynCall_ii"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_ii"].apply(null,arguments)};Module["asm"]=asm;if(!Object.getOwnPropertyDescriptor(Module,"intArrayFromString"))Module["intArrayFromString"]=function(){abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"intArrayToString"))Module["intArrayToString"]=function(){abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ccall"))Module["ccall"]=function(){abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["cwrap"]=cwrap;if(!Object.getOwnPropertyDescriptor(Module,"setValue"))Module["setValue"]=function(){abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getValue"))Module["getValue"]=function(){abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocate"))Module["allocate"]=function(){abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getMemory"))Module["getMemory"]=function(){abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ArrayToString"))Module["UTF8ArrayToString"]=function(){abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ToString"))Module["UTF8ToString"]=function(){abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8Array"))Module["stringToUTF8Array"]=function(){abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8"))Module["stringToUTF8"]=function(){abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF8"))Module["lengthBytesUTF8"]=function(){abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreRun"))Module["addOnPreRun"]=function(){abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnInit"))Module["addOnInit"]=function(){abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreMain"))Module["addOnPreMain"]=function(){abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnExit"))Module["addOnExit"]=function(){abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPostRun"))Module["addOnPostRun"]=function(){abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeStringToMemory"))Module["writeStringToMemory"]=function(){abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeArrayToMemory"))Module["writeArrayToMemory"]=function(){abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeAsciiToMemory"))Module["writeAsciiToMemory"]=function(){abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addRunDependency"))Module["addRunDependency"]=function(){abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"removeRunDependency"))Module["removeRunDependency"]=function(){abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createFolder"))Module["FS_createFolder"]=function(){abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPath"))Module["FS_createPath"]=function(){abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDataFile"))Module["FS_createDataFile"]=function(){abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPreloadedFile"))Module["FS_createPreloadedFile"]=function(){abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLazyFile"))Module["FS_createLazyFile"]=function(){abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLink"))Module["FS_createLink"]=function(){abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDevice"))Module["FS_createDevice"]=function(){abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_unlink"))Module["FS_unlink"]=function(){abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"dynamicAlloc"))Module["dynamicAlloc"]=function(){abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadDynamicLibrary"))Module["loadDynamicLibrary"]=function(){abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadWebAssemblyModule"))Module["loadWebAssemblyModule"]=function(){abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getLEB"))Module["getLEB"]=function(){abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFunctionTables"))Module["getFunctionTables"]=function(){abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"alignFunctionTables"))Module["alignFunctionTables"]=function(){abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"registerFunctions"))Module["registerFunctions"]=function(){abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addFunction"))Module["addFunction"]=function(){abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"removeFunction"))Module["removeFunction"]=function(){abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFuncWrapper"))Module["getFuncWrapper"]=function(){abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"prettyPrint"))Module["prettyPrint"]=function(){abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"makeBigInt"))Module["makeBigInt"]=function(){abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"dynCall"))Module["dynCall"]=function(){abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getCompilerSetting"))Module["getCompilerSetting"]=function(){abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"print"))Module["print"]=function(){abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"printErr"))Module["printErr"]=function(){abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getTempRet0"))Module["getTempRet0"]=function(){abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setTempRet0"))Module["setTempRet0"]=function(){abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"callMain"))Module["callMain"]=function(){abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"abort"))Module["abort"]=function(){abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToNewUTF8"))Module["stringToNewUTF8"]=function(){abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"abortOnCannotGrowMemory"))Module["abortOnCannotGrowMemory"]=function(){abort("'abortOnCannotGrowMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscripten_realloc_buffer"))Module["emscripten_realloc_buffer"]=function(){abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ENV"))Module["ENV"]=function(){abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setjmpId"))Module["setjmpId"]=function(){abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_CODES"))Module["ERRNO_CODES"]=function(){abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_MESSAGES"))Module["ERRNO_MESSAGES"]=function(){abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setErrNo"))Module["setErrNo"]=function(){abort("'setErrNo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"DNS"))Module["DNS"]=function(){abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GAI_ERRNO_MESSAGES"))Module["GAI_ERRNO_MESSAGES"]=function(){abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Protocols"))Module["Protocols"]=function(){abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Sockets"))Module["Sockets"]=function(){abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UNWIND_CACHE"))Module["UNWIND_CACHE"]=function(){abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readAsmConstArgs"))Module["readAsmConstArgs"]=function(){abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_q"))Module["jstoi_q"]=function(){abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_s"))Module["jstoi_s"]=function(){abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH"))Module["PATH"]=function(){abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH_FS"))Module["PATH_FS"]=function(){abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SYSCALLS"))Module["SYSCALLS"]=function(){abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMmap2"))Module["syscallMmap2"]=function(){abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMunmap"))Module["syscallMunmap"]=function(){abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"flush_NO_FILESYSTEM"))Module["flush_NO_FILESYSTEM"]=function(){abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"JSEvents"))Module["JSEvents"]=function(){abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangle"))Module["demangle"]=function(){abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangleAll"))Module["demangleAll"]=function(){abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jsStackTrace"))Module["jsStackTrace"]=function(){abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getEnvStrings"))Module["getEnvStrings"]=function(){abort("'getEnvStrings' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64"))Module["writeI53ToI64"]=function(){abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Clamped"))Module["writeI53ToI64Clamped"]=function(){abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Signaling"))Module["writeI53ToI64Signaling"]=function(){abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Clamped"))Module["writeI53ToU64Clamped"]=function(){abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Signaling"))Module["writeI53ToU64Signaling"]=function(){abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromI64"))Module["readI53FromI64"]=function(){abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromU64"))Module["readI53FromU64"]=function(){abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertI32PairToI53"))Module["convertI32PairToI53"]=function(){abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertU32PairToI53"))Module["convertU32PairToI53"]=function(){abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Browser"))Module["Browser"]=function(){abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GL"))Module["GL"]=function(){abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGet"))Module["emscriptenWebGLGet"]=function(){abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetTexPixelData"))Module["emscriptenWebGLGetTexPixelData"]=function(){abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetUniform"))Module["emscriptenWebGLGetUniform"]=function(){abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetVertexAttrib"))Module["emscriptenWebGLGetVertexAttrib"]=function(){abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AL"))Module["AL"]=function(){abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_unicode"))Module["SDL_unicode"]=function(){abort("'SDL_unicode' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_ttfContext"))Module["SDL_ttfContext"]=function(){abort("'SDL_ttfContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_audio"))Module["SDL_audio"]=function(){abort("'SDL_audio' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL"))Module["SDL"]=function(){abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_gfx"))Module["SDL_gfx"]=function(){abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLUT"))Module["GLUT"]=function(){abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"EGL"))Module["EGL"]=function(){abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW_Window"))Module["GLFW_Window"]=function(){abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW"))Module["GLFW"]=function(){abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLEW"))Module["GLEW"]=function(){abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"IDBStore"))Module["IDBStore"]=function(){abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"runAndAbortIfError"))Module["runAndAbortIfError"]=function(){abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["PThread"]=PThread;if(!Object.getOwnPropertyDescriptor(Module,"establishStackSpace"))Module["establishStackSpace"]=function(){abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getNoExitRuntime"))Module["getNoExitRuntime"]=function(){abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"resetPrototype"))Module["resetPrototype"]=function(){abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"warnOnce"))Module["warnOnce"]=function(){abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackSave"))Module["stackSave"]=function(){abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackRestore"))Module["stackRestore"]=function(){abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackAlloc"))Module["stackAlloc"]=function(){abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AsciiToString"))Module["AsciiToString"]=function(){abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToAscii"))Module["stringToAscii"]=function(){abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF16ToString"))Module["UTF16ToString"]=function(){abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF16"))Module["stringToUTF16"]=function(){abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF16"))Module["lengthBytesUTF16"]=function(){abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF32ToString"))Module["UTF32ToString"]=function(){abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF32"))Module["stringToUTF32"]=function(){abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF32"))Module["lengthBytesUTF32"]=function(){abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8"))Module["allocateUTF8"]=function(){abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8OnStack"))Module["allocateUTF8OnStack"]=function(){abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["writeStackCookie"]=writeStackCookie;Module["checkStackCookie"]=checkStackCookie;Module["abortStackOverflow"]=abortStackOverflow;Module["PThread"]=PThread;Module["_pthread_self"]=_pthread_self;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NORMAL"))Object.defineProperty(Module,"ALLOC_NORMAL",{configurable:true,get:function(){abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_STACK"))Object.defineProperty(Module,"ALLOC_STACK",{configurable:true,get:function(){abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_DYNAMIC"))Object.defineProperty(Module,"ALLOC_DYNAMIC",{configurable:true,get:function(){abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NONE"))Object.defineProperty(Module,"ALLOC_NONE",{configurable:true,get:function(){abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});var calledRun;Module["then"]=function(func){if(calledRun){func(Module)}else{var old=Module["onRuntimeInitialized"];Module["onRuntimeInitialized"]=function(){if(old)old();func(Module)}}return Module};function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}writeStackCookie();preRun();if(runDependencies>0)return;function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();assert(!Module["_main"],'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}checkStackCookie()}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}if(!ENVIRONMENT_IS_PTHREAD)noExitRuntime=true;if(!ENVIRONMENT_IS_PTHREAD)run(); +var Module=typeof WasmBackendModule!=="undefined"?WasmBackendModule:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(Module["ENVIRONMENT"]){throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)")}var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"];DYNAMIC_BASE=Module["DYNAMIC_BASE"];DYNAMICTOP_PTR=Module["DYNAMICTOP_PTR"]}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{throw new Error("environment detection error")}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(!Object.getOwnPropertyDescriptor(Module,"arguments"))Object.defineProperty(Module,"arguments",{configurable:true,get:function(){abort("Module.arguments has been replaced with plain arguments_")}});if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(!Object.getOwnPropertyDescriptor(Module,"thisProgram"))Object.defineProperty(Module,"thisProgram",{configurable:true,get:function(){abort("Module.thisProgram has been replaced with plain thisProgram")}});if(Module["quit"])quit_=Module["quit"];if(!Object.getOwnPropertyDescriptor(Module,"quit"))Object.defineProperty(Module,"quit",{configurable:true,get:function(){abort("Module.quit has been replaced with plain quit_")}});assert(typeof Module["memoryInitializerPrefixURL"]==="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["pthreadMainPrefixURL"]==="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["cdInitializerPrefixURL"]==="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["filePackagePrefixURL"]==="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["read"]==="undefined","Module.read option was removed (modify read_ in JS)");assert(typeof Module["readAsync"]==="undefined","Module.readAsync option was removed (modify readAsync in JS)");assert(typeof Module["readBinary"]==="undefined","Module.readBinary option was removed (modify readBinary in JS)");assert(typeof Module["setWindowTitle"]==="undefined","Module.setWindowTitle option was removed (modify setWindowTitle in JS)");assert(typeof Module["TOTAL_MEMORY"]==="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY");if(!Object.getOwnPropertyDescriptor(Module,"read"))Object.defineProperty(Module,"read",{configurable:true,get:function(){abort("Module.read has been replaced with plain read_")}});if(!Object.getOwnPropertyDescriptor(Module,"readAsync"))Object.defineProperty(Module,"readAsync",{configurable:true,get:function(){abort("Module.readAsync has been replaced with plain readAsync")}});if(!Object.getOwnPropertyDescriptor(Module,"readBinary"))Object.defineProperty(Module,"readBinary",{configurable:true,get:function(){abort("Module.readBinary has been replaced with plain readBinary")}});assert(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER||ENVIRONMENT_IS_NODE,"Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)");var stackSave;var stackRestore;var stackAlloc;stackSave=stackRestore=stackAlloc=function(){abort("cannot use the stack before compiled code is ready to run, and has provided stack access")};function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(!Object.getOwnPropertyDescriptor(Module,"wasmBinary"))Object.defineProperty(Module,"wasmBinary",{configurable:true,get:function(){abort("Module.wasmBinary has been replaced with plain wasmBinary")}});var noExitRuntime;if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(!Object.getOwnPropertyDescriptor(Module,"noExitRuntime"))Object.defineProperty(Module,"noExitRuntime",{configurable:true,get:function(){abort("Module.noExitRuntime has been replaced with plain noExitRuntime")}});if(typeof WebAssembly!=="object"){abort("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.")}var wasmMemory;var wasmTable=new WebAssembly.Table({"initial":120,"maximum":120+0,"element":"anyfunc"});var wasmModule;var threadInfoStruct=0;var selfThreadId=0;var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string")return UTF8ToString(ret);if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i=endIdx)){var u0=u8Array[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=u8Array[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=u8Array[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{if((u0&248)!=240)warnOnce("Invalid UTF-8 leading byte 0x"+u0.toString(16)+" encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!");u0=(u0&7)<<18|u1<<12|u2<<6|u8Array[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;if(u>=2097152)warnOnce("Invalid Unicode code point 0x"+u.toString(16)+" encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF).");outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");HEAP8.set(array,buffer)}var WASM_PAGE_SIZE=65536;var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var STACK_BASE=5255840,STACKTOP=STACK_BASE,STACK_MAX=12960,DYNAMIC_BASE=5255840,DYNAMICTOP_PTR=12032;assert(STACK_BASE%16===0,"stack must start aligned");assert(DYNAMIC_BASE%16===0,"heap must start aligned");if(ENVIRONMENT_IS_PTHREAD){STACK_MAX=STACKTOP=STACK_MAX=2147483647}var TOTAL_STACK=5242880;if(Module["TOTAL_STACK"])assert(TOTAL_STACK===Module["TOTAL_STACK"],"the stack size can no longer be determined at runtime");var INITIAL_INITIAL_MEMORY=Module["INITIAL_MEMORY"]||524288e3;if(!Object.getOwnPropertyDescriptor(Module,"INITIAL_MEMORY"))Object.defineProperty(Module,"INITIAL_MEMORY",{configurable:true,get:function(){abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY")}});assert(INITIAL_INITIAL_MEMORY>=TOTAL_STACK,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+INITIAL_INITIAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");assert(typeof Int32Array!=="undefined"&&typeof Float64Array!=="undefined"&&Int32Array.prototype.subarray!==undefined&&Int32Array.prototype.set!==undefined,"JS engine does not provide full typed array support");if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,"maximum":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_INITIAL_MEMORY=buffer.byteLength;assert(INITIAL_INITIAL_MEMORY%WASM_PAGE_SIZE===0);updateGlobalBufferAndViews(buffer);if(!ENVIRONMENT_IS_PTHREAD){HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE}function writeStackCookie(){assert((STACK_MAX&3)==0);HEAPU32[(STACK_MAX>>2)+1]=34821223;HEAPU32[(STACK_MAX>>2)+2]=2310721022;HEAP32[0]=1668509029}function checkStackCookie(){var cookie1=HEAPU32[(STACK_MAX>>2)+1];var cookie2=HEAPU32[(STACK_MAX>>2)+2];if(cookie1!=34821223||cookie2!=2310721022){abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+cookie2.toString(16)+" "+cookie1.toString(16))}if(HEAP32[0]!==1668509029)abort("Runtime error: The application has corrupted its heap memory area (address zero)!")}function abortStackOverflow(allocSize){abort("Stack overflow! Attempted to allocate "+allocSize+" bytes on the stack, but stack has only "+(STACK_MAX-stackSave()+allocSize)+" bytes available!")}(function(){var h16=new Int16Array(1);var h8=new Int8Array(h16.buffer);h16[0]=25459;if(h8[0]!==115||h8[1]!==99)throw"Runtime error: expected the system to be little-endian!"})();function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;if(ENVIRONMENT_IS_PTHREAD)runtimeInitialized=true;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){checkStackCookie();assert(!runtimeInitialized);runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATMAIN__)}function postRun(){checkStackCookie();if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Math_ceil=Math.ceil;var Math_floor=Math.floor;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!=="undefined"){runDependencyWatcher=setInterval(function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;err("still waiting on run dependencies:")}err("dependency: "+dep)}if(shown){err("(end of list)")}},1e4)}}else{err("warning: run dependency added without ID")}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id]}else{err("warning: run dependency removed without ID")}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";out(what);err(what);ABORT=true;EXITSTATUS=1;var output="abort("+what+") at "+stackTrace();what=output;throw new WebAssembly.RuntimeError(what)}var FS={error:function(){abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1")},init:function(){FS.error()},createDataFile:function(){FS.error()},createPreloadedFile:function(){FS.error()},createLazyFile:function(){FS.error()},open:function(){FS.error()},mkdev:function(){FS.error()},registerDevice:function(){FS.error()},analyzePath:function(){FS.error()},loadFilesFromDB:function(){FS.error()},ErrnoError:function ErrnoError(){FS.error()}};Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}var wasmBinaryFile="tfjs-backend-wasm.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(){try{if(wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(wasmBinaryFile)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary()})}return new Promise(function(resolve,reject){resolve(getBinary())})}function createWasm(){var info={"env":asmLibraryArg,"wasi_snapshot_preview1":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){var numWorkersToLoad=PThread.unusedWorkers.length;PThread.unusedWorkers.forEach(function(w){PThread.loadWasmModuleToWorker(w,function(){if(!--numWorkersToLoad)removeRunDependency("wasm-instantiate")})})}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}var trueModule=Module;function receiveInstantiatedSource(output){assert(Module===trueModule,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");trueModule=null;receiveInstance(output["instance"],output["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&typeof fetch==="function"){fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var ASM_CONSTS={};function initPthreadsJS(){PThread.initRuntime()}if(!ENVIRONMENT_IS_PTHREAD)__ATINIT__.push({func:function(){___wasm_call_ctors()}});function demangle(func){warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return func}function demangleAll(text){var regex=/\b_Z[\w\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"})}var __pthread_ptr=0;var __pthread_is_main_runtime_thread=0;var __pthread_is_main_browser_thread=0;function __register_pthread_ptr(pthreadPtr,isMainBrowserThread,isMainRuntimeThread){pthreadPtr=pthreadPtr|0;isMainBrowserThread=isMainBrowserThread|0;isMainRuntimeThread=isMainRuntimeThread|0;__pthread_ptr=pthreadPtr;__pthread_is_main_browser_thread=isMainBrowserThread;__pthread_is_main_runtime_thread=isMainRuntimeThread}Module["__register_pthread_ptr"]=__register_pthread_ptr;var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var __main_thread_futex_wait_address=12944;function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__main_thread_futex_wait_address>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__main_thread_futex_wait_address>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function __kill_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _kill_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _kill_thread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function __cancel_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cancel_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cancel_thread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function __cleanup_thread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _cleanup_thread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in _cleanup_thread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];if(pthread){var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={MAIN_THREAD_ID:1,mainThreadInfo:{schedPolicy:0,schedPrio:0},unusedWorkers:[],runningWorkers:[],initRuntime:function(){__register_pthread_ptr(PThread.mainThreadBlock,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(PThread.mainThreadBlock)},initMainThreadBlock:function(){assert(!ENVIRONMENT_IS_PTHREAD);var pthreadPoolSize=8;for(var i=0;i>2]=PThread.mainThreadBlock;var headPtr=PThread.mainThreadBlock+156;HEAP32[headPtr>>2]=headPtr;var tlsMemory=12432;for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,PThread.mainThreadBlock+104>>2,tlsMemory);Atomics.store(HEAPU32,PThread.mainThreadBlock+40>>2,PThread.mainThreadBlock);Atomics.store(HEAPU32,PThread.mainThreadBlock+44>>2,42)},initWorker:function(){},pthreads:{},exitHandlers:null,setThreadStatus:function(){},runExitHandlers:function(){if(PThread.exitHandlers!==null){while(PThread.exitHandlers.length>0){PThread.exitHandlers.pop()()}PThread.exitHandlers=null}if(ENVIRONMENT_IS_PTHREAD&&threadInfoStruct)___pthread_tsd_run_dtors()},threadExit:function(exitCode){var tb=_pthread_self();if(tb){err("Pthread 0x"+tb.toString(16)+" exited.");Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);Atomics.store(HEAPU32,tb+60>>2,1);Atomics.store(HEAPU32,tb+64>>2,0);PThread.runExitHandlers();_emscripten_futex_wake(tb+0,2147483647);__register_pthread_ptr(0,0,0);threadInfoStruct=0;if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlers();Atomics.store(HEAPU32,threadInfoStruct+4>>2,-1);Atomics.store(HEAPU32,threadInfoStruct+0>>2,1);_emscripten_futex_wake(threadInfoStruct+0,2147483647);threadInfoStruct=selfThreadId=0;__register_pthread_ptr(0,0,0);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+104>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){delete PThread.pthreads[worker.pthread.thread];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined},receiveObjectTransfer:function(data){},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){__spawn_thread(e.data)}else if(cmd==="cleanupThread"){__cleanup_thread(d["thread"])}else if(cmd==="killThread"){__kill_thread(d["thread"])}else if(cmd==="cancelThread"){__cancel_thread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.thread+68>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){console.log("worker exited - TODO: update the worker queue?")})}assert(wasmMemory instanceof WebAssembly.Memory,"WebAssembly memory should have been loaded by now!");assert(wasmModule instanceof WebAssembly.Module,"WebAssembly Module should have been loaded by now!");worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule,"DYNAMIC_BASE":DYNAMIC_BASE,"DYNAMICTOP_PTR":DYNAMICTOP_PTR})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("tfjs-backend-wasm.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}if(PThread.unusedWorkers.length>0)return PThread.unusedWorkers.pop();else return null},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()>2]=value;else err("failed to set errno from JS");return value}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg);warnOnce("atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)");__ATEXIT__.unshift({func:func,arg:arg})}function ___handle_stack_overflow(){abort("stack overflow")}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({cmd:"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({targetThread:targetThreadId,cmd:"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){err("Cannot send message to thread with ID "+targetThreadId+", unknown thread ID!");return}worker.postMessage({cmd:"processThreadQueue"})}return 1}function _abort(){abort()}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){expectedStatus=expectedStatus|0;newStatus=newStatus|0}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(ENVIRONMENT_IS_WORKER){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{var loadedVal=Atomics.load(HEAP32,addr>>2);if(val!=loadedVal)return-6;var tNow=performance.now();var tEnd=tNow+timeout;Atomics.store(HEAP32,__main_thread_futex_wait_address>>2,addr);var ourWaitAddress=addr;while(addr==ourWaitAddress){tNow=performance.now();if(tNow>tEnd){return-73}_emscripten_main_thread_process_queued_calls();addr=Atomics.load(HEAP32,__main_thread_futex_wait_address>>2)}return 0}}function _emscripten_is_main_browser_thread(){return __pthread_is_main_browser_thread|0}function _emscripten_is_main_runtime_thread(){return __pthread_is_main_runtime_thread|0}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;if(numCallArgs>20-1)throw"emscripten_proxy_to_main_thread_js: Too many arguments "+numCallArgs+" to proxied function idx="+index+", maximum supported is "+(20-1)+"!";var stack=stackSave();var args=stackAlloc(numCallArgs*8);var b=args>>3;for(var i=0;i>3]);buf+=8}else if(ch===105){buf=buf+3&~3;args.push(HEAP32[buf>>2]);buf+=4}else abort("unexpected char in asm const signature "+ch)}return args}function _emscripten_receive_on_main_thread_js(index,numCallArgs,args){_emscripten_receive_on_main_thread_js_callArgs.length=numCallArgs;var b=args>>3;for(var i=0;i=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;_emscripten_async_queue_on_thread_(targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;_emscripten_async_queue_on_thread_(targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function __maybeCStringToJsString(cString){return cString===cString+0?UTF8ToString(cString):cString}var __specialEventTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function __findEventTarget(target){var domElement=__specialEventTargets[target]||(typeof document!=="undefined"?document.querySelector(__maybeCStringToJsString(target)):undefined);return domElement}function __findCanvasEventTarget(target){return __findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=__findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=__findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){newStatus=newStatus|0}function _emscripten_set_thread_name(threadId,name){threadId=threadId|0;name=name|0}function __webgl_acquireInstancedArraysExtension(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)}}}function __webgl_acquireVertexArrayObjectExtension(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)}}}function __webgl_acquireDrawBuffersExtension(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)}}}var GL={counter:1,lastError:0,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},currentContext:null,offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,init:function(){var miniTempFloatBuffer=new Float32Array(GL.MINI_TEMP_BUFFER_SIZE);for(var i=0;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;if(context.version<2){__webgl_acquireInstancedArraysExtension(GLctx);__webgl_acquireVertexArrayObjectExtension(GLctx);__webgl_acquireDrawBuffersExtension(GLctx)}GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query");var automaticallyEnabledExtensions=["OES_texture_float","OES_texture_half_float","OES_standard_derivatives","OES_vertex_array_object","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","OES_element_index_uint","EXT_texture_filter_anisotropic","EXT_frag_depth","WEBGL_draw_buffers","ANGLE_instanced_arrays","OES_texture_float_linear","OES_texture_half_float_linear","EXT_blend_minmax","EXT_shader_texture_lod","EXT_texture_norm16","WEBGL_compressed_texture_pvrtc","EXT_color_buffer_half_float","WEBGL_color_buffer_float","EXT_sRGB","WEBGL_compressed_texture_etc1","EXT_disjoint_timer_query","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_astc","EXT_color_buffer_float","WEBGL_compressed_texture_s3tc_srgb","EXT_disjoint_timer_query_webgl2","WEBKIT_WEBGL_compressed_texture_pvrtc"];var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(automaticallyEnabledExtensions.indexOf(ext)!=-1){GLctx.getExtension(ext)}})},populateUniformTable:function(program){var p=GL.programs[program];var ptable=GL.programInfos[program]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1};var utable=ptable.uniforms;var numUniforms=GLctx.getProgramParameter(p,35718);for(var i=0;i>2;contextAttributes["alpha"]=!!HEAP32[a+(0>>2)];contextAttributes["depth"]=!!HEAP32[a+(4>>2)];contextAttributes["stencil"]=!!HEAP32[a+(8>>2)];contextAttributes["antialias"]=!!HEAP32[a+(12>>2)];contextAttributes["premultipliedAlpha"]=!!HEAP32[a+(16>>2)];contextAttributes["preserveDrawingBuffer"]=!!HEAP32[a+(20>>2)];var powerPreference=HEAP32[a+(24>>2)];contextAttributes["powerPreference"]=__emscripten_webgl_power_preferences[powerPreference];contextAttributes["failIfMajorPerformanceCaveat"]=!!HEAP32[a+(28>>2)];contextAttributes.majorVersion=HEAP32[a+(32>>2)];contextAttributes.minorVersion=HEAP32[a+(36>>2)];contextAttributes.enableExtensionsByDefault=HEAP32[a+(40>>2)];contextAttributes.explicitSwapControl=HEAP32[a+(44>>2)];contextAttributes.proxyContextToMainThread=HEAP32[a+(48>>2)];contextAttributes.renderViaOffscreenBackBuffer=HEAP32[a+(52>>2)];var canvas=__findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];assert(buffer);if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:undefined,get:function(){assert(SYSCALLS.varargs!=undefined);SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},get64:function(low,high){if(low>=0)assert(high===0);else assert(high===-1);return low}};function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,fd);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM");return 0}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,fd,offset_low,offset_high,whence,newOffset);abort("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM")}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd,iov,iovcnt,pnum);var num=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];for(var j=0;j>2]=num;return 0}function _pthread_cleanup_pop(execute){var routine=PThread.exitHandlers.pop();if(execute)routine()}function _pthread_cleanup_push(routine,arg){if(PThread.exitHandlers===null){PThread.exitHandlers=[]}PThread.exitHandlers.push(function(){dynCall_vi(routine,arg)})}function __spawn_thread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! _spawn_thread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,thread:threadParams.pthread_ptr,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(0>>2),0);Atomics.store(HEAPU32,tis+(4>>2),0);Atomics.store(HEAPU32,tis+(8>>2),0);Atomics.store(HEAPU32,tis+(68>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(104>>2),tlsMemory);Atomics.store(HEAPU32,tis+(48>>2),0);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(44>>2),42);Atomics.store(HEAPU32,tis+(108>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(84>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(80>>2),stackHigh);Atomics.store(HEAPU32,tis+(108+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(108+12>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(108+20>>2),threadParams.schedPolicy);Atomics.store(HEAPU32,tis+(108+24>>2),threadParams.schedPrio);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(176>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"selfThreadId":threadParams.pthread_ptr,"parentThreadId":threadParams.parent_pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}}function _pthread_getschedparam(thread,policy,schedparam){if(!policy&&!schedparam)return ERRNO_CODES.EINVAL;if(!thread){err("pthread_getschedparam called with a null thread pointer!");return ERRNO_CODES.ESRCH}var self=HEAP32[thread+12>>2];if(self!==thread){err("pthread_getschedparam attempted on thread "+thread+", which does not point to a valid thread, or does not exist anymore!");return ERRNO_CODES.ESRCH}var schedPolicy=Atomics.load(HEAPU32,thread+108+20>>2);var schedPrio=Atomics.load(HEAPU32,thread+108+24>>2);if(policy)HEAP32[policy>>2]=schedPolicy;if(schedparam)HEAP32[schedparam>>2]=schedPrio;return 0}function _pthread_self(){return __pthread_ptr|0}Module["_pthread_self"]=_pthread_self;function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;var schedPolicy=0;var schedPrio=0;if(attr){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0;var inheritSched=HEAP32[attr+16>>2]===0;if(inheritSched){var prevSchedPolicy=HEAP32[attr+20>>2];var prevSchedPrio=HEAP32[attr+24>>2];var parentThreadPtr=PThread.currentProxiedOperationCallerThread?PThread.currentProxiedOperationCallerThread:_pthread_self();_pthread_getschedparam(parentThreadPtr,attr+20,attr+24);schedPolicy=HEAP32[attr+20>>2];schedPrio=HEAP32[attr+24>>2];HEAP32[attr+20>>2]=prevSchedPolicy;HEAP32[attr+24>>2]=prevSchedPrio}else{schedPolicy=HEAP32[attr+20>>2];schedPrio=HEAP32[attr+24>>2]}}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(232);for(var i=0;i<232>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+156;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,schedPolicy:schedPolicy,schedPrio:schedPrio,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,parent_pthread_ptr:_pthread_self(),arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList)}else{__spawn_thread(threadParams)}return 0}function _roundf(d){d=+d;return d>=+0?+Math_floor(d+ +.5):+Math_ceil(d-+.5)}function _sysconf(name){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,name);switch(name){case 30:return 16384;case 85:var maxHeapSize=2*1024*1024*1024-65536;maxHeapSize=524288e3;maxHeapSize=HEAPU8.length;return maxHeapSize/16384;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:case 79:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator==="object")return navigator["hardwareConcurrency"]||1;return 1}}___setErrNo(28);return-1}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();else PThread.initWorker();var GLctx;GL.init();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_fd_close,_fd_seek,_fd_write,_sysconf];var asmLibraryArg={"__assert_fail":___assert_fail,"__call_main":___call_main,"__handle_stack_overflow":___handle_stack_overflow,"_emscripten_notify_thread_queue":__emscripten_notify_thread_queue,"abort":_abort,"emscripten_conditional_set_current_thread_status":_emscripten_conditional_set_current_thread_status,"emscripten_futex_wait":_emscripten_futex_wait,"emscripten_futex_wake":_emscripten_futex_wake,"emscripten_get_now":_emscripten_get_now,"emscripten_is_main_browser_thread":_emscripten_is_main_browser_thread,"emscripten_is_main_runtime_thread":_emscripten_is_main_runtime_thread,"emscripten_memcpy_big":_emscripten_memcpy_big,"emscripten_receive_on_main_thread_js":_emscripten_receive_on_main_thread_js,"emscripten_resize_heap":_emscripten_resize_heap,"emscripten_set_canvas_element_size":_emscripten_set_canvas_element_size,"emscripten_set_current_thread_status":_emscripten_set_current_thread_status,"emscripten_set_thread_name":_emscripten_set_thread_name,"emscripten_webgl_create_context":_emscripten_webgl_create_context,"fd_close":_fd_close,"fd_seek":_fd_seek,"fd_write":_fd_write,"initPthreadsJS":initPthreadsJS,"memory":wasmMemory||Module["wasmMemory"],"pthread_cleanup_pop":_pthread_cleanup_pop,"pthread_cleanup_push":_pthread_cleanup_push,"pthread_create":_pthread_create,"pthread_self":_pthread_self,"roundf":_roundf,"table":wasmTable};var asm=createWasm();Module["asm"]=asm;var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__wasm_call_ctors"].apply(null,arguments)};var _init=Module["_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["init"].apply(null,arguments)};var _register_tensor=Module["_register_tensor"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["register_tensor"].apply(null,arguments)};var _dispose_data=Module["_dispose_data"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose_data"].apply(null,arguments)};var _dispose=Module["_dispose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dispose"].apply(null,arguments)};var _Abs=Module["_Abs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Abs"].apply(null,arguments)};var _Add=Module["_Add"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Add"].apply(null,arguments)};var _AddN=Module["_AddN"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AddN"].apply(null,arguments)};var _ArgMax=Module["_ArgMax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ArgMax"].apply(null,arguments)};var _AvgPool=Module["_AvgPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["AvgPool"].apply(null,arguments)};var _BatchMatMul=Module["_BatchMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["BatchMatMul"].apply(null,arguments)};var _ClipByValue=Module["_ClipByValue"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ClipByValue"].apply(null,arguments)};var _Conv2D=Module["_Conv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Conv2D"].apply(null,arguments)};var _Cos=Module["_Cos"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Cos"].apply(null,arguments)};var _CropAndResize=Module["_CropAndResize"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["CropAndResize"].apply(null,arguments)};var _DepthwiseConv2dNative=Module["_DepthwiseConv2dNative"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["DepthwiseConv2dNative"].apply(null,arguments)};var _Div=Module["_Div"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Div"].apply(null,arguments)};var _Exp=Module["_Exp"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Exp"].apply(null,arguments)};var _FloorDiv=Module["_FloorDiv"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FloorDiv"].apply(null,arguments)};var _FusedBatchNorm=Module["_FusedBatchNorm"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedBatchNorm"].apply(null,arguments)};var _FusedConv2D=Module["_FusedConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedConv2D"].apply(null,arguments)};var _FusedDepthwiseConv2D=Module["_FusedDepthwiseConv2D"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["FusedDepthwiseConv2D"].apply(null,arguments)};var _Gather=Module["_Gather"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Gather"].apply(null,arguments)};var _GatherNd=Module["_GatherNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GatherNd"].apply(null,arguments)};var _Greater=Module["_Greater"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Greater"].apply(null,arguments)};var _GreaterEqual=Module["_GreaterEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["GreaterEqual"].apply(null,arguments)};var _Less=Module["_Less"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Less"].apply(null,arguments)};var _LessEqual=Module["_LessEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LessEqual"].apply(null,arguments)};var _Log=Module["_Log"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Log"].apply(null,arguments)};var _LogicalAnd=Module["_LogicalAnd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["LogicalAnd"].apply(null,arguments)};var _Max=Module["_Max"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Max"].apply(null,arguments)};var _MaxPool=Module["_MaxPool"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["MaxPool"].apply(null,arguments)};var _Maximum=Module["_Maximum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Maximum"].apply(null,arguments)};var _Min=Module["_Min"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Min"].apply(null,arguments)};var _Minimum=Module["_Minimum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Minimum"].apply(null,arguments)};var _Mul=Module["_Mul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Mul"].apply(null,arguments)};var _Neg=Module["_Neg"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Neg"].apply(null,arguments)};var _NonMaxSuppressionV3=Module["_NonMaxSuppressionV3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV3"].apply(null,arguments)};var _NonMaxSuppressionV5=Module["_NonMaxSuppressionV5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NonMaxSuppressionV5"].apply(null,arguments)};var _NotEqual=Module["_NotEqual"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["NotEqual"].apply(null,arguments)};var _PadV2=Module["_PadV2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["PadV2"].apply(null,arguments)};var _Pow=Module["_Pow"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Pow"].apply(null,arguments)};var _Prelu=Module["_Prelu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Prelu"].apply(null,arguments)};var _Relu=Module["_Relu"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu"].apply(null,arguments)};var _Relu6=Module["_Relu6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Relu6"].apply(null,arguments)};var _ResizeBilinear=Module["_ResizeBilinear"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ResizeBilinear"].apply(null,arguments)};var _Rsqrt=Module["_Rsqrt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Rsqrt"].apply(null,arguments)};var _ScatterNd=Module["_ScatterNd"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["ScatterNd"].apply(null,arguments)};var _Sigmoid=Module["_Sigmoid"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sigmoid"].apply(null,arguments)};var _Sin=Module["_Sin"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sin"].apply(null,arguments)};var _Softmax=Module["_Softmax"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Softmax"].apply(null,arguments)};var _Sqrt=Module["_Sqrt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sqrt"].apply(null,arguments)};var _Square=Module["_Square"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Square"].apply(null,arguments)};var _Sub=Module["_Sub"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sub"].apply(null,arguments)};var _Sum=Module["_Sum"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Sum"].apply(null,arguments)};var _Tanh=Module["_Tanh"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tanh"].apply(null,arguments)};var _Tile=Module["_Tile"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Tile"].apply(null,arguments)};var _Transpose=Module["_Transpose"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["Transpose"].apply(null,arguments)};var __FusedMatMul=Module["__FusedMatMul"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_FusedMatMul"].apply(null,arguments)};var _malloc=Module["_malloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["malloc"].apply(null,arguments)};var _free=Module["_free"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["free"].apply(null,arguments)};var ___em_js__initPthreadsJS=Module["___em_js__initPthreadsJS"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__em_js__initPthreadsJS"].apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_get_global_libc"].apply(null,arguments)};var _memalign=Module["_memalign"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["memalign"].apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__pthread_tsd_run_dtors"].apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null,arguments)};var _emscripten_main_browser_thread_id=Module["_emscripten_main_browser_thread_id"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_main_browser_thread_id"].apply(null,arguments)};var _emscripten_async_run_in_main_thread=Module["_emscripten_async_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread=Module["_emscripten_sync_run_in_main_thread"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_0=Module["_emscripten_sync_run_in_main_thread_0"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_1=Module["_emscripten_sync_run_in_main_thread_1"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_2=Module["_emscripten_sync_run_in_main_thread_2"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_xprintf_varargs=Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_3=Module["_emscripten_sync_run_in_main_thread_3"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_5=Module["_emscripten_sync_run_in_main_thread_5"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_6=Module["_emscripten_sync_run_in_main_thread_6"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null,arguments)};var _emscripten_sync_run_in_main_thread_7=Module["_emscripten_sync_run_in_main_thread_7"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null,arguments)};var _emscripten_async_queue_on_thread_=Module["_emscripten_async_queue_on_thread_"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["emscripten_tls_init"].apply(null,arguments)};var ___set_stack_limit=Module["___set_stack_limit"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__set_stack_limit"].apply(null,arguments)};var stackSave=Module["stackSave"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackSave"].apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackAlloc"].apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackRestore"].apply(null,arguments)};var dynCall_vi=Module["dynCall_vi"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_vi"].apply(null,arguments)};var dynCall_v=Module["dynCall_v"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_v"].apply(null,arguments)};var dynCall_ii=Module["dynCall_ii"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_ii"].apply(null,arguments)};Module["asm"]=asm;if(!Object.getOwnPropertyDescriptor(Module,"intArrayFromString"))Module["intArrayFromString"]=function(){abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"intArrayToString"))Module["intArrayToString"]=function(){abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ccall"))Module["ccall"]=function(){abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["cwrap"]=cwrap;if(!Object.getOwnPropertyDescriptor(Module,"setValue"))Module["setValue"]=function(){abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getValue"))Module["getValue"]=function(){abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocate"))Module["allocate"]=function(){abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getMemory"))Module["getMemory"]=function(){abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ArrayToString"))Module["UTF8ArrayToString"]=function(){abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ToString"))Module["UTF8ToString"]=function(){abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8Array"))Module["stringToUTF8Array"]=function(){abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8"))Module["stringToUTF8"]=function(){abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF8"))Module["lengthBytesUTF8"]=function(){abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreRun"))Module["addOnPreRun"]=function(){abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnInit"))Module["addOnInit"]=function(){abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreMain"))Module["addOnPreMain"]=function(){abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnExit"))Module["addOnExit"]=function(){abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPostRun"))Module["addOnPostRun"]=function(){abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeStringToMemory"))Module["writeStringToMemory"]=function(){abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeArrayToMemory"))Module["writeArrayToMemory"]=function(){abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeAsciiToMemory"))Module["writeAsciiToMemory"]=function(){abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addRunDependency"))Module["addRunDependency"]=function(){abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"removeRunDependency"))Module["removeRunDependency"]=function(){abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createFolder"))Module["FS_createFolder"]=function(){abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPath"))Module["FS_createPath"]=function(){abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDataFile"))Module["FS_createDataFile"]=function(){abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPreloadedFile"))Module["FS_createPreloadedFile"]=function(){abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLazyFile"))Module["FS_createLazyFile"]=function(){abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLink"))Module["FS_createLink"]=function(){abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDevice"))Module["FS_createDevice"]=function(){abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_unlink"))Module["FS_unlink"]=function(){abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"dynamicAlloc"))Module["dynamicAlloc"]=function(){abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadDynamicLibrary"))Module["loadDynamicLibrary"]=function(){abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadWebAssemblyModule"))Module["loadWebAssemblyModule"]=function(){abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getLEB"))Module["getLEB"]=function(){abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFunctionTables"))Module["getFunctionTables"]=function(){abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"alignFunctionTables"))Module["alignFunctionTables"]=function(){abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"registerFunctions"))Module["registerFunctions"]=function(){abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addFunction"))Module["addFunction"]=function(){abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"removeFunction"))Module["removeFunction"]=function(){abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFuncWrapper"))Module["getFuncWrapper"]=function(){abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"prettyPrint"))Module["prettyPrint"]=function(){abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"makeBigInt"))Module["makeBigInt"]=function(){abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"dynCall"))Module["dynCall"]=function(){abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getCompilerSetting"))Module["getCompilerSetting"]=function(){abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"print"))Module["print"]=function(){abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"printErr"))Module["printErr"]=function(){abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getTempRet0"))Module["getTempRet0"]=function(){abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setTempRet0"))Module["setTempRet0"]=function(){abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"callMain"))Module["callMain"]=function(){abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"abort"))Module["abort"]=function(){abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToNewUTF8"))Module["stringToNewUTF8"]=function(){abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"abortOnCannotGrowMemory"))Module["abortOnCannotGrowMemory"]=function(){abort("'abortOnCannotGrowMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscripten_realloc_buffer"))Module["emscripten_realloc_buffer"]=function(){abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ENV"))Module["ENV"]=function(){abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setjmpId"))Module["setjmpId"]=function(){abort("'setjmpId' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_CODES"))Module["ERRNO_CODES"]=function(){abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_MESSAGES"))Module["ERRNO_MESSAGES"]=function(){abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"DNS"))Module["DNS"]=function(){abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GAI_ERRNO_MESSAGES"))Module["GAI_ERRNO_MESSAGES"]=function(){abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Protocols"))Module["Protocols"]=function(){abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Sockets"))Module["Sockets"]=function(){abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UNWIND_CACHE"))Module["UNWIND_CACHE"]=function(){abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readAsmConstArgs"))Module["readAsmConstArgs"]=function(){abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_q"))Module["jstoi_q"]=function(){abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_s"))Module["jstoi_s"]=function(){abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH"))Module["PATH"]=function(){abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"PATH_FS"))Module["PATH_FS"]=function(){abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SYSCALLS"))Module["SYSCALLS"]=function(){abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMmap2"))Module["syscallMmap2"]=function(){abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"syscallMunmap"))Module["syscallMunmap"]=function(){abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"flush_NO_FILESYSTEM"))Module["flush_NO_FILESYSTEM"]=function(){abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"JSEvents"))Module["JSEvents"]=function(){abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangle"))Module["demangle"]=function(){abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"demangleAll"))Module["demangleAll"]=function(){abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"jsStackTrace"))Module["jsStackTrace"]=function(){abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64"))Module["writeI53ToI64"]=function(){abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Clamped"))Module["writeI53ToI64Clamped"]=function(){abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Signaling"))Module["writeI53ToI64Signaling"]=function(){abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Clamped"))Module["writeI53ToU64Clamped"]=function(){abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Signaling"))Module["writeI53ToU64Signaling"]=function(){abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromI64"))Module["readI53FromI64"]=function(){abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromU64"))Module["readI53FromU64"]=function(){abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertI32PairToI53"))Module["convertI32PairToI53"]=function(){abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"convertU32PairToI53"))Module["convertU32PairToI53"]=function(){abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Browser"))Module["Browser"]=function(){abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GL"))Module["GL"]=function(){abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGet"))Module["emscriptenWebGLGet"]=function(){abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetTexPixelData"))Module["emscriptenWebGLGetTexPixelData"]=function(){abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetUniform"))Module["emscriptenWebGLGetUniform"]=function(){abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetVertexAttrib"))Module["emscriptenWebGLGetVertexAttrib"]=function(){abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AL"))Module["AL"]=function(){abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL"))Module["SDL"]=function(){abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"SDL_gfx"))Module["SDL_gfx"]=function(){abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLUT"))Module["GLUT"]=function(){abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"EGL"))Module["EGL"]=function(){abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW_Window"))Module["GLFW_Window"]=function(){abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLFW"))Module["GLFW"]=function(){abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"GLEW"))Module["GLEW"]=function(){abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"IDBStore"))Module["IDBStore"]=function(){abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"runAndAbortIfError"))Module["runAndAbortIfError"]=function(){abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["PThread"]=PThread;if(!Object.getOwnPropertyDescriptor(Module,"establishStackSpace"))Module["establishStackSpace"]=function(){abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getNoExitRuntime"))Module["getNoExitRuntime"]=function(){abort("'getNoExitRuntime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"resetPrototype"))Module["resetPrototype"]=function(){abort("'resetPrototype' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"warnOnce"))Module["warnOnce"]=function(){abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackSave"))Module["stackSave"]=function(){abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackRestore"))Module["stackRestore"]=function(){abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackAlloc"))Module["stackAlloc"]=function(){abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"AsciiToString"))Module["AsciiToString"]=function(){abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToAscii"))Module["stringToAscii"]=function(){abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF16ToString"))Module["UTF16ToString"]=function(){abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF16"))Module["stringToUTF16"]=function(){abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF16"))Module["lengthBytesUTF16"]=function(){abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF32ToString"))Module["UTF32ToString"]=function(){abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF32"))Module["stringToUTF32"]=function(){abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF32"))Module["lengthBytesUTF32"]=function(){abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8"))Module["allocateUTF8"]=function(){abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8OnStack"))Module["allocateUTF8OnStack"]=function(){abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["writeStackCookie"]=writeStackCookie;Module["checkStackCookie"]=checkStackCookie;Module["abortStackOverflow"]=abortStackOverflow;Module["PThread"]=PThread;Module["_pthread_self"]=_pthread_self;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NORMAL"))Object.defineProperty(Module,"ALLOC_NORMAL",{configurable:true,get:function(){abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_STACK"))Object.defineProperty(Module,"ALLOC_STACK",{configurable:true,get:function(){abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_DYNAMIC"))Object.defineProperty(Module,"ALLOC_DYNAMIC",{configurable:true,get:function(){abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NONE"))Object.defineProperty(Module,"ALLOC_NONE",{configurable:true,get:function(){abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});var calledRun;Module["then"]=function(func){if(calledRun){func(Module)}else{var old=Module["onRuntimeInitialized"];Module["onRuntimeInitialized"]=function(){if(old)old();func(Module)}}return Module};function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}writeStackCookie();preRun();if(runDependencies>0)return;function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();assert(!Module["_main"],'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}checkStackCookie()}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}if(!ENVIRONMENT_IS_PTHREAD)noExitRuntime=true;if(!ENVIRONMENT_IS_PTHREAD)run(); return WasmBackendModule diff --git a/tfjs-core/benchmarks/tfjs-backend-wasm.wasm b/tfjs-core/benchmarks/tfjs-backend-wasm.wasm index 2da06f1d7eeacd9b4a633f6c0e1419f7240a219a..cc25c34ed49e8da0d8bf397266d2136126103aa4 100644 GIT binary patch delta 28579 zcmeI53y@`ZUFYxr+}rnkZ{L1*&z1%YW7^S}0 zf3S079Q8`K)5l|fSXfa5>i098Ck6Ue+lBs}$9B1B{e=^*=uY&npZ*xccz?czON5FaAn#x>D%4-l>(w7o4l4o+heEssEPb)VGhVCgomqM^f=_B`Nmq z=D*U}(sHj5M}owcJa3eG?vAAD!RKtZ_ay&uzyIar@Ks5v(JOe@i*8Tc6ODo|_uPvh zN#w_T`H6a=&;W0!!Ec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SwazGx2=R%YG-$*ze!%v6slW)H;`lVv&aPN2S%kDZFU3l`u)1$?*JACra PqtS2a_^ivL_U``+#^#*{ From 1174ca1460ed9da2b4e8d829757f09c1e380b805 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Tue, 12 May 2020 08:34:20 -0400 Subject: [PATCH 72/85] rm --- tfjs-core/benchmarks/tf-backend-wasm.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tfjs-core/benchmarks/tf-backend-wasm.js b/tfjs-core/benchmarks/tf-backend-wasm.js index 255bfc3911b..d986f8278af 100644 --- a/tfjs-core/benchmarks/tf-backend-wasm.js +++ b/tfjs-core/benchmarks/tf-backend-wasm.js @@ -2680,7 +2680,6 @@ * limitations under the License. * ============================================================================= */ - const threadWorker = require('../wasm-out/tfjs-backend-wasm.worker.js'); const WASM_PRIORITY = 2; class BackendWasm extends tfjsCore.KernelBackend { constructor(wasm) { @@ -2817,10 +2816,6 @@ * in Chrome 76). */ async function init() { - console.log('INITIALIZING'); - // ts-lint:disable-next-line:no-any - window.threadWorker = threadWorker; - console.log(threadWorker); return new Promise((resolve, reject) => { const factoryConfig = {}; const locateFile = (path, prefix) => { From 68499dd1e63a677e8e25f2676e29ba7d3a07477f Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Tue, 12 May 2020 08:39:50 -0400 Subject: [PATCH 73/85] bench --- tfjs-core/benchmarks/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tfjs-core/benchmarks/index.html b/tfjs-core/benchmarks/index.html index f083a5d3c0a..d108ffa314d 100644 --- a/tfjs-core/benchmarks/index.html +++ b/tfjs-core/benchmarks/index.html @@ -77,8 +77,8 @@