From 803eb0f57188b386b0c5f76bdc73b2ad905febd8 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Thu, 14 Apr 2022 11:55:49 -0400 Subject: [PATCH] prepare release beta --- CHANGELOG.md | 5 +- TODO.md | 13 +- dist/human.esm.js | 17463 ++++++++++++++++++++-------------------- dist/human.esm.js.map | 4 +- dist/human.js | 887 +- dist/tfjs.esm.js | 829 +- package.json | 10 +- test/build.log | 48 +- test/test.log | 1368 ++-- 9 files changed, 10443 insertions(+), 10184 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b52ac54..2d942256 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,10 @@ ## Changelog -### **HEAD -> main** 2022/04/11 mandic00@live.com +### **HEAD -> main** 2022/04/14 mandic00@live.com + + +### **origin/main** 2022/04/11 mandic00@live.com - face attention model is available in human-models - beta release 2.7 diff --git a/TODO.md b/TODO.md index 65487fbb..79d16580 100644 --- a/TODO.md +++ b/TODO.md @@ -2,7 +2,18 @@ ## Work in Progress -
+Release 2.7: +- add MediaPipe FaceMesh attention model + model is available in @vladmandic/human-models repository + to enable, set `config.face.attention = true` + model replaces iris and eyes keypoints with high-detailed ones + and adds additional keypoints for lips +- changed default face crop from 120% to 140% + to better utilize caching between frames +- refactor draw methods into separate modules +- add **ElectronJS** demo + see +- update build platform and dependencies ### Exploring diff --git a/dist/human.esm.js b/dist/human.esm.js index 35382d2b..d38874ce 100644 --- a/dist/human.esm.js +++ b/dist/human.esm.js @@ -219,524 +219,524 @@ var config = { // dist/tfjs.esm.js var tfjs_esm_exports = {}; __export(tfjs_esm_exports, { - Abs: () => io, - Acos: () => sl, - Acosh: () => rl, - AdadeltaOptimizer: () => fb, - AdagradOptimizer: () => mb, - AdamOptimizer: () => gb, - AdamaxOptimizer: () => bb, - Add: () => Ir, - AddN: () => ka, - All: () => al, - Any: () => il, - ArgMax: () => Ia, - ArgMin: () => ol, - Asin: () => ul, - Asinh: () => ll, - Atan: () => cl, - Atan2: () => pl, - Atanh: () => dl, - AvgPool: () => Sa, - AvgPool3D: () => qd, - AvgPool3DGrad: () => og, - AvgPoolGrad: () => ig, - BackendWasm: () => kde, - BatchMatMul: () => Ca, - BatchToSpaceND: () => oo, - Bincount: () => ug, - BroadcastArgs: () => lg, - BroadcastTo: () => A$, - Callback: () => CW, - CallbackList: () => zL, - Cast: () => Na, - Ceil: () => Ta, - ClipByValue: () => Sr, - Complex: () => jd, - ComplexAbs: () => Kd, - Concat: () => uo, - Conv2D: () => $a, - Conv2DBackpropFilter: () => cg, - Conv2DBackpropInput: () => _a, - Conv3D: () => Xd, - Conv3DBackpropFilterV2: () => dg, - Conv3DBackpropInputV2: () => pg, - Cos: () => Aa, - Cosh: () => Ea, - CropAndResize: () => co, - Cumprod: () => hl, - Cumsum: () => lo, - CustomCallback: () => BL, - DataStorage: () => Ud, - DenseBincount: () => hg, - DepthToSpace: () => po, - DepthwiseConv2dNative: () => Ra, - DepthwiseConv2dNativeBackpropFilter: () => fg, - DepthwiseConv2dNativeBackpropInput: () => mg, - Diag: () => gg, - Dilation2D: () => Yd, - Dilation2DBackpropFilter: () => Qf, - Dilation2DBackpropInput: () => Yf, - ENV: () => Jw, - EarlyStopping: () => NW, - Einsum: () => Qd, - Elu: () => Fa, - EluGrad: () => bg, - Environment: () => S$, - Equal: () => ho, + Abs: () => uo, + Acos: () => rl, + Acosh: () => al, + AdadeltaOptimizer: () => gb, + AdagradOptimizer: () => bb, + AdamOptimizer: () => yb, + AdamaxOptimizer: () => vb, + Add: () => Sr, + AddN: () => Ia, + All: () => il, + Any: () => ol, + ArgMax: () => Sa, + ArgMin: () => ul, + Asin: () => ll, + Asinh: () => cl, + Atan: () => dl, + Atan2: () => hl, + Atanh: () => pl, + AvgPool: () => Ca, + AvgPool3D: () => Kd, + AvgPool3DGrad: () => lg, + AvgPoolGrad: () => ug, + BackendWasm: () => Pde, + BatchMatMul: () => Na, + BatchToSpaceND: () => lo, + Bincount: () => cg, + BroadcastArgs: () => dg, + BroadcastTo: () => P$, + Callback: () => OW, + CallbackList: () => QL, + Cast: () => Ta, + Ceil: () => $a, + ClipByValue: () => Cr, + Complex: () => Xd, + ComplexAbs: () => Yd, + Concat: () => co, + Conv2D: () => _a, + Conv2DBackpropFilter: () => pg, + Conv2DBackpropInput: () => Aa, + Conv3D: () => Qd, + Conv3DBackpropFilterV2: () => hg, + Conv3DBackpropInputV2: () => fg, + Cos: () => Ea, + Cosh: () => Ra, + CropAndResize: () => ho, + Cumprod: () => po, + Cumsum: () => Da, + CustomCallback: () => eB, + DataStorage: () => Hd, + DenseBincount: () => mg, + DepthToSpace: () => fo, + DepthwiseConv2dNative: () => Fa, + DepthwiseConv2dNativeBackpropFilter: () => gg, + DepthwiseConv2dNativeBackpropInput: () => bg, + Diag: () => yg, + Dilation2D: () => Zd, + Dilation2DBackpropFilter: () => Zf, + Dilation2DBackpropInput: () => Qf, + ENV: () => sk, + EarlyStopping: () => PW, + Einsum: () => Jd, + Elu: () => Pa, + EluGrad: () => vg, + Environment: () => A$, + Equal: () => mo, Erf: () => fl, - Exp: () => Oa, - ExpandDims: () => fo, - Expm1: () => mo, - FFT: () => yg, + Exp: () => za, + ExpandDims: () => go, + Expm1: () => bo, + FFT: () => xg, Fill: () => ml, - FlipLeftRight: () => go, - Floor: () => Pa, - FloorDiv: () => za, + FlipLeftRight: () => yo, + Floor: () => Ma, + FloorDiv: () => La, FromPixels: () => fd, - FusedBatchNorm: () => Ma, - FusedConv2D: () => aa, - FusedDepthwiseConv2D: () => ia, - GPGPUContext: () => Kf, - GatherNd: () => yo, - GatherV2: () => bo, - GraphModel: () => E4, - Greater: () => vo, - GreaterEqual: () => La, - History: () => LL, - IFFT: () => vg, - Identity: () => Ba, - Imag: () => Zd, + FusedBatchNorm: () => Ba, + FusedConv2D: () => ia, + FusedDepthwiseConv2D: () => oa, + GPGPUContext: () => Xf, + GatherNd: () => xo, + GatherV2: () => vo, + GraphModel: () => V4, + Greater: () => wo, + GreaterEqual: () => Va, + History: () => JL, + IFFT: () => wg, + Identity: () => Wa, + Imag: () => ep, InputSpec: () => Dt, IsFinite: () => gl, IsInf: () => bl, IsNan: () => yl, - KernelBackend: () => nl, - LRN: () => ep, - LRNGrad: () => wg, - LayerVariable: () => AL, - LayersModel: () => pr, - LeakyRelu: () => Va, - Less: () => xo, - LessEqual: () => wo, - LinSpace: () => xg, - Log: () => Wa, + KernelBackend: () => sl, + LRN: () => np, + LRNGrad: () => Ig, + LayerVariable: () => pz, + LayersModel: () => hr, + LeakyRelu: () => Ua, + Less: () => ko, + LessEqual: () => Io, + LinSpace: () => kg, + Log: () => Ga, Log1p: () => vl, - LogSoftmax: () => E$, - LogicalAnd: () => ko, + LogSoftmax: () => z$, + LogicalAnd: () => So, LogicalNot: () => xl, - LogicalOr: () => Jd, - MathBackendCPU: () => L0, - MathBackendWebGL: () => M1, - Max: () => Ua, - MaxPool: () => Ha, - MaxPool3D: () => tp, - MaxPool3DGrad: () => Ig, - MaxPoolGrad: () => kg, - MaxPoolWithArgmax: () => Sg, - Maximum: () => Ga, - Mean: () => qa, - Min: () => ja, - Minimum: () => Ka, - MirrorPad: () => Xa, + LogicalOr: () => tp, + MathBackendCPU: () => G0, + MathBackendWebGL: () => U1, + Max: () => Ha, + MaxPool: () => ja, + MaxPool3D: () => sp, + MaxPool3DGrad: () => Cg, + MaxPoolGrad: () => Sg, + MaxPoolWithArgmax: () => Ng, + Maximum: () => qa, + Mean: () => Ka, + Min: () => Xa, + Minimum: () => Ya, + MirrorPad: () => Qa, Mod: () => wl, - MomentumOptimizer: () => yb, - Multinomial: () => Cg, - Multiply: () => Ya, - Neg: () => Io, - NonMaxSuppressionV3: () => Co, + MomentumOptimizer: () => xb, + Multinomial: () => Tg, + Multiply: () => Za, + Neg: () => Co, + NonMaxSuppressionV3: () => To, NonMaxSuppressionV4: () => kl, - NonMaxSuppressionV5: () => No, - NotEqual: () => So, - OP_SCOPE_SUFFIX: () => l_, - OneHot: () => $o, - OnesLike: () => To, - Optimizer: () => _r, - OptimizerConstructors: () => Wr, - Pack: () => _o, - PadV2: () => Qa, - Pool: () => $de, - Pow: () => Za, - Prelu: () => Ja, - Prod: () => Ao, - RMSPropOptimizer: () => vb, - RNN: () => Ar, + NonMaxSuppressionV5: () => $o, + NotEqual: () => No, + OP_SCOPE_SUFFIX: () => m_, + OneHot: () => Ao, + OnesLike: () => _o, + Optimizer: () => Ar, + OptimizerConstructors: () => Ur, + Pack: () => Eo, + PadV2: () => Ja, + Pool: () => Wde, + Pow: () => ei, + Prelu: () => ti, + Prod: () => ni, + RMSPropOptimizer: () => wb, + RNN: () => Er, Range: () => Il, - Rank: () => e_, - Real: () => np, - RealDiv: () => Da, + Rank: () => i_, + Real: () => rp, + RealDiv: () => Oa, Reciprocal: () => Sl, - Reduction: () => oO, - Relu: () => ei, - Relu6: () => ni, - Reshape: () => Eo, - ResizeBilinear: () => ti, - ResizeBilinearGrad: () => Tg, + Reduction: () => pO, + Relu: () => si, + Relu6: () => ai, + Reshape: () => Ro, + ResizeBilinear: () => ri, + ResizeBilinearGrad: () => _g, ResizeNearestNeighbor: () => Cl, - ResizeNearestNeighborGrad: () => Ng, - Reverse: () => Ro, - RotateWithOffset: () => qo, - Round: () => Do, - Rsqrt: () => si, - SGDOptimizer: () => Ip, - ScatterNd: () => Fo, - Select: () => Oo, + ResizeNearestNeighborGrad: () => $g, + Reverse: () => Do, + RotateWithOffset: () => jo, + Round: () => Fo, + Rsqrt: () => ii, + SGDOptimizer: () => Cp, + ScatterNd: () => Oo, + Select: () => Po, Selu: () => Nl, - Sequential: () => Ub, - Sigmoid: () => ai, + Sequential: () => Hb, + Sigmoid: () => ui, Sign: () => Tl, - Sin: () => ri, - Sinh: () => zo, - Slice: () => Po, - Softmax: () => ui, + Sin: () => oi, + Sinh: () => Mo, + Slice: () => zo, + Softmax: () => di, Softplus: () => $l, - SpaceToBatchND: () => Mo, - SparseFillEmptyRows: () => sp, + SpaceToBatchND: () => Lo, + SparseFillEmptyRows: () => ap, SparseReshape: () => _l, - SparseSegmentMean: () => rp, - SparseSegmentSum: () => ap, - SparseToDense: () => ip, - SplitV: () => Lo, - Sqrt: () => ii, + SparseSegmentMean: () => ip, + SparseSegmentSum: () => op, + SparseToDense: () => up, + SplitV: () => Bo, + Sqrt: () => li, Square: () => Al, - SquaredDifference: () => li, - Step: () => hi, - StridedSlice: () => Bo, - StringNGrams: () => op, - StringSplit: () => $g, - StringToHashBucketFast: () => _g, - Sub: () => ci, - Sum: () => oi, + SquaredDifference: () => pi, + Step: () => gi, + StridedSlice: () => Vo, + StringNGrams: () => lp, + StringSplit: () => Ag, + StringToHashBucketFast: () => Eg, + Sub: () => hi, + Sum: () => ci, SymbolicTensor: () => $s, - Tan: () => Vo, - Tanh: () => di, + Tan: () => Wo, + Tanh: () => fi, Tensor: () => et, TensorBuffer: () => Vt, - Tile: () => Cr, - TopK: () => Wo, - Transform: () => Uo, - Transpose: () => pi, - Unique: () => Ag, - Unpack: () => Go, - UnsortedSegmentSum: () => up, + Tile: () => Nr, + TopK: () => Uo, + Transform: () => Go, + Transpose: () => mi, + Unique: () => Rg, + Unpack: () => Ho, + UnsortedSegmentSum: () => cp, Variable: () => gd, - ZerosLike: () => Ho, - _FusedMatMul: () => ra, + ZerosLike: () => qo, + _FusedMatMul: () => aa, abs: () => Mt, - acos: () => GA, - acosh: () => qA, + acos: () => YA, + acosh: () => ZA, add: () => ie, - addN: () => KA, - all: () => qk, - any: () => pm, - argMax: () => Hu, - argMin: () => JA, - asin: () => tE, - asinh: () => sE, - atan: () => aE, - atan2: () => oE, - atanh: () => lE, - avgPool: () => Gg, - avgPool3d: () => Yk, - backend: () => zA, + addN: () => eE, + all: () => Yk, + any: () => hm, + argMax: () => qu, + argMin: () => aE, + asin: () => oE, + asinh: () => lE, + atan: () => dE, + atan2: () => hE, + atanh: () => mE, + avgPool: () => qg, + avgPool3d: () => eI, + backend: () => UA, backend_util: () => S, - basicLSTMCell: () => qde, - batchNorm: () => ju, - batchNorm2d: () => $E, - batchNorm3d: () => AE, - batchNorm4d: () => RE, - batchToSpaceND: () => Hg, - bincount: () => Qk, - booleanMaskAsync: () => xpe, - broadcastArgs: () => OE, + basicLSTMCell: () => ipe, + batchNorm: () => Ku, + batchNorm2d: () => FE, + batchNorm3d: () => PE, + batchNorm4d: () => ME, + batchToSpaceND: () => jg, + bincount: () => tI, + booleanMaskAsync: () => Fpe, + broadcastArgs: () => VE, broadcastTo: () => nd, - broadcast_util: () => jo, - browser: () => Nk, + broadcast_util: () => Ko, + browser: () => Ak, buffer: () => De, - callbacks: () => Ape, + callbacks: () => Gpe, cast: () => ce, - ceil: () => ME, + ceil: () => GE, clipByValue: () => Vn, - clone: () => lr, - complex: () => oa, + clone: () => cr, + complex: () => ua, concat: () => Ft, - concat1d: () => VE, - concat2d: () => UE, - concat3d: () => HE, - concat4d: () => jE, - constraints: () => MM, - conv1d: () => Zk, - conv2d: () => ca, - conv2dTranspose: () => Jk, - conv3d: () => eI, - conv3dTranspose: () => tR, - copyRegisteredKernels: () => Ede, - cos: () => jg, - cosh: () => nI, - cosineWindow: () => TI, - cumprod: () => aR, - cumsum: () => sI, + concat1d: () => jE, + concat2d: () => XE, + concat3d: () => QE, + concat4d: () => JE, + constraints: () => $L, + conv1d: () => nI, + conv2d: () => da, + conv2dTranspose: () => sI, + conv3d: () => rI, + conv3dTranspose: () => oR, + copyRegisteredKernels: () => Hde, + cos: () => Xg, + cosh: () => iI, + cosineWindow: () => EI, + cumprod: () => mm, + cumsum: () => oI, customGrad: () => js, - data: () => R4, - denseBincount: () => uR, - deprecationWarn: () => Gk, - depthToSpace: () => cR, - depthwiseConv2d: () => hp, - deregisterOp: () => Rpe, - device_util: () => dp, - diag: () => jde, - dilation2d: () => fR, - disableDeprecationWarnings: () => Ode, + data: () => W4, + denseBincount: () => hR, + deprecationWarn: () => Kk, + depthToSpace: () => mR, + depthwiseConv2d: () => mp, + deregisterOp: () => qpe, + device_util: () => hp, + diag: () => ope, + dilation2d: () => vR, + disableDeprecationWarnings: () => Xde, dispose: () => Re, - disposeVariables: () => Pde, + disposeVariables: () => Yde, div: () => xe, - divNoNan: () => vR, - dot: () => Kde, - dropout: () => nF, - einsum: () => kR, - elu: () => fp, - enableDebugMode: () => Fde, - enableProdMode: () => Dde, - enclosingPowerOfTwo: () => sF, + divNoNan: () => SR, + dot: () => upe, + dropout: () => oF, + einsum: () => TR, + elu: () => gp, + enableDebugMode: () => Kde, + enableProdMode: () => jde, + enclosingPowerOfTwo: () => uF, engine: () => Ss, env: () => X, - equal: () => Kn, - erf: () => CR, - exp: () => Xn, + equal: () => Xn, + erf: () => AR, + exp: () => Yn, expandDims: () => Pn, - expm1: () => _R, - eye: () => rI, - fft: () => lb, + expm1: () => FR, + eye: () => uI, + fft: () => db, fill: () => Pl, - findBackend: () => Ude, - findBackendFactory: () => Gde, - floor: () => mp, - floorDiv: () => Hk, - forceHalfFloat: () => GX, - fused: () => ha, - gather: () => Ku, - gatherND: () => J3, - gather_util: () => $k, - getBackend: () => Vde, - getGradient: () => nx, - getKernel: () => Zf, - getKernelsForBackend: () => Jf, - getThreadsCount: () => Wpe, - gpgpu_util: () => RK, - grad: () => Qde, - grads: () => Zde, - greater: () => Wn, - greaterEqual: () => Ko, + findBackend: () => spe, + findBackendFactory: () => rpe, + floor: () => bp, + floorDiv: () => Xk, + forceHalfFloat: () => e8, + fused: () => fa, + gather: () => Xu, + gatherND: () => rF, + gather_util: () => Rk, + getBackend: () => tpe, + getGradient: () => rx, + getKernel: () => Jf, + getKernelsForBackend: () => em, + getThreadsCount: () => nhe, + gpgpu_util: () => WK, + grad: () => dpe, + grads: () => ppe, + greater: () => Un, + greaterEqual: () => Xo, ifft: () => Id, - imag: () => Kg, - image: () => qn, - inTopKAsync: () => kpe, - initializers: () => qM, - input: () => OB, + imag: () => Yg, + image: () => jn, + inTopKAsync: () => Ppe, + initializers: () => DL, + input: () => HB, io: () => En, - irfft: () => xI, - isFinite: () => Xde, - isInf: () => Yde, - isNaN: () => BR, + irfft: () => SI, + isFinite: () => lpe, + isInf: () => cpe, + isNaN: () => HR, keep: () => Ht, kernel_impls: () => xs, - layers: () => $L, - leakyRelu: () => Xg, - less: () => aI, - lessEqual: () => Xo, - linalg: () => VO, - linspace: () => GR, - loadGraphModel: () => Dpe, - loadLayersModel: () => $pe, - localResponseNormalization: () => qR, - log: () => Yn, - log1p: () => Yg, - logSigmoid: () => tpe, - logSoftmax: () => iI, - logSumExp: () => iD, + layers: () => XL, + leakyRelu: () => Qg, + less: () => lI, + lessEqual: () => Yo, + linalg: () => qO, + linspace: () => XR, + loadGraphModel: () => jpe, + loadLayersModel: () => Wpe, + localResponseNormalization: () => QR, + log: () => Qn, + log1p: () => Zg, + logSigmoid: () => mpe, + logSoftmax: () => cI, + logSumExp: () => dD, logicalAnd: () => Ds, - logicalNot: () => Jg, - logicalOr: () => cI, - logicalXor: () => npe, - losses: () => Cpe, + logicalNot: () => tb, + logicalOr: () => fI, + logicalXor: () => gpe, + losses: () => Lpe, matMul: () => We, - math: () => iA, + math: () => pA, max: () => As, - maxPool: () => eb, - maxPool3d: () => dI, - maxPoolWithArgmax: () => fD, - maximum: () => $r, + maxPool: () => nb, + maxPool3d: () => mI, + maxPoolWithArgmax: () => vD, + maximum: () => _r, mean: () => St, - memory: () => dm, - meshgrid: () => spe, - metrics: () => rW, - min: () => fm, - minimum: () => bp, - mirrorPad: () => xD, - mod: () => kD, - model: () => Npe, - models: () => xW, - moments: () => tb, - movingAverage: () => wpe, + memory: () => pm, + meshgrid: () => bpe, + metrics: () => fW, + min: () => gm, + minimum: () => vp, + mirrorPad: () => CD, + mod: () => TD, + model: () => Bpe, + models: () => AW, + moments: () => sb, + movingAverage: () => Ope, mul: () => V, - multiRNNCell: () => rpe, - multinomial: () => TD, + multiRNNCell: () => ype, + multinomial: () => RD, neg: () => kt, - nextFrame: () => OI, - norm: () => CI, - notEqual: () => Xu, + nextFrame: () => LI, + norm: () => _I, + notEqual: () => Yu, oneHot: () => vd, ones: () => Mn, - onesLike: () => Qn, + onesLike: () => Zn, op: () => L, - outerProduct: () => ape, - pad: () => fi, - pad1d: () => ipe, - pad2d: () => ope, - pad3d: () => upe, - pad4d: () => lpe, - pool: () => cpe, - pow: () => pa, - prelu: () => sb, - print: () => U_, - prod: () => pI, - profile: () => zde, - rand: () => dpe, - randomGamma: () => ppe, - randomNormal: () => KD, + outerProduct: () => vpe, + pad: () => bi, + pad1d: () => xpe, + pad2d: () => wpe, + pad3d: () => kpe, + pad4d: () => Ipe, + pool: () => Spe, + pow: () => ha, + prelu: () => ab, + print: () => X_, + prod: () => gI, + profile: () => Qde, + rand: () => Cpe, + randomGamma: () => Npe, + randomNormal: () => JD, randomUniform: () => Ml, - range: () => Yu, - ready: () => Bde, + range: () => Qu, + ready: () => epe, real: () => wd, - reciprocal: () => ZD, - registerBackend: () => pp, - registerCallbackConstructor: () => _pe, - registerGradient: () => D$, + reciprocal: () => s3, + registerBackend: () => fp, + registerCallbackConstructor: () => Upe, + registerGradient: () => L$, registerKernel: () => El, - registerOp: () => Epe, - regularizers: () => wW, - relu: () => Xs, - relu6: () => hI, - removeBackend: () => Wde, + registerOp: () => Hpe, + regularizers: () => EW, + relu: () => Ys, + relu6: () => bI, + removeBackend: () => npe, reshape: () => G, - reverse: () => Zn, - reverse1d: () => hpe, - reverse2d: () => fpe, - reverse3d: () => mpe, - reverse4d: () => gpe, - rfft: () => cb, - round: () => fI, - rsqrt: () => mI, + reverse: () => Jn, + reverse1d: () => Tpe, + reverse2d: () => $pe, + reverse3d: () => _pe, + reverse4d: () => Ape, + rfft: () => pb, + round: () => yI, + rsqrt: () => vI, scalar: () => we, - scatterND: () => X3, - scatter_util: () => Ak, - selu: () => gI, - separableConv2d: () => c3, - sequential: () => Tpe, + scatterND: () => eF, + scatter_util: () => Fk, + selu: () => xI, + separableConv2d: () => m3, + sequential: () => Vpe, serialization: () => ae, - setBackend: () => Lde, - setPlatform: () => Hde, - setThreadsCount: () => Vpe, - setWasmPath: () => Lpe, - setWasmPaths: () => Bpe, - setWebGLContext: () => S5, - setdiff1dAsync: () => p3, - shared: () => Zy, + setBackend: () => Jde, + setPlatform: () => ape, + setThreadsCount: () => the, + setWasmPath: () => Jpe, + setWasmPaths: () => ehe, + setWebGLContext: () => F5, + setdiff1dAsync: () => b3, + shared: () => ev, sigmoid: () => qs, - sign: () => f3, - signal: () => Spe, - sin: () => bI, - sinh: () => yI, - slice: () => He, - slice1d: () => ib, - slice2d: () => vI, - slice3d: () => ob, + sign: () => v3, + signal: () => Mpe, + sin: () => wI, + sinh: () => kI, + slice: () => qe, + slice1d: () => ub, + slice2d: () => II, + slice3d: () => lb, slice4d: () => kd, slice_util: () => wt, - softmax: () => ub, + softmax: () => cb, softplus: () => zl, - spaceToBatchND: () => nb, + spaceToBatchND: () => rb, sparse: () => Wc, - sparseToDense: () => NI, - spectral: () => Ipe, + sparseToDense: () => AI, + spectral: () => zpe, split: () => Bn, sqrt: () => dn, square: () => ct, - squaredDifference: () => wI, - squeeze: () => mr, - stack: () => Jn, - step: () => yp, - stridedSlice: () => D3, - string: () => Mf, + squaredDifference: () => CI, + squeeze: () => gr, + stack: () => es, + step: () => xp, + stridedSlice: () => M3, + string: () => Bf, sub: () => ge, sum: () => ve, - sumOutType: () => cp, - tan: () => O3, - tanh: () => qu, + sumOutType: () => pp, + tan: () => B3, + tanh: () => ju, tensor: () => fs, tensor1d: () => Zt, - tensor2d: () => Ki, - tensor3d: () => pA, - tensor4d: () => bpe, - tensor5d: () => ype, - tensor6d: () => vpe, + tensor2d: () => Yi, + tensor3d: () => yA, + tensor4d: () => Epe, + tensor5d: () => Rpe, + tensor6d: () => Dpe, tensor_util: () => _s, - test_util: () => _A, + test_util: () => OA, tidy: () => j, tile: () => ps, - time: () => Mde, - topk: () => z3, - train: () => Pi, - transpose: () => qe, - truncatedNormal: () => db, - unique: () => hx, - unregisterGradient: () => Ade, - unregisterKernel: () => _de, - unsortedSegmentSum: () => V3, + time: () => Zde, + topk: () => W3, + train: () => Mi, + transpose: () => Ge, + truncatedNormal: () => hb, + unique: () => mx, + unregisterGradient: () => Gde, + unregisterKernel: () => Ude, + unsortedSegmentSum: () => q3, unstack: () => Fs, upcastType: () => cn, util: () => w, - valueAndGrad: () => Jde, - valueAndGrads: () => epe, - variable: () => U3, - variableGrads: () => XR, - version: () => Gpe, - version_converter: () => Fpe, - version_core: () => Rde, - version_cpu: () => Ope, - version_layers: () => uS, - version_wasm: () => Upe, - version_webgl: () => Ppe, - webgl: () => zpe, - webgl_util: () => I5, - webgpu: () => roe, + valueAndGrad: () => hpe, + valueAndGrads: () => fpe, + variable: () => K3, + variableGrads: () => eD, + version: () => rhe, + version_converter: () => Kpe, + version_core: () => qde, + version_cpu: () => Xpe, + version_layers: () => hS, + version_wasm: () => she, + version_webgl: () => Ype, + webgl: () => Qpe, + webgl_util: () => D5, + webgpu: () => yoe, where: () => vn, - whereAsync: () => II, + whereAsync: () => TI, zeros: () => $t, zerosLike: () => je }); -var LT = Object.create; -var Vd = Object.defineProperty; -var BT = Object.getOwnPropertyDescriptor; -var Vw = Object.getOwnPropertyNames; -var VT = Object.getPrototypeOf; -var WT = Object.prototype.hasOwnProperty; -var UT = (e) => Vd(e, "__esModule", { value: true }); +var HT = Object.create; +var Ud = Object.defineProperty; +var qT = Object.getOwnPropertyDescriptor; +var Hw = Object.getOwnPropertyNames; +var jT = Object.getPrototypeOf; +var KT = Object.prototype.hasOwnProperty; +var XT = (e) => Ud(e, "__esModule", { value: true }); var zt = (e, t) => function() { - return t || (0, e[Vw(e)[0]])((t = { exports: {} }).exports, t), t.exports; + return t || (0, e[Hw(e)[0]])((t = { exports: {} }).exports, t), t.exports; }; var Ae = (e, t) => { for (var n in t) - Vd(e, n, { get: t[n], enumerable: true }); + Ud(e, n, { get: t[n], enumerable: true }); }; -var GT = (e, t, n, s) => { +var YT = (e, t, n, s) => { if (t && typeof t == "object" || typeof t == "function") - for (let r of Vw(t)) - !WT.call(e, r) && (n || r !== "default") && Vd(e, r, { get: () => t[r], enumerable: !(s = BT(t, r)) || s.enumerable }); + for (let r of Hw(t)) + !KT.call(e, r) && (n || r !== "default") && Ud(e, r, { get: () => t[r], enumerable: !(s = qT(t, r)) || s.enumerable }); return e; }; -var xa = (e, t) => GT(UT(Vd(e != null ? LT(VT(e)) : {}, "default", !t && e && e.__esModule ? { get: () => e.default, enumerable: true } : { value: e, enumerable: true })), e); -var HT = zt({ "src/node_modules/long/src/long.js"(e, t) { +var wa = (e, t) => YT(XT(Ud(e != null ? HT(jT(e)) : {}, "default", !t && e && e.__esModule ? { get: () => e.default, enumerable: true } : { value: e, enumerable: true })), e); +var QT = zt({ "src/node_modules/long/src/long.js"(e, t) { t.exports = s; var n = null; try { @@ -1004,11 +1004,11 @@ var HT = zt({ "src/node_modules/long/src/long.js"(e, t) { return new s($[4] << 24 | $[5] << 16 | $[6] << 8 | $[7], $[0] << 24 | $[1] << 16 | $[2] << 8 | $[3], z); }; } }); -var qT = zt({ "(disabled):src/node_modules/node-fetch/browser.js"() { +var ZT = zt({ "(disabled):src/node_modules/node-fetch/browser.js"() { } }); -var jT = zt({ "(disabled):util"() { +var JT = zt({ "(disabled):util"() { } }); -var KT = zt({ "src/node_modules/seedrandom/lib/alea.js"(e, t) { +var e$ = zt({ "src/node_modules/seedrandom/lib/alea.js"(e, t) { (function(n, s, r) { function a(l) { var c = this, p = u(); @@ -1047,7 +1047,7 @@ var KT = zt({ "src/node_modules/seedrandom/lib/alea.js"(e, t) { }) : this.alea = o; })(e, typeof t == "object" && t, typeof define == "function" && define); } }); -var XT = zt({ "src/node_modules/seedrandom/lib/xor128.js"(e, t) { +var t$ = zt({ "src/node_modules/seedrandom/lib/xor128.js"(e, t) { (function(n, s, r) { function a(u) { var l = this, c = ""; @@ -1079,7 +1079,7 @@ var XT = zt({ "src/node_modules/seedrandom/lib/xor128.js"(e, t) { }) : this.xor128 = o; })(e, typeof t == "object" && t, typeof define == "function" && define); } }); -var YT = zt({ "src/node_modules/seedrandom/lib/xorwow.js"(e, t) { +var n$ = zt({ "src/node_modules/seedrandom/lib/xorwow.js"(e, t) { (function(n, s, r) { function a(u) { var l = this, c = ""; @@ -1111,7 +1111,7 @@ var YT = zt({ "src/node_modules/seedrandom/lib/xorwow.js"(e, t) { }) : this.xorwow = o; })(e, typeof t == "object" && t, typeof define == "function" && define); } }); -var QT = zt({ "src/node_modules/seedrandom/lib/xorshift7.js"(e, t) { +var s$ = zt({ "src/node_modules/seedrandom/lib/xorshift7.js"(e, t) { (function(n, s, r) { function a(u) { var l = this; @@ -1157,7 +1157,7 @@ var QT = zt({ "src/node_modules/seedrandom/lib/xorshift7.js"(e, t) { }) : this.xorshift7 = o; })(e, typeof t == "object" && t, typeof define == "function" && define); } }); -var ZT = zt({ "src/node_modules/seedrandom/lib/xor4096.js"(e, t) { +var r$ = zt({ "src/node_modules/seedrandom/lib/xor4096.js"(e, t) { (function(n, s, r) { function a(u) { var l = this; @@ -1197,7 +1197,7 @@ var ZT = zt({ "src/node_modules/seedrandom/lib/xor4096.js"(e, t) { }) : this.xor4096 = o; })(e, typeof t == "object" && t, typeof define == "function" && define); } }); -var JT = zt({ "src/node_modules/seedrandom/lib/tychei.js"(e, t) { +var a$ = zt({ "src/node_modules/seedrandom/lib/tychei.js"(e, t) { (function(n, s, r) { function a(u) { var l = this, c = ""; @@ -1229,9 +1229,9 @@ var JT = zt({ "src/node_modules/seedrandom/lib/tychei.js"(e, t) { }) : this.tychei = o; })(e, typeof t == "object" && t, typeof define == "function" && define); } }); -var e$ = zt({ "(disabled):crypto"() { +var i$ = zt({ "(disabled):crypto"() { } }); -var t$ = zt({ "src/node_modules/seedrandom/seedrandom.js"(e, t) { +var o$ = zt({ "src/node_modules/seedrandom/seedrandom.js"(e, t) { (function(n, s, r) { var a = 256, i = 6, o = 52, u = "random", l = r.pow(a, i), c = r.pow(2, o), p = c * 2, d = a - 1, h; function f(k, T, N) { @@ -1299,7 +1299,7 @@ var t$ = zt({ "src/node_modules/seedrandom/seedrandom.js"(e, t) { if (y(r.random(), s), typeof t == "object" && t.exports) { t.exports = f; try { - h = e$(); + h = i$(); } catch (k) { } } else @@ -1308,23 +1308,23 @@ var t$ = zt({ "src/node_modules/seedrandom/seedrandom.js"(e, t) { }) : r["seed" + u] = f; })(typeof self != "undefined" ? self : e, [], Math); } }); -var Wd = zt({ "src/node_modules/seedrandom/index.js"(e, t) { - var n = KT(), s = XT(), r = YT(), a = QT(), i = ZT(), o = JT(), u = t$(); +var Gd = zt({ "src/node_modules/seedrandom/index.js"(e, t) { + var n = e$(), s = t$(), r = n$(), a = s$(), i = r$(), o = a$(), u = o$(); u.alea = n, u.xor128 = s, u.xorwow = r, u.xorshift7 = a, u.xor4096 = i, u.tychei = o, t.exports = u; } }); -var Ww = zt({ "(disabled):src/node_modules/string_decoder/index.js"() { +var qw = zt({ "(disabled):src/node_modules/string_decoder/index.js"() { } }); -var tg = zt({ "(disabled):fs"() { +var sg = zt({ "(disabled):fs"() { } }); var dd = zt({ "(disabled):path"() { } }); -var n$ = zt({ "(disabled):worker_threads"() { +var u$ = zt({ "(disabled):worker_threads"() { } }); -var s$ = zt({ "(disabled):perf_hooks"() { +var l$ = zt({ "(disabled):perf_hooks"() { } }); -var r$ = zt({ "(disabled):os"() { +var c$ = zt({ "(disabled):os"() { } }); -var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js"(e, t) { +var d$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js"(e, t) { var n = (() => { var s = typeof document != "undefined" && document.currentScript ? document.currentScript.src : void 0; return typeof __filename != "undefined" && (s = s || __filename), function(r) { @@ -1336,7 +1336,7 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js return Ce.buffer != nn && rs(Ce.buffer), oc; } function o() { - return Ce.buffer != nn && rs(Ce.buffer), hu; + return Ce.buffer != nn && rs(Ce.buffer), fu; } function u() { return Ce.buffer != nn && rs(Ce.buffer), uc; @@ -1364,14 +1364,14 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js } var P, R, F, $; function z(C) { - if (C instanceof ku) + if (C instanceof Iu) return; ee("exiting due to exception: " + C); } var W, q, K; if (T) { k ? E = dd().dirname(E) + "/" : E = __dirname + "/", K = () => { - q || (W = tg(), q = dd()); + q || (W = sg(), q = dd()); }, P = function(B, Q) { return K(), B = q.normalize(B), W.readFileSync(B, Q ? void 0 : "utf8"); }, F = (D) => { @@ -1382,12 +1382,12 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js ue ? Q(ue) : B(pe.buffer); }); }, process.argv.length > 1 && (y = process.argv[1].replace(/\\/g, "/")), b = process.argv.slice(2), process.on("uncaughtException", function(D) { - if (!(D instanceof ku)) + if (!(D instanceof Iu)) throw D; }), process.on("unhandledRejection", function(D) { throw D; }), v = (D, B) => { - if (Pr()) + if (zr()) throw process.exitCode = D, B; z(B), process.exit(D); }, d.inspect = function() { @@ -1395,7 +1395,7 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js }; let C; try { - C = n$(); + C = u$(); } catch (D) { throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'), D; } @@ -1417,7 +1417,7 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js B(); }, Q.onerror = B, Q.send(null); }), $ = (C) => document.title = C); - T && typeof performance == "undefined" && (global.performance = s$().performance); + T && typeof performance == "undefined" && (global.performance = l$().performance); var Y = console.log.bind(console), Z = console.warn.bind(console); T && (K(), Y = (C) => W.writeSync(1, C + ` `), Z = (C) => W.writeSync(2, C + ` @@ -1439,8 +1439,8 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js for (var ue = 0; ue < Te.length; ++ue) pe.push(bt[Te[ue]]); ye == "v" ? pe.push(0) : pe = pe.concat([1, bt[ye]]), pe[1] = pe.length - 2; - var us = new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0].concat(pe, [2, 7, 1, 1, 101, 1, 102, 0, 0, 7, 5, 1, 1, 102, 0, 0])), ls = new WebAssembly.Module(us), Bc = new WebAssembly.Instance(ls, { e: { f: C } }), Iu = Bc.exports.f; - return Iu; + var us = new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0].concat(pe, [2, 7, 1, 1, 101, 1, 102, 0, 0, 7, 5, 1, 1, 102, 0, 0])), ls = new WebAssembly.Module(us), Bc = new WebAssembly.Instance(ls, { e: { f: C } }), Su = Bc.exports.f; + return Su; } var re = [], le; function me() { @@ -1455,7 +1455,7 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js } function ke(C, D) { for (var B = C; B < C + D; B++) { - var Q = $i(B); + var Q = Ai(B); Q && le.set(Q, B); } } @@ -1464,10 +1464,10 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js }, Pe = Atomics.load, Xe = Atomics.store, Je = Atomics.compareExchange, Ye; d.wasmBinary && (Ye = d.wasmBinary); var tt = d.noExitRuntime || true; - typeof WebAssembly != "object" && Ci("no native wasm support detected"); + typeof WebAssembly != "object" && Ti("no native wasm support detected"); var Ce, ut, at = false, Jt; function Nt(C, D) { - C || Ci(D); + C || Ti(D); } function Cn(C) { var D = d["_" + C]; @@ -1475,15 +1475,15 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js } function Et(C, D, B, Q, ue) { var pe = { string: function($n) { - var Oi = 0; + var zi = 0; if ($n != null && $n !== 0) { - var ex = ($n.length << 2) + 1; - Oi = Fi(ex), Ls($n, Oi, ex); + var nx = ($n.length << 2) + 1; + zi = Pi(nx), Ls($n, zi, nx); } - return Oi; + return zi; }, array: function($n) { - var Oi = Fi($n.length); - return Bs($n, Oi), Oi; + var zi = Pi($n.length); + return Bs($n, zi), zi; } }; function ye($n) { return D === "string" ? tn($n) : D === "boolean" ? Boolean($n) : $n; @@ -1492,13 +1492,13 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js if (Q) for (var ls = 0; ls < Q.length; ls++) { var Bc = pe[B[ls]]; - Bc ? (us === 0 && (us = Ef()), bt[ls] = Bc(Q[ls])) : bt[ls] = Q[ls]; + Bc ? (us === 0 && (us = Df()), bt[ls] = Bc(Q[ls])) : bt[ls] = Q[ls]; } - var Iu = Te.apply(null, bt); - function MT($n) { + var Su = Te.apply(null, bt); + function GT($n) { return us !== 0 && Pc(us), ye($n); } - return Iu = MT(Iu), Iu; + return Su = GT(Su), Su; } function en(C, D, B, Q) { B = B || []; @@ -1576,29 +1576,29 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js function Ls(C, D, B) { return Ms(C, i(), D, B); } - function ki(C) { + function Si(C) { for (var D = 0, B = 0; B < C.length; ++B) { var Q = C.charCodeAt(B); Q >= 55296 && Q <= 57343 && (Q = 65536 + ((Q & 1023) << 10) | C.charCodeAt(++B) & 1023), Q <= 127 ? ++D : Q <= 2047 ? D += 2 : Q <= 65535 ? D += 3 : D += 4; } return D; } - var Js = typeof TextDecoder != "undefined" ? new Tn("utf-16le") : void 0; + var er = typeof TextDecoder != "undefined" ? new Tn("utf-16le") : void 0; function Bs(C, D) { a().set(C, D); } - function pu(C, D, B) { + function hu(C, D, B) { for (var Q = 0; Q < C.length; ++Q) a()[D++ >> 0] = C.charCodeAt(Q); B || (a()[D >> 0] = 0); } - function Ii(C, D) { + function Ci(C, D) { return C % D > 0 && (C += D - C % D), C; } - var nn, ic, oc, hu, uc, lc, Fv, cc, dc; + var nn, ic, oc, fu, uc, lc, Pv, cc, dc; N && (nn = d.buffer); function rs(C) { - nn = C, d.HEAP8 = ic = new Int8Array(C), d.HEAP16 = hu = new Int16Array(C), d.HEAP32 = lc = new Int32Array(C), d.HEAPU8 = oc = new Uint8Array(C), d.HEAPU16 = uc = new Uint16Array(C), d.HEAPU32 = Fv = new Uint32Array(C), d.HEAPF32 = cc = new Float32Array(C), d.HEAPF64 = dc = new Float64Array(C); + nn = C, d.HEAP8 = ic = new Int8Array(C), d.HEAP16 = fu = new Int16Array(C), d.HEAP32 = lc = new Int32Array(C), d.HEAPU8 = oc = new Uint8Array(C), d.HEAPU16 = uc = new Uint16Array(C), d.HEAPU32 = Pv = new Uint32Array(C), d.HEAPF32 = cc = new Float32Array(C), d.HEAPF64 = dc = new Float64Array(C); } var pc = d.INITIAL_MEMORY || 16777216; if (N) @@ -1608,58 +1608,58 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js else if (Ce = new WebAssembly.Memory({ initial: pc / 65536, maximum: 32768, shared: true }), !(Ce.buffer instanceof SharedArrayBuffer)) throw ee("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"), T && console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"), Error("bad memory"); Ce && (nn = Ce.buffer), pc = nn.byteLength, rs(nn); - var Fn, Si = [], er = [], th = [], hc = [], Or = false, nh = false, fc = 0; - function Pr() { + var Fn, Ni = [], tr = [], sh = [], hc = [], Pr = false, rh = false, fc = 0; + function zr() { return tt || fc > 0; } function sn() { if (d.preRun) for (typeof d.preRun == "function" && (d.preRun = [d.preRun]); d.preRun.length; ) - Ov(d.preRun.shift()); - vc(Si); + zv(d.preRun.shift()); + vc(Ni); } - function fu() { - Or = true, !N && vc(er); + function mu() { + Pr = true, !N && vc(tr); } - function sh() { - N || ($e.terminateAllThreads(), nh = true); + function ah() { + N || (_e.terminateAllThreads(), rh = true); } - function rh() { + function ih() { if (!N) { if (d.postRun) for (typeof d.postRun == "function" && (d.postRun = [d.postRun]); d.postRun.length; ) - mu(d.postRun.shift()); + gu(d.postRun.shift()); vc(hc); } } - function Ov(C) { - Si.unshift(C); + function zv(C) { + Ni.unshift(C); } - function Pv(C) { - er.unshift(C); + function Mv(C) { + tr.unshift(C); } - function mu(C) { + function gu(C) { hc.unshift(C); } - var tr = 0, mc = null, as = null; - function gu(C) { - tr++, d.monitorRunDependencies && d.monitorRunDependencies(tr); + var nr = 0, mc = null, as = null; + function bu(C) { + nr++, d.monitorRunDependencies && d.monitorRunDependencies(nr); } - function zv(C) { - if (tr--, d.monitorRunDependencies && d.monitorRunDependencies(tr), tr == 0 && (mc !== null && (clearInterval(mc), mc = null), as)) { + function Lv(C) { + if (nr--, d.monitorRunDependencies && d.monitorRunDependencies(nr), nr == 0 && (mc !== null && (clearInterval(mc), mc = null), as)) { var D = as; as = null, D(); } } d.preloadedImages = {}, d.preloadedAudios = {}; - function Ci(C) { + function Ti(C) { N ? postMessage({ cmd: "onAbort", arg: C }) : d.onAbort && d.onAbort(C), C = "Aborted(" + C + ")", ee(C), at = true, Jt = 1, C += ". Build with -s ASSERTIONS=1 for more info."; var D = new WebAssembly.RuntimeError(C); throw f(D), D; } - var ah = "data:application/octet-stream;base64,"; + var oh = "data:application/octet-stream;base64,"; function gc(C) { - return C.startsWith(ah); + return C.startsWith(oh); } function bc(C) { return C.startsWith("file://"); @@ -1674,10 +1674,10 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js return F(C); throw "both async and sync fetching of the wasm failed"; } catch (D) { - Ci(D); + Ti(D); } } - function Ni() { + function $i() { if (!Ye && (x || k)) { if (typeof fetch == "function" && !bc(rn)) return fetch(rn, { credentials: "same-origin" }).then(function(C) { @@ -1698,30 +1698,30 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js return yc(rn); }); } - function ih() { + function uh() { var C = { env: Ec, wasi_snapshot_preview1: Ec }; function D(ye, Te) { var bt = ye.exports; - if (d.asm = bt, hh(d.asm.emscripten_tls_init), Fn = d.asm.__indirect_function_table, Pv(d.asm.__wasm_call_ctors), ut = Te, !N) { - var us = $e.unusedWorkers.length; - $e.unusedWorkers.forEach(function(ls) { - $e.loadWasmModuleToWorker(ls, function() { - --us || zv("wasm-instantiate"); + if (d.asm = bt, mh(d.asm.emscripten_tls_init), Fn = d.asm.__indirect_function_table, Mv(d.asm.__wasm_call_ctors), ut = Te, !N) { + var us = _e.unusedWorkers.length; + _e.unusedWorkers.forEach(function(ls) { + _e.loadWasmModuleToWorker(ls, function() { + --us || Lv("wasm-instantiate"); }); }); } } - N || gu("wasm-instantiate"); + N || bu("wasm-instantiate"); function B(ye) { D(ye.instance, ye.module); } function Q(ye) { - return Ni().then(function(Te) { + return $i().then(function(Te) { return WebAssembly.instantiate(Te, C); }).then(function(Te) { return Te; }).then(ye, function(Te) { - ee("failed to asynchronously prepare wasm: " + Te), Ci(Te); + ee("failed to asynchronously prepare wasm: " + Te), Ti(Te); }); } function ue() { @@ -1741,7 +1741,7 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js } return ue().catch(f), {}; } - var Mv, Lv, oh = {}; + var Bv, Vv, lh = {}; function vc(C) { for (; C.length > 0; ) { var D = C.shift(); @@ -1750,91 +1750,91 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js continue; } var B = D.func; - typeof B == "number" ? D.arg === void 0 ? $i(B)() : $i(B)(D.arg) : B(D.arg === void 0 ? null : D.arg); + typeof B == "number" ? D.arg === void 0 ? Ai(B)() : Ai(B)(D.arg) : B(D.arg === void 0 ? null : D.arg); } } - function Ti(C) { - var D = Ef(), B = C(); + function _i(C) { + var D = Df(), B = C(); return Pc(D), B; } - function qN(C) { + function ZN(C) { return C; } - function Bv(C) { + function Wv(C) { var D = /\b_Z[\w\d_]+/g; return C.replace(D, function(B) { var Q = B; return B === Q ? B : Q + " [" + B + "]"; }); } - function uh(C) { + function ch(C) { l()[C >> 2] = 0; - var D = $e.pthreads[C]; - delete $e.pthreads[C], D.worker.terminate(), Af(C), $e.runningWorkers.splice($e.runningWorkers.indexOf(D.worker), 1), D.worker.pthread = void 0; + var D = _e.pthreads[C]; + delete _e.pthreads[C], D.worker.terminate(), Rf(C), _e.runningWorkers.splice(_e.runningWorkers.indexOf(D.worker), 1), D.worker.pthread = void 0; } - function lh(C) { - var D = $e.pthreads[C]; + function dh(C) { + var D = _e.pthreads[C]; D.worker.postMessage({ cmd: "cancel" }); } function xc(C) { - var D = $e.pthreads[C]; + var D = _e.pthreads[C]; if (D) { l()[C >> 2] = 0; var B = D.worker; - $e.returnWorkerToPool(B); + _e.returnWorkerToPool(B); } } function wc(C) { - OT(C); + VT(C); } - function ch(C) { - if (C instanceof ku || C == "unwind") + function ph(C) { + if (C instanceof Iu || C == "unwind") return Jt; v(1, C); } - var $e = { unusedWorkers: [], runningWorkers: [], tlsInitFunctions: [], init: function() { - N ? $e.initWorker() : $e.initMainThread(); + var _e = { unusedWorkers: [], runningWorkers: [], tlsInitFunctions: [], init: function() { + N ? _e.initWorker() : _e.initMainThread(); }, initMainThread: function() { for (var C = 8, D = 0; D < C; ++D) - $e.allocateUnusedWorker(); + _e.allocateUnusedWorker(); }, initWorker: function() { tt = false; }, pthreads: {}, setExitStatus: function(C) { Jt = C; }, terminateAllThreads: function() { - for (var C in $e.pthreads) { - var D = $e.pthreads[C]; - D && D.worker && $e.returnWorkerToPool(D.worker); + for (var C in _e.pthreads) { + var D = _e.pthreads[C]; + D && D.worker && _e.returnWorkerToPool(D.worker); } - for (var B = 0; B < $e.unusedWorkers.length; ++B) { - var Q = $e.unusedWorkers[B]; + for (var B = 0; B < _e.unusedWorkers.length; ++B) { + var Q = _e.unusedWorkers[B]; Q.terminate(); } - $e.unusedWorkers = []; + _e.unusedWorkers = []; }, returnWorkerToPool: function(C) { - $e.runWithoutMainThreadQueuedCalls(function() { - delete $e.pthreads[C.pthread.threadInfoStruct], $e.unusedWorkers.push(C), $e.runningWorkers.splice($e.runningWorkers.indexOf(C), 1), Af(C.pthread.threadInfoStruct), C.pthread = void 0; + _e.runWithoutMainThreadQueuedCalls(function() { + delete _e.pthreads[C.pthread.threadInfoStruct], _e.unusedWorkers.push(C), _e.runningWorkers.splice(_e.runningWorkers.indexOf(C), 1), Rf(C.pthread.threadInfoStruct), C.pthread = void 0; }); }, runWithoutMainThreadQueuedCalls: function(C) { - l()[Jv >> 2] = 0; + l()[tx >> 2] = 0; try { C(); } finally { - l()[Jv >> 2] = 1; + l()[tx >> 2] = 1; } }, receiveObjectTransfer: function(C) { }, threadInit: function() { - for (var C in $e.tlsInitFunctions) - $e.tlsInitFunctions[C](); + for (var C in _e.tlsInitFunctions) + _e.tlsInitFunctions[C](); }, loadWasmModuleToWorker: function(C, D) { C.onmessage = (B) => { var Q = B.data, ue = Q.cmd; - if (C.pthread && ($e.currentProxiedOperationCallerThread = C.pthread.threadInfoStruct), Q.targetThread && Q.targetThread != Oc()) { - var pe = $e.pthreads[Q.targetThread]; - pe ? pe.worker.postMessage(Q, Q.transferList) : ee('Internal error! Worker sent a message "' + ue + '" to target pthread ' + Q.targetThread + ", but that thread no longer exists!"), $e.currentProxiedOperationCallerThread = void 0; + if (C.pthread && (_e.currentProxiedOperationCallerThread = C.pthread.threadInfoStruct), Q.targetThread && Q.targetThread != Oc()) { + var pe = _e.pthreads[Q.targetThread]; + pe ? pe.worker.postMessage(Q, Q.transferList) : ee('Internal error! Worker sent a message "' + ue + '" to target pthread ' + Q.targetThread + ", but that thread no longer exists!"), _e.currentProxiedOperationCallerThread = void 0; return; } - ue === "processQueuedMainThreadWork" ? Kv() : ue === "spawnThread" ? Ic(Q) : ue === "cleanupThread" ? xc(Q.thread) : ue === "killThread" ? uh(Q.thread) : ue === "cancelThread" ? lh(Q.thread) : ue === "loaded" ? (C.loaded = true, D && D(C), C.runPthread && (C.runPthread(), delete C.runPthread)) : ue === "print" ? te("Thread " + Q.threadId + ": " + Q.text) : ue === "printErr" ? ee("Thread " + Q.threadId + ": " + Q.text) : ue === "alert" ? alert("Thread " + Q.threadId + ": " + Q.text) : Q.target === "setimmediate" ? C.postMessage(Q) : ue === "onAbort" ? d.onAbort && d.onAbort(Q.arg) : ee("worker sent an unknown command " + ue), $e.currentProxiedOperationCallerThread = void 0; + ue === "processQueuedMainThreadWork" ? Yv() : ue === "spawnThread" ? Ic(Q) : ue === "cleanupThread" ? xc(Q.thread) : ue === "killThread" ? ch(Q.thread) : ue === "cancelThread" ? dh(Q.thread) : ue === "loaded" ? (C.loaded = true, D && D(C), C.runPthread && (C.runPthread(), delete C.runPthread)) : ue === "print" ? te("Thread " + Q.threadId + ": " + Q.text) : ue === "printErr" ? ee("Thread " + Q.threadId + ": " + Q.text) : ue === "alert" ? alert("Thread " + Q.threadId + ": " + Q.text) : Q.target === "setimmediate" ? C.postMessage(Q) : ue === "onAbort" ? d.onAbort && d.onAbort(Q.arg) : ee("worker sent an unknown command " + ue), _e.currentProxiedOperationCallerThread = void 0; }, C.onerror = (B) => { var Q = "worker sent an error!"; throw ee(Q + " " + B.filename + ":" + B.lineno + ": " + B.message), B; @@ -1846,34 +1846,34 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js })), C.postMessage({ cmd: "load", urlOrBlob: d.mainScriptUrlOrBlob || s, wasmMemory: Ce, wasmModule: ut }); }, allocateUnusedWorker: function() { var C = A("tfjs-backend-wasm-threaded-simd.worker.js"); - $e.unusedWorkers.push(new Worker(C)); + _e.unusedWorkers.push(new Worker(C)); }, getNewWorker: function() { - return $e.unusedWorkers.length == 0 && ($e.allocateUnusedWorker(), $e.loadWasmModuleToWorker($e.unusedWorkers[0])), $e.unusedWorkers.pop(); + return _e.unusedWorkers.length == 0 && (_e.allocateUnusedWorker(), _e.loadWasmModuleToWorker(_e.unusedWorkers[0])), _e.unusedWorkers.pop(); } }; - function dh() { + function hh() { var C = Oc(), D = l()[C + 44 >> 2], B = l()[C + 48 >> 2], Q = D - B; - Zv(D, Q), Pc(D); + ex(D, Q), Pc(D); } - d.establishStackSpace = dh; + d.establishStackSpace = hh; function kc(C) { if (N) - return Lr(1, 0, C); + return Br(1, 0, C); try { wc(C); } catch (D) { - ch(D); + ph(D); } } - var zr = []; - function $i(C) { - var D = zr[C]; - return D || (C >= zr.length && (zr.length = C + 1), zr[C] = D = Fn.get(C)), D; + var Mr = []; + function Ai(C) { + var D = Mr[C]; + return D || (C >= Mr.length && (Mr.length = C + 1), Mr[C] = D = Fn.get(C)), D; } - function ph(C, D) { - return $i(C)(D); + function fh(C, D) { + return Ai(C)(D); } - d.invokeEntryPoint = ph; - function Vv() { + d.invokeEntryPoint = fh; + function Uv() { var C = new Error(); if (!C.stack) { try { @@ -1886,119 +1886,119 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js } return C.stack.toString(); } - function hh(C, D, B) { - $e.tlsInitFunctions.push(C); + function mh(C, D, B) { + _e.tlsInitFunctions.push(C); } - function Wv(C, D) { - Fn.set(C, D), zr[C] = D; + function Gv(C, D) { + Fn.set(C, D), Mr[C] = D; } - var Mr; - T ? Mr = () => { + var Lr; + T ? Lr = () => { var C = process.hrtime(); return C[0] * 1e3 + C[1] / 1e6; - } : N ? Mr = () => performance.now() - d.__performance_now_clock_drift : Mr = () => performance.now(); - var fh = true; - function mh(C) { - return l()[jv() >> 2] = C, C; + } : N ? Lr = () => performance.now() - d.__performance_now_clock_drift : Lr = () => performance.now(); + var gh = true; + function bh(C) { + return l()[Xv() >> 2] = C, C; } - function gh(C, D) { + function yh(C, D) { var B; if (C === 0) B = Date.now(); - else if ((C === 1 || C === 4) && fh) - B = Mr(); + else if ((C === 1 || C === 4) && gh) + B = Lr(); else - return mh(28), -1; + return bh(28), -1; return l()[D >> 2] = B / 1e3 | 0, l()[D + 4 >> 2] = B % 1e3 * 1e3 * 1e3 | 0, 0; } - function bh(C, D) { - return gh(C, D); + function vh(C, D) { + return yh(C, D); } - function yh(C) { - Xv(C, !k, 1, !x), $e.threadInit(); + function xh(C) { + Qv(C, !k, 1, !x), _e.threadInit(); } - function vh(C) { + function wh(C) { N ? postMessage({ cmd: "cleanupThread", thread: C }) : xc(C); } function Ic(C) { - var D = $e.getNewWorker(); + var D = _e.getNewWorker(); if (!D) return 6; - $e.runningWorkers.push(D); - var B = $e.pthreads[C.pthread_ptr] = { worker: D, threadInfoStruct: C.pthread_ptr }; + _e.runningWorkers.push(D); + var B = _e.pthreads[C.pthread_ptr] = { worker: D, threadInfoStruct: C.pthread_ptr }; D.pthread = B; var Q = { cmd: "run", start_routine: C.startRoutine, arg: C.arg, threadInfoStruct: C.pthread_ptr }; return D.runPthread = () => { Q.time = performance.now(), D.postMessage(Q, C.transferList); }, D.loaded && (D.runPthread(), delete D.runPthread), 0; } - function xh(C, D, B, Q) { + function kh(C, D, B, Q) { if (typeof SharedArrayBuffer == "undefined") return ee("Current environment does not support SharedArrayBuffer, pthreads are not available!"), 6; var ue = [], pe = 0; if (N && (ue.length === 0 || pe)) - return Yv(687865856, C, D, B, Q); + return Zv(687865856, C, D, B, Q); if (pe) return pe; var ye = { startRoutine: B, pthread_ptr: C, arg: Q, transferList: ue }; return N ? (ye.cmd = "spawnThread", postMessage(ye, ue), 0) : Ic(ye); } - function wh() { + function Ih() { return 2097152; } - function kh(C, D) { + function Sh(C, D) { if (C == D) postMessage({ cmd: "processQueuedMainThreadWork" }); else if (N) postMessage({ targetThread: C, cmd: "processThreadQueue" }); else { - var B = $e.pthreads[C], Q = B && B.worker; + var B = _e.pthreads[C], Q = B && B.worker; if (!Q) return; Q.postMessage({ cmd: "processThreadQueue" }); } return 1; } - function Ih() { - Ci(""); + function Ch() { + Ti(""); } - function Sh() { + function Nh() { T || k || ne("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread"); } function Sc() { return 2147483648; } - function Ch(C, D, B) { + function Th(C, D, B) { i().copyWithin(C, D, D + B); } - function Nh() { - return T ? r$().cpus().length : navigator.hardwareConcurrency; + function $h() { + return T ? c$().cpus().length : navigator.hardwareConcurrency; } - function Lr(C, D) { + function Br(C, D) { var B = arguments.length - 2, Q = arguments; - return Ti(function() { - for (var ue = B, pe = Fi(ue * 8), ye = pe >> 3, Te = 0; Te < B; Te++) { + return _i(function() { + for (var ue = B, pe = Pi(ue * 8), ye = pe >> 3, Te = 0; Te < B; Te++) { var bt = Q[2 + Te]; p()[ye + Te] = bt; } - return Qv(C, ue, pe, D); + return Jv(C, ue, pe, D); }); } - var bu = []; - function Th(C, D, B) { - bu.length = D; + var yu = []; + function _h(C, D, B) { + yu.length = D; for (var Q = B >> 3, ue = 0; ue < D; ue++) - bu[ue] = p()[Q + ue]; - var pe = C < 0, ye = pe ? oh[-C - 1] : qh[C]; - return ye.apply(null, bu); + yu[ue] = p()[Q + ue]; + var pe = C < 0, ye = pe ? lh[-C - 1] : Kh[C]; + return ye.apply(null, yu); } - function $h(C) { + function Ah(C) { try { return Ce.grow(C - nn.byteLength + 65535 >>> 16), rs(Ce.buffer), 1; } catch (D) { } } - function _h(C) { + function Eh(C) { var D = i().length; if (C = C >>> 0, C <= D) return false; @@ -2008,18 +2008,18 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js for (var Q = 1; Q <= 4; Q *= 2) { var ue = D * (1 + 0.2 / Q); ue = Math.min(ue, C + 100663296); - var pe = Math.min(B, Ii(Math.max(C, ue), 65536)), ye = $h(pe); + var pe = Math.min(B, Ci(Math.max(C, ue), 65536)), ye = Ah(pe); if (ye) return true; } return false; } - var Le = { inEventHandler: 0, removeAllEventListeners: function() { - for (var C = Le.eventHandlers.length - 1; C >= 0; --C) - Le._removeHandler(C); - Le.eventHandlers = [], Le.deferredCalls = []; + var Be = { inEventHandler: 0, removeAllEventListeners: function() { + for (var C = Be.eventHandlers.length - 1; C >= 0; --C) + Be._removeHandler(C); + Be.eventHandlers = [], Be.deferredCalls = []; }, registerRemoveEventListeners: function() { - Le.removeEventListenersRegistered || (th.push(Le.removeAllEventListeners), Le.removeEventListenersRegistered = true); + Be.removeEventListenersRegistered || (sh.push(Be.removeAllEventListeners), Be.removeEventListenersRegistered = true); }, deferredCalls: [], deferCall: function(C, D, B) { function Q(ye, Te) { if (ye.length != Te.length) @@ -2029,51 +2029,51 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js return false; return true; } - for (var ue in Le.deferredCalls) { - var pe = Le.deferredCalls[ue]; + for (var ue in Be.deferredCalls) { + var pe = Be.deferredCalls[ue]; if (pe.targetFunction == C && Q(pe.argsList, B)) return; } - Le.deferredCalls.push({ targetFunction: C, precedence: D, argsList: B }), Le.deferredCalls.sort(function(ye, Te) { + Be.deferredCalls.push({ targetFunction: C, precedence: D, argsList: B }), Be.deferredCalls.sort(function(ye, Te) { return ye.precedence < Te.precedence; }); }, removeDeferredCalls: function(C) { - for (var D = 0; D < Le.deferredCalls.length; ++D) - Le.deferredCalls[D].targetFunction == C && (Le.deferredCalls.splice(D, 1), --D); + for (var D = 0; D < Be.deferredCalls.length; ++D) + Be.deferredCalls[D].targetFunction == C && (Be.deferredCalls.splice(D, 1), --D); }, canPerformEventHandlerRequests: function() { - return Le.inEventHandler && Le.currentEventHandler.allowsDeferredCalls; + return Be.inEventHandler && Be.currentEventHandler.allowsDeferredCalls; }, runDeferredCalls: function() { - if (!!Le.canPerformEventHandlerRequests()) - for (var C = 0; C < Le.deferredCalls.length; ++C) { - var D = Le.deferredCalls[C]; - Le.deferredCalls.splice(C, 1), --C, D.targetFunction.apply(null, D.argsList); + if (!!Be.canPerformEventHandlerRequests()) + for (var C = 0; C < Be.deferredCalls.length; ++C) { + var D = Be.deferredCalls[C]; + Be.deferredCalls.splice(C, 1), --C, D.targetFunction.apply(null, D.argsList); } }, eventHandlers: [], removeAllHandlersOnTarget: function(C, D) { - for (var B = 0; B < Le.eventHandlers.length; ++B) - Le.eventHandlers[B].target == C && (!D || D == Le.eventHandlers[B].eventTypeString) && Le._removeHandler(B--); + for (var B = 0; B < Be.eventHandlers.length; ++B) + Be.eventHandlers[B].target == C && (!D || D == Be.eventHandlers[B].eventTypeString) && Be._removeHandler(B--); }, _removeHandler: function(C) { - var D = Le.eventHandlers[C]; - D.target.removeEventListener(D.eventTypeString, D.eventListenerFunc, D.useCapture), Le.eventHandlers.splice(C, 1); + var D = Be.eventHandlers[C]; + D.target.removeEventListener(D.eventTypeString, D.eventListenerFunc, D.useCapture), Be.eventHandlers.splice(C, 1); }, registerOrRemoveHandler: function(C) { var D = function(ue) { - ++Le.inEventHandler, Le.currentEventHandler = C, Le.runDeferredCalls(), C.handlerFunc(ue), Le.runDeferredCalls(), --Le.inEventHandler; + ++Be.inEventHandler, Be.currentEventHandler = C, Be.runDeferredCalls(), C.handlerFunc(ue), Be.runDeferredCalls(), --Be.inEventHandler; }; if (C.callbackfunc) - C.eventListenerFunc = D, C.target.addEventListener(C.eventTypeString, D, C.useCapture), Le.eventHandlers.push(C), Le.registerRemoveEventListeners(); + C.eventListenerFunc = D, C.target.addEventListener(C.eventTypeString, D, C.useCapture), Be.eventHandlers.push(C), Be.registerRemoveEventListeners(); else - for (var B = 0; B < Le.eventHandlers.length; ++B) - Le.eventHandlers[B].target == C.target && Le.eventHandlers[B].eventTypeString == C.eventTypeString && Le._removeHandler(B--); + for (var B = 0; B < Be.eventHandlers.length; ++B) + Be.eventHandlers[B].target == C.target && Be.eventHandlers[B].eventTypeString == C.eventTypeString && Be._removeHandler(B--); }, queueEventHandlerOnThread_iiii: function(C, D, B, Q, ue) { - Ti(function() { - var pe = Fi(12); - l()[pe >> 2] = B, l()[pe + 4 >> 2] = Q, l()[pe + 8 >> 2] = ue, _f(C, 637534208, D, Q, pe); + _i(function() { + var pe = Pi(12); + l()[pe >> 2] = B, l()[pe + 4 >> 2] = Q, l()[pe + 8 >> 2] = ue, Ef(C, 637534208, D, Q, pe); }); }, getTargetThreadForEventCallback: function(C) { switch (C) { case 1: return 0; case 2: - return $e.currentProxiedOperationCallerThread; + return _e.currentProxiedOperationCallerThread; default: return C; } @@ -2082,33 +2082,33 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js }, fullscreenEnabled: function() { return document.fullscreenEnabled || document.webkitFullscreenEnabled; } }; - function Ah(C) { - var D = ki(C) + 1, B = $f(D); + function Rh(C) { + var D = Si(C) + 1, B = Af(D); return Ls(C, B, D), B; } - function Eh(C, D, B, Q) { - Ti(function() { - var ue = Fi(12), pe = 0; - D && (pe = Ah(D)), l()[ue >> 2] = pe, l()[ue + 4 >> 2] = B, l()[ue + 8 >> 2] = Q, _f(C, 657457152, 0, pe, ue); + function Dh(C, D, B, Q) { + _i(function() { + var ue = Pi(12), pe = 0; + D && (pe = Rh(D)), l()[ue >> 2] = pe, l()[ue + 4 >> 2] = B, l()[ue + 8 >> 2] = Q, Ef(C, 657457152, 0, pe, ue); }); } - function Rh(C, D, B, Q) { - D = D ? tn(D) : "", Eh(C, D, B, Q); + function Fh(C, D, B, Q) { + D = D ? tn(D) : "", Dh(C, D, B, Q); } - function Dh(C) { + function Oh(C) { return C > 2 ? tn(C) : C; } - var Fh = [0, typeof document != "undefined" ? document : 0, typeof window != "undefined" ? window : 0]; - function Oh(C) { - C = Dh(C); - var D = Fh[C] || (typeof document != "undefined" ? document.querySelector(C) : void 0); + var Ph = [0, typeof document != "undefined" ? document : 0, typeof window != "undefined" ? window : 0]; + function zh(C) { + C = Oh(C); + var D = Ph[C] || (typeof document != "undefined" ? document.querySelector(C) : void 0); return D; } - function yu(C) { - return Oh(C); + function vu(C) { + return zh(C); } function Cc(C, D, B) { - var Q = yu(C); + var Q = vu(C); if (!Q) return -4; if (Q.canvasSharedPtr && (l()[Q.canvasSharedPtr >> 2] = D, l()[Q.canvasSharedPtr + 4 >> 2] = B), Q.offscreenCanvas || !Q.controlTransferredOffscreen) { @@ -2121,22 +2121,22 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js Q.width = D, Q.height = B, ue && Q.GLctxObject.GLctx.viewport(0, 0, D, B); } else if (Q.canvasSharedPtr) { var ye = l()[Q.canvasSharedPtr + 8 >> 2]; - return Rh(ye, C, D, B), 1; + return Fh(ye, C, D, B), 1; } else return -4; return 0; } function Nc(C, D, B) { - return N ? Lr(2, 1, C, D, B) : Cc(C, D, B); + return N ? Br(2, 1, C, D, B) : Cc(C, D, B); } - function Ph(C, D, B) { - var Q = yu(C); + function Mh(C, D, B) { + var Q = vu(C); return Q ? Cc(C, D, B) : Nc(C, D, B); } - function zh() { + function Lh() { throw "unwind"; } - function Mh(C) { + function Bh(C) { var D = C.getExtension("ANGLE_instanced_arrays"); if (D) return C.vertexAttribDivisor = function(B, Q) { @@ -2147,7 +2147,7 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js D.drawElementsInstancedANGLE(B, Q, ue, pe, ye); }, 1; } - function Lh(C) { + function Vh(C) { var D = C.getExtension("OES_vertex_array_object"); if (D) return C.createVertexArray = function() { @@ -2160,14 +2160,14 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js return D.isVertexArrayOES(B); }, 1; } - function Bh(C) { + function Wh(C) { var D = C.getExtension("WEBGL_draw_buffers"); if (D) return C.drawBuffers = function(B, Q) { D.drawBuffersWEBGL(B, Q); }, 1; } - function Vh(C) { + function Uh(C) { return !!(C.multiDrawWebgl = C.getExtension("WEBGL_multi_draw")); } var gt = { counter: 1, buffers: [], programs: [], framebuffers: [], renderbuffers: [], textures: [], shaders: [], vaos: [], contexts: {}, offscreenCanvases: {}, queries: [], stringCache: {}, unpackAlignment: 4, recordError: function(D) { @@ -2193,7 +2193,7 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js var Q = gt.registerContext(B, D); return Q; }, registerContext: function(C, D) { - var B = $f(8); + var B = Af(8); l()[B + 4 >> 2] = Oc(); var Q = { handle: B, attributes: D, version: D.majorVersion, GLctx: C }; return C.canvas && (C.canvas.GLctxObject = Q), gt.contexts[B] = Q, (typeof D.enableExtensionsByDefault == "undefined" || D.enableExtensionsByDefault) && gt.initExtensions(Q), B; @@ -2202,34 +2202,34 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js }, getContext: function(C) { return gt.contexts[C]; }, deleteContext: function(C) { - gt.currentContext === gt.contexts[C] && (gt.currentContext = null), typeof Le == "object" && Le.removeAllHandlersOnTarget(gt.contexts[C].GLctx.canvas), gt.contexts[C] && gt.contexts[C].GLctx.canvas && (gt.contexts[C].GLctx.canvas.GLctxObject = void 0), qv(gt.contexts[C].handle), gt.contexts[C] = null; + gt.currentContext === gt.contexts[C] && (gt.currentContext = null), typeof Be == "object" && Be.removeAllHandlersOnTarget(gt.contexts[C].GLctx.canvas), gt.contexts[C] && gt.contexts[C].GLctx.canvas && (gt.contexts[C].GLctx.canvas.GLctxObject = void 0), Kv(gt.contexts[C].handle), gt.contexts[C] = null; }, initExtensions: function(C) { if (C || (C = gt.currentContext), !C.initExtensionsDone) { C.initExtensionsDone = true; var D = C.GLctx; - Mh(D), Lh(D), Bh(D), D.disjointTimerQueryExt = D.getExtension("EXT_disjoint_timer_query"), Vh(D); + Bh(D), Vh(D), Wh(D), D.disjointTimerQueryExt = D.getExtension("EXT_disjoint_timer_query"), Uh(D); var B = D.getSupportedExtensions() || []; B.forEach(function(Q) { !Q.includes("lose_context") && !Q.includes("debug") && D.getExtension(Q); }); } - } }, Wh = ["default", "low-power", "high-performance"]; - function Uh(C, D) { - var B = D >> 2, Q = l()[B + 6], ue = { alpha: !!l()[B + 0], depth: !!l()[B + 1], stencil: !!l()[B + 2], antialias: !!l()[B + 3], premultipliedAlpha: !!l()[B + 4], preserveDrawingBuffer: !!l()[B + 5], powerPreference: Wh[Q], failIfMajorPerformanceCaveat: !!l()[B + 7], majorVersion: l()[B + 8], minorVersion: l()[B + 9], enableExtensionsByDefault: l()[B + 10], explicitSwapControl: l()[B + 11], proxyContextToMainThread: l()[B + 12], renderViaOffscreenBackBuffer: l()[B + 13] }, pe = yu(C); + } }, Gh = ["default", "low-power", "high-performance"]; + function Hh(C, D) { + var B = D >> 2, Q = l()[B + 6], ue = { alpha: !!l()[B + 0], depth: !!l()[B + 1], stencil: !!l()[B + 2], antialias: !!l()[B + 3], premultipliedAlpha: !!l()[B + 4], preserveDrawingBuffer: !!l()[B + 5], powerPreference: Gh[Q], failIfMajorPerformanceCaveat: !!l()[B + 7], majorVersion: l()[B + 8], minorVersion: l()[B + 9], enableExtensionsByDefault: l()[B + 10], explicitSwapControl: l()[B + 11], proxyContextToMainThread: l()[B + 12], renderViaOffscreenBackBuffer: l()[B + 13] }, pe = vu(C); if (!pe || ue.explicitSwapControl) return 0; var ye = gt.createContext(pe, ue); return ye; } - function Gh(C, D) { - return Uh(C, D); + function qh(C, D) { + return Hh(C, D); } - var _i = { mappings: {}, buffers: [null, [], []], printChar: function(C, D) { - var B = _i.buffers[C]; + var Ei = { mappings: {}, buffers: [null, [], []], printChar: function(C, D) { + var B = Ei.buffers[C]; D === 0 || D === 10 ? ((C === 1 ? te : ee)(Dn(B, 0)), B.length = 0) : B.push(D); }, varargs: void 0, get: function() { - _i.varargs += 4; - var C = l()[_i.varargs - 4 >> 2]; + Ei.varargs += 4; + var C = l()[Ei.varargs - 4 >> 2]; return C; }, getStr: function(C) { var D = tn(C); @@ -2238,112 +2238,112 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js return C; } }; function Tc(C) { - return N ? Lr(3, 1, C) : 0; + return N ? Br(3, 1, C) : 0; } function $c(C, D, B, Q, ue) { if (N) - return Lr(4, 1, C, D, B, Q, ue); + return Br(4, 1, C, D, B, Q, ue); } function _c(C, D, B, Q) { if (N) - return Lr(5, 1, C, D, B, Q); + return Br(5, 1, C, D, B, Q); for (var ue = 0, pe = 0; pe < B; pe++) { var ye = l()[D >> 2], Te = l()[D + 4 >> 2]; D += 8; for (var bt = 0; bt < Te; bt++) - _i.printChar(C, i()[ye + bt]); + Ei.printChar(C, i()[ye + bt]); ue += Te; } return l()[Q >> 2] = ue, 0; } - function Hh(C) { + function jh(C) { Ee(C); } - $e.init(); - var Ac, qh = [null, kc, Nc, Tc, $c, _c], Uv = false, Ec = { __clock_gettime: bh, __emscripten_init_main_thread_js: yh, __emscripten_thread_cleanup: vh, __pthread_create_js: xh, _emscripten_default_pthread_stack_size: wh, _emscripten_notify_thread_queue: kh, abort: Ih, emscripten_check_blocking_allowed: Sh, emscripten_get_heap_max: Sc, emscripten_get_now: Mr, emscripten_memcpy_big: Ch, emscripten_num_logical_cores: Nh, emscripten_receive_on_main_thread_js: Th, emscripten_resize_heap: _h, emscripten_set_canvas_element_size: Ph, emscripten_unwind_to_js_event_loop: zh, emscripten_webgl_create_context: Gh, exit: wc, fd_close: Tc, fd_seek: $c, fd_write: _c, memory: Ce || d.wasmMemory, setTempRet0: Hh }, Gv = ih(), jh = d.___wasm_call_ctors = function() { - return (jh = d.___wasm_call_ctors = d.asm.__wasm_call_ctors).apply(null, arguments); - }, Kh = d._init = function() { - return (Kh = d._init = d.asm.init).apply(null, arguments); - }, Xh = d._init_with_threads_count = function() { - return (Xh = d._init_with_threads_count = d.asm.init_with_threads_count).apply(null, arguments); - }, Yh = d._get_threads_count = function() { - return (Yh = d._get_threads_count = d.asm.get_threads_count).apply(null, arguments); - }, Qh = d._register_tensor = function() { - return (Qh = d._register_tensor = d.asm.register_tensor).apply(null, arguments); - }, Zh = d._dispose_data = function() { - return (Zh = d._dispose_data = d.asm.dispose_data).apply(null, arguments); - }, Jh = d._dispose = function() { - return (Jh = d._dispose = d.asm.dispose).apply(null, arguments); - }, ef = d._Abs = function() { - return (ef = d._Abs = d.asm.Abs).apply(null, arguments); - }, tf = d._Add = function() { - return (tf = d._Add = d.asm.Add).apply(null, arguments); - }, nf = d._AddN = function() { - return (nf = d._AddN = d.asm.AddN).apply(null, arguments); - }, sf = d._All = function() { - return (sf = d._All = d.asm.All).apply(null, arguments); - }, rf = d._Any = function() { - return (rf = d._Any = d.asm.Any).apply(null, arguments); - }, af = d._ArgMax = function() { - return (af = d._ArgMax = d.asm.ArgMax).apply(null, arguments); - }, of = d._AvgPool = function() { - return (of = d._AvgPool = d.asm.AvgPool).apply(null, arguments); - }, uf = d._BatchMatMul = function() { - return (uf = d._BatchMatMul = d.asm.BatchMatMul).apply(null, arguments); - }, lf = d._Ceil = function() { - return (lf = d._Ceil = d.asm.Ceil).apply(null, arguments); - }, cf = d._ClipByValue = function() { - return (cf = d._ClipByValue = d.asm.ClipByValue).apply(null, arguments); - }, df = d._Conv2D = function() { - return (df = d._Conv2D = d.asm.Conv2D).apply(null, arguments); - }, pf = d._Conv2DBackpropInput = function() { - return (pf = d._Conv2DBackpropInput = d.asm.Conv2DBackpropInput).apply(null, arguments); - }, hf = d._Cos = function() { - return (hf = d._Cos = d.asm.Cos).apply(null, arguments); - }, ff = d._Cosh = function() { - return (ff = d._Cosh = d.asm.Cosh).apply(null, arguments); - }, mf = d._CropAndResize = function() { - return (mf = d._CropAndResize = d.asm.CropAndResize).apply(null, arguments); - }, gf = d._Cumprod = function() { - return (gf = d._Cumprod = d.asm.Cumprod).apply(null, arguments); - }, bf = d._Cumsum = function() { - return (bf = d._Cumsum = d.asm.Cumsum).apply(null, arguments); - }, yf = d._DepthToSpace = function() { - return (yf = d._DepthToSpace = d.asm.DepthToSpace).apply(null, arguments); - }, vf = d._DepthwiseConv2dNative = function() { - return (vf = d._DepthwiseConv2dNative = d.asm.DepthwiseConv2dNative).apply(null, arguments); - }, xf = d._Elu = function() { - return (xf = d._Elu = d.asm.Elu).apply(null, arguments); - }, wf = d._Equal = function() { - return (wf = d._Equal = d.asm.Equal).apply(null, arguments); - }, kf = d._Exp = function() { - return (kf = d._Exp = d.asm.Exp).apply(null, arguments); - }, If = d._FlipLeftRight = function() { - return (If = d._FlipLeftRight = d.asm.FlipLeftRight).apply(null, arguments); + _e.init(); + var Ac, Kh = [null, kc, Nc, Tc, $c, _c], Hv = false, Ec = { __clock_gettime: vh, __emscripten_init_main_thread_js: xh, __emscripten_thread_cleanup: wh, __pthread_create_js: kh, _emscripten_default_pthread_stack_size: Ih, _emscripten_notify_thread_queue: Sh, abort: Ch, emscripten_check_blocking_allowed: Nh, emscripten_get_heap_max: Sc, emscripten_get_now: Lr, emscripten_memcpy_big: Th, emscripten_num_logical_cores: $h, emscripten_receive_on_main_thread_js: _h, emscripten_resize_heap: Eh, emscripten_set_canvas_element_size: Mh, emscripten_unwind_to_js_event_loop: Lh, emscripten_webgl_create_context: qh, exit: wc, fd_close: Tc, fd_seek: $c, fd_write: _c, memory: Ce || d.wasmMemory, setTempRet0: jh }, qv = uh(), Xh = d.___wasm_call_ctors = function() { + return (Xh = d.___wasm_call_ctors = d.asm.__wasm_call_ctors).apply(null, arguments); + }, Yh = d._init = function() { + return (Yh = d._init = d.asm.init).apply(null, arguments); + }, Qh = d._init_with_threads_count = function() { + return (Qh = d._init_with_threads_count = d.asm.init_with_threads_count).apply(null, arguments); + }, Zh = d._get_threads_count = function() { + return (Zh = d._get_threads_count = d.asm.get_threads_count).apply(null, arguments); + }, Jh = d._register_tensor = function() { + return (Jh = d._register_tensor = d.asm.register_tensor).apply(null, arguments); + }, ef = d._dispose_data = function() { + return (ef = d._dispose_data = d.asm.dispose_data).apply(null, arguments); + }, tf = d._dispose = function() { + return (tf = d._dispose = d.asm.dispose).apply(null, arguments); + }, nf = d._Abs = function() { + return (nf = d._Abs = d.asm.Abs).apply(null, arguments); + }, sf = d._Add = function() { + return (sf = d._Add = d.asm.Add).apply(null, arguments); + }, rf = d._AddN = function() { + return (rf = d._AddN = d.asm.AddN).apply(null, arguments); + }, af = d._All = function() { + return (af = d._All = d.asm.All).apply(null, arguments); + }, of = d._Any = function() { + return (of = d._Any = d.asm.Any).apply(null, arguments); + }, uf = d._ArgMax = function() { + return (uf = d._ArgMax = d.asm.ArgMax).apply(null, arguments); + }, lf = d._AvgPool = function() { + return (lf = d._AvgPool = d.asm.AvgPool).apply(null, arguments); + }, cf = d._BatchMatMul = function() { + return (cf = d._BatchMatMul = d.asm.BatchMatMul).apply(null, arguments); + }, df = d._Ceil = function() { + return (df = d._Ceil = d.asm.Ceil).apply(null, arguments); + }, pf = d._ClipByValue = function() { + return (pf = d._ClipByValue = d.asm.ClipByValue).apply(null, arguments); + }, hf = d._Conv2D = function() { + return (hf = d._Conv2D = d.asm.Conv2D).apply(null, arguments); + }, ff = d._Conv2DBackpropInput = function() { + return (ff = d._Conv2DBackpropInput = d.asm.Conv2DBackpropInput).apply(null, arguments); + }, mf = d._Cos = function() { + return (mf = d._Cos = d.asm.Cos).apply(null, arguments); + }, gf = d._Cosh = function() { + return (gf = d._Cosh = d.asm.Cosh).apply(null, arguments); + }, bf = d._CropAndResize = function() { + return (bf = d._CropAndResize = d.asm.CropAndResize).apply(null, arguments); + }, yf = d._Cumprod = function() { + return (yf = d._Cumprod = d.asm.Cumprod).apply(null, arguments); + }, vf = d._Cumsum = function() { + return (vf = d._Cumsum = d.asm.Cumsum).apply(null, arguments); + }, xf = d._DepthToSpace = function() { + return (xf = d._DepthToSpace = d.asm.DepthToSpace).apply(null, arguments); + }, wf = d._DepthwiseConv2dNative = function() { + return (wf = d._DepthwiseConv2dNative = d.asm.DepthwiseConv2dNative).apply(null, arguments); + }, kf = d._Elu = function() { + return (kf = d._Elu = d.asm.Elu).apply(null, arguments); + }, If = d._Equal = function() { + return (If = d._Equal = d.asm.Equal).apply(null, arguments); + }, Sf = d._Exp = function() { + return (Sf = d._Exp = d.asm.Exp).apply(null, arguments); + }, Cf = d._FlipLeftRight = function() { + return (Cf = d._FlipLeftRight = d.asm.FlipLeftRight).apply(null, arguments); }, Rc = d._Floor = function() { return (Rc = d._Floor = d.asm.Floor).apply(null, arguments); }, Dc = d._FloorDiv = function() { return (Dc = d._FloorDiv = d.asm.FloorDiv).apply(null, arguments); - }, vu = d._FusedBatchNorm = function() { - return (vu = d._FusedBatchNorm = d.asm.FusedBatchNorm).apply(null, arguments); - }, Sf = d._FusedConv2D = function() { - return (Sf = d._FusedConv2D = d.asm.FusedConv2D).apply(null, arguments); - }, Cf = d._FusedDepthwiseConv2D = function() { - return (Cf = d._FusedDepthwiseConv2D = d.asm.FusedDepthwiseConv2D).apply(null, arguments); - }, Ai = d._Gather = function() { - return (Ai = d._Gather = d.asm.Gather).apply(null, arguments); - }, xu = d._GatherNd = function() { - return (xu = d._GatherNd = d.asm.GatherNd).apply(null, arguments); - }, wu = d._Greater = function() { - return (wu = d._Greater = d.asm.Greater).apply(null, arguments); - }, Hv = d._GreaterEqual = function() { - return (Hv = d._GreaterEqual = d.asm.GreaterEqual).apply(null, arguments); - }, Ei = d._LeakyRelu = function() { - return (Ei = d._LeakyRelu = d.asm.LeakyRelu).apply(null, arguments); - }, Ri = d._Less = function() { - return (Ri = d._Less = d.asm.Less).apply(null, arguments); - }, Nf = d._LessEqual = function() { - return (Nf = d._LessEqual = d.asm.LessEqual).apply(null, arguments); + }, xu = d._FusedBatchNorm = function() { + return (xu = d._FusedBatchNorm = d.asm.FusedBatchNorm).apply(null, arguments); + }, Nf = d._FusedConv2D = function() { + return (Nf = d._FusedConv2D = d.asm.FusedConv2D).apply(null, arguments); + }, Tf = d._FusedDepthwiseConv2D = function() { + return (Tf = d._FusedDepthwiseConv2D = d.asm.FusedDepthwiseConv2D).apply(null, arguments); + }, Ri = d._Gather = function() { + return (Ri = d._Gather = d.asm.Gather).apply(null, arguments); + }, wu = d._GatherNd = function() { + return (wu = d._GatherNd = d.asm.GatherNd).apply(null, arguments); + }, ku = d._Greater = function() { + return (ku = d._Greater = d.asm.Greater).apply(null, arguments); + }, jv = d._GreaterEqual = function() { + return (jv = d._GreaterEqual = d.asm.GreaterEqual).apply(null, arguments); + }, Di = d._LeakyRelu = function() { + return (Di = d._LeakyRelu = d.asm.LeakyRelu).apply(null, arguments); + }, Fi = d._Less = function() { + return (Fi = d._Less = d.asm.Less).apply(null, arguments); + }, $f = d._LessEqual = function() { + return ($f = d._LessEqual = d.asm.LessEqual).apply(null, arguments); }, H = d._Log = function() { return (H = d._Log = d.asm.Log).apply(null, arguments); }, J = d._LogicalAnd = function() { @@ -2366,150 +2366,150 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js return (is = d._Multiply = d.asm.Multiply).apply(null, arguments); }, os = d._Neg = function() { return (os = d._Neg = d.asm.Neg).apply(null, arguments); - }, Di = d._NonMaxSuppressionV3 = function() { - return (Di = d._NonMaxSuppressionV3 = d.asm.NonMaxSuppressionV3).apply(null, arguments); - }, Br = d._NonMaxSuppressionV4 = function() { - return (Br = d._NonMaxSuppressionV4 = d.asm.NonMaxSuppressionV4).apply(null, arguments); - }, Tf = d._NonMaxSuppressionV5 = function() { - return (Tf = d._NonMaxSuppressionV5 = d.asm.NonMaxSuppressionV5).apply(null, arguments); + }, Oi = d._NonMaxSuppressionV3 = function() { + return (Oi = d._NonMaxSuppressionV3 = d.asm.NonMaxSuppressionV3).apply(null, arguments); + }, Vr = d._NonMaxSuppressionV4 = function() { + return (Vr = d._NonMaxSuppressionV4 = d.asm.NonMaxSuppressionV4).apply(null, arguments); + }, _f = d._NonMaxSuppressionV5 = function() { + return (_f = d._NonMaxSuppressionV5 = d.asm.NonMaxSuppressionV5).apply(null, arguments); }, an = d._NotEqual = function() { return (an = d._NotEqual = d.asm.NotEqual).apply(null, arguments); - }, nr = d._OneHot = function() { - return (nr = d._OneHot = d.asm.OneHot).apply(null, arguments); + }, sr = d._OneHot = function() { + return (sr = d._OneHot = d.asm.OneHot).apply(null, arguments); }, Fc = d._PadV2 = function() { return (Fc = d._PadV2 = d.asm.PadV2).apply(null, arguments); - }, jN = d._Pow = function() { - return (jN = d._Pow = d.asm.Pow).apply(null, arguments); - }, KN = d._Prelu = function() { - return (KN = d._Prelu = d.asm.Prelu).apply(null, arguments); - }, XN = d._Prod = function() { - return (XN = d._Prod = d.asm.Prod).apply(null, arguments); - }, YN = d._RealDiv = function() { - return (YN = d._RealDiv = d.asm.RealDiv).apply(null, arguments); - }, QN = d._Relu = function() { - return (QN = d._Relu = d.asm.Relu).apply(null, arguments); - }, ZN = d._Relu6 = function() { - return (ZN = d._Relu6 = d.asm.Relu6).apply(null, arguments); - }, JN = d._ResizeBilinear = function() { - return (JN = d._ResizeBilinear = d.asm.ResizeBilinear).apply(null, arguments); - }, eT = d._Reverse = function() { - return (eT = d._Reverse = d.asm.Reverse).apply(null, arguments); - }, tT = d._RotateWithOffset = function() { - return (tT = d._RotateWithOffset = d.asm.RotateWithOffset).apply(null, arguments); - }, nT = d._Round = function() { - return (nT = d._Round = d.asm.Round).apply(null, arguments); - }, sT = d._Rsqrt = function() { - return (sT = d._Rsqrt = d.asm.Rsqrt).apply(null, arguments); - }, rT = d._ScatterNd = function() { - return (rT = d._ScatterNd = d.asm.ScatterNd).apply(null, arguments); - }, aT = d._SelectV2 = function() { - return (aT = d._SelectV2 = d.asm.SelectV2).apply(null, arguments); - }, iT = d._Sigmoid = function() { - return (iT = d._Sigmoid = d.asm.Sigmoid).apply(null, arguments); - }, oT = d._Sin = function() { - return (oT = d._Sin = d.asm.Sin).apply(null, arguments); - }, uT = d._Softmax = function() { - return (uT = d._Softmax = d.asm.Softmax).apply(null, arguments); - }, lT = d._SparseFillEmptyRows = function() { - return (lT = d._SparseFillEmptyRows = d.asm.SparseFillEmptyRows).apply(null, arguments); - }, cT = d._SparseReshape = function() { - return (cT = d._SparseReshape = d.asm.SparseReshape).apply(null, arguments); - }, dT = d._SparseSegmentReduction = function() { - return (dT = d._SparseSegmentReduction = d.asm.SparseSegmentReduction).apply(null, arguments); - }, pT = d._Sqrt = function() { - return (pT = d._Sqrt = d.asm.Sqrt).apply(null, arguments); - }, hT = d._Square = function() { - return (hT = d._Square = d.asm.Square).apply(null, arguments); - }, fT = d._SquaredDifference = function() { - return (fT = d._SquaredDifference = d.asm.SquaredDifference).apply(null, arguments); - }, mT = d._Step = function() { - return (mT = d._Step = d.asm.Step).apply(null, arguments); - }, gT = d._StridedSlice = function() { - return (gT = d._StridedSlice = d.asm.StridedSlice).apply(null, arguments); - }, bT = d._Sub = function() { - return (bT = d._Sub = d.asm.Sub).apply(null, arguments); - }, yT = d._Sum = function() { - return (yT = d._Sum = d.asm.Sum).apply(null, arguments); - }, vT = d._Tan = function() { - return (vT = d._Tan = d.asm.Tan).apply(null, arguments); - }, xT = d._Tanh = function() { - return (xT = d._Tanh = d.asm.Tanh).apply(null, arguments); - }, wT = d._Tile = function() { - return (wT = d._Tile = d.asm.Tile).apply(null, arguments); - }, kT = d._TopK = function() { - return (kT = d._TopK = d.asm.TopK).apply(null, arguments); - }, IT = d._Transform = function() { - return (IT = d._Transform = d.asm.Transform).apply(null, arguments); - }, ST = d._Transpose = function() { - return (ST = d._Transpose = d.asm.Transpose).apply(null, arguments); - }, CT = d.__FusedMatMul = function() { - return (CT = d.__FusedMatMul = d.asm._FusedMatMul).apply(null, arguments); - }, $f = d._malloc = function() { - return ($f = d._malloc = d.asm.malloc).apply(null, arguments); - }, qv = d._free = function() { - return (qv = d._free = d.asm.free).apply(null, arguments); - }, NT = d._emscripten_tls_init = function() { - return (NT = d._emscripten_tls_init = d.asm.emscripten_tls_init).apply(null, arguments); - }, jv = d.___errno_location = function() { - return (jv = d.___errno_location = d.asm.__errno_location).apply(null, arguments); + }, JN = d._Pow = function() { + return (JN = d._Pow = d.asm.Pow).apply(null, arguments); + }, eT = d._Prelu = function() { + return (eT = d._Prelu = d.asm.Prelu).apply(null, arguments); + }, tT = d._Prod = function() { + return (tT = d._Prod = d.asm.Prod).apply(null, arguments); + }, nT = d._RealDiv = function() { + return (nT = d._RealDiv = d.asm.RealDiv).apply(null, arguments); + }, sT = d._Relu = function() { + return (sT = d._Relu = d.asm.Relu).apply(null, arguments); + }, rT = d._Relu6 = function() { + return (rT = d._Relu6 = d.asm.Relu6).apply(null, arguments); + }, aT = d._ResizeBilinear = function() { + return (aT = d._ResizeBilinear = d.asm.ResizeBilinear).apply(null, arguments); + }, iT = d._Reverse = function() { + return (iT = d._Reverse = d.asm.Reverse).apply(null, arguments); + }, oT = d._RotateWithOffset = function() { + return (oT = d._RotateWithOffset = d.asm.RotateWithOffset).apply(null, arguments); + }, uT = d._Round = function() { + return (uT = d._Round = d.asm.Round).apply(null, arguments); + }, lT = d._Rsqrt = function() { + return (lT = d._Rsqrt = d.asm.Rsqrt).apply(null, arguments); + }, cT = d._ScatterNd = function() { + return (cT = d._ScatterNd = d.asm.ScatterNd).apply(null, arguments); + }, dT = d._SelectV2 = function() { + return (dT = d._SelectV2 = d.asm.SelectV2).apply(null, arguments); + }, pT = d._Sigmoid = function() { + return (pT = d._Sigmoid = d.asm.Sigmoid).apply(null, arguments); + }, hT = d._Sin = function() { + return (hT = d._Sin = d.asm.Sin).apply(null, arguments); + }, fT = d._Softmax = function() { + return (fT = d._Softmax = d.asm.Softmax).apply(null, arguments); + }, mT = d._SparseFillEmptyRows = function() { + return (mT = d._SparseFillEmptyRows = d.asm.SparseFillEmptyRows).apply(null, arguments); + }, gT = d._SparseReshape = function() { + return (gT = d._SparseReshape = d.asm.SparseReshape).apply(null, arguments); + }, bT = d._SparseSegmentReduction = function() { + return (bT = d._SparseSegmentReduction = d.asm.SparseSegmentReduction).apply(null, arguments); + }, yT = d._Sqrt = function() { + return (yT = d._Sqrt = d.asm.Sqrt).apply(null, arguments); + }, vT = d._Square = function() { + return (vT = d._Square = d.asm.Square).apply(null, arguments); + }, xT = d._SquaredDifference = function() { + return (xT = d._SquaredDifference = d.asm.SquaredDifference).apply(null, arguments); + }, wT = d._Step = function() { + return (wT = d._Step = d.asm.Step).apply(null, arguments); + }, kT = d._StridedSlice = function() { + return (kT = d._StridedSlice = d.asm.StridedSlice).apply(null, arguments); + }, IT = d._Sub = function() { + return (IT = d._Sub = d.asm.Sub).apply(null, arguments); + }, ST = d._Sum = function() { + return (ST = d._Sum = d.asm.Sum).apply(null, arguments); + }, CT = d._Tan = function() { + return (CT = d._Tan = d.asm.Tan).apply(null, arguments); + }, NT = d._Tanh = function() { + return (NT = d._Tanh = d.asm.Tanh).apply(null, arguments); + }, TT = d._Tile = function() { + return (TT = d._Tile = d.asm.Tile).apply(null, arguments); + }, $T = d._TopK = function() { + return ($T = d._TopK = d.asm.TopK).apply(null, arguments); + }, _T = d._Transform = function() { + return (_T = d._Transform = d.asm.Transform).apply(null, arguments); + }, AT = d._Transpose = function() { + return (AT = d._Transpose = d.asm.Transpose).apply(null, arguments); + }, ET = d.__FusedMatMul = function() { + return (ET = d.__FusedMatMul = d.asm._FusedMatMul).apply(null, arguments); + }, Af = d._malloc = function() { + return (Af = d._malloc = d.asm.malloc).apply(null, arguments); + }, Kv = d._free = function() { + return (Kv = d._free = d.asm.free).apply(null, arguments); + }, RT = d._emscripten_tls_init = function() { + return (RT = d._emscripten_tls_init = d.asm.emscripten_tls_init).apply(null, arguments); + }, Xv = d.___errno_location = function() { + return (Xv = d.___errno_location = d.asm.__errno_location).apply(null, arguments); }, Oc = d._pthread_self = function() { return (Oc = d._pthread_self = d.asm.pthread_self).apply(null, arguments); - }, Kv = d._emscripten_main_thread_process_queued_calls = function() { - return (Kv = d._emscripten_main_thread_process_queued_calls = d.asm.emscripten_main_thread_process_queued_calls).apply(null, arguments); - }, TT = d.__emscripten_thread_crashed = function() { - return (TT = d.__emscripten_thread_crashed = d.asm._emscripten_thread_crashed).apply(null, arguments); - }, Xv = d.__emscripten_thread_init = function() { - return (Xv = d.__emscripten_thread_init = d.asm._emscripten_thread_init).apply(null, arguments); - }, $T = d._emscripten_current_thread_process_queued_calls = function() { - return ($T = d._emscripten_current_thread_process_queued_calls = d.asm.emscripten_current_thread_process_queued_calls).apply(null, arguments); - }, _T = d._emscripten_main_browser_thread_id = function() { - return (_T = d._emscripten_main_browser_thread_id = d.asm.emscripten_main_browser_thread_id).apply(null, arguments); - }, AT = d._emscripten_sync_run_in_main_thread_2 = function() { - return (AT = d._emscripten_sync_run_in_main_thread_2 = d.asm.emscripten_sync_run_in_main_thread_2).apply(null, arguments); - }, Yv = d._emscripten_sync_run_in_main_thread_4 = function() { - return (Yv = d._emscripten_sync_run_in_main_thread_4 = d.asm.emscripten_sync_run_in_main_thread_4).apply(null, arguments); - }, Qv = d._emscripten_run_in_main_runtime_thread_js = function() { - return (Qv = d._emscripten_run_in_main_runtime_thread_js = d.asm.emscripten_run_in_main_runtime_thread_js).apply(null, arguments); - }, _f = d._emscripten_dispatch_to_thread_ = function() { - return (_f = d._emscripten_dispatch_to_thread_ = d.asm.emscripten_dispatch_to_thread_).apply(null, arguments); - }, Af = d.__emscripten_thread_free_data = function() { - return (Af = d.__emscripten_thread_free_data = d.asm._emscripten_thread_free_data).apply(null, arguments); - }, ET = d.__emscripten_thread_exit = function() { - return (ET = d.__emscripten_thread_exit = d.asm._emscripten_thread_exit).apply(null, arguments); - }, RT = d._memalign = function() { - return (RT = d._memalign = d.asm.memalign).apply(null, arguments); - }, Zv = d._emscripten_stack_set_limits = function() { - return (Zv = d._emscripten_stack_set_limits = d.asm.emscripten_stack_set_limits).apply(null, arguments); - }, Ef = d.stackSave = function() { - return (Ef = d.stackSave = d.asm.stackSave).apply(null, arguments); + }, Yv = d._emscripten_main_thread_process_queued_calls = function() { + return (Yv = d._emscripten_main_thread_process_queued_calls = d.asm.emscripten_main_thread_process_queued_calls).apply(null, arguments); + }, DT = d.__emscripten_thread_crashed = function() { + return (DT = d.__emscripten_thread_crashed = d.asm._emscripten_thread_crashed).apply(null, arguments); + }, Qv = d.__emscripten_thread_init = function() { + return (Qv = d.__emscripten_thread_init = d.asm._emscripten_thread_init).apply(null, arguments); + }, FT = d._emscripten_current_thread_process_queued_calls = function() { + return (FT = d._emscripten_current_thread_process_queued_calls = d.asm.emscripten_current_thread_process_queued_calls).apply(null, arguments); + }, OT = d._emscripten_main_browser_thread_id = function() { + return (OT = d._emscripten_main_browser_thread_id = d.asm.emscripten_main_browser_thread_id).apply(null, arguments); + }, PT = d._emscripten_sync_run_in_main_thread_2 = function() { + return (PT = d._emscripten_sync_run_in_main_thread_2 = d.asm.emscripten_sync_run_in_main_thread_2).apply(null, arguments); + }, Zv = d._emscripten_sync_run_in_main_thread_4 = function() { + return (Zv = d._emscripten_sync_run_in_main_thread_4 = d.asm.emscripten_sync_run_in_main_thread_4).apply(null, arguments); + }, Jv = d._emscripten_run_in_main_runtime_thread_js = function() { + return (Jv = d._emscripten_run_in_main_runtime_thread_js = d.asm.emscripten_run_in_main_runtime_thread_js).apply(null, arguments); + }, Ef = d._emscripten_dispatch_to_thread_ = function() { + return (Ef = d._emscripten_dispatch_to_thread_ = d.asm.emscripten_dispatch_to_thread_).apply(null, arguments); + }, Rf = d.__emscripten_thread_free_data = function() { + return (Rf = d.__emscripten_thread_free_data = d.asm._emscripten_thread_free_data).apply(null, arguments); + }, zT = d.__emscripten_thread_exit = function() { + return (zT = d.__emscripten_thread_exit = d.asm._emscripten_thread_exit).apply(null, arguments); + }, MT = d._memalign = function() { + return (MT = d._memalign = d.asm.memalign).apply(null, arguments); + }, ex = d._emscripten_stack_set_limits = function() { + return (ex = d._emscripten_stack_set_limits = d.asm.emscripten_stack_set_limits).apply(null, arguments); + }, Df = d.stackSave = function() { + return (Df = d.stackSave = d.asm.stackSave).apply(null, arguments); }, Pc = d.stackRestore = function() { return (Pc = d.stackRestore = d.asm.stackRestore).apply(null, arguments); - }, Fi = d.stackAlloc = function() { - return (Fi = d.stackAlloc = d.asm.stackAlloc).apply(null, arguments); - }, DT = d.dynCall_iijjiiii = function() { - return (DT = d.dynCall_iijjiiii = d.asm.dynCall_iijjiiii).apply(null, arguments); - }, FT = d.dynCall_jiji = function() { - return (FT = d.dynCall_jiji = d.asm.dynCall_jiji).apply(null, arguments); - }, Jv = d.__emscripten_allow_main_runtime_queued_calls = 21456; - d.cwrap = en, d.keepRuntimeAlive = Pr, d.PThread = $e, d.PThread = $e, d.wasmMemory = Ce, d.ExitStatus = ku; + }, Pi = d.stackAlloc = function() { + return (Pi = d.stackAlloc = d.asm.stackAlloc).apply(null, arguments); + }, LT = d.dynCall_iijjiiii = function() { + return (LT = d.dynCall_iijjiiii = d.asm.dynCall_iijjiiii).apply(null, arguments); + }, BT = d.dynCall_jiji = function() { + return (BT = d.dynCall_jiji = d.asm.dynCall_jiji).apply(null, arguments); + }, tx = d.__emscripten_allow_main_runtime_queued_calls = 21456; + d.cwrap = en, d.keepRuntimeAlive = zr, d.PThread = _e, d.PThread = _e, d.wasmMemory = Ce, d.ExitStatus = Iu; var zc; - function ku(C) { + function Iu(C) { this.name = "ExitStatus", this.message = "Program terminated with exit(" + C + ")", this.status = C; } as = function C() { - zc || Rf(), zc || (as = C); + zc || Ff(), zc || (as = C); }; - function Rf(C) { - if (C = C || b, tr > 0) + function Ff(C) { + if (C = C || b, nr > 0) return; if (N) { - h(d), fu(), postMessage({ cmd: "loaded" }); + h(d), mu(), postMessage({ cmd: "loaded" }); return; } - if (sn(), tr > 0) + if (sn(), nr > 0) return; function D() { - zc || (zc = true, d.calledRun = true, !at && (fu(), h(d), d.onRuntimeInitialized && d.onRuntimeInitialized(), rh())); + zc || (zc = true, d.calledRun = true, !at && (mu(), h(d), d.onRuntimeInitialized && d.onRuntimeInitialized(), ih())); } d.setStatus ? (d.setStatus("Running..."), setTimeout(function() { setTimeout(function() { @@ -2517,19 +2517,19 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js }, 1), D(); }, 1)) : D(); } - d.run = Rf; - function OT(C, D) { + d.run = Ff; + function VT(C, D) { if (Jt = C, !D && N) throw kc(C), "unwind"; - Pr() || sh(), PT(C); + zr() || ah(), WT(C); } - function PT(C) { - Jt = C, Pr() || ($e.terminateAllThreads(), d.onExit && d.onExit(C), at = true), v(C, new ku(C)); + function WT(C) { + Jt = C, zr() || (_e.terminateAllThreads(), d.onExit && d.onExit(C), at = true), v(C, new Iu(C)); } if (d.preInit) for (typeof d.preInit == "function" && (d.preInit = [d.preInit]); d.preInit.length > 0; ) d.preInit.pop()(); - Rf(); + Ff(); var Mc; m && (Mc = { uncaughtException: process.listeners("uncaughtException").filter(function(C) { return !m.uncaughtException.indexOf(C) > -1; @@ -2544,9 +2544,9 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js else throw new Error("Could not find wasm module in post.js"); if (Mc) { - var zT = Lc._dispose; + var UT = Lc._dispose; Lc._dispose = function() { - zT(), Mc.uncaughtException.forEach(function(C) { + UT(), Mc.uncaughtException.forEach(function(C) { process.removeListener("uncaughtException", C); }), Mc.unhandledRejection.forEach(function(C) { process.removeListener("unhandledRejection", C); @@ -2560,7 +2560,7 @@ var a$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm-threaded-simd.js return n; }) : typeof e == "object" && (e.WasmBackendModuleThreadedSimd = n); } }); -var i$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js"(e, t) { +var p$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js"(e, t) { var n = (() => { var s = typeof document != "undefined" && document.currentScript ? document.currentScript.src : void 0; return typeof __filename != "undefined" && (s = s || __filename), function(r) { @@ -2579,13 +2579,13 @@ var i$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js"(e, t) { } var y, v, x, k; function T(H) { - if (H instanceof xu) + if (H instanceof wu) return; R("exiting due to exception: " + H); } var N, E, A; m ? (f ? g = dd().dirname(g) + "/" : g = __dirname + "/", A = () => { - E || (N = tg(), E = dd()); + E || (N = sg(), E = dd()); }, y = function(J, de) { return A(), J = E.normalize(J), N.readFileSync(J, de ? void 0 : "utf8"); }, x = (H) => { @@ -2596,12 +2596,12 @@ var i$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js"(e, t) { Ie ? de(Ie) : J(Qe.buffer); }); }, process.argv.length > 1 && (p = process.argv[1].replace(/\\/g, "/")), c = process.argv.slice(2), process.on("uncaughtException", function(H) { - if (!(H instanceof xu)) + if (!(H instanceof wu)) throw H; }), process.on("unhandledRejection", function(H) { throw H; }), d = (H, J) => { - if (hu()) + if (fu()) throw process.exitCode = H, J; T(J), process.exit(H); }, a.inspect = function() { @@ -2639,23 +2639,23 @@ var i$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js"(e, t) { for (var Qe = 0; Qe < ze.length; ++Qe) Ze.push(Tt[ze[Qe]]); Ve == "v" ? Ze.push(0) : Ze = Ze.concat([1, Tt[Ve]]), Ze[1] = Ze.length - 2; - var is = new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0].concat(Ze, [2, 7, 1, 1, 101, 1, 102, 0, 0, 7, 5, 1, 1, 102, 0, 0])), os = new WebAssembly.Module(is), Di = new WebAssembly.Instance(os, { e: { f: H } }), Br = Di.exports.f; - return Br; + var is = new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0].concat(Ze, [2, 7, 1, 1, 101, 1, 102, 0, 0, 7, 5, 1, 1, 102, 0, 0])), os = new WebAssembly.Module(is), Oi = new WebAssembly.Instance(os, { e: { f: H } }), Vr = Oi.exports.f; + return Vr; } var W = [], q; function K() { if (W.length) return W.pop(); try { - Js.grow(1); + er.grow(1); } catch (H) { throw H instanceof RangeError ? "Unable to grow wasm table. Set ALLOW_TABLE_GROWTH." : H; } - return Js.length - 1; + return er.length - 1; } function Y(H, J) { for (var de = H; de < H + J; de++) { - var Ie = gu(de); + var Ie = bu(de); Ie && q.set(Ie, de); } } @@ -2664,10 +2664,10 @@ var i$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js"(e, t) { }, ee; a.wasmBinary && (ee = a.wasmBinary); var se = a.noExitRuntime || true; - typeof WebAssembly != "object" && Or("no native wasm support detected"); + typeof WebAssembly != "object" && Pr("no native wasm support detected"); var ne, oe = false, re; function le(H, J) { - H || Or(J); + H || Pr(J); } function me(H) { var J = a["_" + H]; @@ -2675,15 +2675,15 @@ var i$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js"(e, t) { } function ke(H, J, de, Ie, Qe) { var Ze = { string: function(an) { - var nr = 0; + var sr = 0; if (an != null && an !== 0) { var Fc = (an.length << 2) + 1; - nr = vu(Fc), tt(an, nr, Fc); + sr = xu(Fc), tt(an, sr, Fc); } - return nr; + return sr; }, array: function(an) { - var nr = vu(an.length); - return at(an, nr), nr; + var sr = xu(an.length); + return at(an, sr), sr; } }; function Ve(an) { return J === "string" ? Je(an) : J === "boolean" ? Boolean(an) : an; @@ -2691,14 +2691,14 @@ var i$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js"(e, t) { var ze = me(H), Tt = [], is = 0; if (Ie) for (var os = 0; os < Ie.length; os++) { - var Di = Ze[de[os]]; - Di ? (is === 0 && (is = Rc()), Tt[os] = Di(Ie[os])) : Tt[os] = Ie[os]; + var Oi = Ze[de[os]]; + Oi ? (is === 0 && (is = Rc()), Tt[os] = Oi(Ie[os])) : Tt[os] = Ie[os]; } - var Br = ze.apply(null, Tt); - function Tf(an) { + var Vr = ze.apply(null, Tt); + function _f(an) { return is !== 0 && Dc(is), Ve(an); } - return Br = Tf(Br), Br; + return Vr = _f(Vr), Vr; } function Se(H, J, de, Ie) { de = de || []; @@ -2794,63 +2794,63 @@ var i$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js"(e, t) { function Ls(H) { Cn = H, a.HEAP8 = Et = new Int8Array(H), a.HEAP16 = Nn = new Int16Array(H), a.HEAP32 = Yt = new Int32Array(H), a.HEAPU8 = en = new Uint8Array(H), a.HEAPU16 = Tn = new Uint16Array(H), a.HEAPU32 = Dn = new Uint32Array(H), a.HEAPF32 = tn = new Float32Array(H), a.HEAPF64 = Ms = new Float64Array(H); } - var ki = a.INITIAL_MEMORY || 16777216, Js, Bs = [], pu = [], Ii = [], nn = false, ic = false, oc = 0; - function hu() { + var Si = a.INITIAL_MEMORY || 16777216, er, Bs = [], hu = [], Ci = [], nn = false, ic = false, oc = 0; + function fu() { return se || oc > 0; } function uc() { if (a.preRun) for (typeof a.preRun == "function" && (a.preRun = [a.preRun]); a.preRun.length; ) dc(a.preRun.shift()); - mu(Bs); + gu(Bs); } function lc() { - nn = true, mu(pu); + nn = true, gu(hu); } - function Fv() { + function Pv() { ic = true; } function cc() { if (a.postRun) for (typeof a.postRun == "function" && (a.postRun = [a.postRun]); a.postRun.length; ) pc(a.postRun.shift()); - mu(Ii); + gu(Ci); } function dc(H) { Bs.unshift(H); } function rs(H) { - pu.unshift(H); + hu.unshift(H); } function pc(H) { - Ii.unshift(H); + Ci.unshift(H); } - var Fn = 0, Si = null, er = null; - function th(H) { + var Fn = 0, Ni = null, tr = null; + function sh(H) { Fn++, a.monitorRunDependencies && a.monitorRunDependencies(Fn); } function hc(H) { - if (Fn--, a.monitorRunDependencies && a.monitorRunDependencies(Fn), Fn == 0 && (Si !== null && (clearInterval(Si), Si = null), er)) { - var J = er; - er = null, J(); + if (Fn--, a.monitorRunDependencies && a.monitorRunDependencies(Fn), Fn == 0 && (Ni !== null && (clearInterval(Ni), Ni = null), tr)) { + var J = tr; + tr = null, J(); } } a.preloadedImages = {}, a.preloadedAudios = {}; - function Or(H) { + function Pr(H) { a.onAbort && a.onAbort(H), H = "Aborted(" + H + ")", R(H), oe = true, re = 1, H += ". Build with -s ASSERTIONS=1 for more info."; var J = new WebAssembly.RuntimeError(H); throw o(J), J; } - var nh = "data:application/octet-stream;base64,"; + var rh = "data:application/octet-stream;base64,"; function fc(H) { - return H.startsWith(nh); + return H.startsWith(rh); } - function Pr(H) { + function zr(H) { return H.startsWith("file://"); } var sn; sn = "tfjs-backend-wasm.wasm", fc(sn) || (sn = b(sn)); - function fu(H) { + function mu(H) { try { if (H == sn && ee) return new Uint8Array(ee); @@ -2858,18 +2858,18 @@ var i$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js"(e, t) { return x(H); throw "both async and sync fetching of the wasm failed"; } catch (J) { - Or(J); + Pr(J); } } - function sh() { + function ah() { if (!ee && (h || f)) { - if (typeof fetch == "function" && !Pr(sn)) + if (typeof fetch == "function" && !zr(sn)) return fetch(sn, { credentials: "same-origin" }).then(function(H) { if (!H.ok) throw "failed to load wasm binary file at '" + sn + "'"; return H.arrayBuffer(); }).catch(function() { - return fu(sn); + return mu(sn); }); if (v) return new Promise(function(H, J) { @@ -2879,30 +2879,30 @@ var i$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js"(e, t) { }); } return Promise.resolve().then(function() { - return fu(sn); + return mu(sn); }); } - function rh() { - var H = { env: Ti, wasi_snapshot_preview1: Ti }; + function ih() { + var H = { env: _i, wasi_snapshot_preview1: _i }; function J(Ve, ze) { var Tt = Ve.exports; - a.asm = Tt, ne = a.asm.memory, Ls(ne.buffer), Js = a.asm.__indirect_function_table, rs(a.asm.__wasm_call_ctors), hc("wasm-instantiate"); + a.asm = Tt, ne = a.asm.memory, Ls(ne.buffer), er = a.asm.__indirect_function_table, rs(a.asm.__wasm_call_ctors), hc("wasm-instantiate"); } - th("wasm-instantiate"); + sh("wasm-instantiate"); function de(Ve) { J(Ve.instance); } function Ie(Ve) { - return sh().then(function(ze) { + return ah().then(function(ze) { return WebAssembly.instantiate(ze, H); }).then(function(ze) { return ze; }).then(Ve, function(ze) { - R("failed to asynchronously prepare wasm: " + ze), Or(ze); + R("failed to asynchronously prepare wasm: " + ze), Pr(ze); }); } function Qe() { - return !ee && typeof WebAssembly.instantiateStreaming == "function" && !fc(sn) && !Pr(sn) && typeof fetch == "function" ? fetch(sn, { credentials: "same-origin" }).then(function(Ve) { + return !ee && typeof WebAssembly.instantiateStreaming == "function" && !fc(sn) && !zr(sn) && typeof fetch == "function" ? fetch(sn, { credentials: "same-origin" }).then(function(Ve) { var ze = WebAssembly.instantiateStreaming(Ve, H); return ze.then(de, function(Tt) { return R("wasm streaming compile failed: " + Tt), R("falling back to ArrayBuffer instantiation"), Ie(de); @@ -2918,8 +2918,8 @@ var i$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js"(e, t) { } return Qe().catch(o), {}; } - var Ov, Pv; - function mu(H) { + var zv, Mv; + function gu(H) { for (; H.length > 0; ) { var J = H.shift(); if (typeof J == "function") { @@ -2927,10 +2927,10 @@ var i$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js"(e, t) { continue; } var de = J.func; - typeof de == "number" ? J.arg === void 0 ? gu(de)() : gu(de)(J.arg) : de(J.arg === void 0 ? null : J.arg); + typeof de == "number" ? J.arg === void 0 ? bu(de)() : bu(de)(J.arg) : de(J.arg === void 0 ? null : J.arg); } } - function tr(H) { + function nr(H) { return H; } function mc(H) { @@ -2941,11 +2941,11 @@ var i$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js"(e, t) { }); } var as = []; - function gu(H) { + function bu(H) { var J = as[H]; - return J || (H >= as.length && (as.length = H + 1), as[H] = J = Js.get(H)), J; + return J || (H >= as.length && (as.length = H + 1), as[H] = J = er.get(H)), J; } - function zv() { + function Lv() { var H = new Error(); if (!H.stack) { try { @@ -2958,11 +2958,11 @@ var i$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js"(e, t) { } return H.stack.toString(); } - function Ci(H, J) { - Js.set(H, J), as[H] = J; + function Ti(H, J) { + er.set(H, J), as[H] = J; } - function ah() { - Or(""); + function oh() { + Pr(""); } function gc(H, J, de) { en.copyWithin(H, J, J + de); @@ -2991,12 +2991,12 @@ var i$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js"(e, t) { } return false; } - var Ni = { mappings: {}, buffers: [null, [], []], printChar: function(H, J) { - var de = Ni.buffers[H]; + var $i = { mappings: {}, buffers: [null, [], []], printChar: function(H, J) { + var de = $i.buffers[H]; J === 0 || J === 10 ? ((H === 1 ? P : R)(Xe(de, 0)), de.length = 0) : de.push(J); }, varargs: void 0, get: function() { - Ni.varargs += 4; - var H = Yt[Ni.varargs - 4 >> 2]; + $i.varargs += 4; + var H = Yt[$i.varargs - 4 >> 2]; return H; }, getStr: function(H) { var J = Je(H); @@ -3004,240 +3004,240 @@ var i$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js"(e, t) { }, get64: function(H, J) { return H; } }; - function ih(H) { + function uh(H) { return 0; } - function Mv(H, J, de, Ie, Qe) { + function Bv(H, J, de, Ie, Qe) { } - function Lv(H, J, de, Ie) { + function Vv(H, J, de, Ie) { for (var Qe = 0, Ze = 0; Ze < de; Ze++) { var Ve = Yt[J >> 2], ze = Yt[J + 4 >> 2]; J += 8; for (var Tt = 0; Tt < ze; Tt++) - Ni.printChar(H, en[Ve + Tt]); + $i.printChar(H, en[Ve + Tt]); Qe += ze; } return Yt[Ie >> 2] = Qe, 0; } - function oh(H) { + function lh(H) { te(H); } - var vc = false, Ti = { abort: ah, emscripten_memcpy_big: gc, emscripten_resize_heap: yc, fd_close: ih, fd_seek: Mv, fd_write: Lv, setTempRet0: oh }, qN = rh(), Bv = a.___wasm_call_ctors = function() { - return (Bv = a.___wasm_call_ctors = a.asm.__wasm_call_ctors).apply(null, arguments); - }, uh = a._init = function() { - return (uh = a._init = a.asm.init).apply(null, arguments); - }, lh = a._init_with_threads_count = function() { - return (lh = a._init_with_threads_count = a.asm.init_with_threads_count).apply(null, arguments); + var vc = false, _i = { abort: oh, emscripten_memcpy_big: gc, emscripten_resize_heap: yc, fd_close: uh, fd_seek: Bv, fd_write: Vv, setTempRet0: lh }, ZN = ih(), Wv = a.___wasm_call_ctors = function() { + return (Wv = a.___wasm_call_ctors = a.asm.__wasm_call_ctors).apply(null, arguments); + }, ch = a._init = function() { + return (ch = a._init = a.asm.init).apply(null, arguments); + }, dh = a._init_with_threads_count = function() { + return (dh = a._init_with_threads_count = a.asm.init_with_threads_count).apply(null, arguments); }, xc = a._get_threads_count = function() { return (xc = a._get_threads_count = a.asm.get_threads_count).apply(null, arguments); }, wc = a._register_tensor = function() { return (wc = a._register_tensor = a.asm.register_tensor).apply(null, arguments); - }, ch = a._dispose_data = function() { - return (ch = a._dispose_data = a.asm.dispose_data).apply(null, arguments); - }, $e = a._dispose = function() { - return ($e = a._dispose = a.asm.dispose).apply(null, arguments); - }, dh = a._Abs = function() { - return (dh = a._Abs = a.asm.Abs).apply(null, arguments); + }, ph = a._dispose_data = function() { + return (ph = a._dispose_data = a.asm.dispose_data).apply(null, arguments); + }, _e = a._dispose = function() { + return (_e = a._dispose = a.asm.dispose).apply(null, arguments); + }, hh = a._Abs = function() { + return (hh = a._Abs = a.asm.Abs).apply(null, arguments); }, kc = a._Add = function() { return (kc = a._Add = a.asm.Add).apply(null, arguments); - }, zr = a._AddN = function() { - return (zr = a._AddN = a.asm.AddN).apply(null, arguments); - }, $i = a._All = function() { - return ($i = a._All = a.asm.All).apply(null, arguments); - }, ph = a._Any = function() { - return (ph = a._Any = a.asm.Any).apply(null, arguments); - }, Vv = a._ArgMax = function() { - return (Vv = a._ArgMax = a.asm.ArgMax).apply(null, arguments); - }, hh = a._AvgPool = function() { - return (hh = a._AvgPool = a.asm.AvgPool).apply(null, arguments); - }, Wv = a._BatchMatMul = function() { - return (Wv = a._BatchMatMul = a.asm.BatchMatMul).apply(null, arguments); - }, Mr = a._Ceil = function() { - return (Mr = a._Ceil = a.asm.Ceil).apply(null, arguments); - }, fh = a._ClipByValue = function() { - return (fh = a._ClipByValue = a.asm.ClipByValue).apply(null, arguments); - }, mh = a._Conv2D = function() { - return (mh = a._Conv2D = a.asm.Conv2D).apply(null, arguments); - }, gh = a._Conv2DBackpropInput = function() { - return (gh = a._Conv2DBackpropInput = a.asm.Conv2DBackpropInput).apply(null, arguments); - }, bh = a._Cos = function() { - return (bh = a._Cos = a.asm.Cos).apply(null, arguments); - }, yh = a._Cosh = function() { - return (yh = a._Cosh = a.asm.Cosh).apply(null, arguments); - }, vh = a._CropAndResize = function() { - return (vh = a._CropAndResize = a.asm.CropAndResize).apply(null, arguments); + }, Mr = a._AddN = function() { + return (Mr = a._AddN = a.asm.AddN).apply(null, arguments); + }, Ai = a._All = function() { + return (Ai = a._All = a.asm.All).apply(null, arguments); + }, fh = a._Any = function() { + return (fh = a._Any = a.asm.Any).apply(null, arguments); + }, Uv = a._ArgMax = function() { + return (Uv = a._ArgMax = a.asm.ArgMax).apply(null, arguments); + }, mh = a._AvgPool = function() { + return (mh = a._AvgPool = a.asm.AvgPool).apply(null, arguments); + }, Gv = a._BatchMatMul = function() { + return (Gv = a._BatchMatMul = a.asm.BatchMatMul).apply(null, arguments); + }, Lr = a._Ceil = function() { + return (Lr = a._Ceil = a.asm.Ceil).apply(null, arguments); + }, gh = a._ClipByValue = function() { + return (gh = a._ClipByValue = a.asm.ClipByValue).apply(null, arguments); + }, bh = a._Conv2D = function() { + return (bh = a._Conv2D = a.asm.Conv2D).apply(null, arguments); + }, yh = a._Conv2DBackpropInput = function() { + return (yh = a._Conv2DBackpropInput = a.asm.Conv2DBackpropInput).apply(null, arguments); + }, vh = a._Cos = function() { + return (vh = a._Cos = a.asm.Cos).apply(null, arguments); + }, xh = a._Cosh = function() { + return (xh = a._Cosh = a.asm.Cosh).apply(null, arguments); + }, wh = a._CropAndResize = function() { + return (wh = a._CropAndResize = a.asm.CropAndResize).apply(null, arguments); }, Ic = a._Cumprod = function() { return (Ic = a._Cumprod = a.asm.Cumprod).apply(null, arguments); - }, xh = a._Cumsum = function() { - return (xh = a._Cumsum = a.asm.Cumsum).apply(null, arguments); - }, wh = a._DepthToSpace = function() { - return (wh = a._DepthToSpace = a.asm.DepthToSpace).apply(null, arguments); - }, kh = a._DepthwiseConv2dNative = function() { - return (kh = a._DepthwiseConv2dNative = a.asm.DepthwiseConv2dNative).apply(null, arguments); - }, Ih = a._Elu = function() { - return (Ih = a._Elu = a.asm.Elu).apply(null, arguments); - }, Sh = a._Equal = function() { - return (Sh = a._Equal = a.asm.Equal).apply(null, arguments); + }, kh = a._Cumsum = function() { + return (kh = a._Cumsum = a.asm.Cumsum).apply(null, arguments); + }, Ih = a._DepthToSpace = function() { + return (Ih = a._DepthToSpace = a.asm.DepthToSpace).apply(null, arguments); + }, Sh = a._DepthwiseConv2dNative = function() { + return (Sh = a._DepthwiseConv2dNative = a.asm.DepthwiseConv2dNative).apply(null, arguments); + }, Ch = a._Elu = function() { + return (Ch = a._Elu = a.asm.Elu).apply(null, arguments); + }, Nh = a._Equal = function() { + return (Nh = a._Equal = a.asm.Equal).apply(null, arguments); }, Sc = a._Exp = function() { return (Sc = a._Exp = a.asm.Exp).apply(null, arguments); - }, Ch = a._FlipLeftRight = function() { - return (Ch = a._FlipLeftRight = a.asm.FlipLeftRight).apply(null, arguments); - }, Nh = a._Floor = function() { - return (Nh = a._Floor = a.asm.Floor).apply(null, arguments); - }, Lr = a._FloorDiv = function() { - return (Lr = a._FloorDiv = a.asm.FloorDiv).apply(null, arguments); - }, bu = a._FusedBatchNorm = function() { - return (bu = a._FusedBatchNorm = a.asm.FusedBatchNorm).apply(null, arguments); - }, Th = a._FusedConv2D = function() { - return (Th = a._FusedConv2D = a.asm.FusedConv2D).apply(null, arguments); - }, $h = a._FusedDepthwiseConv2D = function() { - return ($h = a._FusedDepthwiseConv2D = a.asm.FusedDepthwiseConv2D).apply(null, arguments); - }, _h = a._Gather = function() { - return (_h = a._Gather = a.asm.Gather).apply(null, arguments); - }, Le = a._GatherNd = function() { - return (Le = a._GatherNd = a.asm.GatherNd).apply(null, arguments); - }, Ah = a._Greater = function() { - return (Ah = a._Greater = a.asm.Greater).apply(null, arguments); - }, Eh = a._GreaterEqual = function() { - return (Eh = a._GreaterEqual = a.asm.GreaterEqual).apply(null, arguments); - }, Rh = a._LeakyRelu = function() { - return (Rh = a._LeakyRelu = a.asm.LeakyRelu).apply(null, arguments); - }, Dh = a._Less = function() { - return (Dh = a._Less = a.asm.Less).apply(null, arguments); - }, Fh = a._LessEqual = function() { - return (Fh = a._LessEqual = a.asm.LessEqual).apply(null, arguments); - }, Oh = a._Log = function() { - return (Oh = a._Log = a.asm.Log).apply(null, arguments); - }, yu = a._LogicalAnd = function() { - return (yu = a._LogicalAnd = a.asm.LogicalAnd).apply(null, arguments); + }, Th = a._FlipLeftRight = function() { + return (Th = a._FlipLeftRight = a.asm.FlipLeftRight).apply(null, arguments); + }, $h = a._Floor = function() { + return ($h = a._Floor = a.asm.Floor).apply(null, arguments); + }, Br = a._FloorDiv = function() { + return (Br = a._FloorDiv = a.asm.FloorDiv).apply(null, arguments); + }, yu = a._FusedBatchNorm = function() { + return (yu = a._FusedBatchNorm = a.asm.FusedBatchNorm).apply(null, arguments); + }, _h = a._FusedConv2D = function() { + return (_h = a._FusedConv2D = a.asm.FusedConv2D).apply(null, arguments); + }, Ah = a._FusedDepthwiseConv2D = function() { + return (Ah = a._FusedDepthwiseConv2D = a.asm.FusedDepthwiseConv2D).apply(null, arguments); + }, Eh = a._Gather = function() { + return (Eh = a._Gather = a.asm.Gather).apply(null, arguments); + }, Be = a._GatherNd = function() { + return (Be = a._GatherNd = a.asm.GatherNd).apply(null, arguments); + }, Rh = a._Greater = function() { + return (Rh = a._Greater = a.asm.Greater).apply(null, arguments); + }, Dh = a._GreaterEqual = function() { + return (Dh = a._GreaterEqual = a.asm.GreaterEqual).apply(null, arguments); + }, Fh = a._LeakyRelu = function() { + return (Fh = a._LeakyRelu = a.asm.LeakyRelu).apply(null, arguments); + }, Oh = a._Less = function() { + return (Oh = a._Less = a.asm.Less).apply(null, arguments); + }, Ph = a._LessEqual = function() { + return (Ph = a._LessEqual = a.asm.LessEqual).apply(null, arguments); + }, zh = a._Log = function() { + return (zh = a._Log = a.asm.Log).apply(null, arguments); + }, vu = a._LogicalAnd = function() { + return (vu = a._LogicalAnd = a.asm.LogicalAnd).apply(null, arguments); }, Cc = a._Max = function() { return (Cc = a._Max = a.asm.Max).apply(null, arguments); }, Nc = a._MaxPool = function() { return (Nc = a._MaxPool = a.asm.MaxPool).apply(null, arguments); - }, Ph = a._Maximum = function() { - return (Ph = a._Maximum = a.asm.Maximum).apply(null, arguments); - }, zh = a._Mean = function() { - return (zh = a._Mean = a.asm.Mean).apply(null, arguments); - }, Mh = a._Min = function() { - return (Mh = a._Min = a.asm.Min).apply(null, arguments); - }, Lh = a._Minimum = function() { - return (Lh = a._Minimum = a.asm.Minimum).apply(null, arguments); - }, Bh = a._MirrorPad = function() { - return (Bh = a._MirrorPad = a.asm.MirrorPad).apply(null, arguments); - }, Vh = a._Multiply = function() { - return (Vh = a._Multiply = a.asm.Multiply).apply(null, arguments); + }, Mh = a._Maximum = function() { + return (Mh = a._Maximum = a.asm.Maximum).apply(null, arguments); + }, Lh = a._Mean = function() { + return (Lh = a._Mean = a.asm.Mean).apply(null, arguments); + }, Bh = a._Min = function() { + return (Bh = a._Min = a.asm.Min).apply(null, arguments); + }, Vh = a._Minimum = function() { + return (Vh = a._Minimum = a.asm.Minimum).apply(null, arguments); + }, Wh = a._MirrorPad = function() { + return (Wh = a._MirrorPad = a.asm.MirrorPad).apply(null, arguments); + }, Uh = a._Multiply = function() { + return (Uh = a._Multiply = a.asm.Multiply).apply(null, arguments); }, gt = a._Neg = function() { return (gt = a._Neg = a.asm.Neg).apply(null, arguments); - }, Wh = a._NonMaxSuppressionV3 = function() { - return (Wh = a._NonMaxSuppressionV3 = a.asm.NonMaxSuppressionV3).apply(null, arguments); - }, Uh = a._NonMaxSuppressionV4 = function() { - return (Uh = a._NonMaxSuppressionV4 = a.asm.NonMaxSuppressionV4).apply(null, arguments); - }, Gh = a._NonMaxSuppressionV5 = function() { - return (Gh = a._NonMaxSuppressionV5 = a.asm.NonMaxSuppressionV5).apply(null, arguments); - }, _i = a._NotEqual = function() { - return (_i = a._NotEqual = a.asm.NotEqual).apply(null, arguments); + }, Gh = a._NonMaxSuppressionV3 = function() { + return (Gh = a._NonMaxSuppressionV3 = a.asm.NonMaxSuppressionV3).apply(null, arguments); + }, Hh = a._NonMaxSuppressionV4 = function() { + return (Hh = a._NonMaxSuppressionV4 = a.asm.NonMaxSuppressionV4).apply(null, arguments); + }, qh = a._NonMaxSuppressionV5 = function() { + return (qh = a._NonMaxSuppressionV5 = a.asm.NonMaxSuppressionV5).apply(null, arguments); + }, Ei = a._NotEqual = function() { + return (Ei = a._NotEqual = a.asm.NotEqual).apply(null, arguments); }, Tc = a._OneHot = function() { return (Tc = a._OneHot = a.asm.OneHot).apply(null, arguments); }, $c = a._PadV2 = function() { return ($c = a._PadV2 = a.asm.PadV2).apply(null, arguments); }, _c = a._Pow = function() { return (_c = a._Pow = a.asm.Pow).apply(null, arguments); - }, Hh = a._Prelu = function() { - return (Hh = a._Prelu = a.asm.Prelu).apply(null, arguments); + }, jh = a._Prelu = function() { + return (jh = a._Prelu = a.asm.Prelu).apply(null, arguments); }, Ac = a._Prod = function() { return (Ac = a._Prod = a.asm.Prod).apply(null, arguments); - }, qh = a._RealDiv = function() { - return (qh = a._RealDiv = a.asm.RealDiv).apply(null, arguments); - }, Uv = a._Relu = function() { - return (Uv = a._Relu = a.asm.Relu).apply(null, arguments); + }, Kh = a._RealDiv = function() { + return (Kh = a._RealDiv = a.asm.RealDiv).apply(null, arguments); + }, Hv = a._Relu = function() { + return (Hv = a._Relu = a.asm.Relu).apply(null, arguments); }, Ec = a._Relu6 = function() { return (Ec = a._Relu6 = a.asm.Relu6).apply(null, arguments); - }, Gv = a._ResizeBilinear = function() { - return (Gv = a._ResizeBilinear = a.asm.ResizeBilinear).apply(null, arguments); - }, jh = a._Reverse = function() { - return (jh = a._Reverse = a.asm.Reverse).apply(null, arguments); - }, Kh = a._RotateWithOffset = function() { - return (Kh = a._RotateWithOffset = a.asm.RotateWithOffset).apply(null, arguments); - }, Xh = a._Round = function() { - return (Xh = a._Round = a.asm.Round).apply(null, arguments); - }, Yh = a._Rsqrt = function() { - return (Yh = a._Rsqrt = a.asm.Rsqrt).apply(null, arguments); - }, Qh = a._ScatterNd = function() { - return (Qh = a._ScatterNd = a.asm.ScatterNd).apply(null, arguments); - }, Zh = a._SelectV2 = function() { - return (Zh = a._SelectV2 = a.asm.SelectV2).apply(null, arguments); - }, Jh = a._Sigmoid = function() { - return (Jh = a._Sigmoid = a.asm.Sigmoid).apply(null, arguments); - }, ef = a._Sin = function() { - return (ef = a._Sin = a.asm.Sin).apply(null, arguments); - }, tf = a._Softmax = function() { - return (tf = a._Softmax = a.asm.Softmax).apply(null, arguments); - }, nf = a._SparseFillEmptyRows = function() { - return (nf = a._SparseFillEmptyRows = a.asm.SparseFillEmptyRows).apply(null, arguments); - }, sf = a._SparseReshape = function() { - return (sf = a._SparseReshape = a.asm.SparseReshape).apply(null, arguments); - }, rf = a._SparseSegmentReduction = function() { - return (rf = a._SparseSegmentReduction = a.asm.SparseSegmentReduction).apply(null, arguments); - }, af = a._Sqrt = function() { - return (af = a._Sqrt = a.asm.Sqrt).apply(null, arguments); - }, of = a._Square = function() { - return (of = a._Square = a.asm.Square).apply(null, arguments); - }, uf = a._SquaredDifference = function() { - return (uf = a._SquaredDifference = a.asm.SquaredDifference).apply(null, arguments); - }, lf = a._Step = function() { - return (lf = a._Step = a.asm.Step).apply(null, arguments); - }, cf = a._StridedSlice = function() { - return (cf = a._StridedSlice = a.asm.StridedSlice).apply(null, arguments); - }, df = a._Sub = function() { - return (df = a._Sub = a.asm.Sub).apply(null, arguments); - }, pf = a._Sum = function() { - return (pf = a._Sum = a.asm.Sum).apply(null, arguments); - }, hf = a._Tan = function() { - return (hf = a._Tan = a.asm.Tan).apply(null, arguments); - }, ff = a._Tanh = function() { - return (ff = a._Tanh = a.asm.Tanh).apply(null, arguments); - }, mf = a._Tile = function() { - return (mf = a._Tile = a.asm.Tile).apply(null, arguments); - }, gf = a._TopK = function() { - return (gf = a._TopK = a.asm.TopK).apply(null, arguments); - }, bf = a._Transform = function() { - return (bf = a._Transform = a.asm.Transform).apply(null, arguments); - }, yf = a._Transpose = function() { - return (yf = a._Transpose = a.asm.Transpose).apply(null, arguments); - }, vf = a.__FusedMatMul = function() { - return (vf = a.__FusedMatMul = a.asm._FusedMatMul).apply(null, arguments); - }, xf = a._malloc = function() { - return (xf = a._malloc = a.asm.malloc).apply(null, arguments); - }, wf = a._free = function() { - return (wf = a._free = a.asm.free).apply(null, arguments); - }, kf = a.___errno_location = function() { - return (kf = a.___errno_location = a.asm.__errno_location).apply(null, arguments); - }, If = a._emscripten_main_thread_process_queued_calls = function() { - return (If = a._emscripten_main_thread_process_queued_calls = a.asm.emscripten_main_thread_process_queued_calls).apply(null, arguments); + }, qv = a._ResizeBilinear = function() { + return (qv = a._ResizeBilinear = a.asm.ResizeBilinear).apply(null, arguments); + }, Xh = a._Reverse = function() { + return (Xh = a._Reverse = a.asm.Reverse).apply(null, arguments); + }, Yh = a._RotateWithOffset = function() { + return (Yh = a._RotateWithOffset = a.asm.RotateWithOffset).apply(null, arguments); + }, Qh = a._Round = function() { + return (Qh = a._Round = a.asm.Round).apply(null, arguments); + }, Zh = a._Rsqrt = function() { + return (Zh = a._Rsqrt = a.asm.Rsqrt).apply(null, arguments); + }, Jh = a._ScatterNd = function() { + return (Jh = a._ScatterNd = a.asm.ScatterNd).apply(null, arguments); + }, ef = a._SelectV2 = function() { + return (ef = a._SelectV2 = a.asm.SelectV2).apply(null, arguments); + }, tf = a._Sigmoid = function() { + return (tf = a._Sigmoid = a.asm.Sigmoid).apply(null, arguments); + }, nf = a._Sin = function() { + return (nf = a._Sin = a.asm.Sin).apply(null, arguments); + }, sf = a._Softmax = function() { + return (sf = a._Softmax = a.asm.Softmax).apply(null, arguments); + }, rf = a._SparseFillEmptyRows = function() { + return (rf = a._SparseFillEmptyRows = a.asm.SparseFillEmptyRows).apply(null, arguments); + }, af = a._SparseReshape = function() { + return (af = a._SparseReshape = a.asm.SparseReshape).apply(null, arguments); + }, of = a._SparseSegmentReduction = function() { + return (of = a._SparseSegmentReduction = a.asm.SparseSegmentReduction).apply(null, arguments); + }, uf = a._Sqrt = function() { + return (uf = a._Sqrt = a.asm.Sqrt).apply(null, arguments); + }, lf = a._Square = function() { + return (lf = a._Square = a.asm.Square).apply(null, arguments); + }, cf = a._SquaredDifference = function() { + return (cf = a._SquaredDifference = a.asm.SquaredDifference).apply(null, arguments); + }, df = a._Step = function() { + return (df = a._Step = a.asm.Step).apply(null, arguments); + }, pf = a._StridedSlice = function() { + return (pf = a._StridedSlice = a.asm.StridedSlice).apply(null, arguments); + }, hf = a._Sub = function() { + return (hf = a._Sub = a.asm.Sub).apply(null, arguments); + }, ff = a._Sum = function() { + return (ff = a._Sum = a.asm.Sum).apply(null, arguments); + }, mf = a._Tan = function() { + return (mf = a._Tan = a.asm.Tan).apply(null, arguments); + }, gf = a._Tanh = function() { + return (gf = a._Tanh = a.asm.Tanh).apply(null, arguments); + }, bf = a._Tile = function() { + return (bf = a._Tile = a.asm.Tile).apply(null, arguments); + }, yf = a._TopK = function() { + return (yf = a._TopK = a.asm.TopK).apply(null, arguments); + }, vf = a._Transform = function() { + return (vf = a._Transform = a.asm.Transform).apply(null, arguments); + }, xf = a._Transpose = function() { + return (xf = a._Transpose = a.asm.Transpose).apply(null, arguments); + }, wf = a.__FusedMatMul = function() { + return (wf = a.__FusedMatMul = a.asm._FusedMatMul).apply(null, arguments); + }, kf = a._malloc = function() { + return (kf = a._malloc = a.asm.malloc).apply(null, arguments); + }, If = a._free = function() { + return (If = a._free = a.asm.free).apply(null, arguments); + }, Sf = a.___errno_location = function() { + return (Sf = a.___errno_location = a.asm.__errno_location).apply(null, arguments); + }, Cf = a._emscripten_main_thread_process_queued_calls = function() { + return (Cf = a._emscripten_main_thread_process_queued_calls = a.asm.emscripten_main_thread_process_queued_calls).apply(null, arguments); }, Rc = a.stackSave = function() { return (Rc = a.stackSave = a.asm.stackSave).apply(null, arguments); }, Dc = a.stackRestore = function() { return (Dc = a.stackRestore = a.asm.stackRestore).apply(null, arguments); - }, vu = a.stackAlloc = function() { - return (vu = a.stackAlloc = a.asm.stackAlloc).apply(null, arguments); - }, Sf = a.dynCall_iijjiiii = function() { - return (Sf = a.dynCall_iijjiiii = a.asm.dynCall_iijjiiii).apply(null, arguments); - }, Cf = a.dynCall_jiji = function() { - return (Cf = a.dynCall_jiji = a.asm.dynCall_jiji).apply(null, arguments); + }, xu = a.stackAlloc = function() { + return (xu = a.stackAlloc = a.asm.stackAlloc).apply(null, arguments); + }, Nf = a.dynCall_iijjiiii = function() { + return (Nf = a.dynCall_iijjiiii = a.asm.dynCall_iijjiiii).apply(null, arguments); + }, Tf = a.dynCall_jiji = function() { + return (Tf = a.dynCall_jiji = a.asm.dynCall_jiji).apply(null, arguments); }; a.cwrap = Se; - var Ai; - function xu(H) { + var Ri; + function wu(H) { this.name = "ExitStatus", this.message = "Program terminated with exit(" + H + ")", this.status = H; } - er = function H() { - Ai || wu(), Ai || (er = H); + tr = function H() { + Ri || ku(), Ri || (tr = H); }; - function wu(H) { + function ku(H) { if (H = H || c, Fn > 0 || (uc(), Fn > 0)) return; function J() { - Ai || (Ai = true, a.calledRun = true, !oe && (lc(), i(a), a.onRuntimeInitialized && a.onRuntimeInitialized(), cc())); + Ri || (Ri = true, a.calledRun = true, !oe && (lc(), i(a), a.onRuntimeInitialized && a.onRuntimeInitialized(), cc())); } a.setStatus ? (a.setStatus("Running..."), setTimeout(function() { setTimeout(function() { @@ -3245,33 +3245,33 @@ var i$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js"(e, t) { }, 1), J(); }, 1)) : J(); } - a.run = wu; - function Hv(H) { - re = H, hu() || (a.onExit && a.onExit(H), oe = true), d(H, new xu(H)); + a.run = ku; + function jv(H) { + re = H, fu() || (a.onExit && a.onExit(H), oe = true), d(H, new wu(H)); } if (a.preInit) for (typeof a.preInit == "function" && (a.preInit = [a.preInit]); a.preInit.length > 0; ) a.preInit.pop()(); - wu(); - var Ei; - u && (Ei = { uncaughtException: process.listeners("uncaughtException").filter(function(H) { + ku(); + var Di; + u && (Di = { uncaughtException: process.listeners("uncaughtException").filter(function(H) { return !u.uncaughtException.indexOf(H) > -1; }), unhandledRejection: process.listeners("unhandledRejection").filter(function(H) { return !u.unhandledRejection.indexOf(H) > -1; }) }); - var Ri; + var Fi; if (typeof r != "undefined") - Ri = r; + Fi = r; else if (typeof WasmBackendModuleThreadedSimd != "undefined") - Ri = WasmBackendModuleThreadedSimd; + Fi = WasmBackendModuleThreadedSimd; else throw new Error("Could not find wasm module in post.js"); - if (Ei) { - var Nf = Ri._dispose; - Ri._dispose = function() { - Nf(), Ei.uncaughtException.forEach(function(H) { + if (Di) { + var $f = Fi._dispose; + Fi._dispose = function() { + $f(), Di.uncaughtException.forEach(function(H) { process.removeListener("uncaughtException", H); - }), Ei.unhandledRejection.forEach(function(H) { + }), Di.unhandledRejection.forEach(function(H) { process.removeListener("unhandledRejection", H); }); }; @@ -3283,9 +3283,9 @@ var i$ = zt({ "src/tfjs-backend-wasm/wasm-out/tfjs-backend-wasm.js"(e, t) { return n; }) : typeof e == "object" && (e.WasmBackendModule = n); } }); -var o$ = 1e-7; -var u$ = 1e-4; -var Ud = class { +var h$ = 1e-7; +var f$ = 1e-4; +var Hd = class { constructor(e, t) { this.backend = e, this.dataMover = t, this.data = /* @__PURE__ */ new WeakMap(), this.dataIdsCount = 0; } @@ -3305,7 +3305,7 @@ var Ud = class { return this.dataIdsCount; } }; -var nl = class { +var sl = class { refCount(e) { return On("refCount"); } @@ -3346,7 +3346,7 @@ var nl = class { return On("floatPrecision"); } epsilon() { - return this.floatPrecision() === 32 ? o$ : u$; + return this.floatPrecision() === 32 ? h$ : f$; } dispose() { return On("dispose"); @@ -3355,39 +3355,39 @@ var nl = class { function On(e) { throw new Error(`'${e}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`); } -function Uw(e) { +function jw(e) { let t = e.length, n = 0; for (; t > 0; ) n = Math.random() * t | 0, t--, pd(e, t, n); } -function l$(e, t) { +function m$(e, t) { if (e.length !== t.length) throw new Error(`Array sizes must match to be shuffled together First array length was ${e.length}Second array length was ${t.length}`); let n = e.length, s = 0; for (; n > 0; ) s = Math.random() * n | 0, n--, pd(e, n, s), pd(t, n, s); } -function Vu(e, t, n) { +function Wu(e, t, n) { return Math.max(e, Math.min(t, n)); } -function c$(e) { +function g$(e) { return e % 2 === 0 ? e : e + 1; } function pd(e, t, n) { let s = e[t]; e[t] = e[n], e[n] = s; } -function d$(e) { +function b$(e) { let t = 0; for (let n = 0; n < e.length; n++) t += e[n]; return t; } -function p$(e, t) { +function y$(e, t) { let n = Math.random(); return t * n + (1 - n) * e; } -function h$(e, t) { +function v$(e, t) { let n = 0; for (let s = 0; s < e.length; s++) { let r = Number(e[s]) - Number(t[s]); @@ -3400,15 +3400,15 @@ function O(e, t) { throw new Error(typeof t == "string" ? t : t()); } function pn(e, t, n = "") { - O(kr(e, t), () => n + ` Shapes ${e} and ${t} must match`); + O(Ir(e, t), () => n + ` Shapes ${e} and ${t} must match`); } -function wa(e) { +function ka(e) { O(e != null, () => "The input to the tensor constructor must be a non-null value."); } -function sa(e, t = [], n = false) { +function ra(e, t = [], n = false) { if (t == null && (t = []), Array.isArray(e) || Qt(e) && !n) for (let s = 0; s < e.length; ++s) - sa(e[s], t, n); + ra(e[s], t, n); else t.push(e); return t; @@ -3421,10 +3421,10 @@ function pt(e) { t *= e[n]; return t; } -function f$(e) { +function x$(e) { return e.length === 0; } -function kr(e, t) { +function Ir(e, t) { if (e === t) return true; if (e == null || t == null || e.length !== t.length) @@ -3434,10 +3434,10 @@ function kr(e, t) { return false; return true; } -function Yi(e) { +function Zi(e) { return e % 1 === 0; } -function m$(e) { +function w$(e) { if (Math.tanh != null) return Math.tanh(e); if (e === 1 / 0) @@ -3449,20 +3449,20 @@ function m$(e) { return (t - 1) / (t + 1); } } -function g$(e) { +function k$(e) { let t = Math.ceil(Math.sqrt(e)); return [t, Math.ceil(e / t)]; } -function b$(e) { +function I$(e) { let t = new Uint32Array(e); for (let n = 0; n < e; ++n) t[n] = n; - return Uw(t), t; + return jw(t), t; } -function zu(e, t) { +function Mu(e, t) { return t <= e.length ? e : e + " ".repeat(t - e.length); } -function y$(e, t = (s) => 0, n) { +function S$(e, t = (s) => 0, n) { return new Promise((s, r) => { let a = 0, i = () => { if (e()) { @@ -3480,7 +3480,7 @@ function y$(e, t = (s) => 0, n) { i(); }); } -function v$(e, t) { +function C$(e, t) { let n = 1, s = -1; for (let a = 0; a < e.length; ++a) if (e[a] >= 0) @@ -3505,9 +3505,9 @@ function v$(e, t) { } function ts(e, t) { let n = t.length; - return e = e == null ? t.map((s, r) => r) : [].concat(e), O(e.every((s) => s >= -n && s < n), () => `All values in axis param must be in range [-${n}, ${n}) but got axis ${e}`), O(e.every((s) => Yi(s)), () => `All values in axis param must be integers but got axis ${e}`), e.map((s) => s < 0 ? n + s : s); + return e = e == null ? t.map((s, r) => r) : [].concat(e), O(e.every((s) => s >= -n && s < n), () => `All values in axis param must be in range [-${n}, ${n}) but got axis ${e}`), O(e.every((s) => Zi(s)), () => `All values in axis param must be integers but got axis ${e}`), e.map((s) => s < 0 ? n + s : s); } -function Gw(e, t) { +function Kw(e, t) { let n = [], s = [], r = t != null && Array.isArray(t) && t.length === 0, a = t == null || r ? null : ts(t, e).sort(), i = 0; for (let o = 0; o < e.length; ++o) { if (a != null) { @@ -3519,7 +3519,7 @@ function Gw(e, t) { } return { newShape: n, keptDims: s }; } -function Hw(e, t) { +function Xw(e, t) { let n = null; if (e == null || e === "float32") n = new Float32Array(t); @@ -3531,7 +3531,7 @@ function Hw(e, t) { throw new Error(`Unknown data type ${e}`); return n; } -function qw(e, t) { +function Yw(e, t) { let n = null; if (e == null || e === "float32") n = new Float32Array(t); @@ -3545,23 +3545,23 @@ function qw(e, t) { throw new Error(`Unknown data type ${e}`); return n; } -function jw(e, t) { +function Qw(e, t) { for (let n = 0; n < e.length; n++) { let s = e[n]; if (isNaN(s) || !isFinite(s)) throw Error(`A tensor of type ${t} being uploaded contains ${s}.`); } } -function Kw(e) { +function Zw(e) { return e === "bool" || e === "complex64" || e === "float32" || e === "int32" || e === "string"; } -function x$(e, t) { +function N$(e, t) { return !(t === "complex64" || t === "float32" && e !== "complex64" || t === "int32" && e !== "float32" && e !== "complex64" || t === "bool" && e === "bool"); } function Qt(e) { return e instanceof Float32Array || e instanceof Int32Array || e instanceof Uint8Array || e instanceof Uint8ClampedArray; } -function Xf(e) { +function Yf(e) { if (e === "float32" || e === "int32") return 4; if (e === "complex64") @@ -3570,25 +3570,25 @@ function Xf(e) { return 1; throw new Error(`Unknown dtype ${e}`); } -function Xw(e) { +function Jw(e) { if (e == null) return 0; let t = 0; return e.forEach((n) => t += n.length), t; } -function ir(e) { +function or(e) { return typeof e == "string" || e instanceof String; } -function Yw(e) { +function ek(e) { return typeof e == "boolean"; } -function Qw(e) { +function tk(e) { return typeof e == "number"; } -function Gd(e) { - return Array.isArray(e) ? Gd(e[0]) : e instanceof Float32Array ? "float32" : e instanceof Int32Array || e instanceof Uint8Array || e instanceof Uint8ClampedArray ? "int32" : Qw(e) ? "float32" : ir(e) ? "string" : Yw(e) ? "bool" : "float32"; +function qd(e) { + return Array.isArray(e) ? qd(e[0]) : e instanceof Float32Array ? "float32" : e instanceof Int32Array || e instanceof Uint8Array || e instanceof Uint8ClampedArray ? "int32" : tk(e) ? "float32" : or(e) ? "string" : ek(e) ? "bool" : "float32"; } -function hr(e) { +function fr(e) { return !!(e && e.constructor && e.call && e.apply); } function hd(e, t) { @@ -3597,7 +3597,7 @@ function hd(e, t) { return n; return e; } -function ao(e) { +function oo(e) { let t = e.length; if (t < 2) return []; @@ -3607,7 +3607,7 @@ function ao(e) { n[s] = n[s + 1] * e[s + 1]; return n; } -function Zw(e, t, n, s = false) { +function nk(e, t, n, s = false) { let r = new Array(); if (t.length === 1) { let a = t[0] * (s ? 2 : 1); @@ -3616,11 +3616,11 @@ function Zw(e, t, n, s = false) { } else { let a = t[0], i = t.slice(1), o = i.reduce((u, l) => u * l) * (s ? 2 : 1); for (let u = 0; u < a; u++) - r[u] = Zw(e + u * o, i, n, s); + r[u] = nk(e + u * o, i, n, s); } return r; } -function Hi(e, t, n = false) { +function ji(e, t, n = false) { if (e.length === 0) return t[0]; let s = e.reduce((r, a) => r * a) * (n ? 2 : 1); @@ -3628,15 +3628,15 @@ function Hi(e, t, n = false) { return []; if (s !== t.length) throw new Error(`[${e}] does not match the input size ${t.length}${n ? " for a complex tensor" : ""}.`); - return Zw(0, e, t, n); + return nk(0, e, t, n); } -function ng(e, t) { - let n = Hd(e, t); +function rg(e, t) { + let n = jd(e, t); for (let s = 0; s < n.length; s++) n[s] = 1; return n; } -function Hd(e, t) { +function jd(e, t) { if (t == null || t === "float32" || t === "complex64") return new Float32Array(e); if (t === "int32") @@ -3645,22 +3645,22 @@ function Hd(e, t) { return new Uint8Array(e); throw new Error(`Unknown data type ${t}`); } -function w$(e, t) { +function T$(e, t) { let n = e.reduce((s, r) => s * r, 1); if (t == null || t === "float32") - return Hi(e, new Float32Array(n)); + return ji(e, new Float32Array(n)); if (t === "int32") - return Hi(e, new Int32Array(n)); + return ji(e, new Int32Array(n)); if (t === "bool") - return Hi(e, new Uint8Array(n)); + return ji(e, new Uint8Array(n)); throw new Error(`Unknown data type ${t}`); } -function sg(e) { +function ag(e) { e.forEach((t) => { O(Number.isInteger(t) && t >= 0, () => `Tensor must have a shape comprised of positive integers but got shape [${e}].`); }); } -function k$(e, t, n) { +function $$(e, t, n) { if (t === 0) return 0; if (t === 1) @@ -3670,7 +3670,7 @@ function k$(e, t, n) { s += n[r] * e[r]; return s; } -function I$(e, t, n) { +function _$(e, t, n) { if (t === 0) return []; if (t === 1) @@ -3680,13 +3680,13 @@ function I$(e, t, n) { s[r] = Math.floor(e / n[r]), e -= s[r] * n[r]; return s[s.length - 1] = e, s; } -function rg(e) { +function ig(e) { return e && e.then && typeof e.then == "function"; } -var tx = "tfjsflags"; -var S$ = class { +var sx = "tfjsflags"; +var A$ = class { constructor(e) { - this.global = e, this.flags = {}, this.flagRegistry = {}, this.urlFlags = {}, this.getQueryParams = C$, this.populateURLFlags(); + this.global = e, this.flags = {}, this.flagRegistry = {}, this.urlFlags = {}, this.getQueryParams = E$, this.populateURLFlags(); } setPlatform(e, t) { this.platform != null && (X().getBool("IS_TEST") || X().getBool("PROD") || console.warn(`Platform ${this.platformName} has already been set. Overwriting the platform with ${e}.`)), this.platformName = e, this.platform = t; @@ -3704,7 +3704,7 @@ var S$ = class { if (e in this.flags) return this.flags[e]; let t = this.evaluateFlag(e); - if (rg(t)) + if (ig(t)) throw new Error(`Flag ${e} cannot be synchronously evaluated. Please use getAsync() instead.`); return this.flags[e] = t, this.flags[e]; } @@ -3740,20 +3740,20 @@ var S$ = class { if (typeof this.global == "undefined" || typeof this.global.location == "undefined" || typeof this.global.location.search == "undefined") return; let e = this.getQueryParams(this.global.location.search); - tx in e && e[tx].split(",").forEach((n) => { + sx in e && e[sx].split(",").forEach((n) => { let [s, r] = n.split(":"); - this.urlFlags[s] = T$(s, r); + this.urlFlags[s] = D$(s, r); }); } }; -function C$(e) { +function E$(e) { let t = {}; - return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (n, ...s) => (N$(t, s[0], s[1]), s.join("="))), t; + return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (n, ...s) => (R$(t, s[0], s[1]), s.join("="))), t; } -function N$(e, t, n) { +function R$(e, t, n) { e[decodeURIComponent(t)] = decodeURIComponent(n || ""); } -function T$(e, t) { +function D$(e, t) { if (t = t.toLowerCase(), t === "true" || t === "false") return t === "true"; if (`${+t}` === t) @@ -3761,15 +3761,15 @@ function T$(e, t) { throw new Error(`Could not parse value flag value ${t} for flag ${e}.`); } function X() { - return Jw; + return sk; } -var Jw = null; -function $$(e) { - Jw = e; +var sk = null; +function F$(e) { + sk = e; } -var Df; -function ek() { - if (Df == null) { +var Of; +function rk() { + if (Of == null) { let e; if (typeof window != "undefined") e = window; @@ -3781,16 +3781,16 @@ function ek() { e = self; else throw new Error("Could not find a global object"); - Df = e; + Of = e; } - return Df; + return Of; } -function _$() { - let e = ek(); +function O$() { + let e = rk(); return e._tfGlobals == null && (e._tfGlobals = /* @__PURE__ */ new Map()), e._tfGlobals; } -function ag(e, t) { - let n = _$(); +function og(e, t) { + let n = O$(); if (n.has(e)) return n.get(e); { @@ -3798,191 +3798,191 @@ function ag(e, t) { return n.set(e, s), n.get(e); } } -var io = "Abs"; -var sl = "Acos"; -var rl = "Acosh"; -var Ir = "Add"; -var ka = "AddN"; -var al = "All"; -var il = "Any"; -var Ia = "ArgMax"; -var ol = "ArgMin"; -var ul = "Asin"; -var ll = "Asinh"; -var cl = "Atan"; -var dl = "Atanh"; -var pl = "Atan2"; -var Sa = "AvgPool"; -var ig = "AvgPoolGrad"; -var qd = "AvgPool3D"; -var og = "AvgPool3DGrad"; -var Ca = "BatchMatMul"; -var oo = "BatchToSpaceND"; -var ug = "Bincount"; -var A$ = "BroadcastTo"; -var lg = "BroadcastArgs"; -var Na = "Cast"; -var Ta = "Ceil"; -var Sr = "ClipByValue"; -var jd = "Complex"; -var Kd = "ComplexAbs"; -var uo = "Concat"; -var $a = "Conv2D"; -var cg = "Conv2DBackpropFilter"; -var _a = "Conv2DBackpropInput"; -var Xd = "Conv3D"; -var dg = "Conv3DBackpropFilterV2"; -var pg = "Conv3DBackpropInputV2"; -var Aa = "Cos"; -var Ea = "Cosh"; -var hl = "Cumprod"; -var lo = "Cumsum"; -var co = "CropAndResize"; -var hg = "DenseBincount"; -var po = "DepthToSpace"; -var Ra = "DepthwiseConv2dNative"; -var fg = "DepthwiseConv2dNativeBackpropFilter"; -var mg = "DepthwiseConv2dNativeBackpropInput"; -var gg = "Diag"; -var Yd = "Dilation2D"; -var Yf = "Dilation2DBackpropInput"; -var Qf = "Dilation2DBackpropFilter"; -var Da = "RealDiv"; -var Qd = "Einsum"; -var Fa = "Elu"; -var bg = "EluGrad"; +var uo = "Abs"; +var rl = "Acos"; +var al = "Acosh"; +var Sr = "Add"; +var Ia = "AddN"; +var il = "All"; +var ol = "Any"; +var Sa = "ArgMax"; +var ul = "ArgMin"; +var ll = "Asin"; +var cl = "Asinh"; +var dl = "Atan"; +var pl = "Atanh"; +var hl = "Atan2"; +var Ca = "AvgPool"; +var ug = "AvgPoolGrad"; +var Kd = "AvgPool3D"; +var lg = "AvgPool3DGrad"; +var Na = "BatchMatMul"; +var lo = "BatchToSpaceND"; +var cg = "Bincount"; +var P$ = "BroadcastTo"; +var dg = "BroadcastArgs"; +var Ta = "Cast"; +var $a = "Ceil"; +var Cr = "ClipByValue"; +var Xd = "Complex"; +var Yd = "ComplexAbs"; +var co = "Concat"; +var _a = "Conv2D"; +var pg = "Conv2DBackpropFilter"; +var Aa = "Conv2DBackpropInput"; +var Qd = "Conv3D"; +var hg = "Conv3DBackpropFilterV2"; +var fg = "Conv3DBackpropInputV2"; +var Ea = "Cos"; +var Ra = "Cosh"; +var po = "Cumprod"; +var Da = "Cumsum"; +var ho = "CropAndResize"; +var mg = "DenseBincount"; +var fo = "DepthToSpace"; +var Fa = "DepthwiseConv2dNative"; +var gg = "DepthwiseConv2dNativeBackpropFilter"; +var bg = "DepthwiseConv2dNativeBackpropInput"; +var yg = "Diag"; +var Zd = "Dilation2D"; +var Qf = "Dilation2DBackpropInput"; +var Zf = "Dilation2DBackpropFilter"; +var Oa = "RealDiv"; +var Jd = "Einsum"; +var Pa = "Elu"; +var vg = "EluGrad"; var fl = "Erf"; -var ho = "Equal"; -var Oa = "Exp"; -var fo = "ExpandDims"; -var mo = "Expm1"; -var yg = "FFT"; +var mo = "Equal"; +var za = "Exp"; +var go = "ExpandDims"; +var bo = "Expm1"; +var xg = "FFT"; var ml = "Fill"; -var go = "FlipLeftRight"; -var Pa = "Floor"; -var za = "FloorDiv"; -var Ma = "FusedBatchNorm"; -var bo = "GatherV2"; -var yo = "GatherNd"; -var vo = "Greater"; -var La = "GreaterEqual"; -var Ba = "Identity"; -var vg = "IFFT"; -var Zd = "Imag"; +var yo = "FlipLeftRight"; +var Ma = "Floor"; +var La = "FloorDiv"; +var Ba = "FusedBatchNorm"; +var vo = "GatherV2"; +var xo = "GatherNd"; +var wo = "Greater"; +var Va = "GreaterEqual"; +var Wa = "Identity"; +var wg = "IFFT"; +var ep = "Imag"; var gl = "IsFinite"; var bl = "IsInf"; var yl = "IsNan"; -var Va = "LeakyRelu"; -var xo = "Less"; -var wo = "LessEqual"; -var xg = "LinSpace"; -var Wa = "Log"; +var Ua = "LeakyRelu"; +var ko = "Less"; +var Io = "LessEqual"; +var kg = "LinSpace"; +var Ga = "Log"; var vl = "Log1p"; -var ko = "LogicalAnd"; +var So = "LogicalAnd"; var xl = "LogicalNot"; -var Jd = "LogicalOr"; -var E$ = "LogSoftmax"; -var ep = "LRN"; -var wg = "LRNGrad"; -var Ua = "Max"; -var Ga = "Maximum"; -var Ha = "MaxPool"; -var kg = "MaxPoolGrad"; -var tp = "MaxPool3D"; -var Ig = "MaxPool3DGrad"; -var Sg = "MaxPoolWithArgmax"; -var qa = "Mean"; -var ja = "Min"; -var Ka = "Minimum"; -var Xa = "MirrorPad"; +var tp = "LogicalOr"; +var z$ = "LogSoftmax"; +var np = "LRN"; +var Ig = "LRNGrad"; +var Ha = "Max"; +var qa = "Maximum"; +var ja = "MaxPool"; +var Sg = "MaxPoolGrad"; +var sp = "MaxPool3D"; +var Cg = "MaxPool3DGrad"; +var Ng = "MaxPoolWithArgmax"; +var Ka = "Mean"; +var Xa = "Min"; +var Ya = "Minimum"; +var Qa = "MirrorPad"; var wl = "Mod"; -var Cg = "Multinomial"; -var Ya = "Multiply"; -var Io = "Neg"; -var So = "NotEqual"; -var Co = "NonMaxSuppressionV3"; +var Tg = "Multinomial"; +var Za = "Multiply"; +var Co = "Neg"; +var No = "NotEqual"; +var To = "NonMaxSuppressionV3"; var kl = "NonMaxSuppressionV4"; -var No = "NonMaxSuppressionV5"; -var To = "OnesLike"; -var $o = "OneHot"; -var _o = "Pack"; -var Qa = "PadV2"; -var $de = "Pool"; -var Za = "Pow"; -var Ja = "Prelu"; -var Ao = "Prod"; +var $o = "NonMaxSuppressionV5"; +var _o = "OnesLike"; +var Ao = "OneHot"; +var Eo = "Pack"; +var Ja = "PadV2"; +var Wde = "Pool"; +var ei = "Pow"; +var ti = "Prelu"; +var ni = "Prod"; var Il = "Range"; -var np = "Real"; +var rp = "Real"; var Sl = "Reciprocal"; -var ei = "Relu"; -var Eo = "Reshape"; +var si = "Relu"; +var Ro = "Reshape"; var Cl = "ResizeNearestNeighbor"; -var Ng = "ResizeNearestNeighborGrad"; -var ti = "ResizeBilinear"; -var Tg = "ResizeBilinearGrad"; -var ni = "Relu6"; -var Ro = "Reverse"; -var Do = "Round"; -var si = "Rsqrt"; -var Fo = "ScatterNd"; -var Oo = "Select"; +var $g = "ResizeNearestNeighborGrad"; +var ri = "ResizeBilinear"; +var _g = "ResizeBilinearGrad"; +var ai = "Relu6"; +var Do = "Reverse"; +var Fo = "Round"; +var ii = "Rsqrt"; +var Oo = "ScatterNd"; +var Po = "Select"; var Nl = "Selu"; -var Po = "Slice"; -var ri = "Sin"; -var zo = "Sinh"; +var zo = "Slice"; +var oi = "Sin"; +var Mo = "Sinh"; var Tl = "Sign"; -var ai = "Sigmoid"; +var ui = "Sigmoid"; var $l = "Softplus"; -var ii = "Sqrt"; -var oi = "Sum"; -var Mo = "SpaceToBatchND"; -var Lo = "SplitV"; -var ui = "Softmax"; -var sp = "SparseFillEmptyRows"; +var li = "Sqrt"; +var ci = "Sum"; +var Lo = "SpaceToBatchND"; +var Bo = "SplitV"; +var di = "Softmax"; +var ap = "SparseFillEmptyRows"; var _l = "SparseReshape"; -var rp = "SparseSegmentMean"; -var ap = "SparseSegmentSum"; -var ip = "SparseToDense"; -var li = "SquaredDifference"; +var ip = "SparseSegmentMean"; +var op = "SparseSegmentSum"; +var up = "SparseToDense"; +var pi = "SquaredDifference"; var Al = "Square"; -var Bo = "StridedSlice"; -var op = "StringNGrams"; -var $g = "StringSplit"; -var _g = "StringToHashBucketFast"; -var ci = "Sub"; -var Vo = "Tan"; -var di = "Tanh"; -var Cr = "Tile"; -var Wo = "TopK"; -var Uo = "Transform"; -var pi = "Transpose"; -var Ag = "Unique"; -var Go = "Unpack"; -var up = "UnsortedSegmentSum"; -var Ho = "ZerosLike"; -var hi = "Step"; +var Vo = "StridedSlice"; +var lp = "StringNGrams"; +var Ag = "StringSplit"; +var Eg = "StringToHashBucketFast"; +var hi = "Sub"; +var Wo = "Tan"; +var fi = "Tanh"; +var Nr = "Tile"; +var Uo = "TopK"; +var Go = "Transform"; +var mi = "Transpose"; +var Rg = "Unique"; +var Ho = "Unpack"; +var cp = "UnsortedSegmentSum"; +var qo = "ZerosLike"; +var gi = "Step"; var fd = "FromPixels"; -var qo = "RotateWithOffset"; -var ra = "_FusedMatMul"; -var aa = "FusedConv2D"; -var ia = "FusedDepthwiseConv2D"; -function ar(...e) { +var jo = "RotateWithOffset"; +var aa = "_FusedMatMul"; +var ia = "FusedConv2D"; +var oa = "FusedDepthwiseConv2D"; +function ir(...e) { X().getBool("IS_TEST") || X().getBool("PROD") || console.warn(...e); } -function R$(...e) { +function M$(...e) { X().getBool("IS_TEST") || X().getBool("PROD") || console.log(...e); } -var Qi = ag("kernelRegistry", () => /* @__PURE__ */ new Map()); -var Wu = ag("gradRegistry", () => /* @__PURE__ */ new Map()); -function Zf(e, t) { - let n = Eg(e, t); - return Qi.get(n); +var Ji = og("kernelRegistry", () => /* @__PURE__ */ new Map()); +var Uu = og("gradRegistry", () => /* @__PURE__ */ new Map()); +function Jf(e, t) { + let n = Dg(e, t); + return Ji.get(n); } -function nx(e) { - return Wu.get(e); +function rx(e) { + return Uu.get(e); } -function Jf(e) { - let t = Qi.entries(), n = []; +function em(e) { + let t = Ji.entries(), n = []; for (; ; ) { let { done: s, value: r } = t.next(); if (s) @@ -3993,121 +3993,121 @@ function Jf(e) { return n; } function El(e) { - let { kernelName: t, backendName: n } = e, s = Eg(t, n); - Qi.has(s) && ar(`The kernel '${t}' for backend '${n}' is already registered`), Qi.set(s, e); + let { kernelName: t, backendName: n } = e, s = Dg(t, n); + Ji.has(s) && ir(`The kernel '${t}' for backend '${n}' is already registered`), Ji.set(s, e); } -function D$(e) { +function L$(e) { let { kernelName: t } = e; - Wu.has(t) && X().getBool("DEBUG") && ar(`Overriding the gradient for '${t}'`), Wu.set(t, e); + Uu.has(t) && X().getBool("DEBUG") && ir(`Overriding the gradient for '${t}'`), Uu.set(t, e); } -function _de(e, t) { - let n = Eg(e, t); - if (!Qi.has(n)) +function Ude(e, t) { + let n = Dg(e, t); + if (!Ji.has(n)) throw new Error(`The kernel '${e}' for backend '${t}' is not registered`); - Qi.delete(n); + Ji.delete(n); } -function Ade(e) { - if (!Wu.has(e)) +function Gde(e) { + if (!Uu.has(e)) throw new Error(`The gradient '${e}' for backend is not registered`); - Wu.delete(e); + Uu.delete(e); } -function Ede(e, t) { - Jf(e).forEach((s) => { +function Hde(e, t) { + em(e).forEach((s) => { let r = Object.assign({}, s, { backendName: t }); El(r); }); } -function Eg(e, t) { +function Dg(e, t) { return `${t}_${e}`; } var w = {}; -Ae(w, { arraysEqual: () => kr, assert: () => O, assertNonNegativeIntegerDimensions: () => sg, assertNonNull: () => wa, assertShapesMatch: () => pn, bytesFromStringArray: () => Xw, bytesPerElement: () => Xf, checkConversionForErrors: () => jw, clamp: () => Vu, computeStrides: () => ao, createScalarValue: () => L$, createShuffledIndices: () => b$, decodeString: () => md, distSquared: () => h$, encodeString: () => Dl, fetch: () => V$, fingerPrint64: () => M$, flatten: () => sa, getArrayFromDType: () => qw, getTypedArrayFromDType: () => Hw, hasEncodingLoss: () => x$, hexToLong: () => Rl, indexToLoc: () => I$, inferDtype: () => Gd, inferFromImplicitShape: () => v$, isBoolean: () => Yw, isFunction: () => hr, isInt: () => Yi, isNumber: () => Qw, isPromise: () => rg, isScalarShape: () => f$, isString: () => ir, isTypedArray: () => Qt, isValidDtype: () => Kw, locToIndex: () => k$, makeOnesTypedArray: () => ng, makeZerosNestedTypedArray: () => w$, makeZerosTypedArray: () => Hd, nearestDivisor: () => hd, nearestLargerEven: () => c$, now: () => Uu, parseAxisParam: () => ts, randUniform: () => p$, repeatedTry: () => y$, rightPad: () => zu, shuffle: () => Uw, shuffleCombo: () => l$, sizeFromShape: () => pt, sizeToSquarishShape: () => g$, squeezeShape: () => Gw, sum: () => d$, swap: () => pd, tanh: () => m$, toNestedArray: () => Hi, toTypedArray: () => lp }); -var sx = xa(HT()); -var qr = sx.default || sx; +Ae(w, { arraysEqual: () => Ir, assert: () => O, assertNonNegativeIntegerDimensions: () => ag, assertNonNull: () => ka, assertShapesMatch: () => pn, bytesFromStringArray: () => Jw, bytesPerElement: () => Yf, checkConversionForErrors: () => Qw, clamp: () => Wu, computeStrides: () => oo, createScalarValue: () => H$, createShuffledIndices: () => I$, decodeString: () => md, distSquared: () => v$, encodeString: () => Dl, fetch: () => j$, fingerPrint64: () => G$, flatten: () => ra, getArrayFromDType: () => Yw, getTypedArrayFromDType: () => Xw, hasEncodingLoss: () => N$, hexToLong: () => Rl, indexToLoc: () => _$, inferDtype: () => qd, inferFromImplicitShape: () => C$, isBoolean: () => ek, isFunction: () => fr, isInt: () => Zi, isNumber: () => tk, isPromise: () => ig, isScalarShape: () => x$, isString: () => or, isTypedArray: () => Qt, isValidDtype: () => Zw, locToIndex: () => $$, makeOnesTypedArray: () => rg, makeZerosNestedTypedArray: () => T$, makeZerosTypedArray: () => jd, nearestDivisor: () => hd, nearestLargerEven: () => g$, now: () => Gu, parseAxisParam: () => ts, randUniform: () => y$, repeatedTry: () => S$, rightPad: () => Mu, shuffle: () => jw, shuffleCombo: () => m$, sizeFromShape: () => pt, sizeToSquarishShape: () => k$, squeezeShape: () => Kw, sum: () => b$, swap: () => pd, tanh: () => w$, toNestedArray: () => ji, toTypedArray: () => dp }); +var ax = wa(QT()); +var jr = ax.default || ax; function Rl(e) { - return qr.fromString(e, true, 16); + return jr.fromString(e, true, 16); } -var tk = Rl("c3a5c85c97cb3127"); -var Gr = Rl("b492b66fbe98f273"); +var ak = Rl("c3a5c85c97cb3127"); +var Hr = Rl("b492b66fbe98f273"); var on = Rl("9ae16a3b2f90404f"); -function em(e) { +function tm(e) { return e.xor(e.shru(47)); } -function nk(e, t, n) { +function ik(e, t, n) { let s = e.slice(t, t + n); - return qr.fromBytes(Array.from(s), true, true); + return jr.fromBytes(Array.from(s), true, true); } function lt(e, t) { - return nk(e, t, 8); + return ik(e, t, 8); } -function rx(e, t) { - return nk(e, t, 4); +function ix(e, t) { + return ik(e, t, 4); } function Lt(e, t) { return t === 0 ? e : e.shru(t).or(e.shl(64 - t)); } -function ur(e, t, n = Rl("9ddfea08eb382d69")) { +function lr(e, t, n = Rl("9ddfea08eb382d69")) { let s = e.xor(t).mul(n); s = s.xor(s.shru(47)); let r = t.xor(s).mul(n); return r = r.xor(r.shru(47)), r = r.mul(n), r; } -function F$(e, t, n, s, r, a) { +function B$(e, t, n, s, r, a) { r = r.add(e), a = Lt(a.add(r).add(s), 21); let i = r; return r = r.add(t), r = r.add(n), a = a.add(Lt(r, 44)), [r.add(s), a.add(i)]; } function Vc(e, t, n, s) { - return F$(lt(e, t), lt(e, t + 8), lt(e, t + 16), lt(e, t + 24), n, s); + return B$(lt(e, t), lt(e, t + 8), lt(e, t + 16), lt(e, t + 24), n, s); } -function O$(e, t = e.length) { +function V$(e, t = e.length) { if (t >= 8) { let n = on.add(t * 2), s = lt(e, 0).add(on), r = lt(e, t - 8), a = Lt(r, 37).mul(n).add(s), i = Lt(s, 25).add(r).mul(n); - return ur(a, i, n); + return lr(a, i, n); } if (t >= 4) { - let n = on.add(t * 2), s = rx(e, 0); - return ur(s.shl(3).add(t), rx(e, t - 4), n); + let n = on.add(t * 2), s = ix(e, 0); + return lr(s.shl(3).add(t), ix(e, t - 4), n); } if (t > 0) { let n = e[0], s = e[t >> 1], r = e[t - 1], a = n + (s << 8), i = t + (r << 2); - return em(on.mul(a).xor(tk.mul(i))).mul(on); + return tm(on.mul(a).xor(ak.mul(i))).mul(on); } return on; } -function P$(e, t = e.length) { - let n = on.add(t * 2), s = lt(e, 0).mul(Gr), r = lt(e, 8), a = lt(e, t - 8).mul(n), i = lt(e, t - 16).mul(on); - return ur(Lt(s.add(r), 43).add(Lt(a, 30)).add(i), s.add(Lt(r.add(on), 18)).add(a), n); +function W$(e, t = e.length) { + let n = on.add(t * 2), s = lt(e, 0).mul(Hr), r = lt(e, 8), a = lt(e, t - 8).mul(n), i = lt(e, t - 16).mul(on); + return lr(Lt(s.add(r), 43).add(Lt(a, 30)).add(i), s.add(Lt(r.add(on), 18)).add(a), n); } -function z$(e, t = e.length) { - let n = on.add(t * 2), s = lt(e, 0).mul(on), r = lt(e, 8), a = lt(e, t - 8).mul(n), i = lt(e, t - 16).mul(on), o = Lt(s.add(r), 43).add(Lt(a, 30)).add(i), u = ur(o, s.add(Lt(r.add(on), 18)).add(a), n), l = lt(e, 16).mul(n), c = lt(e, 24), p = o.add(lt(e, t - 32)).mul(n), d = u.add(lt(e, t - 24)).mul(n); - return ur(Lt(l.add(c), 43).add(Lt(p, 30)).add(d), l.add(Lt(c.add(s), 18)).add(p), n); +function U$(e, t = e.length) { + let n = on.add(t * 2), s = lt(e, 0).mul(on), r = lt(e, 8), a = lt(e, t - 8).mul(n), i = lt(e, t - 16).mul(on), o = Lt(s.add(r), 43).add(Lt(a, 30)).add(i), u = lr(o, s.add(Lt(r.add(on), 18)).add(a), n), l = lt(e, 16).mul(n), c = lt(e, 24), p = o.add(lt(e, t - 32)).mul(n), d = u.add(lt(e, t - 24)).mul(n); + return lr(Lt(l.add(c), 43).add(Lt(p, 30)).add(d), l.add(Lt(c.add(s), 18)).add(p), n); } -function M$(e, t = e.length) { - let n = qr.fromNumber(81, true); +function G$(e, t = e.length) { + let n = jr.fromNumber(81, true); if (t <= 32) - return t <= 16 ? O$(e, t) : P$(e, t); + return t <= 16 ? V$(e, t) : W$(e, t); if (t <= 64) - return z$(e, t); - let s = n, r = n.mul(Gr).add(113), a = em(r.mul(on).add(113)).mul(on), i = [qr.UZERO, qr.UZERO], o = [qr.UZERO, qr.UZERO]; + return U$(e, t); + let s = n, r = n.mul(Hr).add(113), a = tm(r.mul(on).add(113)).mul(on), i = [jr.UZERO, jr.UZERO], o = [jr.UZERO, jr.UZERO]; s = s.mul(on).add(lt(e, 0)); let u = 0, l = (t - 1 >> 6) * 64, c = l + (t - 1 & 63) - 63; do - s = Lt(s.add(r).add(i[0]).add(lt(e, u + 8)), 37).mul(Gr), r = Lt(r.add(i[1]).add(lt(e, u + 48)), 42).mul(Gr), s = s.xor(o[1]), r = r.add(i[0]).add(lt(e, u + 40)), a = Lt(a.add(o[0]), 33).mul(Gr), i = Vc(e, u, i[1].mul(Gr), s.add(o[0])), o = Vc(e, u + 32, a.add(o[1]), r.add(lt(e, u + 16))), [a, s] = [s, a], u += 64; + s = Lt(s.add(r).add(i[0]).add(lt(e, u + 8)), 37).mul(Hr), r = Lt(r.add(i[1]).add(lt(e, u + 48)), 42).mul(Hr), s = s.xor(o[1]), r = r.add(i[0]).add(lt(e, u + 40)), a = Lt(a.add(o[0]), 33).mul(Hr), i = Vc(e, u, i[1].mul(Hr), s.add(o[0])), o = Vc(e, u + 32, a.add(o[1]), r.add(lt(e, u + 16))), [a, s] = [s, a], u += 64; while (u !== l); - let p = Gr.add(a.and(255).shl(1)); - return u = c, o[0] = o[0].add(t - 1 & 63), i[0] = i[0].add(o[0]), o[0] = o[0].add(i[0]), s = Lt(s.add(r).add(i[0]).add(lt(e, u + 8)), 37).mul(p), r = Lt(r.add(i[1]).add(lt(e, u + 48)), 42).mul(p), s = s.xor(o[1].mul(9)), r = r.add(i[0].mul(9).add(lt(e, u + 40))), a = Lt(a.add(o[0]), 33).mul(p), i = Vc(e, u, i[1].mul(p), s.add(o[0])), o = Vc(e, u + 32, a.add(o[1]), r.add(lt(e, u + 16))), [a, s] = [s, a], ur(ur(i[0], o[0], p).add(em(r).mul(tk)).add(a), ur(i[1], o[1], p).add(s), p); + let p = Hr.add(a.and(255).shl(1)); + return u = c, o[0] = o[0].add(t - 1 & 63), i[0] = i[0].add(o[0]), o[0] = o[0].add(i[0]), s = Lt(s.add(r).add(i[0]).add(lt(e, u + 8)), 37).mul(p), r = Lt(r.add(i[1]).add(lt(e, u + 48)), 42).mul(p), s = s.xor(o[1].mul(9)), r = r.add(i[0].mul(9).add(lt(e, u + 40))), a = Lt(a.add(o[0]), 33).mul(p), i = Vc(e, u, i[1].mul(p), s.add(o[0])), o = Vc(e, u + 32, a.add(o[1]), r.add(lt(e, u + 16))), [a, s] = [s, a], lr(lr(i[0], o[0], p).add(tm(r).mul(ak)).add(a), lr(i[1], o[1], p).add(s), p); } -function L$(e, t) { - return t === "string" ? Dl(e) : lp([e], t); +function H$(e, t) { + return t === "string" ? Dl(e) : dp([e], t); } -function B$(e, t) { +function q$(e, t) { return e instanceof Float32Array && t === "float32" || e instanceof Int32Array && t === "int32" || e instanceof Uint8Array && t === "bool"; } -function lp(e, t) { +function dp(e, t) { if (t === "string") throw new Error("Cannot convert a string[] to a TypedArray"); - if (Array.isArray(e) && (e = sa(e)), X().getBool("DEBUG") && jw(e, t), B$(e, t)) + if (Array.isArray(e) && (e = ra(e)), X().getBool("DEBUG") && Qw(e, t), q$(e, t)) return e; if (t == null || t === "float32" || t === "complex64") return new Float32Array(e); @@ -4121,10 +4121,10 @@ function lp(e, t) { } else throw new Error(`Unknown data type ${t}`); } -function Uu() { +function Gu() { return X().platform.now(); } -function V$(e, t) { +function j$(e, t) { return X().platform.fetch(e, t); } function Dl(e, t = "utf-8") { @@ -4133,27 +4133,27 @@ function Dl(e, t = "utf-8") { function md(e, t = "utf-8") { return t = t || "utf-8", X().platform.decode(e, t); } -var W$ = class { +var K$ = class { constructor(e, t) { - this.backendTimer = e, this.logger = t, t == null && (this.logger = new G$()); + this.backendTimer = e, this.logger = t, t == null && (this.logger = new Y$()); } profileKernel(e, t, n) { let s, r = () => { s = n(); - }, a, i = Uu(); + }, a, i = Gu(); if (this.backendTimer.timerAvailable()) a = this.backendTimer.time(r); else { r(); for (let u of s) u.dataSync(); - a = Promise.resolve({ kernelMs: Uu() - i }); + a = Promise.resolve({ kernelMs: Gu() - i }); } if (X().getBool("CHECK_COMPUTATION_FOR_ERRORS")) for (let u = 0; u < s.length; u++) { let l = s[u]; l.data().then((c) => { - U$(c, l.dtype, e); + X$(c, l.dtype, e); }); } return { kernelName: e, outputs: s, inputs: t, timeMs: a.then((u) => u.kernelMs), extraInfo: a.then((u) => u.getExtraProfileInfo != null ? u.getExtraProfileInfo() : "") }; @@ -4167,7 +4167,7 @@ var W$ = class { }); } }; -function U$(e, t, n) { +function X$(e, t, n) { if (t !== "float32") return false; for (let s = 0; s < e.length; s++) { @@ -4177,9 +4177,9 @@ function U$(e, t, n) { } return false; } -var G$ = class { +var Y$ = class { logKernelProfile(e, t, n, s, r, a) { - let i = typeof s == "number" ? zu(`${s}ms`, 9) : s.error, o = zu(e, 25), u = t.rank, l = t.size, c = zu(t.shape.toString(), 14), p = ""; + let i = typeof s == "number" ? Mu(`${s}ms`, 9) : s.error, o = Mu(e, 25), u = t.rank, l = t.size, c = Mu(t.shape.toString(), 14), p = ""; for (let d in r) { let h = r[d]; if (h != null) { @@ -4190,7 +4190,7 @@ var G$ = class { console.log(`%c${o} %c${i} %c${u}D ${c} %c${l} %c${p} %c${a}`, "font-weight:bold", "color:red", "color:blue", "color: orange", "color: green", "color: steelblue"); } }; -function H$(e, t, n) { +function Q$(e, t, n) { let s = {}, r = {}; for (let u = 0; u < t.length; u++) s[t[u].id] = true; @@ -4234,7 +4234,7 @@ function H$(e, t, n) { } return o; } -function q$(e, t, n, s) { +function Z$(e, t, n, s) { for (let r = t.length - 1; r >= 0; r--) { let a = t[r], i = []; if (a.outputs.forEach((u) => { @@ -4250,7 +4250,7 @@ function q$(e, t, n, s) { if (l.dtype !== "float32") throw new Error(`Error in gradient for op ${a.kernelName}. The gradient of input ${u} must have 'float32' dtype, but has '${l.dtype}'`); let c = a.inputs[u]; - if (!kr(l.shape, c.shape)) + if (!Ir(l.shape, c.shape)) throw new Error(`Error in gradient for op ${a.kernelName}. The gradient of input '${u}' has shape '${l.shape}', which does not match the shape of the input '${c.shape}'`); if (e[c.id] == null) e[c.id] = l; @@ -4261,57 +4261,57 @@ function q$(e, t, n, s) { } } } -var ax = 20; -var Su = 3; -var Ff = 7; -function j$(e, t, n, s) { - let r = ao(t), a = K$(e, t, n, r), i = t.length, o = ed(e, t, n, r, a), u = ["Tensor"]; +var ox = 20; +var Cu = 3; +var Pf = 7; +function J$(e, t, n, s) { + let r = oo(t), a = e_(e, t, n, r), i = t.length, o = ed(e, t, n, r, a), u = ["Tensor"]; return s && (u.push(` dtype: ${n}`), u.push(` rank: ${i}`), u.push(` shape: [${t}]`), u.push(" values:")), u.push(o.map((l) => " " + l).join(` `)), u.join(` `); } -function K$(e, t, n, s) { - let r = pt(t), a = s[s.length - 1], i = new Array(a).fill(0), o = t.length, u = n === "complex64" ? _u(e) : e; +function e_(e, t, n, s) { + let r = pt(t), a = s[s.length - 1], i = new Array(a).fill(0), o = t.length, u = n === "complex64" ? Au(e) : e; if (o > 1) for (let l = 0; l < r / a; l++) { let c = l * a; for (let p = 0; p < a; p++) - i[p] = Math.max(i[p], $u(u[c + p], 0, n).length); + i[p] = Math.max(i[p], _u(u[c + p], 0, n).length); } return i; } -function $u(e, t, n) { +function _u(e, t, n) { let s; - return Array.isArray(e) ? s = `${parseFloat(e[0].toFixed(Ff))} + ${parseFloat(e[1].toFixed(Ff))}j` : ir(e) ? s = `'${e}'` : n === "bool" ? s = sk(e) : s = parseFloat(e.toFixed(Ff)).toString(), zu(s, t); + return Array.isArray(e) ? s = `${parseFloat(e[0].toFixed(Pf))} + ${parseFloat(e[1].toFixed(Pf))}j` : or(e) ? s = `'${e}'` : n === "bool" ? s = ok(e) : s = parseFloat(e.toFixed(Pf)).toString(), Mu(s, t); } -function sk(e) { +function ok(e) { return e === 0 ? "false" : "true"; } function ed(e, t, n, s, r, a = true) { let i = n === "complex64" ? 2 : 1, o = t[0], u = t.length; if (u === 0) { if (n === "complex64") { - let m = _u(e); - return [$u(m[0], 0, n)]; + let m = Au(e); + return [_u(m[0], 0, n)]; } - return n === "bool" ? [sk(e[0])] : [e[0].toString()]; + return n === "bool" ? [ok(e[0])] : [e[0].toString()]; } if (u === 1) { - if (o > ax) { - let g = Su * i, b = Array.from(e.slice(0, g)), y = Array.from(e.slice((o - Su) * i, o * i)); - return n === "complex64" && (b = _u(b), y = _u(y)), ["[" + b.map((v, x) => $u(v, r[x], n)).join(", ") + ", ..., " + y.map((v, x) => $u(v, r[o - Su + x], n)).join(", ") + "]"]; + if (o > ox) { + let g = Cu * i, b = Array.from(e.slice(0, g)), y = Array.from(e.slice((o - Cu) * i, o * i)); + return n === "complex64" && (b = Au(b), y = Au(y)), ["[" + b.map((v, x) => _u(v, r[x], n)).join(", ") + ", ..., " + y.map((v, x) => _u(v, r[o - Cu + x], n)).join(", ") + "]"]; } - let m = n === "complex64" ? _u(e) : Array.from(e); - return ["[" + m.map((g, b) => $u(g, r[b], n)).join(", ") + "]"]; + let m = n === "complex64" ? Au(e) : Array.from(e); + return ["[" + m.map((g, b) => _u(g, r[b], n)).join(", ") + "]"]; } let l = t.slice(1), c = s.slice(1), p = s[0] * i, d = []; - if (o > ax) { - for (let m = 0; m < Su; m++) { + if (o > ox) { + for (let m = 0; m < Cu; m++) { let g = m * p, b = g + p; d.push(...ed(e.slice(g, b), l, n, c, r, false)); } d.push("..."); - for (let m = o - Su; m < o; m++) { + for (let m = o - Cu; m < o; m++) { let g = m * p, b = g + p; d.push(...ed(e.slice(g, b), l, n, c, r, m === o - 1)); } @@ -4331,7 +4331,7 @@ function ed(e, t, n, s, r, a = true) { `; return d[d.length - 1] = " " + d[d.length - 1] + "]" + (a ? "" : f), d; } -function _u(e) { +function Au(e) { let t = []; for (let n = 0; n < e.length; n += 2) t.push([e[n], e[n + 1]]); @@ -4345,7 +4345,7 @@ var Vt = class { } if (t === "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 = n || qw(t, this.size), this.strides = ao(e); + this.values = n || Yw(t, this.size), this.strides = oo(e); } set(e, ...t) { t.length === 0 && (t = [0]), O(t.length === this.rank, () => `The number of provided coordinates (${t.length}) must match the rank (${this.rank})`); @@ -4395,37 +4395,37 @@ var Vt = class { } }; var cs = null; -var Wi = null; -var X$ = null; -function Y$(e) { +var Gi = null; +var t_ = null; +function n_(e) { cs = e; } -function Q$(e) { - Wi = e; +function s_(e) { + Gi = e; } -function Z$(e) { - X$ = e; +function r_(e) { + t_ = e; } var et = class { constructor(e, t, n, s) { - this.kept = false, this.isDisposedInternal = false, this.shape = e.slice(), this.dtype = t || "float32", this.size = pt(e), this.strides = ao(e), this.dataId = n, this.id = s, this.rankType = this.rank < 5 ? this.rank.toString() : "higher"; + this.kept = false, this.isDisposedInternal = false, this.shape = e.slice(), this.dtype = t || "float32", this.size = pt(e), this.strides = oo(e), this.dataId = n, this.id = s, this.rankType = this.rank < 5 ? this.rank.toString() : "higher"; } get rank() { return this.shape.length; } async buffer() { let e = await this.data(); - return Wi.buffer(this.shape, this.dtype, e); + return Gi.buffer(this.shape, this.dtype, e); } bufferSync() { - return Wi.buffer(this.shape, this.dtype, this.dataSync()); + return Gi.buffer(this.shape, this.dtype, this.dataSync()); } async array() { let e = await this.data(); - return Hi(this.shape, e, this.dtype === "complex64"); + return ji(this.shape, e, this.dtype === "complex64"); } arraySync() { - return Hi(this.shape, this.dataSync(), this.dtype === "complex64"); + return ji(this.shape, this.dataSync(), this.dtype === "complex64"); } async data() { this.throwIfDisposed(); @@ -4470,27 +4470,27 @@ var et = class { throw new Error("Tensor is disposed."); } print(e = false) { - return Wi.print(this, e); + return Gi.print(this, e); } clone() { - return this.throwIfDisposed(), Wi.clone(this); + return this.throwIfDisposed(), Gi.clone(this); } toString(e = false) { let t = this.dataSync(); - return j$(t, this.shape, this.dtype, e); + return J$(t, this.shape, this.dtype, e); } cast(e) { - return this.throwIfDisposed(), Wi.cast(this, e); + return this.throwIfDisposed(), Gi.cast(this, e); } variable(e = true, t, n) { return this.throwIfDisposed(), cs().makeVariable(this, e, t, n); } }; Object.defineProperty(et, Symbol.hasInstance, { value: (e) => !!e && e.data != null && e.dataSync != null && e.throwIfDisposed != null }); -function J$() { - return ag("Tensor", () => et); +function a_() { + return og("Tensor", () => et); } -J$(); +a_(); var gd = class extends et { constructor(e, t, n, s) { super(e.shape, e.dtype, e.dataId, s), this.trainable = t, this.name = n; @@ -4498,7 +4498,7 @@ var gd = class extends et { assign(e) { if (e.dtype !== this.dtype) throw new Error(`dtype of the new value (${e.dtype}) and previous value (${this.dtype}) must match`); - if (!kr(e.shape, this.shape)) + if (!Ir(e.shape, this.shape)) throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`); cs().disposeTensor(this), this.dataId = e.dataId, cs().incRef(this, null); } @@ -4508,22 +4508,22 @@ var gd = class extends et { }; Object.defineProperty(gd, Symbol.hasInstance, { value: (e) => e instanceof et && e.assign != null && e.assign instanceof Function }); var _s = {}; -Ae(_s, { assertTypesMatch: () => uk, getTensorsInContainer: () => Rg, isTensorInList: () => n_, makeTypesMatch: () => vt }); -var e_ = ((e) => (e.R0 = "R0", e.R1 = "R1", e.R2 = "R2", e.R3 = "R3", e.R4 = "R4", e.R5 = "R5", e.R6 = "R6", e))(e_ || {}); -var rk = ((e) => (e.float32 = "float32", e.int32 = "int32", e.bool = "int32", e.complex64 = "complex64", e))(rk || {}); -var ak = ((e) => (e.float32 = "float32", e.int32 = "int32", e.bool = "bool", e.complex64 = "complex64", e))(ak || {}); -var ik = ((e) => (e.float32 = "float32", e.int32 = "float32", e.bool = "float32", e.complex64 = "complex64", e))(ik || {}); -var ok = ((e) => (e.float32 = "complex64", e.int32 = "complex64", e.bool = "complex64", e.complex64 = "complex64", e))(ok || {}); -var t_ = { float32: ik, int32: rk, bool: ak, complex64: ok }; +Ae(_s, { assertTypesMatch: () => pk, getTensorsInContainer: () => Fg, isTensorInList: () => u_, makeTypesMatch: () => vt }); +var i_ = ((e) => (e.R0 = "R0", e.R1 = "R1", e.R2 = "R2", e.R3 = "R3", e.R4 = "R4", e.R5 = "R5", e.R6 = "R6", e))(i_ || {}); +var uk = ((e) => (e.float32 = "float32", e.int32 = "int32", e.bool = "int32", e.complex64 = "complex64", e))(uk || {}); +var lk = ((e) => (e.float32 = "float32", e.int32 = "int32", e.bool = "bool", e.complex64 = "complex64", e))(lk || {}); +var ck = ((e) => (e.float32 = "float32", e.int32 = "float32", e.bool = "float32", e.complex64 = "complex64", e))(ck || {}); +var dk = ((e) => (e.float32 = "complex64", e.int32 = "complex64", e.bool = "complex64", e.complex64 = "complex64", e))(dk || {}); +var o_ = { float32: ck, int32: uk, bool: lk, complex64: dk }; function cn(e, t) { if (e === "string" || t === "string") { if (e === "string" && t === "string") return "string"; throw new Error(`Can not upcast ${e} with ${t}`); } - return t_[e][t]; + return o_[e][t]; } -function cp(e) { +function pp(e) { return cn(e, "int32"); } function vt(e, t) { @@ -4532,38 +4532,38 @@ function vt(e, t) { let n = cn(e.dtype, t.dtype); return [e.cast(n), t.cast(n)]; } -function uk(e, t) { +function pk(e, t) { O(e.dtype === t.dtype, () => `The dtypes of the first(${e.dtype}) and second(${t.dtype}) input must match`); } -function n_(e, t) { +function u_(e, t) { return t.some((n) => n.id === e.id); } -function Rg(e) { +function Fg(e) { let t = []; - return lk(e, t, /* @__PURE__ */ new Set()), t; + return hk(e, t, /* @__PURE__ */ new Set()), t; } -function lk(e, t, n) { +function hk(e, t, n) { if (e == null) return; if (e instanceof et) { t.push(e); return; } - if (!s_(e)) + if (!l_(e)) return; let s = e; for (let r in s) { let a = s[r]; - n.has(a) || (n.add(a), lk(a, t, n)); + n.has(a) || (n.add(a), hk(a, t, n)); } } -function s_(e) { +function l_(e) { return Array.isArray(e) || typeof e == "object"; } -function Of(e) { +function zf(e) { return e.kernelName != null; } -var ix = class { +var ux = class { constructor() { this.registeredVariables = {}, this.nextTapeNodeId = 0, this.numBytes = 0, this.numTensors = 0, this.numStringTensors = 0, this.numDataBuffers = 0, this.gradientDepth = 0, this.kernelDepth = 0, this.scopeStack = [], this.numDataMovesStack = [], this.nextScopeId = 0, this.tensorInfo = /* @__PURE__ */ new WeakMap(), this.profiling = false, this.activeProfile = { newBytes: 0, newTensors: 0, peakBytes: 0, kernels: [], result: null, get kernelNames() { return Array.from(new Set(this.kernels.map((e) => e.name))); @@ -4574,9 +4574,9 @@ var ix = class { this.registeredVariables[e].dispose(); } }; -var tm = class { +var nm = class { constructor(e) { - this.ENV = e, this.registry = {}, this.registryFactory = {}, this.pendingBackendInitId = 0, this.state = new ix(); + this.ENV = e, this.registry = {}, this.registryFactory = {}, this.pendingBackendInitId = 0, this.state = new ux(); } async ready() { if (this.pendingBackendInit != null) @@ -4622,7 +4622,7 @@ var tm = class { return e in this.registryFactory ? this.registryFactory[e].factory : null; } registerBackend(e, t, n = 1) { - return e in this.registryFactory ? (ar(`${e} backend was already registered. Reusing existing backend factory.`), false) : (this.registryFactory[e] = { factory: t, priority: n }, true); + return e in this.registryFactory ? (ir(`${e} backend was already registered. Reusing existing backend factory.`), false) : (this.registryFactory[e] = { factory: t, priority: n }, true); } async setBackend(e) { if (this.registryFactory[e] == null) @@ -4633,15 +4633,15 @@ var tm = class { if (!(n ? await t : t)) return false; } - return this.backendInstance = this.registry[e], this.setupRegisteredKernels(), this.profiler = new W$(this.backendInstance), true; + return this.backendInstance = this.registry[e], this.setupRegisteredKernels(), this.profiler = new K$(this.backendInstance), true; } setupRegisteredKernels() { - Jf(this.backendName).forEach((t) => { + em(this.backendName).forEach((t) => { t.setupFunc != null && t.setupFunc(this.backendInstance); }); } disposeRegisteredKernels(e) { - Jf(e).forEach((n) => { + em(e).forEach((n) => { n.disposeFunc != null && n.disposeFunc(this.registry[e]); }); } @@ -4651,13 +4651,13 @@ var tm = class { throw new Error(`Cannot initialize backend ${e}, no registration found.`); try { let n = t.factory(); - if (n && !(n instanceof nl) && typeof n.then == "function") { - let s = ++this.pendingBackendInitId, r = n.then((a) => s < this.pendingBackendInitId ? false : (this.registry[e] = a, this.pendingBackendInit = null, true)).catch((a) => (s < this.pendingBackendInitId || (this.pendingBackendInit = null, ar(`Initialization of backend ${e} failed`), ar(a.stack || a.message)), false)); + if (n && !(n instanceof sl) && typeof n.then == "function") { + let s = ++this.pendingBackendInitId, r = n.then((a) => s < this.pendingBackendInitId ? false : (this.registry[e] = a, this.pendingBackendInit = null, true)).catch((a) => (s < this.pendingBackendInitId || (this.pendingBackendInit = null, ir(`Initialization of backend ${e} failed`), ir(a.stack || a.message)), false)); return this.pendingBackendInit = r, { success: r, asyncInit: true }; } else return this.registry[e] = n, { success: true, asyncInit: false }; } catch (n) { - return ar(`Initialization of backend ${e} failed`), ar(n.stack || n.message), { success: false, asyncInit: false }; + return ir(`Initialization of backend ${e} failed`), ir(n.stack || n.message), { success: false, asyncInit: false }; } } removeBackend(e) { @@ -4709,20 +4709,20 @@ var tm = class { } } nextTensorId() { - return tm.nextTensorId++; + return nm.nextTensorId++; } nextVariableId() { - return tm.nextVariableId++; + return nm.nextVariableId++; } clone(e) { - let t = M.runKernel(Ba, { x: e }), n = { x: e }, s = (a) => ({ x: () => { + let t = M.runKernel(Wa, { x: e }), n = { x: e }, s = (a) => ({ x: () => { let i = "float32", o = { x: a }, u = { dtype: i }; - return M.runKernel(Na, o, u); + return M.runKernel(Ta, o, u); } }), r = []; return this.addTapeNode(this.state.activeScope.name, n, [t], s, r, {}), t; } runKernel(e, t, n) { - if (this.backendName == null && this.backend, !(Zf(e, this.backendName) != null)) + if (this.backendName == null && this.backend, !(Jf(e, this.backendName) != null)) throw new Error(`Kernel '${e}' not registered for backend '${this.backendName}'`); return this.runKernelFunc({ kernelName: e, inputs: t, attrs: n }); } @@ -4743,11 +4743,11 @@ var tm = class { this.shouldCheckForMemLeaks() && this.state.numDataMovesStack.push(0); let i; this.backendName == null && this.backend; - let o, u = Of(e) ? e.kernelName : this.state.activeScope != null ? this.state.activeScope.name : ""; - if (Of(e)) { + let o, u = zf(e) ? e.kernelName : this.state.activeScope != null ? this.state.activeScope.name : ""; + if (zf(e)) { let { kernelName: h, inputs: f, attrs: m } = e; this.backendName == null && this.backend; - let g = Zf(h, this.backendName); + let g = Jf(h, this.backendName); O(g != null, () => `Cannot find registered kernel '${h}' for backend '${this.backendName}'`), i = () => { let b = this.backend.numDataIds(); o = g.kernelFunc({ inputs: f, attrs: m, backend: this.backend }); @@ -4776,7 +4776,7 @@ var tm = class { return this.shouldCheckForMemLeaks() && this.checkKernelForMemLeak(u, m, g), g; }; } - let { inputs: l, attrs: c } = e, p = Of(e) ? null : e.backwardsFunc, d; + let { inputs: l, attrs: c } = e, p = zf(e) ? null : e.backwardsFunc, d; return this.scopedRun(() => this.state.kernelDepth++, () => this.state.kernelDepth--, () => { !this.ENV.getBool("DEBUG") && !this.state.profiling ? t = i() : (d = this.profiler.profileKernel(u, l, () => i()), this.ENV.getBool("DEBUG") && this.profiler.logKernelProfile(d), t = d.outputs); }), s && this.addTapeNode(u, l, t, p, n, c), this.state.profiling && this.state.activeProfile.kernels.push({ name: u, bytesAdded: this.state.numBytes - r, totalBytesSnapshot: this.state.numBytes, tensorsAdded: this.state.numTensors - a, totalTensorsSnapshot: this.state.numTensors, inputShapes: Object.keys(l).map((h) => l[h] != null ? l[h].shape : null), outputShapes: t.map((h) => h.shape), kernelTimeMs: d.timeMs, extraInfo: d.extraInfo }), Array.isArray(o) ? t : t[0]; @@ -4785,7 +4785,7 @@ var tm = class { return e.map((n) => this.keep(this.clone(n))); } getTensorsForGradient(e, t, n) { - let s = nx(e); + let s = rx(e); if (s != null) { let r = s.inputsToSave || [], a = s.outputsToSave || [], i; s.saveAllInputs ? (O(Array.isArray(t), () => "saveAllInputs is true, expected inputs to be an array."), i = Object.keys(t).map((u) => t[u])) : i = r.map((u) => t[u]); @@ -4799,10 +4799,10 @@ var tm = class { throw new Error("Values passed to engine.makeTensor() are null"); n = n || "float32", s = s || this.backend; let r = e; - n === "string" && ir(e[0]) && (r = e.map((o) => Dl(o))); + n === "string" && or(e[0]) && (r = e.map((o) => Dl(o))); let a = s.write(r, t, n), i = new et(t, n, a, this.nextTensorId()); if (this.trackTensor(i, s), n === "string") { - let o = this.state.tensorInfo.get(a), u = Xw(r); + let o = this.state.tensorInfo.get(a), u = Jw(r); this.state.numBytes += u - o.bytes, o.bytes = u; } return i; @@ -4822,7 +4822,7 @@ var tm = class { trackTensor(e, t) { this.state.numTensors++, e.dtype === "string" && this.state.numStringTensors++; let n = 0; - e.dtype !== "complex64" && e.dtype !== "string" && (n = e.size * Xf(e.dtype)), this.state.numBytes += n, this.state.tensorInfo.has(e.dataId) || (this.state.numDataBuffers++, this.state.tensorInfo.set(e.dataId, { backend: t || this.backend, dtype: e.dtype, shape: e.shape, bytes: n })), e instanceof gd || this.track(e); + e.dtype !== "complex64" && e.dtype !== "string" && (n = e.size * Yf(e.dtype)), this.state.numBytes += n, this.state.tensorInfo.has(e.dataId) || (this.state.numDataBuffers++, this.state.tensorInfo.set(e.dataId, { backend: t || this.backend, dtype: e.dtype, shape: e.shape, bytes: n })), e instanceof gd || this.track(e); } incRef(e, t) { this.trackTensor(e, t), this.backend.incRef(e.dataId); @@ -4835,7 +4835,7 @@ var tm = class { return; let t = this.state.tensorInfo.get(e.dataId); if (this.state.numTensors--, e.dtype === "string" && (this.state.numStringTensors--, this.state.numBytes -= t.bytes), e.dtype !== "complex64" && e.dtype !== "string") { - let n = e.size * Xf(e.dtype); + let n = e.size * Yf(e.dtype); this.state.numBytes -= n; } t.backend.disposeData(e.dataId) && this.removeDataId(e.dataId, t.backend); @@ -4865,10 +4865,10 @@ var tm = class { return this.state.gradientDepth > 0 && this.state.kernelDepth === 0; } addTapeNode(e, t, n, s, r, a) { - let i = { id: this.state.nextTapeNodeId++, kernelName: e, inputs: t, outputs: n, saved: r }, o = nx(e); + let i = { id: this.state.nextTapeNodeId++, kernelName: e, inputs: t, outputs: n, saved: r }, o = rx(e); o != null && (s = o.gradFunc), s != null && (i.gradient = (u) => (u = u.map((l, c) => { if (l == null) { - let p = n[c], d = Hd(p.size, p.dtype); + let p = n[c], d = jd(p.size, p.dtype); return this.makeTensor(d, p.shape, p.dtype); } return l; @@ -4888,7 +4888,7 @@ var tm = class { e && (t.name = e), this.state.scopeStack.push(t), this.state.activeScope = t; } endScope(e) { - let t = Rg(e), n = new Set(t.map((r) => r.id)); + let t = Fg(e), n = new Set(t.map((r) => r.id)); for (let r = 0; r < this.state.activeScope.track.length; r++) { let a = this.state.activeScope.track[r]; !a.kept && !n.has(a.id) && a.dispose(); @@ -4903,12 +4903,12 @@ var tm = class { throw new Error(`dy must have 'float32' dtype, but has '${n.dtype}'`); let r = this.scopedRun(() => this.startTape(), () => this.endTape(), () => this.tidy("forward", e)); O(r instanceof et, () => "The result y returned by f() must be a tensor."); - let a = H$(this.state.activeTape, t, r); + let a = Q$(this.state.activeTape, t, r); if (!s && a.length === 0 && t.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", () => { let i = {}; - i[r.id] = n == null ? r_(r.shape) : n, q$(i, a, (u) => this.tidy(u), a_); + i[r.id] = n == null ? c_(r.shape) : n, Z$(i, a, (u) => this.tidy(u), d_); let o = t.map((u) => i[u.id]); return this.state.gradientDepth === 0 && (this.state.activeTape.forEach((u) => { for (let l of u.saved) @@ -4917,13 +4917,13 @@ var tm = class { }); } customGrad(e) { - return O(hr(e), () => "The f passed in customGrad(f) must be a function."), (...t) => { + return O(fr(e), () => "The f passed in customGrad(f) must be a function."), (...t) => { O(t.every((i) => i instanceof et), () => "The args passed in customGrad(f)(x1, x2,...) must all be tensors"); let n, s = {}; t.forEach((i, o) => { s[o] = i; }); - let r = (i, o) => (n = e(...t, o), O(n.value instanceof et, () => "The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"), O(hr(n.gradFunc), () => "The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."), n.value), a = (i, o) => { + let r = (i, o) => (n = e(...t, o), O(n.value instanceof et, () => "The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"), O(fr(n.gradFunc), () => "The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."), n.value), a = (i, o) => { let u = n.gradFunc(i, o), l = Array.isArray(u) ? u : [u]; O(l.length === t.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(...)."), O(l.every((p) => p instanceof et), () => "The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors."); let c = {}; @@ -4944,8 +4944,8 @@ var tm = class { return this.state.tensorInfo.get(e).backend.readToGPU(e, t); } async time(e) { - let t = Uu(), n = await this.backend.time(e); - return n.wallMs = Uu() - t, n; + let t = Gu(), n = await this.backend.time(e); + return n.wallMs = Gu() - t, n; } track(e) { return this.state.activeScope != null && (e.scopeId = this.state.activeScope.id, this.state.activeScope.track.push(e)), e; @@ -4954,45 +4954,45 @@ var tm = class { return this.state.registeredVariables; } reset() { - this.pendingBackendInitId++, this.state.dispose(), this.ENV.reset(), this.state = new ix(); + this.pendingBackendInitId++, this.state.dispose(), this.ENV.reset(), this.state = new ux(); for (let e in this.registry) this.disposeRegisteredKernels(e), this.registry[e].dispose(), delete this.registry[e]; this.backendName = null, this.backendInstance = null, this.pendingBackendInit = null; } }; -var Dg = tm; -Dg.nextTensorId = 0; -Dg.nextVariableId = 0; -function r_(e) { - let t = ng(pt(e), "float32"); +var Og = nm; +Og.nextTensorId = 0; +Og.nextVariableId = 0; +function c_(e) { + let t = rg(pt(e), "float32"); return M.makeTensor(t, e, "float32"); } -function ck() { - let e = ek(); +function fk() { + let e = rk(); if (e._tfengine == null) { - let t = new S$(e); - e._tfengine = new Dg(t); + let t = new A$(e); + e._tfengine = new Og(t); } - return $$(e._tfengine.ENV), Y$(() => e._tfengine), e._tfengine; + return F$(e._tfengine.ENV), n_(() => e._tfengine), e._tfengine; } -var M = ck(); -function a_(e, t) { +var M = fk(); +function d_(e, t) { let n = { a: e, b: t }; - return M.runKernel(Ir, n); + return M.runKernel(Sr, n); } -var dp = {}; -Ae(dp, { isBrowser: () => dk, isMobile: () => u_, mockIsMobile: () => o_ }); -function i_() { +var hp = {}; +Ae(hp, { isBrowser: () => mk, isMobile: () => f_, mockIsMobile: () => h_ }); +function p_() { return typeof navigator != "undefined" && navigator != null; } -var nm; -function o_(e) { - nm = e; +var sm; +function h_(e) { + sm = e; } -function u_(e) { - if (nm !== void 0) - return nm; - if (e || i_()) { +function f_(e) { + if (sm !== void 0) + return sm; + if (e || p_()) { if (e || (e = navigator), e.product === "ReactNative") return true; let t = e.userAgent || e.vendor || (typeof window != "undefined" ? window.opera : ""); @@ -5004,23 +5004,23 @@ function u_(e) { } return false; } -function dk() { +function mk() { return typeof window != "undefined" && window.document != null || typeof WorkerGlobalScope != "undefined"; } -var jn = X(); -jn.registerFlag("DEBUG", () => false, (e) => { +var Kn = X(); +Kn.registerFlag("DEBUG", () => false, (e) => { e && 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."); }); -jn.registerFlag("IS_BROWSER", () => dk()); -jn.registerFlag("IS_NODE", () => typeof process != "undefined" && typeof process.versions != "undefined" && typeof process.versions.node != "undefined"); -jn.registerFlag("IS_CHROME", () => typeof navigator != "undefined" && navigator != null && navigator.userAgent != null && /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor)); -jn.registerFlag("PROD", () => false); -jn.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY", () => jn.getBool("DEBUG")); -jn.registerFlag("DEPRECATION_WARNINGS_ENABLED", () => true); -jn.registerFlag("IS_TEST", () => false); -jn.registerFlag("CHECK_COMPUTATION_FOR_ERRORS", () => true); -jn.registerFlag("WRAP_TO_IMAGEBITMAP", () => false); -jn.registerFlag("ENGINE_COMPILE_ONLY", () => false); +Kn.registerFlag("IS_BROWSER", () => mk()); +Kn.registerFlag("IS_NODE", () => typeof process != "undefined" && typeof process.versions != "undefined" && typeof process.versions.node != "undefined"); +Kn.registerFlag("IS_CHROME", () => typeof navigator != "undefined" && navigator != null && navigator.userAgent != null && /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor)); +Kn.registerFlag("PROD", () => false); +Kn.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY", () => Kn.getBool("DEBUG")); +Kn.registerFlag("DEPRECATION_WARNINGS_ENABLED", () => true); +Kn.registerFlag("IS_TEST", () => false); +Kn.registerFlag("CHECK_COMPUTATION_FOR_ERRORS", () => true); +Kn.registerFlag("WRAP_TO_IMAGEBITMAP", () => false); +Kn.registerFlag("ENGINE_COMPILE_ONLY", () => false); function Rs(e, t) { let n = e; if (Qt(e)) @@ -5030,9 +5030,9 @@ function Rs(e, t) { let s = []; for (; Array.isArray(n) || Qt(n) && t !== "string"; ) s.push(n.length), n = n[0]; - return Array.isArray(e) && X().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY") && pk(e, s, []), s; + return Array.isArray(e) && X().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY") && gk(e, s, []), s; } -function pk(e, t, n) { +function gk(e, t, n) { if (n = n || [], !Array.isArray(e) && !Qt(e)) { O(t.length === 0, () => `Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`); return; @@ -5040,9 +5040,9 @@ function pk(e, t, n) { O(t.length > 0, () => `Element arr[${n.join("][")}] should be a primitive, but is an array of ${e.length} elements`), O(e.length === t[0], () => `Element arr[${n.join("][")}] should have ${t[0]} elements, but has ${e.length} elements`); let s = t.slice(1); for (let r = 0; r < e.length; ++r) - pk(e[r], s, n.concat(r)); + gk(e[r], s, n.concat(r)); } -function ox(e, t, n, s) { +function lx(e, t, n, s) { if (e !== "string_or_numeric") { if (e == null) throw new Error("Expected dtype cannot be null."); @@ -5052,54 +5052,54 @@ function ox(e, t, n, s) { } function _(e, t, n, s = "numeric") { if (e instanceof et) - return ox(s, e.dtype, t, n), e; - let r = Gd(e); - if (r !== "string" && ["bool", "int32", "float32"].indexOf(s) >= 0 && (r = s), ox(s, r, t, n), e == null || !Qt(e) && !Array.isArray(e) && typeof e != "number" && typeof e != "boolean" && typeof e != "string") { + return lx(s, e.dtype, t, n), e; + let r = qd(e); + if (r !== "string" && ["bool", "int32", "float32"].indexOf(s) >= 0 && (r = s), lx(s, r, t, n), e == null || !Qt(e) && !Array.isArray(e) && typeof e != "number" && typeof e != "boolean" && typeof e != "string") { let u = e == null ? "null" : e.constructor.name; throw new Error(`Argument '${t}' passed to '${n}' must be a Tensor or TensorLike, but got '${u}'`); } let a = Rs(e, r); !Qt(e) && !Array.isArray(e) && (e = [e]); - let o = r !== "string" ? lp(e, r) : sa(e, [], true); + let o = r !== "string" ? dp(e, r) : ra(e, [], true); return M.makeTensor(o, a, r); } -function Gu(e, t, n, s = "numeric") { +function Hu(e, t, n, s = "numeric") { if (!Array.isArray(e)) throw new Error(`Argument ${t} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``); return e.map((a, i) => _(a, `${t}[${i}]`, n, s)); } -var l_ = "__op"; +var m_ = "__op"; function L(e) { let t = Object.keys(e); if (t.length !== 1) throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${t.length} keys.`); let n = t[0], s = e[n]; - n.endsWith("_") && (n = n.substring(0, n.length - 1)), n = n + l_; + n.endsWith("_") && (n = n.substring(0, n.length - 1)), n = n + m_; let r = (...a) => { M.startScope(n); try { let i = s(...a); - return rg(i) && console.error("Cannot return a Promise inside of tidy."), M.endScope(i), i; + return ig(i) && console.error("Cannot return a Promise inside of tidy."), M.endScope(i), i; } catch (i) { throw M.endScope(null), i; } }; return Object.defineProperty(r, "name", { value: n, configurable: true }), r; } -function c_(e, t) { +function g_(e, t) { let n = _(e, "real", "complex"), s = _(t, "imag", "complex"); pn(n.shape, s.shape, `real and imag shapes, ${n.shape} and ${s.shape}, must match in call to tf.complex().`); let r = { real: n, imag: s }; - return M.runKernel(jd, r); + return M.runKernel(Xd, r); } -var oa = L({ complex_: c_ }); -function Nr(e, t, n, s) { - if (s == null && (s = Gd(e)), s === "complex64") +var ua = L({ complex_: g_ }); +function Tr(e, t, n, s) { + if (s == null && (s = qd(e)), s === "complex64") throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag)."); if (!Qt(e) && !Array.isArray(e) && typeof e != "number" && typeof e != "boolean" && typeof e != "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 (t != null) { - sg(t); + ag(t); let r = pt(t), a = pt(n); O(r === a, () => `Based on the provided shape, [${t}], the tensor should have ${r} values but has ${a}`); for (let i = 0; i < n.length; ++i) { @@ -5107,15 +5107,15 @@ function Nr(e, t, n, s) { O(n[i] === t[i] || !u, () => `Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${t}). `); } } - return !Qt(e) && !Array.isArray(e) && (e = [e]), t = t || n, e = s !== "string" ? lp(e, s) : sa(e, [], true), M.makeTensor(e, t, s); + return !Qt(e) && !Array.isArray(e) && (e = [e]), t = t || n, e = s !== "string" ? dp(e, s) : ra(e, [], true), M.makeTensor(e, t, s); } function fs(e, t, n) { let s = Rs(e, n); - return Nr(e, t, s, n); + return Tr(e, t, s, n); } -var sm = { float32: 4, float16: 2, int32: 4, uint16: 2, uint8: 1, bool: 1, complex64: 8 }; +var rm = { float32: 4, float16: 2, int32: 4, uint16: 2, uint8: 1, bool: 1, complex64: 8 }; var bd = 4; -async function d_(e, t) { +async function b_(e, t) { let n = [], s = [], r = Array.isArray(e) ? e.map((i) => i.name) : Object.keys(e); for (let i = 0; i < r.length; ++i) { let o = r[i], u = Array.isArray(e) ? e[i].tensor : e[o]; @@ -5137,9 +5137,9 @@ async function d_(e, t) { t != null && (l.group = t), n.push(l); } let a = await Promise.all(s); - return { data: p_(a), specs: n }; + return { data: y_(a), specs: n }; } -function hk(e, t) { +function bk(e, t) { let n = {}, s, r = 0; for (let a of t) { let i = a.name, o = a.dtype, u = a.shape, l = pt(u), c; @@ -5153,7 +5153,7 @@ function hk(e, t) { throw new Error(`Weight ${a.name} is quantized with ${p.dtype} which only supports weights of type float32 not ${o}.`); } else throw new Error(`Weight ${a.name} has unknown quantization dtype ${p.dtype}. Supported quantization dtypes are: 'uint8', 'uint16', and 'float16'.`); - let d = sm[p.dtype], h = e.slice(r, r + l * d), f = p.dtype === "uint8" ? new Uint8Array(h) : new Uint16Array(h); + let d = rm[p.dtype], h = e.slice(r, r + l * d), f = p.dtype === "uint8" ? new Uint8Array(h) : new Uint16Array(h); if (o === "float32") if (p.dtype === "uint8" || p.dtype === "uint16") { c = new Float32Array(f.length); @@ -5162,7 +5162,7 @@ function hk(e, t) { c[m] = g * p.scale + p.min; } } else if (p.dtype === "float16") - s === void 0 && (s = y_()), c = s(f); + s === void 0 && (s = S_()), c = s(f); else throw new Error(`Unsupported quantization type ${p.dtype} for weight type float32.`); else if (o === "int32") { @@ -5186,7 +5186,7 @@ function hk(e, t) { c.push(f), r += h; } } else { - let p = sm[o], d = e.slice(r, r + l * p); + let p = rm[o], d = e.slice(r, r + l * p); if (o === "float32") c = new Float32Array(d); else if (o === "int32") @@ -5199,7 +5199,7 @@ function hk(e, t) { for (let b = 0; b < h.length; b++) h[b] = c[b * 2], f[b] = c[b * 2 + 1]; let m = fs(h, u, "float32"), g = fs(f, u, "float32"); - n[i] = oa(m, g), m.dispose(), g.dispose(); + n[i] = ua(m, g), m.dispose(), g.dispose(); } else throw new Error(`Unsupported dtype in weight '${i}': ${o}`); r += l * p; @@ -5208,7 +5208,7 @@ function hk(e, t) { } return n; } -function p_(e) { +function y_(e) { if (e === null) throw new Error(`Invalid input value: ${JSON.stringify(e)}`); let t = 0, n = []; @@ -5221,20 +5221,20 @@ function p_(e) { s.set(new Uint8Array(a.buffer), r), r += a.byteLength; }), s.buffer; } -var Fg = typeof Buffer != "undefined" && (typeof Blob == "undefined" || typeof atob == "undefined" || typeof btoa == "undefined"); -function ux(e) { - return Fg ? Buffer.byteLength(e) : new Blob([e]).size; +var Pg = typeof Buffer != "undefined" && (typeof Blob == "undefined" || typeof atob == "undefined" || typeof btoa == "undefined"); +function cx(e) { + return Pg ? Buffer.byteLength(e) : new Blob([e]).size; } -function h_(e) { - if (Fg) +function v_(e) { + if (Pg) return Buffer.from(e).toString("base64"); let t = new Uint8Array(e), n = ""; for (let s = 0, r = t.length; s < r; s++) n += String.fromCharCode(t[s]); return btoa(n); } -function f_(e) { - if (Fg) { +function x_(e) { + if (Pg) { let s = Buffer.from(e, "base64"); return s.buffer.slice(s.byteOffset, s.byteOffset + s.byteLength); } @@ -5243,7 +5243,7 @@ function f_(e) { n.set([t.charCodeAt(s)], s); return n.buffer; } -function Og(e) { +function zg(e) { if (e.length === 1) return e[0]; let t = 0; @@ -5255,18 +5255,18 @@ function Og(e) { n.set(new Uint8Array(r), s), s += r.byteLength; }), n.buffer; } -function lx(e) { +function dx(e) { let t = "/"; for (e = e.trim(); e.endsWith(t); ) e = e.slice(0, e.length - 1); let n = e.split(t); return n[n.length - 1]; } -function fk(e, t) { +function yk(e, t) { let n = { modelTopology: e.modelTopology, format: e.format, generatedBy: e.generatedBy, convertedBy: e.convertedBy, weightsManifest: t }; return e.signature != null && (n.signature = e.signature), e.userDefinedMetadata != null && (n.userDefinedMetadata = e.userDefinedMetadata), e.modelInitializer != null && (n.modelInitializer = e.modelInitializer), e.trainingConfig != null && (n.trainingConfig = e.trainingConfig), n; } -async function Pg(e, t) { +async function Mg(e, t) { let n = { modelTopology: e.modelTopology, format: e.format, generatedBy: e.generatedBy, convertedBy: e.convertedBy }; if (e.trainingConfig != null && (n.trainingConfig = e.trainingConfig), e.weightsManifest != null) { let [s, r] = await t(e.weightsManifest); @@ -5277,9 +5277,9 @@ async function Pg(e, t) { function Fl(e) { if (e.modelTopology instanceof ArrayBuffer) throw new Error("Expected JSON model topology, received ArrayBuffer."); - return { dateSaved: new Date(), modelTopologyType: "JSON", modelTopologyBytes: e.modelTopology == null ? 0 : ux(JSON.stringify(e.modelTopology)), weightSpecsBytes: e.weightSpecs == null ? 0 : ux(JSON.stringify(e.weightSpecs)), weightDataBytes: e.weightData == null ? 0 : e.weightData.byteLength }; + return { dateSaved: new Date(), modelTopologyType: "JSON", modelTopologyBytes: e.modelTopology == null ? 0 : cx(JSON.stringify(e.modelTopology)), weightSpecsBytes: e.weightSpecs == null ? 0 : cx(JSON.stringify(e.weightSpecs)), weightDataBytes: e.weightData == null ? 0 : e.weightData.byteLength }; } -function m_() { +function w_() { let e = (n) => { let s = n << 13, r = 0; for (; (s & 8388608) === 0; ) @@ -5293,7 +5293,7 @@ function m_() { t[n] = 939524096 + (n - 1024 << 13); return t; } -function g_() { +function k_() { let e = new Uint32Array(64); e[0] = 0, e[31] = 1199570944, e[32] = 2147483648, e[63] = 3347054592; for (let t = 1; t < 31; t++) @@ -5302,14 +5302,14 @@ function g_() { e[t] = 2147483648 + (t - 32 << 23); return e; } -function b_() { +function I_() { let e = new Uint32Array(64); for (let t = 0; t < 64; t++) e[t] = 1024; return e[0] = e[32] = 0, e; } -function y_() { - let e = m_(), t = g_(), n = b_(); +function S_() { + let e = w_(), t = k_(), n = I_(); return (s) => { let r = new ArrayBuffer(4 * s.length), a = new Uint32Array(r); for (let i = 0; i < s.length; i++) { @@ -5346,15 +5346,15 @@ var xt = class { }), s; } }; -var v_ = (e) => xt.registerSaveRouter(e); -var x_ = (e) => xt.registerLoadRouter(e); -var w_ = (e) => xt.getSaveHandlers(e); -var k_ = (e, t) => xt.getLoadHandlers(e, t); -var rm = "tensorflowjs"; -var am = 1; -var Yr = "models_store"; -var or = "model_info_store"; -function mk() { +var C_ = (e) => xt.registerSaveRouter(e); +var N_ = (e) => xt.registerLoadRouter(e); +var T_ = (e) => xt.getSaveHandlers(e); +var $_ = (e, t) => xt.getLoadHandlers(e, t); +var am = "tensorflowjs"; +var im = 1; +var Qr = "models_store"; +var ur = "model_info_store"; +function vk() { if (!X().getBool("IS_BROWSER")) throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser."); let e = typeof window == "undefined" ? self : window, t = e.indexedDB || e.mozIndexedDB || e.webkitIndexedDB || e.msIndexedDB || e.shimIndexedDB; @@ -5362,13 +5362,13 @@ function mk() { throw new Error("The current browser does not appear to support IndexedDB."); return t; } -function im(e) { +function om(e) { let t = e.result; - t.createObjectStore(Yr, { keyPath: "modelPath" }), t.createObjectStore(or, { keyPath: "modelPath" }); + t.createObjectStore(Qr, { keyPath: "modelPath" }), t.createObjectStore(ur, { keyPath: "modelPath" }); } -var ua = class { +var la = class { constructor(e) { - if (this.indexedDB = mk(), e == null || !e) + if (this.indexedDB = vk(), e == null || !e) throw new Error("For IndexedDB, modelPath must not be null, undefined or empty."); this.modelPath = e; } @@ -5382,23 +5382,23 @@ var ua = class { } databaseAction(e, t) { return new Promise((n, s) => { - let r = this.indexedDB.open(rm, am); - r.onupgradeneeded = () => im(r), r.onsuccess = () => { + let r = this.indexedDB.open(am, im); + r.onupgradeneeded = () => om(r), r.onsuccess = () => { let a = r.result; if (t == null) { - let i = a.transaction(Yr, "readonly"), u = i.objectStore(Yr).get(this.modelPath); + let i = a.transaction(Qr, "readonly"), u = i.objectStore(Qr).get(this.modelPath); u.onsuccess = () => { if (u.result == null) return a.close(), s(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`)); n(u.result.modelArtifacts); }, u.onerror = (l) => (a.close(), s(u.error)), i.oncomplete = () => a.close(); } else { - let i = Fl(t), o = a.transaction(or, "readwrite"), u = o.objectStore(or), l = u.put({ modelPath: this.modelPath, modelArtifactsInfo: i }), c; + let i = Fl(t), o = a.transaction(ur, "readwrite"), u = o.objectStore(ur), l = u.put({ modelPath: this.modelPath, modelArtifactsInfo: i }), c; l.onsuccess = () => { - c = a.transaction(Yr, "readwrite"); - let d = c.objectStore(Yr).put({ modelPath: this.modelPath, modelArtifacts: t, modelArtifactsInfo: i }); + c = a.transaction(Qr, "readwrite"); + let d = c.objectStore(Qr).put({ modelPath: this.modelPath, modelArtifacts: t, modelArtifactsInfo: i }); d.onsuccess = () => n({ modelArtifactsInfo: i }), d.onerror = (h) => { - u = o.objectStore(or); + u = o.objectStore(ur); let f = u.delete(this.modelPath); f.onsuccess = () => (a.close(), s(d.error)), f.onerror = (m) => (a.close(), s(d.error)); }; @@ -5410,25 +5410,25 @@ var ua = class { }); } }; -ua.URL_SCHEME = "indexeddb://"; -var gk = (e) => X().getBool("IS_BROWSER") && !Array.isArray(e) && e.startsWith(ua.URL_SCHEME) ? I_(e.slice(ua.URL_SCHEME.length)) : null; -xt.registerSaveRouter(gk); -xt.registerLoadRouter(gk); -function I_(e) { - return new ua(e); +la.URL_SCHEME = "indexeddb://"; +var xk = (e) => X().getBool("IS_BROWSER") && !Array.isArray(e) && e.startsWith(la.URL_SCHEME) ? __(e.slice(la.URL_SCHEME.length)) : null; +xt.registerSaveRouter(xk); +xt.registerLoadRouter(xk); +function __(e) { + return new la(e); } -function S_(e) { - return e.startsWith(ua.URL_SCHEME) ? e.slice(ua.URL_SCHEME.length) : e; +function A_(e) { + return e.startsWith(la.URL_SCHEME) ? e.slice(la.URL_SCHEME.length) : e; } -var C_ = class { +var E_ = class { constructor() { - this.indexedDB = mk(); + this.indexedDB = vk(); } async listModels() { return new Promise((e, t) => { - let n = this.indexedDB.open(rm, am); - n.onupgradeneeded = () => im(n), n.onsuccess = () => { - let s = n.result, r = s.transaction(or, "readonly"), i = r.objectStore(or).getAll(); + let n = this.indexedDB.open(am, im); + n.onupgradeneeded = () => om(n), n.onsuccess = () => { + let s = n.result, r = s.transaction(ur, "readonly"), i = r.objectStore(ur).getAll(); i.onsuccess = () => { let o = {}; for (let u of i.result) @@ -5439,17 +5439,17 @@ var C_ = class { }); } async removeModel(e) { - return e = S_(e), new Promise((t, n) => { - let s = this.indexedDB.open(rm, am); - s.onupgradeneeded = () => im(s), s.onsuccess = () => { - let r = s.result, a = r.transaction(or, "readwrite"), i = a.objectStore(or), o = i.get(e), u; + return e = A_(e), new Promise((t, n) => { + let s = this.indexedDB.open(am, im); + s.onupgradeneeded = () => om(s), s.onsuccess = () => { + let r = s.result, a = r.transaction(ur, "readwrite"), i = a.objectStore(ur), o = i.get(e), u; o.onsuccess = () => { if (o.result == null) return r.close(), n(new Error(`Cannot find model with path '${e}' in IndexedDB.`)); { let l = i.delete(e), c = () => { - u = r.transaction(Yr, "readwrite"); - let d = u.objectStore(Yr).delete(e); + u = r.transaction(Qr, "readwrite"); + let d = u.objectStore(Qr).delete(e); d.onsuccess = () => t(o.result.modelArtifactsInfo), d.onerror = (h) => n(o.error); }; l.onsuccess = c, l.onerror = (p) => (c(), r.close(), n(o.error)); @@ -5462,35 +5462,35 @@ var C_ = class { } }; var Gs = "/"; -var Ui = "tensorflowjs_models"; -var bk = "info"; -var N_ = "model_topology"; -var T_ = "weight_specs"; -var $_ = "weight_data"; -var __ = "model_metadata"; -function yk(e) { - return { info: [Ui, e, bk].join(Gs), topology: [Ui, e, N_].join(Gs), weightSpecs: [Ui, e, T_].join(Gs), weightData: [Ui, e, $_].join(Gs), modelMetadata: [Ui, e, __].join(Gs) }; +var Hi = "tensorflowjs_models"; +var wk = "info"; +var R_ = "model_topology"; +var D_ = "weight_specs"; +var F_ = "weight_data"; +var O_ = "model_metadata"; +function kk(e) { + return { info: [Hi, e, wk].join(Gs), topology: [Hi, e, R_].join(Gs), weightSpecs: [Hi, e, D_].join(Gs), weightData: [Hi, e, F_].join(Gs), modelMetadata: [Hi, e, O_].join(Gs) }; } -function vk(e) { +function Ik(e) { for (let t of Object.values(e)) window.localStorage.removeItem(t); } -function A_(e) { +function P_(e) { let t = e.split(Gs); if (t.length < 3) throw new Error(`Invalid key format: ${e}`); return t.slice(1, t.length - 1).join(Gs); } -function E_(e) { - return e.startsWith(la.URL_SCHEME) ? e.slice(la.URL_SCHEME.length) : e; +function z_(e) { + return e.startsWith(ca.URL_SCHEME) ? e.slice(ca.URL_SCHEME.length) : e; } -var la = class { +var ca = class { constructor(e) { if (!X().getBool("IS_BROWSER") || typeof window == "undefined" || typeof window.localStorage == "undefined") throw new Error("The current environment does not support local storage."); if (this.LS = window.localStorage, e == null || !e) throw new Error("For local storage, modelPath must not be null, undefined or empty."); - this.modelPath = e, this.keys = yk(this.modelPath); + this.modelPath = e, this.keys = kk(this.modelPath); } async save(e) { if (e.modelTopology instanceof ArrayBuffer) @@ -5498,11 +5498,11 @@ var la = class { { let t = JSON.stringify(e.modelTopology), n = JSON.stringify(e.weightSpecs), s = Fl(e); try { - this.LS.setItem(this.keys.info, JSON.stringify(s)), this.LS.setItem(this.keys.topology, t), this.LS.setItem(this.keys.weightSpecs, n), this.LS.setItem(this.keys.weightData, h_(e.weightData)); + this.LS.setItem(this.keys.info, JSON.stringify(s)), this.LS.setItem(this.keys.topology, t), this.LS.setItem(this.keys.weightSpecs, n), this.LS.setItem(this.keys.weightData, v_(e.weightData)); let r = { format: e.format, generatedBy: e.generatedBy, convertedBy: e.convertedBy, signature: e.signature != null ? e.signature : void 0, userDefinedMetadata: e.userDefinedMetadata != null ? e.userDefinedMetadata : void 0, modelInitializer: e.modelInitializer != null ? e.modelInitializer : void 0, trainingConfig: e.trainingConfig != null ? e.trainingConfig : void 0 }; return this.LS.setItem(this.keys.modelMetadata, JSON.stringify(r)), { modelArtifactsInfo: s }; } catch (r) { - throw vk(this.keys), new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${s.modelTopologyBytes}, weightSpecsBytes=${s.weightSpecsBytes}, weightDataBytes=${s.weightDataBytes}.`); + throw Ik(this.keys), new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${s.modelTopologyBytes}, weightSpecsBytes=${s.weightSpecsBytes}, weightDataBytes=${s.weightDataBytes}.`); } } } @@ -5528,41 +5528,41 @@ var la = class { let a = this.LS.getItem(this.keys.weightData); if (a == null) throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`); - return t.weightData = f_(a), t; + return t.weightData = x_(a), t; } }; -la.URL_SCHEME = "localstorage://"; -var xk = (e) => X().getBool("IS_BROWSER") && !Array.isArray(e) && e.startsWith(la.URL_SCHEME) ? R_(e.slice(la.URL_SCHEME.length)) : null; -xt.registerSaveRouter(xk); -xt.registerLoadRouter(xk); -function R_(e) { - return new la(e); +ca.URL_SCHEME = "localstorage://"; +var Sk = (e) => X().getBool("IS_BROWSER") && !Array.isArray(e) && e.startsWith(ca.URL_SCHEME) ? M_(e.slice(ca.URL_SCHEME.length)) : null; +xt.registerSaveRouter(Sk); +xt.registerLoadRouter(Sk); +function M_(e) { + return new ca(e); } -var D_ = class { +var L_ = class { constructor() { O(X().getBool("IS_BROWSER"), () => "Current environment is not a web browser"), O(typeof window == "undefined" || typeof window.localStorage != "undefined", () => "Current browser does not appear to support localStorage"), this.LS = window.localStorage; } async listModels() { - let e = {}, t = Ui + Gs, n = Gs + bk; + let e = {}, t = Hi + Gs, n = Gs + wk; for (let s = 0; s < this.LS.length; ++s) { let r = this.LS.key(s); if (r.startsWith(t) && r.endsWith(n)) { - let a = A_(r); + let a = P_(r); e[a] = JSON.parse(this.LS.getItem(r)); } } return e; } async removeModel(e) { - e = E_(e); - let t = yk(e); + e = z_(e); + let t = kk(e); if (this.LS.getItem(t.info) == null) throw new Error(`Cannot find model at path '${e}'`); let n = JSON.parse(this.LS.getItem(t.info)); - return vk(t), n; + return Ik(t), n; } }; -var qi = "://"; +var Ki = "://"; var zn = class { constructor() { this.managers = {}; @@ -5571,7 +5571,7 @@ var zn = class { return zn.instance == null && (zn.instance = new zn()), zn.instance; } static registerManager(e, t) { - O(e != null, () => "scheme must not be undefined or null."), e.endsWith(qi) && (e = e.slice(0, e.indexOf(qi))), O(e.length > 0, () => "scheme must not be an empty string."); + O(e != null, () => "scheme must not be undefined or null."), e.endsWith(Ki) && (e = e.slice(0, e.indexOf(Ki))), O(e.length > 0, () => "scheme must not be an empty string."); let n = zn.getInstance(); O(n.managers[e] == null, () => `A model store manager is already registered for scheme '${e}'.`), n.managers[e] = t; } @@ -5586,11 +5586,11 @@ var zn = class { } }; function td(e) { - if (e.indexOf(qi) === -1) + if (e.indexOf(Ki) === -1) throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${zn.getSchemes().join(",")}`); - return { scheme: e.split(qi)[0], path: e.split(qi)[1] }; + return { scheme: e.split(Ki)[0], path: e.split(Ki)[1] }; } -async function wk(e, t, n = false) { +async function Ck(e, t, n = false) { O(e !== t, () => `Old path and new path are the same: '${e}'`); let s = xt.getLoadHandlers(e); O(s.length > 0, () => `Copying failed because no load handler is found for source URL ${e}.`), O(s.length < 2, () => `Copying failed because more than one (${s.length}) load handlers for source URL ${e}.`); @@ -5601,28 +5601,28 @@ async function wk(e, t, n = false) { let p = await i.save(c); return n && !l && await zn.getManager(o).removeModel(u), p.modelArtifactsInfo; } -async function F_() { +async function B_() { let e = zn.getSchemes(), t = {}; for (let n of e) { let s = await zn.getManager(n).listModels(); for (let r in s) { - let a = n + qi + r; + let a = n + Ki + r; t[a] = s[r]; } } return t; } -async function O_(e) { +async function V_(e) { let t = td(e); return zn.getManager(t.scheme).removeModel(t.path); } -async function P_(e, t) { - return wk(e, t, false); +async function W_(e, t) { + return Ck(e, t, false); } -async function z_(e, t) { - return wk(e, t, true); +async function U_(e, t) { + return Ck(e, t, true); } -var M_ = class { +var G_ = class { fetch(e, t) { return fetch(e, t); } @@ -5639,24 +5639,24 @@ var M_ = class { } }; if (X().get("IS_BROWSER")) { - X().setPlatform("browser", new M_()); + X().setPlatform("browser", new G_()); try { - zn.registerManager(la.URL_SCHEME, new D_()); + zn.registerManager(ca.URL_SCHEME, new L_()); } catch (e) { } try { - zn.registerManager(ua.URL_SCHEME, new C_()); + zn.registerManager(la.URL_SCHEME, new E_()); } catch (e) { } } -var L_ = { importFetch: () => qT() }; -var Pf; -var B_ = class { +var H_ = { importFetch: () => ZT() }; +var Mf; +var q_ = class { constructor() { - this.util = jT(), this.textEncoder = new this.util.TextEncoder(); + this.util = JT(), this.textEncoder = new this.util.TextEncoder(); } fetch(e, t) { - return X().global.fetch != null ? X().global.fetch(e, t) : (Pf == null && (Pf = L_.importFetch()), Pf(e, t)); + return X().global.fetch != null ? X().global.fetch(e, t) : (Mf == null && (Mf = H_.importFetch()), Mf(e, t)); } now() { let e = process.hrtime(); @@ -5671,44 +5671,44 @@ var B_ = class { return e.length === 0 ? "" : new this.util.TextDecoder(t).decode(e); } }; -X().get("IS_NODE") && !X().get("IS_BROWSER") && X().setPlatform("node", new B_()); +X().get("IS_NODE") && !X().get("IS_BROWSER") && X().setPlatform("node", new q_()); function De(e, t = "float32", n) { - return t = t || "float32", sg(e), new Vt(e, t, n); + return t = t || "float32", ag(e), new Vt(e, t, n); } -function V_(e, t) { +function j_(e, t) { let n = _(e, "x", "cast"); - if (!Kw(t)) + if (!Zw(t)) throw new Error(`Failed to cast to unknown dtype ${t}`); if (t === "string" && n.dtype !== "string" || t !== "string" && n.dtype === "string") throw new Error("Only strings can be casted to strings"); let s = { x: n }, r = { dtype: t }; - return M.runKernel(Na, s, r); + return M.runKernel(Ta, s, r); } -var ce = L({ cast_: V_ }); -function W_(e) { +var ce = L({ cast_: j_ }); +function K_(e) { let n = { x: _(e, "x", "clone", "string_or_numeric") }; - return M.runKernel(Ba, n); + return M.runKernel(Wa, n); } -var lr = L({ clone_: W_ }); -function U_(e, t = false) { +var cr = L({ clone_: K_ }); +function X_(e, t = false) { console.log(e.toString(t)); } -ck(); -var G_ = { buffer: De, cast: ce, clone: lr, print: U_ }; -Q$(G_); +fk(); +var Y_ = { buffer: De, cast: ce, clone: cr, print: X_ }; +s_(Y_); var En = {}; -Ae(En, { browserFiles: () => Q_, browserHTTPRequest: () => nA, concatenateArrayBuffers: () => Og, copyModel: () => P_, decodeWeights: () => hk, encodeWeights: () => d_, fromMemory: () => rA, getLoadHandlers: () => k_, getModelArtifactsForJSON: () => Pg, getModelArtifactsInfoForJSON: () => Fl, getSaveHandlers: () => w_, http: () => Mg, isHTTPScheme: () => um, listModels: () => F_, loadWeights: () => Z_, moveModel: () => z_, registerLoadRouter: () => x_, registerSaveRouter: () => v_, removeModel: () => O_, weightsLoaderFactory: () => Ik, withSaveHandler: () => aA }); -var H_ = "model"; -var q_ = ".json"; -var j_ = ".weights.bin"; -function cx(e) { +Ae(En, { browserFiles: () => sA, browserHTTPRequest: () => uA, concatenateArrayBuffers: () => zg, copyModel: () => W_, decodeWeights: () => bk, encodeWeights: () => b_, fromMemory: () => cA, getLoadHandlers: () => $_, getModelArtifactsForJSON: () => Mg, getModelArtifactsInfoForJSON: () => Fl, getSaveHandlers: () => T_, http: () => Bg, isHTTPScheme: () => lm, listModels: () => B_, loadWeights: () => rA, moveModel: () => U_, registerLoadRouter: () => N_, registerSaveRouter: () => C_, removeModel: () => V_, weightsLoaderFactory: () => Tk, withSaveHandler: () => dA }); +var Q_ = "model"; +var Z_ = ".json"; +var J_ = ".weights.bin"; +function px(e) { return new Promise((t) => setTimeout(t)).then(e); } -var om = class { +var um = class { constructor(e) { if (!X().getBool("IS_BROWSER")) throw new Error("browserDownloads() cannot proceed because the current environment is not a browser."); - e.startsWith(om.URL_SCHEME) && (e = e.slice(om.URL_SCHEME.length)), (e == null || e.length === 0) && (e = H_), this.modelJsonFileName = e + q_, this.weightDataFileName = e + j_; + e.startsWith(um.URL_SCHEME) && (e = e.slice(um.URL_SCHEME.length)), (e == null || e.length === 0) && (e = Q_), this.modelJsonFileName = e + Z_, this.weightDataFileName = e + J_; } async save(e) { if (typeof document == "undefined") @@ -5717,18 +5717,18 @@ var om = class { if (e.modelTopology instanceof ArrayBuffer) throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet."); { - let n = [{ paths: ["./" + this.weightDataFileName], weights: e.weightSpecs }], s = fk(e, n), r = window.URL.createObjectURL(new Blob([JSON.stringify(s)], { type: "application/json" })), a = this.modelJsonAnchor == null ? document.createElement("a") : this.modelJsonAnchor; - if (a.download = this.modelJsonFileName, a.href = r, await cx(() => a.dispatchEvent(new MouseEvent("click"))), e.weightData != null) { + let n = [{ paths: ["./" + this.weightDataFileName], weights: e.weightSpecs }], s = yk(e, n), r = window.URL.createObjectURL(new Blob([JSON.stringify(s)], { type: "application/json" })), a = this.modelJsonAnchor == null ? document.createElement("a") : this.modelJsonAnchor; + if (a.download = this.modelJsonFileName, a.href = r, await px(() => a.dispatchEvent(new MouseEvent("click"))), e.weightData != null) { let i = this.weightDataAnchor == null ? document.createElement("a") : this.weightDataAnchor; - i.download = this.weightDataFileName, i.href = t, await cx(() => i.dispatchEvent(new MouseEvent("click"))); + i.download = this.weightDataFileName, i.href = t, await px(() => i.dispatchEvent(new MouseEvent("click"))); } return { modelArtifactsInfo: Fl(e) }; } } }; -var yd = om; +var yd = um; yd.URL_SCHEME = "downloads://"; -var K_ = class { +var eA = class { constructor(e) { if (e == null || e.length < 1) throw new Error(`When calling browserFiles, at least 1 file is required, but received ${e}`); @@ -5751,7 +5751,7 @@ var K_ = class { e({ modelTopology: a }); return; } - let o = Pg(r, (u) => this.loadWeights(u)); + let o = Mg(r, (u) => this.loadWeights(u)); e(o); }, n.onerror = (s) => t(`Failed to read model topology and weights manifest JSON from file '${this.jsonFile.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`), n.readAsText(this.jsonFile); }); @@ -5761,7 +5761,7 @@ var K_ = class { for (let a of e) t.push(...a.weights), n.push(...a.paths); let s = this.checkManifestAndWeightFiles(e), r = n.map((a) => this.loadWeightsFile(a, s[a])); - return Promise.all(r).then((a) => [t, Og(a)]); + return Promise.all(r).then((a) => [t, zg(a)]); } loadWeightsFile(e, t) { return new Promise((n, s) => { @@ -5773,10 +5773,10 @@ var K_ = class { }); } checkManifestAndWeightFiles(e) { - let t = [], n = this.weightsFiles.map((r) => lx(r.name)), s = {}; + let t = [], n = this.weightsFiles.map((r) => dx(r.name)), s = {}; for (let r of e) r.paths.forEach((a) => { - let i = lx(a); + let i = dx(a); if (t.indexOf(i) !== -1) throw new Error(`Duplicate file basename found in weights manifest: '${i}'`); if (t.push(i), n.indexOf(i) === -1) @@ -5788,15 +5788,15 @@ var K_ = class { return s; } }; -var X_ = (e) => X().getBool("IS_BROWSER") && !Array.isArray(e) && e.startsWith(yd.URL_SCHEME) ? Y_(e.slice(yd.URL_SCHEME.length)) : null; -xt.registerSaveRouter(X_); -function Y_(e = "model") { +var tA = (e) => X().getBool("IS_BROWSER") && !Array.isArray(e) && e.startsWith(yd.URL_SCHEME) ? nA(e.slice(yd.URL_SCHEME.length)) : null; +xt.registerSaveRouter(tA); +function nA(e = "model") { return new yd(e); } -function Q_(e) { - return new K_(e); +function sA(e) { + return new eA(e); } -function dx(e, t, n, s) { +function hx(e, t, n, s) { i(e), n = n == null ? 0 : n, s = s == null ? 1 : s, o(n, s); let r = 0, a = (u) => (u.then((l) => { let c = n + ++r / e.length * (s - n); @@ -5810,21 +5810,21 @@ function dx(e, t, n, s) { } return Promise.all(e.map(a)); } -async function kk(e, t) { +async function Nk(e, t) { t == null && (t = {}); - let n = t.fetchFunc == null ? X().platform.fetch : t.fetchFunc, s = e.map((p) => n(p, t.requestInit, { isBinary: true })), r = 0, a = 0.5, o = (t.onProgress == null ? await Promise.all(s) : await dx(s, t.onProgress, r, a)).map((p) => p.arrayBuffer()), u = 0.5, l = 1; - return t.onProgress == null ? await Promise.all(o) : await dx(o, t.onProgress, u, l); + let n = t.fetchFunc == null ? X().platform.fetch : t.fetchFunc, s = e.map((p) => n(p, t.requestInit, { isBinary: true })), r = 0, a = 0.5, o = (t.onProgress == null ? await Promise.all(s) : await hx(s, t.onProgress, r, a)).map((p) => p.arrayBuffer()), u = 0.5, l = 1; + return t.onProgress == null ? await Promise.all(o) : await hx(o, t.onProgress, u, l); } -async function Z_(e, t = "", n, s) { - return Ik((i) => kk(i, { requestInit: s }))(e, t, n); +async function rA(e, t = "", n, s) { + return Tk((i) => Nk(i, { requestInit: s }))(e, t, n); } -function Ik(e) { +function Tk(e) { return async (t, n = "", s) => { let r = t.map(() => false), a = {}, i = s != null ? s.map(() => false) : [], o = []; if (t.forEach((h, f) => { let m = 0; h.weights.forEach((g) => { - let b = "quantization" in g ? g.quantization.dtype : g.dtype, y = sm[b] * pt(g.shape), v = () => { + let b = "quantization" in g ? g.quantization.dtype : g.dtype, y = rm[b] * pt(g.shape), v = () => { r[f] = true, a[f] == null && (a[f] = []), a[f].push({ manifestEntry: g, groupOffset: m, sizeBytes: y }); }; s != null ? s.forEach((x, k) => { @@ -5854,16 +5854,16 @@ Manifest JSON has weights with names: ${o.join(", ")}.`); b.set(k, y), y += k.byteLength; } a[h].forEach((x) => { - let k = g.slice(x.groupOffset, x.groupOffset + x.sizeBytes), T = hk(k, [x.manifestEntry]); + let k = g.slice(x.groupOffset, x.groupOffset + x.sizeBytes), T = bk(k, [x.manifestEntry]); for (let N in T) p[N] = T[N]; }), d += f; }), p; }; } -var J_ = "application/octet-stream"; -var eA = "application/json"; -var zg = class { +var aA = "application/octet-stream"; +var iA = "application/json"; +var Lg = class { constructor(e, t) { if (this.DEFAULT_METHOD = "POST", t == null && (t = {}), this.weightPathPrefix = t.weightPathPrefix, this.onProgress = t.onProgress, this.weightUrlConverter = t.weightUrlConverter, t.fetchFunc != null ? (O(typeof t.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 = t.fetchFunc) : this.fetch = X().platform.fetch, O(e != null && e.length > 0, () => "URL path for http must not be null, undefined or empty."), Array.isArray(e) && O(e.length === 2, () => `URL paths for http must have a length of 2, (actual length is ${e.length}).`), this.path = e, t.requestInit != null && t.requestInit.body != null) throw new Error("requestInit is expected to have no pre-existing body, but has one."); @@ -5874,8 +5874,8 @@ var zg = class { throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet."); let t = Object.assign({ method: this.DEFAULT_METHOD }, this.requestInit); t.body = new FormData(); - let n = [{ paths: ["./model.weights.bin"], weights: e.weightSpecs }], s = fk(e, n); - t.body.append("model.json", new Blob([JSON.stringify(s)], { type: eA }), "model.json"), e.weightData != null && t.body.append("model.weights.bin", new Blob([e.weightData], { type: J_ }), "model.weights.bin"); + let n = [{ paths: ["./model.weights.bin"], weights: e.weightSpecs }], s = yk(e, n); + t.body.append("model.json", new Blob([JSON.stringify(s)], { type: iA }), "model.json"), e.weightData != null && t.body.append("model.weights.bin", new Blob([e.weightData], { type: aA }), "model.weights.bin"); let r = await this.fetch(this.path, t); if (r.ok) return { modelArtifactsInfo: Fl(e), responses: [r] }; @@ -5895,10 +5895,10 @@ var zg = class { let n = t.modelTopology, s = t.weightsManifest; if (n == null && s == null) throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`); - return Pg(t, (r) => this.loadWeights(r)); + return Mg(t, (r) => this.loadWeights(r)); } async loadWeights(e) { - let t = Array.isArray(this.path) ? this.path[1] : this.path, [n, s] = tA(t), r = this.weightPathPrefix || n, a = []; + let t = Array.isArray(this.path) ? this.path[1] : this.path, [n, s] = oA(t), r = this.weightPathPrefix || n, a = []; for (let l of e) a.push(...l.weights); let i = [], o = []; @@ -5906,37 +5906,37 @@ var zg = class { for (let c of l.paths) this.weightUrlConverter != null ? o.push(this.weightUrlConverter(c)) : i.push(r + c + s); this.weightUrlConverter && i.push(...await Promise.all(o)); - let u = await kk(i, { requestInit: this.requestInit, fetchFunc: this.fetch, onProgress: this.onProgress }); - return [a, Og(u)]; + let u = await Nk(i, { requestInit: this.requestInit, fetchFunc: this.fetch, onProgress: this.onProgress }); + return [a, zg(u)]; } }; -zg.URL_SCHEME_REGEX = /^https?:\/\//; -function tA(e) { +Lg.URL_SCHEME_REGEX = /^https?:\/\//; +function oA(e) { let t = e.lastIndexOf("/"), n = e.lastIndexOf("?"), s = e.substring(0, t), r = n > t ? e.substring(n) : ""; return [s + "/", r]; } -function um(e) { - return e.match(zg.URL_SCHEME_REGEX) != null; +function lm(e) { + return e.match(Lg.URL_SCHEME_REGEX) != null; } -var Sk = (e, t) => { +var $k = (e, t) => { if (typeof fetch == "undefined" && (t == null || t.fetchFunc == null)) return null; { let n = true; - if (Array.isArray(e) ? n = e.every((s) => um(s)) : n = um(e), n) - return Mg(e, t); + if (Array.isArray(e) ? n = e.every((s) => lm(s)) : n = lm(e), n) + return Bg(e, t); } return null; }; -xt.registerSaveRouter(Sk); -xt.registerLoadRouter(Sk); -function Mg(e, t) { - return new zg(e, t); +xt.registerSaveRouter($k); +xt.registerLoadRouter($k); +function Bg(e, t) { + return new Lg(e, t); } -function nA(e, t) { - return Mg(e, t); +function uA(e, t) { + return Bg(e, t); } -var zf = class { +var Lf = class { constructor(e) { this.modelArtifacts = e; } @@ -5944,7 +5944,7 @@ var zf = class { return this.modelArtifacts; } }; -var sA = class { +var lA = class { constructor(e) { this.saveHandler = e; } @@ -5952,48 +5952,48 @@ var sA = class { return this.saveHandler(e); } }; -function rA(e, t, n, s) { - return arguments.length === 1 ? e.modelTopology != null || e.weightSpecs != null ? new zf(e) : (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."), new zf({ modelTopology: e })) : (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."), new zf({ modelTopology: e, weightSpecs: t, weightData: n, trainingConfig: s })); +function cA(e, t, n, s) { + return arguments.length === 1 ? e.modelTopology != null || e.weightSpecs != null ? new Lf(e) : (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."), new Lf({ modelTopology: e })) : (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."), new Lf({ modelTopology: e, weightSpecs: t, weightData: n, trainingConfig: s })); } -function aA(e) { - return new sA(e); +function dA(e) { + return new lA(e); } -var iA = {}; -Ae(iA, { confusionMatrix: () => dA }); -function oA(e, t, n = false, s = false) { +var pA = {}; +Ae(pA, { confusionMatrix: () => bA }); +function hA(e, t, n = false, s = false) { let r = _(e, "a", "matMul"), a = _(t, "b", "matMul"); [r, a] = vt(r, a); let i = { a: r, b: a }, o = { transposeA: n, transposeB: s }; - return M.runKernel(Ca, i, o); + return M.runKernel(Na, i, o); } -var We = L({ matMul_: oA }); -function uA(e, t, n = 1, s = 0) { +var We = L({ matMul_: hA }); +function fA(e, t, n = 1, s = 0) { if (t < 2) throw new Error(`Error in oneHot: depth must be >=2, but it is ${t}`); let a = { indices: _(e, "indices", "oneHot", "int32") }, i = { depth: t, onValue: n, offValue: s }; - return M.runKernel($o, a, i); + return M.runKernel(Ao, a, i); } -var vd = L({ oneHot_: uA }); -function lA(e, t) { +var vd = L({ oneHot_: fA }); +function mA(e, t) { let n = _(e, "x", "transpose"); if (t == null && (t = n.shape.map((a, i) => i).reverse()), O(n.rank === t.length, () => `Error in transpose: rank of input ${n.rank} must match length of perm ${t}.`), t.forEach((a) => { O(a >= 0 && a < n.rank, () => `All entries in 'perm' must be between 0 and ${n.rank - 1} but got ${t}`); }), n.rank <= 1) return n.clone(); let s = { x: n }, r = { perm: t }; - return M.runKernel(pi, s, r); + return M.runKernel(mi, s, r); } -var qe = L({ transpose_: lA }); -function cA(e, t, n) { +var Ge = L({ transpose_: mA }); +function gA(e, t, n) { let s = _(e, "labels", "confusionMatrix"), r = _(t, "predictions", "confusionMatrix"); O(n == null || n > 0 && Number.isInteger(n), () => `If provided, numClasses must be a positive integer, but got ${n}`), O(s.rank === 1, () => `Expected the rank of labels to be 1, but got ${s.rank}`), O(r.rank === 1, () => `Expected the rank of predictions to be 1, but got ${r.rank}`), O(s.shape[0] === r.shape[0], () => `Mismatch in the number of examples: ${s.shape[0]} vs. ${r.shape[0]}. Labels and predictions should have the same number of elements.`), O(n > 0 && Number.isInteger(n), () => `numClasses is required to be a positive integer, but got ${n}`); - let a = vd(ce(s, "int32"), n), i = vd(ce(r, "int32"), n), o = qe(a), u = We(o, i); + let a = vd(ce(s, "int32"), n), i = vd(ce(r, "int32"), n), o = Ge(a), u = We(o, i); return ce(u, "int32"); } -var dA = L({ confusionMatrix_: cA }); -var jo = {}; -Ae(jo, { assertAndGetBroadcastShape: () => ot, getBroadcastDims: () => Ck, getReductionAxes: () => _t }); -function Ck(e, t) { +var bA = L({ confusionMatrix_: gA }); +var Ko = {}; +Ae(Ko, { assertAndGetBroadcastShape: () => ot, getBroadcastDims: () => _k, getReductionAxes: () => _t }); +function _k(e, t) { let n = e.length, s = []; for (let r = 0; r < n; r++) { let a = n - 1 - r, i = e[a] || 1; @@ -6027,20 +6027,20 @@ function ot(e, t) { } return n; } -var Nk = {}; -Ae(Nk, { fromPixels: () => vA, fromPixelsAsync: () => bA, toPixels: () => yA }); -function pA(e, t, n) { - if (wa(e), t != null && t.length !== 3) +var Ak = {}; +Ae(Ak, { fromPixels: () => CA, fromPixelsAsync: () => IA, toPixels: () => SA }); +function yA(e, t, n) { + if (ka(e), t != null && t.length !== 3) throw new Error("tensor3d() requires shape to have three numbers"); let s = Rs(e, n); if (s.length !== 3 && s.length !== 1) throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray"); if (s.length === 1 && t == null) throw new Error("tensor3d() requires shape to be provided when `values` are a flat array"); - return Nr(e, t, s, n); + return Tr(e, t, s, n); } -var Vr; -function Tk(e, t = 3) { +var Wr; +function Ek(e, t = 3) { if (t > 4) throw new Error("Cannot construct Tensor with more than 4 channels from pixels."); if (e == null) @@ -6062,7 +6062,7 @@ function Tk(e, t = 3) { 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 ${e.constructor.name}`); if (r && r && e.readyState < 2) throw new Error("The video element has not loaded data yet. Please wait for `loadeddata` event on the