@genai-fi/nanogpt 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DatasetBuilder-DU1G1OKX.js → DatasetBuilder-DRDW8tcM.js} +85 -86
- package/dist/Generator-BcR_14Cj.js +316 -0
- package/dist/{RealDiv-CSnvtN2E.js → RealDiv-Cl8k3YTx.js} +54 -62
- package/dist/{Reshape-BlylqwWy.js → Reshape-CKxKPKqi.js} +9 -12
- package/dist/Reshape-H5zZRgr9.js +16 -0
- package/dist/RoPECache-dYscFINl.js +722 -0
- package/dist/TeachableLLM.js +29 -34
- package/dist/api/beamer.js +5 -6
- package/dist/api/responses.js +11 -12
- package/dist/api/training.js +12 -14
- package/dist/axis_util-rF9RnwKE.js +37 -0
- package/dist/backend.js +5 -6
- package/dist/{backend_util-DAV0I34P.js → backend_util-Cpp0Gwlp.js} +180 -185
- package/dist/{binary_op_util-CrYk9LXL.js → binary_op_util-WY9YIl0q.js} +3 -7
- package/dist/broadcast_to-CGvLNiQ0.js +20 -0
- package/dist/checks/appendCache.js +7 -7
- package/dist/checks/attentionMask.js +9 -8
- package/dist/checks/check.js +1 -2
- package/dist/checks/gelu.js +6 -6
- package/dist/checks/index.js +24 -25
- package/dist/checks/matMulGelu.js +7 -7
- package/dist/checks/normRMS.js +14 -12
- package/dist/checks/normRMSGrad.js +9 -8
- package/dist/checks/packUnpack.js +7 -7
- package/dist/checks/qkv.js +1 -34
- package/dist/checks/rope.js +6 -6
- package/dist/checks/weights.js +1 -2
- package/dist/clip_by_value-D-UX9am5.js +13 -0
- package/dist/complex-Cl904TqN.js +13 -0
- package/dist/{complex_util-CkazZsaH.js → complex_util-BBlPAm-s.js} +1 -2
- package/dist/concat-Oip5acVY.js +14 -0
- package/dist/{concat_util-CWzvQQlK.js → concat_util-CY45Hf4F.js} +2 -3
- package/dist/data/docx.js +3 -4
- package/dist/data/pdf.js +11 -14
- package/dist/data/stream.js +1 -2
- package/dist/data/textLoader.js +16 -15
- package/dist/data-CV_i_H6B.js +11 -0
- package/dist/data.js +5 -12
- package/dist/dist-CMMLi-qO.js +2675 -0
- package/dist/{dist-BGVm64AY.js → dist-DeVH1nGn.js} +1465 -1573
- package/dist/{dist-CwK5S7Ls.js → dist-DyL7qSLJ.js} +2664 -2400
- package/dist/dropout16-CA31Ud5a.js +20 -0
- package/dist/dropout_util-SiFMbFXz.js +22 -0
- package/dist/{eventemitter3-D_qV3Lof.js → eventemitter3-wmfmOP_f.js} +2 -3
- package/dist/expand_dims-Dh3Fulyn.js +10 -0
- package/dist/floor-BwjmUb7X.js +8 -0
- package/dist/gather-B5Z1RFt5.js +14 -0
- package/dist/gatherSub-CRUfUzBa.js +22 -0
- package/dist/gelu-Xx9-ohH9.js +25 -0
- package/dist/{gpgpu_math-20tPK8LM.js → gpgpu_math-48m8q3jI.js} +265 -286
- package/dist/inference/Beamer.js +34 -27
- package/dist/inference/Generator.js +1 -273
- package/dist/inference/tokenisePrompt.js +5 -4
- package/dist/inference/types.d.ts +6 -0
- package/dist/inference/utilities.js +1 -2
- package/dist/{jszip.min-DKa1Rjyn.js → jszip.min-Btv48m44.js} +68 -64
- package/dist/{kernel_funcs_utils-ql8Y8qPn.js → kernel_funcs_utils-BYRpSfV_.js} +39 -42
- package/dist/layers/BaseLayer.js +9 -10
- package/dist/layers/GQA.js +45 -44
- package/dist/layers/HeadLayer.js +13 -13
- package/dist/layers/LoRA.js +17 -20
- package/dist/layers/MHA.d.ts +2 -2
- package/dist/layers/MHA.js +46 -45
- package/dist/layers/MLP.js +22 -21
- package/dist/layers/PositionEmbedding.js +14 -13
- package/dist/layers/RMSNorm.js +14 -13
- package/dist/layers/RoPECache.js +1 -338
- package/dist/layers/TiedEmbedding.js +15 -14
- package/dist/layers/TransformerBlock.d.ts +3 -9
- package/dist/layers/TransformerBlock.js +29 -30
- package/dist/layers/WeightStore.js +4 -5
- package/dist/layers-CFqEip3s.js +13 -0
- package/dist/layers.js +3 -11
- package/dist/loader/load.js +27 -24
- package/dist/loader/loadHF.js +3 -3
- package/dist/loader/loadTransformers.js +5 -6
- package/dist/loader/loadZipMeta.js +1 -2
- package/dist/loader/newZipLoad.js +1 -2
- package/dist/loader/oldZipLoad.js +8 -9
- package/dist/loader/save.js +15 -16
- package/dist/main.js +3281 -3463
- package/dist/{matMul16-CO1QhsRt.js → matMul16-tE26fnhf.js} +29 -27
- package/dist/{matMulGelu-CBoqTZM7.js → matMulGelu-ASUWlKqu.js} +33 -33
- package/dist/mat_mul-R9_DWmIT.js +16 -0
- package/dist/models/Llama.js +48 -49
- package/dist/models/NanoGPTV1.js +53 -54
- package/dist/models/NanoGPTV2.js +48 -49
- package/dist/models/Qwen3.js +48 -49
- package/dist/models/config.js +3 -8
- package/dist/models/factory.js +7 -8
- package/dist/models/model.d.ts +5 -7
- package/dist/models/model.js +1 -2
- package/dist/models-DyBpJJwM.js +13 -0
- package/dist/models.js +6 -14
- package/dist/mul16-C7sqgqik.js +41 -0
- package/dist/non_max_suppression_impl-B0H318rb.js +72 -0
- package/dist/not_equal-Bu3O8rh_.js +67 -0
- package/dist/one_hot-TEMPumJj.js +14 -0
- package/dist/ones-DpPXWa6A.js +13 -0
- package/dist/ops/adamAdjust.js +2 -3
- package/dist/ops/adamMoments.js +2 -3
- package/dist/ops/add16.js +2 -3
- package/dist/ops/appendCache.js +9 -8
- package/dist/ops/attentionMask.d.ts +1 -1
- package/dist/ops/attentionMask.js +8 -5
- package/dist/ops/concat16.js +5 -5
- package/dist/ops/cpu/adamAdjust.js +7 -8
- package/dist/ops/cpu/adamMoments.js +5 -5
- package/dist/ops/cpu/appendCache.js +3 -3
- package/dist/ops/cpu/attentionMask.js +12 -8
- package/dist/ops/cpu/fusedSoftmax.js +3 -3
- package/dist/ops/cpu/gatherSub.js +1 -12
- package/dist/ops/cpu/gelu.js +12 -13
- package/dist/ops/cpu/matMul16.js +7 -7
- package/dist/ops/cpu/matMulGelu.js +21 -18
- package/dist/ops/cpu/matMulMul.js +8 -9
- package/dist/ops/cpu/mulDropout.js +8 -9
- package/dist/ops/cpu/normRMS.js +12 -13
- package/dist/ops/cpu/qkv.js +14 -13
- package/dist/ops/cpu/rope.js +11 -8
- package/dist/ops/cpu/scatterSub.js +1 -12
- package/dist/ops/dot16.js +16 -17
- package/dist/ops/dropout.js +9 -8
- package/dist/ops/dropout16.js +1 -22
- package/dist/ops/gatherSub.js +3 -4
- package/dist/ops/gelu.js +1 -2
- package/dist/ops/globalNorm.js +10 -10
- package/dist/ops/grads/add16.js +16 -17
- package/dist/ops/grads/attentionMask.js +6 -7
- package/dist/ops/grads/dropout16.js +1 -1
- package/dist/ops/grads/gelu.js +1 -2
- package/dist/ops/grads/matMul16.js +1 -2
- package/dist/ops/grads/matMulGelu.js +6 -7
- package/dist/ops/grads/mul16.js +1 -1
- package/dist/ops/grads/normRMS.js +8 -9
- package/dist/ops/grads/pack16.js +1 -2
- package/dist/ops/grads/qkv.js +10 -10
- package/dist/ops/grads/rope.js +1 -2
- package/dist/ops/grads/silu.js +1 -2
- package/dist/ops/grads/softmax16.js +6 -7
- package/dist/ops/grads/unpack16.js +1 -2
- package/dist/ops/grads/utils.js +1 -2
- package/dist/ops/matMul16.d.ts +1 -1
- package/dist/ops/matMul16.js +1 -2
- package/dist/ops/matMulGelu.js +3 -4
- package/dist/ops/matMulMul.js +2 -3
- package/dist/ops/mul16.js +1 -43
- package/dist/ops/mulDrop.js +2 -3
- package/dist/ops/normRMS.js +2 -3
- package/dist/ops/pack16.js +1 -2
- package/dist/ops/qkv.js +2 -3
- package/dist/ops/reshape16.js +11 -11
- package/dist/ops/rope.js +1 -2
- package/dist/ops/scatterSub.js +3 -4
- package/dist/ops/silu.js +1 -2
- package/dist/ops/slice16.js +5 -5
- package/dist/ops/softmax16.js +3 -4
- package/dist/ops/sub16.js +3 -4
- package/dist/ops/sum16.js +3 -3
- package/dist/ops/transpose16.js +16 -15
- package/dist/ops/unpack16.js +1 -2
- package/dist/ops/webgl/adamAdjust.js +8 -9
- package/dist/ops/webgl/adamMoments.js +2 -3
- package/dist/ops/webgl/appendCache.js +2 -3
- package/dist/ops/webgl/attentionMask.js +2 -3
- package/dist/ops/webgl/dropout16.js +2 -3
- package/dist/ops/webgl/fusedSoftmax.js +13 -13
- package/dist/ops/webgl/gatherSub.js +2 -3
- package/dist/ops/webgl/gelu.js +11 -12
- package/dist/ops/webgl/log.js +10 -10
- package/dist/ops/webgl/matMul16.js +31 -24
- package/dist/ops/webgl/matMulGelu.js +1 -2
- package/dist/ops/webgl/matMulMul.js +3 -4
- package/dist/ops/webgl/mulDropout.js +2 -3
- package/dist/ops/webgl/normRMS.js +11 -10
- package/dist/ops/webgl/qkv.js +2 -3
- package/dist/ops/webgl/rope.js +4 -5
- package/dist/ops/webgl/scatterSub.js +2 -3
- package/dist/ops/webgpu/adamAdjust.js +13 -14
- package/dist/ops/webgpu/adamMoments.js +13 -14
- package/dist/ops/webgpu/add16.js +3 -4
- package/dist/ops/webgpu/appendCache.js +20 -21
- package/dist/ops/webgpu/attentionMask.js +18 -19
- package/dist/ops/webgpu/attentionMask32_program.js +7 -8
- package/dist/ops/webgpu/clipScale.js +11 -12
- package/dist/ops/webgpu/concat16.js +17 -18
- package/dist/ops/webgpu/dropout16.js +6 -7
- package/dist/ops/webgpu/gatherSub.js +11 -12
- package/dist/ops/webgpu/gelu.js +10 -11
- package/dist/ops/webgpu/index.js +17 -17
- package/dist/ops/webgpu/matMul16.js +74 -63
- package/dist/ops/webgpu/matMul16_program.d.ts +2 -1
- package/dist/ops/webgpu/matMul16_program.js +29 -21
- package/dist/ops/webgpu/mul16.js +3 -4
- package/dist/ops/webgpu/norm2.js +9 -10
- package/dist/ops/webgpu/normRMS.js +9 -10
- package/dist/ops/webgpu/normRMS16_program.js +1 -2
- package/dist/ops/webgpu/normRMS32_program.js +1 -2
- package/dist/ops/webgpu/normRMSGrad.js +30 -30
- package/dist/ops/webgpu/pack16.js +2 -3
- package/dist/ops/webgpu/pack16_program.js +3 -4
- package/dist/ops/webgpu/qkv.js +10 -11
- package/dist/ops/webgpu/rope.js +26 -27
- package/dist/ops/webgpu/scatterSub.js +12 -13
- package/dist/ops/webgpu/silu.js +10 -11
- package/dist/ops/webgpu/slice16.js +17 -18
- package/dist/ops/webgpu/softmax16.js +9 -9
- package/dist/ops/webgpu/softmax16_program.js +9 -10
- package/dist/ops/webgpu/softmax16_subgroup_program.js +11 -12
- package/dist/ops/webgpu/softmax16grad.js +8 -9
- package/dist/ops/webgpu/sub16.js +3 -4
- package/dist/ops/webgpu/sum16.js +16 -15
- package/dist/ops/webgpu/transpose16.js +13 -12
- package/dist/ops/webgpu/transpose16_program.js +3 -4
- package/dist/ops/webgpu/transpose16_shared_program.js +17 -18
- package/dist/ops/webgpu/unpack16.js +8 -9
- package/dist/ops/webgpu/utils/binary_op.js +20 -21
- package/dist/ops/webgpu/utils/deviceInfo.js +1 -2
- package/dist/ops/webgpu/utils/reductions.js +21 -20
- package/dist/ops-Be5ACU5R.js +13 -0
- package/dist/ops-C1UpdEYM.js +509 -0
- package/dist/{pack16-BhuXNUS7.js → pack16-BHO4t1-M.js} +14 -17
- package/dist/pad-Dy-1IP3A.js +13 -0
- package/dist/patches/webgpu_backend.js +18 -19
- package/dist/patches/webgpu_base.js +2 -3
- package/dist/patches/webgpu_program.js +21 -22
- package/dist/{pdf-Bzuk68Vy.js → pdf-CbnQ75VG.js} +380 -701
- package/dist/{picomatch-BO4HbNfo.js → picomatch--TW6gyBJ.js} +229 -291
- package/dist/qkv-BQfNPucX.js +42 -0
- package/dist/rand_util-_vCY93Uw.js +44 -0
- package/dist/random_normal-DUIT8kyC.js +11 -0
- package/dist/range-CYvQC3fW.js +13 -0
- package/dist/relu-C4XULT8A.js +8 -0
- package/dist/reshape-DJb1jgMt.js +8 -0
- package/dist/resize_nearest_neighbor-DAqcTYUe.js +188 -0
- package/dist/{chunk-CWhphoD1.js → rolldown-runtime-CwxnZyOB.js} +4 -5
- package/dist/{rope-BPu_uooz.js → rope-JjBVufF_.js} +6 -8
- package/dist/scatterSub-BOnqk-uY.js +27 -0
- package/dist/scatter_nd_util-BepMCpLY.js +34 -0
- package/dist/seedrandom-SHEGFK6H.js +282 -0
- package/dist/selu_util-DeOTf-sc.js +27 -0
- package/dist/shared-BIDMUBCs.js +1864 -0
- package/dist/{shared-CfTzpULd.js → shared-CX_iPI5K.js} +2 -3
- package/dist/silu-DsAE2cJ5.js +23 -0
- package/dist/slice-Dlb1FlzG.js +13 -0
- package/dist/{slice_util-Dve4TkDn.js → slice_util-BVgPRoij.js} +3 -4
- package/dist/softmax-Dpav_dWw.js +10 -0
- package/dist/split-DYnT8chz.js +11 -0
- package/dist/squeeze-B3XYGAlg.js +9 -0
- package/dist/stack-Dbbt9mIk.js +10 -0
- package/dist/step-DA-5DNu9.js +348 -0
- package/dist/{stream-BpAwcvHz.js → stream-BBe2apn4.js} +68 -88
- package/dist/sum-C8qNbFNp.js +13 -0
- package/dist/tensor-ALxWZfmz.js +7 -0
- package/dist/tensor1d-BHgkkhTE.js +9 -0
- package/dist/tensor2d-ARItvqVn.js +10 -0
- package/dist/tensor4d-D1zRBipJ.js +10 -0
- package/dist/tfjs_backend-CsXOum0h.js +685 -0
- package/dist/tile-DfyQ0KX-.js +10 -0
- package/dist/tokenise-DbS2Ea-T.js +14 -0
- package/dist/tokenise.js +6 -15
- package/dist/tokeniser/BaseTokeniser.js +5 -9
- package/dist/tokeniser/CharTokeniser.js +1 -2
- package/dist/tokeniser/bpe.js +19 -20
- package/dist/topk-BrU2pkrR.js +19 -0
- package/dist/training/AdamW.js +35 -31
- package/dist/training/BasicTrainer.js +56 -56
- package/dist/training/DatasetBuilder.js +1 -2
- package/dist/training/Evaluator.js +4 -4
- package/dist/training/LRScheduler.js +1 -2
- package/dist/training/PreTrainer.js +7 -8
- package/dist/training/SFTTrainer.js +7 -8
- package/dist/training/configure.js +16 -15
- package/dist/training/factory.js +1 -2
- package/dist/training/loss.js +1 -2
- package/dist/training/orthoGrad.js +2 -3
- package/dist/training/prepareData.js +18 -17
- package/dist/training/sparseCrossEntropy.js +38 -32
- package/dist/training/tasks/TokenStore.js +21 -22
- package/dist/training/tasks/tokenStream.js +1 -2
- package/dist/training/validateOptions.js +1 -2
- package/dist/training/validation.js +1 -2
- package/dist/transpose-BC-M_OoT.js +34 -0
- package/dist/unsorted_segment_sum-BelC7R-q.js +408 -0
- package/dist/utilities/arrayClose.js +5 -4
- package/dist/utilities/arrayShape.js +1 -2
- package/dist/utilities/datasetID.js +1 -2
- package/dist/utilities/dummy.js +15 -15
- package/dist/utilities/float16.js +10 -10
- package/dist/utilities/maxHeap.js +1 -2
- package/dist/utilities/multinomialCPU.d.ts +1 -2
- package/dist/utilities/multinomialCPU.js +6 -8
- package/dist/utilities/packed.js +2 -3
- package/dist/utilities/parameters.js +3 -4
- package/dist/utilities/performance.js +2 -3
- package/dist/utilities/profile.js +3 -4
- package/dist/utilities/random.js +1 -2
- package/dist/utilities/safetensors.js +14 -14
- package/dist/utilities/sentences.js +16 -13
- package/dist/utilities/tokenParse.js +1 -2
- package/dist/utilities/tokens.js +5 -6
- package/dist/utilities/topP.d.ts +1 -0
- package/dist/utilities/topP.js +20 -13
- package/dist/utilities/waitForModel.js +1 -2
- package/dist/utilities/weights.js +4 -4
- package/dist/utilities/yielder.js +1 -2
- package/dist/{v4-BK7K-jy_.js → v4-YCkfo8OR.js} +4 -7
- package/dist/{webgpu-IAn9VotJ.js → webgpu-BHX-uBym.js} +156 -163
- package/dist/{webgpu_program-B0PokuRJ.js → webgpu_program-DvkFqRlR.js} +28 -29
- package/dist/{webgpu_util-DfODg6XI.js → webgpu_util-5QTyovaf.js} +2 -3
- package/dist/zeros-hxKGkRfl.js +12 -0
- package/package.json +3 -3
- package/dist/Reshape-CwxdaU8n.js +0 -17
- package/dist/dist-Da20xy8E.js +0 -6375
- package/dist/gelu-B6637MKa.js +0 -27
- package/dist/selu_util-B_AFEfoz.js +0 -24
- package/dist/shared-24EoeHJl.js +0 -1314
- package/dist/silu-B6bvCgJ7.js +0 -25
- package/dist/tfjs_backend-h5weiy1O.js +0 -614
|
@@ -1,38 +1,40 @@
|
|
|
1
|
-
import { n as e } from "./
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { a as
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { n as e } from "./rolldown-runtime-CwxnZyOB.js";
|
|
2
|
+
import { C as t, Ct as n, St as r, T as i, Ti as a, Vi as o, ht as s, lt as c, mt as l, qi as u, w as d, yi as f } from "./dist-CMMLi-qO.js";
|
|
3
|
+
import { a as ee, c as te, i as ne, n as re, o as ie, r as ae, s as oe, t as se } from "./axis_util-rF9RnwKE.js";
|
|
4
|
+
import { n as ce, t as le } from "./concat_util-CY45Hf4F.js";
|
|
5
|
+
import { _ as ue, c as de, d as fe, f as pe, g as me, h as he, l as ge, m as _e, p as ve, s as ye, u as be } from "./step-DA-5DNu9.js";
|
|
6
|
+
import { a as xe, i as Se, n as Ce, o as we, r as Te, t as Ee } from "./selu_util-DeOTf-sc.js";
|
|
7
|
+
import { s as De } from "./slice_util-BVgPRoij.js";
|
|
8
|
+
import { n as Oe, r as ke, t as Ae } from "./scatter_nd_util-BepMCpLY.js";
|
|
9
|
+
import { a as je, c as Me, i as Ne, n as Pe, o as Fe, r as Ie, s as Le, t as Re } from "./complex_util-BBlPAm-s.js";
|
|
10
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd_util.js
|
|
11
|
+
function p(e, t) {
|
|
9
12
|
let n = e.shape.length, r = t.shape.length;
|
|
10
13
|
if (n < 1) throw Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${n}.`);
|
|
11
14
|
if (r < 1) throw Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${r}.`);
|
|
12
15
|
if (t.dtype !== "int32") throw Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${t.dtype}.`);
|
|
13
16
|
if (t.shape[r - 1] > n) throw Error(`index innermost dimension length must be <= tensor rank; saw: ${t.shape[r - 1]} vs. ${n}`);
|
|
14
|
-
if (
|
|
15
|
-
let i = t.shape,
|
|
16
|
-
for (let e = 0; e < i.length - 1; ++e)
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
let
|
|
20
|
-
for (let e =
|
|
21
|
-
let
|
|
17
|
+
if (u(e.shape) === 0) throw Error(`Requested more than 0 entries, but input is empty. Input shape: ${e.shape}.`);
|
|
18
|
+
let i = t.shape, o = i[i.length - 1], s = 1;
|
|
19
|
+
for (let e = 0; e < i.length - 1; ++e) s *= i[e];
|
|
20
|
+
let c = e.shape, l = i.slice();
|
|
21
|
+
l.pop();
|
|
22
|
+
let d = 1;
|
|
23
|
+
for (let e = o; e < n; ++e) d *= c[e], l.push(c[e]);
|
|
24
|
+
let f = [...a(e.shape).map((e) => e / d), 1].slice(0, o);
|
|
22
25
|
return [
|
|
23
|
-
c,
|
|
24
|
-
o,
|
|
25
26
|
l,
|
|
26
|
-
|
|
27
|
+
s,
|
|
28
|
+
d,
|
|
29
|
+
f
|
|
27
30
|
];
|
|
28
31
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var g;
|
|
32
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/ragged_to_dense_util.js
|
|
33
|
+
var m;
|
|
32
34
|
(function(e) {
|
|
33
35
|
e[e.FIRST_DIM_SIZE = 0] = "FIRST_DIM_SIZE", e[e.VALUE_ROWIDS = 1] = "VALUE_ROWIDS", e[e.ROW_LENGTHS = 2] = "ROW_LENGTHS", e[e.ROW_SPLITS = 3] = "ROW_SPLITS", e[e.ROW_LIMITS = 4] = "ROW_LIMITS", e[e.ROW_STARTS = 5] = "ROW_STARTS";
|
|
34
|
-
})(
|
|
35
|
-
function
|
|
36
|
+
})(m ||= {});
|
|
37
|
+
function h(e, t, n) {
|
|
36
38
|
let r = [];
|
|
37
39
|
if (n == null && t == null) return r;
|
|
38
40
|
if (t == null) for (; r.length < e + n.length;) r.push(-1);
|
|
@@ -41,29 +43,31 @@ function _(e, t, n) {
|
|
|
41
43
|
if (e + n.length !== r.length) throw Error(`rt input.shape and shape=${t} are incompatible: rt input.rank = ${e + n.length}, but shape.rank = ${r.length}`);
|
|
42
44
|
for (let i = 1; i < n.length; ++i) {
|
|
43
45
|
let a = n[i], o = r[r.length - n.length + i], s = r[o];
|
|
44
|
-
if (a >= 0)
|
|
45
|
-
if (s
|
|
46
|
-
|
|
46
|
+
if (a >= 0) {
|
|
47
|
+
if (s >= 0) {
|
|
48
|
+
if (s !== a) throw Error(`rt input.shape and shape=${t} are incompatible: rt input.shape[${i + e}] = ${a} but shape[${i + e}] = ${s}`);
|
|
49
|
+
} else r[o] = a;
|
|
50
|
+
}
|
|
47
51
|
}
|
|
48
52
|
return r;
|
|
49
53
|
}
|
|
50
|
-
function
|
|
54
|
+
function g(e) {
|
|
51
55
|
let t = {
|
|
52
|
-
FIRST_DIM_SIZE:
|
|
53
|
-
VALUE_ROWIDS:
|
|
54
|
-
ROW_LENGTHS:
|
|
55
|
-
ROW_SPLITS:
|
|
56
|
-
ROW_LIMITS:
|
|
57
|
-
ROW_STARTS:
|
|
56
|
+
FIRST_DIM_SIZE: m.FIRST_DIM_SIZE,
|
|
57
|
+
VALUE_ROWIDS: m.VALUE_ROWIDS,
|
|
58
|
+
ROW_LENGTHS: m.ROW_LENGTHS,
|
|
59
|
+
ROW_SPLITS: m.ROW_SPLITS,
|
|
60
|
+
ROW_LIMITS: m.ROW_LIMITS,
|
|
61
|
+
ROW_STARTS: m.ROW_STARTS
|
|
58
62
|
}, n = [];
|
|
59
63
|
for (let r of e) if (r in t) n.push(t[r]);
|
|
60
64
|
else break;
|
|
61
65
|
return n;
|
|
62
66
|
}
|
|
63
|
-
function
|
|
64
|
-
return e.length === 0 ? 0 : e[0] ===
|
|
67
|
+
function _(e) {
|
|
68
|
+
return e.length === 0 ? 0 : e[0] === m.FIRST_DIM_SIZE ? e.length - 1 : e.length;
|
|
65
69
|
}
|
|
66
|
-
function
|
|
70
|
+
function v(e, t) {
|
|
67
71
|
if (e == null || t == null) return;
|
|
68
72
|
let n = e.length, r = t.length;
|
|
69
73
|
if (n >= r) throw Error(`defaultValue.shape=${e} and ragged tensor flatValues.shape=${t}, are incompatible: defaultValue.rank = ${n} must be less than ragged tensor input flatValues.rank = ${r})`);
|
|
@@ -72,17 +76,15 @@ function b(e, t) {
|
|
|
72
76
|
if (n >= 0 && r >= 0 && n !== 1 && n !== r) throw Error(`defaultValue.shape=${e}, and ragged tensor input flatValues.shape=${t} are incompatible: defaultValue.shape[${i - e.length}] = ${n} but ragged tensor input.flatValues.shape[${i - e.length}] = ${r}`);
|
|
73
77
|
}
|
|
74
78
|
}
|
|
75
|
-
function
|
|
76
|
-
return e <= 30 ? e :
|
|
79
|
+
function y(e) {
|
|
80
|
+
return e <= 30 ? e : o(e, Math.floor(Math.sqrt(e)));
|
|
77
81
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
function S(e, t, n) {
|
|
82
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/rotate_util.js
|
|
83
|
+
function ze(e, t, n) {
|
|
81
84
|
return [n * (typeof e == "number" ? e : e[0]), t * (typeof e == "number" ? e : e[1])];
|
|
82
85
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
function C(e, t, n, r = !0) {
|
|
86
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_util.js
|
|
87
|
+
function b(e, t, n, r = !0) {
|
|
86
88
|
let i = [];
|
|
87
89
|
if (r) i = i.concat(t.slice(0)), i.push(e[0] / n), i = i.concat(e.slice(1));
|
|
88
90
|
else {
|
|
@@ -93,7 +95,7 @@ function C(e, t, n, r = !0) {
|
|
|
93
95
|
}
|
|
94
96
|
return i;
|
|
95
97
|
}
|
|
96
|
-
function
|
|
98
|
+
function x(e, t, n = !0) {
|
|
97
99
|
let r = [];
|
|
98
100
|
if (n) {
|
|
99
101
|
r.push(t);
|
|
@@ -105,33 +107,32 @@ function Le(e, t, n = !0) {
|
|
|
105
107
|
}
|
|
106
108
|
return r;
|
|
107
109
|
}
|
|
108
|
-
function
|
|
110
|
+
function S(e, t, n, r = !0) {
|
|
109
111
|
let i = [];
|
|
110
112
|
r ? i.push(e[0] / n) : i.push(e[0] * n);
|
|
111
113
|
for (let n = 1; n < e.length; ++n) n <= t.length ? r ? i.push(t[n - 1] * e[n]) : i.push(e[n] / t[n - 1]) : i.push(e[n]);
|
|
112
114
|
return i;
|
|
113
115
|
}
|
|
114
|
-
function
|
|
116
|
+
function C(e, t) {
|
|
115
117
|
let n = [0];
|
|
116
118
|
for (let r = 0; r < t; ++r) n.push(e[r][0]);
|
|
117
119
|
return n;
|
|
118
120
|
}
|
|
119
|
-
function
|
|
121
|
+
function w(e, t, n) {
|
|
120
122
|
let r = e.slice(0, 1);
|
|
121
123
|
for (let i = 0; i < n; ++i) r.push(e[i + 1] - t[i][0] - t[i][1]);
|
|
122
124
|
return r;
|
|
123
125
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
function I(e, t) {
|
|
126
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/erf_util.js
|
|
127
|
+
var T = .3275911, E = .254829592, D = -.284496736, O = 1.421413741, k = -1.453152027, A = 1.061405429, j = "->", Be = /->/g, M = ",", N = "...";
|
|
128
|
+
function P(e, t) {
|
|
128
129
|
e = e.replace(/\s/g, "");
|
|
129
|
-
let n = (e.length - e.replace(
|
|
130
|
+
let n = (e.length - e.replace(Be, "").length) / 2;
|
|
130
131
|
if (n < 1) throw Error("Equations without an arrow are not supported.");
|
|
131
|
-
if (n > 1) throw Error(`Equation must contain exactly one arrow ("${
|
|
132
|
-
let [r, i] = e.split(
|
|
133
|
-
f(r.indexOf(
|
|
134
|
-
let a = r.split(
|
|
132
|
+
if (n > 1) throw Error(`Equation must contain exactly one arrow ("${j}").`);
|
|
133
|
+
let [r, i] = e.split(j);
|
|
134
|
+
f(r.indexOf(N) === -1, () => `The ellipsis notation ("${N}") is not supported yet.`);
|
|
135
|
+
let a = r.split(M), o = a.length;
|
|
135
136
|
if (t !== o) throw Error(`Expected ${o} input tensors, received ${t}`);
|
|
136
137
|
if (o > 2) throw Error("Support for more than 2 input tensors is not implemented yet.");
|
|
137
138
|
let s = [];
|
|
@@ -142,7 +143,7 @@ function I(e, t) {
|
|
|
142
143
|
}
|
|
143
144
|
for (let e = 0; e < r.length; ++e) {
|
|
144
145
|
let t = r[e];
|
|
145
|
-
s.indexOf(t) === -1 && t !==
|
|
146
|
+
s.indexOf(t) === -1 && t !== M && s.push(t);
|
|
146
147
|
}
|
|
147
148
|
let c = Array(a.length);
|
|
148
149
|
for (let e = 0; e < o; ++e) {
|
|
@@ -158,7 +159,7 @@ function I(e, t) {
|
|
|
158
159
|
idDims: c
|
|
159
160
|
};
|
|
160
161
|
}
|
|
161
|
-
function
|
|
162
|
+
function F(e, t) {
|
|
162
163
|
let n = Array(e);
|
|
163
164
|
n.fill(-1);
|
|
164
165
|
for (let e = 0; e < t.length; ++e) n[t[e]] = e;
|
|
@@ -169,20 +170,20 @@ function L(e, t) {
|
|
|
169
170
|
expandDims: r
|
|
170
171
|
};
|
|
171
172
|
}
|
|
172
|
-
function
|
|
173
|
+
function I(e, t, n) {
|
|
173
174
|
let r = Array(e);
|
|
174
175
|
for (let e = 0; e < n.length; ++e) {
|
|
175
176
|
let i = n[e].shape;
|
|
176
177
|
for (let n = 0; n < t[e].length; ++n) r[t[e][n]] === void 0 ? r[t[e][n]] = i[n] : f(r[t[e][n]] === i[n], () => `Expected dimension ${r[t[e][n]]} at axis ${n} of input shaped ${JSON.stringify(i)}, but got dimension ${i[n]}`);
|
|
177
178
|
}
|
|
178
179
|
}
|
|
179
|
-
function
|
|
180
|
+
function L(e, t) {
|
|
180
181
|
let n = e, r = [], i = 0;
|
|
181
182
|
e.length === 0 && n.push(-1), i = e.length + 1;
|
|
182
183
|
for (let e = 0; e < i; ++e) r.push([]);
|
|
183
184
|
let a = [];
|
|
184
185
|
for (let e = 0; e < n.length; ++e) {
|
|
185
|
-
let i = n[e], o =
|
|
186
|
+
let i = n[e], o = Ve(t, i);
|
|
186
187
|
for (let t of o) a.indexOf(t) === -1 && (r[e].push(t), a.push(t));
|
|
187
188
|
}
|
|
188
189
|
return {
|
|
@@ -190,84 +191,80 @@ function z(e, t) {
|
|
|
190
191
|
steps: r
|
|
191
192
|
};
|
|
192
193
|
}
|
|
193
|
-
function
|
|
194
|
+
function R(e) {
|
|
194
195
|
return e.every((e, t) => e === t);
|
|
195
196
|
}
|
|
196
|
-
function
|
|
197
|
+
function Ve(e, t) {
|
|
197
198
|
let n = [];
|
|
198
199
|
for (let r = 0; r < e.length; ++r) (e[r].length === 0 || e[r].indexOf(t) !== -1 || t === -1) && n.push(r);
|
|
199
200
|
return n;
|
|
200
201
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
function V(e, t, n = 0) {
|
|
202
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/split_util.js
|
|
203
|
+
function z(e, t, n = 0) {
|
|
204
204
|
let r = [];
|
|
205
205
|
if (typeof t == "number") f(e.shape[n] % t === 0, () => "Number of splits must evenly divide the axis."), r = Array(t).fill(e.shape[n] / t);
|
|
206
206
|
else {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
207
|
+
let i = t.reduce((e, t) => (t === -1 && (e += 1), e), 0);
|
|
208
|
+
f(i <= 1, () => "There should be only one negative value in split array.");
|
|
209
|
+
let a = t.indexOf(-1);
|
|
210
|
+
if (a !== -1) {
|
|
210
211
|
let r = t.reduce((e, t) => t > 0 ? e + t : e);
|
|
211
|
-
t[
|
|
212
|
+
t[a] = e.shape[n] - r;
|
|
212
213
|
}
|
|
213
214
|
f(e.shape[n] === t.reduce((e, t) => e + t), () => "The sum of sizes must match the size of the axis dimension."), r = t;
|
|
214
215
|
}
|
|
215
216
|
return r;
|
|
216
217
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
function H(e) {
|
|
218
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/sparse/sparse_fill_empty_rows_util.js
|
|
219
|
+
function B(e) {
|
|
220
220
|
return `Received SparseTensor with denseShape[0] = 0 but
|
|
221
221
|
indices.shape[0] = ${e}`;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function V(e, t) {
|
|
224
224
|
return `indices(${e}, 0) is invalid: ${t} < 0`;
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function H(e, t, n) {
|
|
227
227
|
return `indices(${e}, 0) is invalid: ${t} >= ${n}`;
|
|
228
228
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
function G(e, t) {
|
|
229
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/sparse/sparse_reshape_util.js
|
|
230
|
+
function U(e, t) {
|
|
232
231
|
return `only one output dimension may be -1, not both ${e} and ${t}`;
|
|
233
232
|
}
|
|
234
|
-
function
|
|
233
|
+
function W(e, t) {
|
|
235
234
|
return `size ${e} must be non-negative, not ${t}`;
|
|
236
235
|
}
|
|
237
|
-
function
|
|
236
|
+
function G() {
|
|
238
237
|
return "reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero";
|
|
239
238
|
}
|
|
240
|
-
function
|
|
241
|
-
return `Input to reshape is a SparseTensor with ${
|
|
242
|
-
dense values, but the requested shape requires a multiple of ${
|
|
239
|
+
function K(e, t) {
|
|
240
|
+
return `Input to reshape is a SparseTensor with ${u(e)}
|
|
241
|
+
dense values, but the requested shape requires a multiple of ${u(t)}. inputShape=${e} outputShape= ${t}`;
|
|
243
242
|
}
|
|
244
|
-
function
|
|
245
|
-
return `Input to reshape is a tensor with ${
|
|
243
|
+
function q(e, t) {
|
|
244
|
+
return `Input to reshape is a tensor with ${u(e)} dense values, but the requested shape has ${u(t)}. inputShape=${e} outputShape=${t}`;
|
|
246
245
|
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
function X() {
|
|
246
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/sparse/sparse_segment_reduction_util.js
|
|
247
|
+
function J() {
|
|
250
248
|
return "segment ids must be >= 0";
|
|
251
249
|
}
|
|
252
|
-
function
|
|
250
|
+
function Y() {
|
|
253
251
|
return "segment ids are not increasing";
|
|
254
252
|
}
|
|
255
|
-
function
|
|
253
|
+
function X(e, t) {
|
|
256
254
|
return `Segment id ${e} out of range [0, ${t}), possibly because segmentIds input is not sorted.`;
|
|
257
255
|
}
|
|
258
|
-
function
|
|
256
|
+
function Z(e, t, n) {
|
|
259
257
|
return `Bad: indices[${e}] == ${t} out of range [0, ${n})`;
|
|
260
258
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
var Ve = /* @__PURE__ */ e({
|
|
259
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.js
|
|
260
|
+
var He = /* @__PURE__ */ e({
|
|
264
261
|
collectGatherOpShapeInfo: () => We,
|
|
265
262
|
computeOutShape: () => Ue,
|
|
266
|
-
segOpComputeOptimalWindowSize: () =>
|
|
263
|
+
segOpComputeOptimalWindowSize: () => Q
|
|
267
264
|
});
|
|
268
|
-
function
|
|
265
|
+
function Q(e, t) {
|
|
269
266
|
let n = !1, r;
|
|
270
|
-
for (e <= 30 ? (r = e, n = !0) : r =
|
|
267
|
+
for (e <= 30 ? (r = e, n = !0) : r = o(e, Math.floor(Math.sqrt(e))); !n;) r > t || r === e ? n = !0 : r = o(e, r + 1);
|
|
271
268
|
return r;
|
|
272
269
|
}
|
|
273
270
|
function Ue(e, t, n) {
|
|
@@ -295,105 +292,103 @@ function We(e, t, n, r) {
|
|
|
295
292
|
outputShape: s
|
|
296
293
|
};
|
|
297
294
|
}
|
|
298
|
-
|
|
299
|
-
//#region node_modules/@tensorflow/tfjs-core/dist/backends/backend_util.js
|
|
295
|
+
// node_modules/@tensorflow/tfjs-core/dist/backends/backend_util.js
|
|
300
296
|
var Ge = /* @__PURE__ */ e({
|
|
301
|
-
ERF_A1: () =>
|
|
302
|
-
ERF_A2: () =>
|
|
303
|
-
ERF_A3: () =>
|
|
304
|
-
ERF_A4: () =>
|
|
305
|
-
ERF_A5: () =>
|
|
306
|
-
ERF_P: () =>
|
|
297
|
+
ERF_A1: () => E,
|
|
298
|
+
ERF_A2: () => D,
|
|
299
|
+
ERF_A3: () => O,
|
|
300
|
+
ERF_A4: () => k,
|
|
301
|
+
ERF_A5: () => A,
|
|
302
|
+
ERF_P: () => T,
|
|
307
303
|
PARALLELIZE_THRESHOLD: () => 30,
|
|
308
|
-
RowPartitionType: () =>
|
|
309
|
-
SELU_SCALE: () =>
|
|
310
|
-
SELU_SCALEALPHA: () =>
|
|
311
|
-
applyActivation: () =>
|
|
312
|
-
assertAndGetBroadcastShape: () =>
|
|
313
|
-
assertAxesAreInnerMostDims: () =>
|
|
314
|
-
assertParamsConsistent: () =>
|
|
315
|
-
assignToTypedArray: () =>
|
|
316
|
-
axesAreInnerMostDims: () =>
|
|
317
|
-
calculateShapes: () =>
|
|
318
|
-
checkEinsumDimSizes: () =>
|
|
304
|
+
RowPartitionType: () => m,
|
|
305
|
+
SELU_SCALE: () => Ee,
|
|
306
|
+
SELU_SCALEALPHA: () => Ce,
|
|
307
|
+
applyActivation: () => Te,
|
|
308
|
+
assertAndGetBroadcastShape: () => t,
|
|
309
|
+
assertAxesAreInnerMostDims: () => se,
|
|
310
|
+
assertParamsConsistent: () => le,
|
|
311
|
+
assignToTypedArray: () => Re,
|
|
312
|
+
axesAreInnerMostDims: () => re,
|
|
313
|
+
calculateShapes: () => Ae,
|
|
314
|
+
checkEinsumDimSizes: () => I,
|
|
319
315
|
checkPadOnDimRoundingMode: () => ye,
|
|
320
|
-
combineLocations: () =>
|
|
321
|
-
combineRaggedTensorToTensorShapes: () =>
|
|
322
|
-
complexWithEvenIndex: () =>
|
|
323
|
-
complexWithOddIndex: () =>
|
|
324
|
-
computeConv2DInfo: () =>
|
|
325
|
-
computeConv3DInfo: () =>
|
|
326
|
-
computeDefaultPad: () =>
|
|
327
|
-
computeDilation2DInfo: () =>
|
|
328
|
-
computeOptimalWindowSize: () =>
|
|
329
|
-
computeOutAndReduceShapes: () =>
|
|
330
|
-
computeOutShape: () =>
|
|
331
|
-
computePool2DInfo: () =>
|
|
332
|
-
computePool3DInfo: () =>
|
|
333
|
-
convertConv2DDataFormat: () =>
|
|
334
|
-
decodeEinsumEquation: () =>
|
|
316
|
+
combineLocations: () => ae,
|
|
317
|
+
combineRaggedTensorToTensorShapes: () => h,
|
|
318
|
+
complexWithEvenIndex: () => Pe,
|
|
319
|
+
complexWithOddIndex: () => Ie,
|
|
320
|
+
computeConv2DInfo: () => de,
|
|
321
|
+
computeConv3DInfo: () => ge,
|
|
322
|
+
computeDefaultPad: () => be,
|
|
323
|
+
computeDilation2DInfo: () => fe,
|
|
324
|
+
computeOptimalWindowSize: () => y,
|
|
325
|
+
computeOutAndReduceShapes: () => ne,
|
|
326
|
+
computeOutShape: () => ce,
|
|
327
|
+
computePool2DInfo: () => pe,
|
|
328
|
+
computePool3DInfo: () => ve,
|
|
329
|
+
convertConv2DDataFormat: () => _e,
|
|
330
|
+
decodeEinsumEquation: () => P,
|
|
335
331
|
eitherStridesOrDilationsAreOne: () => he,
|
|
336
|
-
expandShapeToKeepDim: () =>
|
|
337
|
-
exponent: () =>
|
|
338
|
-
exponents: () =>
|
|
332
|
+
expandShapeToKeepDim: () => ee,
|
|
333
|
+
exponent: () => Ne,
|
|
334
|
+
exponents: () => je,
|
|
339
335
|
fromStringArrayToUint8: () => $,
|
|
340
336
|
fromUint8ToStringArray: () => Ke,
|
|
341
|
-
getAxesPermutation: () =>
|
|
337
|
+
getAxesPermutation: () => ie,
|
|
342
338
|
getBroadcastDims: () => d,
|
|
343
|
-
getComplexWithIndex: () =>
|
|
344
|
-
getEinsumComputePath: () =>
|
|
345
|
-
getEinsumPermutation: () =>
|
|
346
|
-
getFusedBiasGradient: () =>
|
|
347
|
-
getFusedDyActivation: () =>
|
|
348
|
-
getImageCenter: () =>
|
|
349
|
-
getInnerMostAxes: () =>
|
|
350
|
-
getPermuted: () =>
|
|
351
|
-
getRaggedRank: () =>
|
|
352
|
-
getReductionAxes: () =>
|
|
353
|
-
getReshaped: () =>
|
|
354
|
-
getReshapedPermuted: () =>
|
|
355
|
-
getRowPartitionTypesHelper: () =>
|
|
356
|
-
getSliceBeginCoords: () =>
|
|
357
|
-
getSliceSize: () =>
|
|
358
|
-
getSparseFillEmptyRowsIndicesDenseShapeMismatch: () =>
|
|
359
|
-
getSparseFillEmptyRowsNegativeIndexErrorMessage: () =>
|
|
360
|
-
getSparseFillEmptyRowsOutOfRangeIndexErrorMessage: () =>
|
|
361
|
-
getSparseReshapeEmptyTensorZeroOutputDimErrorMessage: () =>
|
|
362
|
-
getSparseReshapeInputOutputMismatchErrorMessage: () =>
|
|
363
|
-
getSparseReshapeInputOutputMultipleErrorMessage: () =>
|
|
364
|
-
getSparseReshapeMultipleNegativeOneOutputDimErrorMessage: () =>
|
|
365
|
-
getSparseReshapeNegativeOutputDimErrorMessage: () =>
|
|
366
|
-
getSparseSegmentReductionIndicesOutOfRangeErrorMessage: () =>
|
|
367
|
-
getSparseSegmentReductionNegativeSegmentIdsErrorMessage: () =>
|
|
368
|
-
getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage: () =>
|
|
369
|
-
getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage: () =>
|
|
370
|
-
getUndoAxesPermutation: () =>
|
|
371
|
-
isIdentityPermutation: () =>
|
|
372
|
-
log: () =>
|
|
373
|
-
mergeRealAndImagArrays: () =>
|
|
374
|
-
prepareAndValidate: () =>
|
|
375
|
-
prepareSplitSize: () =>
|
|
376
|
-
segment_util: () =>
|
|
377
|
-
shouldFuse: () =>
|
|
378
|
-
slice_util: () =>
|
|
379
|
-
splitRealAndImagArrays: () =>
|
|
380
|
-
stridesOrDilationsArePositive: () =>
|
|
381
|
-
tupleValuesAreOne: () =>
|
|
382
|
-
upcastType: () =>
|
|
383
|
-
validateDefaultValueShape: () =>
|
|
384
|
-
validateInput: () =>
|
|
385
|
-
validateUpdateShape: () =>
|
|
386
|
-
warn: () =>
|
|
339
|
+
getComplexWithIndex: () => Fe,
|
|
340
|
+
getEinsumComputePath: () => L,
|
|
341
|
+
getEinsumPermutation: () => F,
|
|
342
|
+
getFusedBiasGradient: () => Se,
|
|
343
|
+
getFusedDyActivation: () => xe,
|
|
344
|
+
getImageCenter: () => ze,
|
|
345
|
+
getInnerMostAxes: () => oe,
|
|
346
|
+
getPermuted: () => x,
|
|
347
|
+
getRaggedRank: () => _,
|
|
348
|
+
getReductionAxes: () => i,
|
|
349
|
+
getReshaped: () => b,
|
|
350
|
+
getReshapedPermuted: () => S,
|
|
351
|
+
getRowPartitionTypesHelper: () => g,
|
|
352
|
+
getSliceBeginCoords: () => C,
|
|
353
|
+
getSliceSize: () => w,
|
|
354
|
+
getSparseFillEmptyRowsIndicesDenseShapeMismatch: () => B,
|
|
355
|
+
getSparseFillEmptyRowsNegativeIndexErrorMessage: () => V,
|
|
356
|
+
getSparseFillEmptyRowsOutOfRangeIndexErrorMessage: () => H,
|
|
357
|
+
getSparseReshapeEmptyTensorZeroOutputDimErrorMessage: () => G,
|
|
358
|
+
getSparseReshapeInputOutputMismatchErrorMessage: () => q,
|
|
359
|
+
getSparseReshapeInputOutputMultipleErrorMessage: () => K,
|
|
360
|
+
getSparseReshapeMultipleNegativeOneOutputDimErrorMessage: () => U,
|
|
361
|
+
getSparseReshapeNegativeOutputDimErrorMessage: () => W,
|
|
362
|
+
getSparseSegmentReductionIndicesOutOfRangeErrorMessage: () => Z,
|
|
363
|
+
getSparseSegmentReductionNegativeSegmentIdsErrorMessage: () => J,
|
|
364
|
+
getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage: () => Y,
|
|
365
|
+
getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage: () => X,
|
|
366
|
+
getUndoAxesPermutation: () => te,
|
|
367
|
+
isIdentityPermutation: () => R,
|
|
368
|
+
log: () => r,
|
|
369
|
+
mergeRealAndImagArrays: () => Le,
|
|
370
|
+
prepareAndValidate: () => p,
|
|
371
|
+
prepareSplitSize: () => z,
|
|
372
|
+
segment_util: () => He,
|
|
373
|
+
shouldFuse: () => we,
|
|
374
|
+
slice_util: () => De,
|
|
375
|
+
splitRealAndImagArrays: () => Me,
|
|
376
|
+
stridesOrDilationsArePositive: () => me,
|
|
377
|
+
tupleValuesAreOne: () => ue,
|
|
378
|
+
upcastType: () => c,
|
|
379
|
+
validateDefaultValueShape: () => v,
|
|
380
|
+
validateInput: () => Oe,
|
|
381
|
+
validateUpdateShape: () => ke,
|
|
382
|
+
warn: () => n
|
|
387
383
|
});
|
|
388
384
|
function Ke(e) {
|
|
389
385
|
try {
|
|
390
|
-
return e.map((e) =>
|
|
386
|
+
return e.map((e) => l(e));
|
|
391
387
|
} catch (e) {
|
|
392
388
|
throw Error(`Failed to decode encoded string bytes into utf-8, error: ${e}`);
|
|
393
389
|
}
|
|
394
390
|
}
|
|
395
391
|
function $(e) {
|
|
396
|
-
return e.map((e) =>
|
|
392
|
+
return e.map((e) => s(e));
|
|
397
393
|
}
|
|
398
|
-
|
|
399
|
-
export { D as A, y as B, L as C, A as D, k as E, E as F, b as H, S as I, x as L, C as M, w as N, j as O, T as P, g as R, z as S, O as T, h as U, v as V, U as _, Ue as a, R as b, X as c, q as d, Y as f, H as g, K as h, We as i, Le as j, M as k, Z as l, G as m, $ as n, He as o, J as p, Ke as r, Be as s, Ge as t, Q as u, W as v, B as w, I as x, V as y, _ as z };
|
|
394
|
+
export { T as A, _ as B, F as C, O as D, D as E, w as F, v as H, ze as I, y as L, b as M, S as N, k as O, C as P, m as R, L as S, E as T, p as U, g as V, V as _, Ue as a, I as b, J as c, G as d, q as f, B as g, W as h, We as i, x as j, A as k, Y as l, U as m, $ as n, Q as o, K as p, Ke as r, Z as s, Ge as t, X as u, H as v, R as w, P as x, z as y, h as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// node_modules/@tensorflow/tfjs-backend-webgpu/dist/binary_op_util.js
|
|
2
2
|
var e;
|
|
3
3
|
(function(e) {
|
|
4
4
|
e[e.ADD = 0] = "ADD", e[e.ATAN2 = 1] = "ATAN2", e[e.COMPLEX_MULTIPLY_IMAG = 2] = "COMPLEX_MULTIPLY_IMAG", e[e.COMPLEX_MULTIPLY_REAL = 3] = "COMPLEX_MULTIPLY_REAL", e[e.DIV = 4] = "DIV", e[e.ELU_DER = 5] = "ELU_DER", e[e.EQUAL = 6] = "EQUAL", e[e.FLOOR_DIV = 7] = "FLOOR_DIV", e[e.GREATER = 8] = "GREATER", e[e.GREATER_EQUAL = 9] = "GREATER_EQUAL", e[e.LESS = 10] = "LESS", e[e.LESS_EQUAL = 11] = "LESS_EQUAL", e[e.LOGICAL_AND = 12] = "LOGICAL_AND", e[e.LOGICAL_OR = 13] = "LOGICAL_OR", e[e.MAX = 14] = "MAX", e[e.MIN = 15] = "MIN", e[e.MOD = 16] = "MOD", e[e.MUL = 17] = "MUL", e[e.NOT_EQUAL = 18] = "NOT_EQUAL", e[e.POW = 19] = "POW", e[e.PRELU = 20] = "PRELU", e[e.SQUARED_DIFFERENCE = 21] = "SQUARED_DIFFERENCE", e[e.SUB = 22] = "SUB";
|
|
@@ -45,7 +45,7 @@ function A(A, j) {
|
|
|
45
45
|
${i}(isNaN) | aIsNaN | bIsNaN);
|
|
46
46
|
}
|
|
47
47
|
`;
|
|
48
|
-
} while (
|
|
48
|
+
} while (0);
|
|
49
49
|
switch (A) {
|
|
50
50
|
case e.ADD:
|
|
51
51
|
M = t;
|
|
@@ -89,15 +89,11 @@ function A(A, j) {
|
|
|
89
89
|
case e.SQUARED_DIFFERENCE:
|
|
90
90
|
M = O;
|
|
91
91
|
break;
|
|
92
|
-
case e.SUB:
|
|
93
|
-
M = k;
|
|
94
|
-
break;
|
|
95
|
-
default:
|
|
92
|
+
case e.SUB: M = k;
|
|
96
93
|
}
|
|
97
94
|
return `
|
|
98
95
|
${M}
|
|
99
96
|
return resultTemp;
|
|
100
97
|
`;
|
|
101
98
|
}
|
|
102
|
-
//#endregion
|
|
103
99
|
export { A as n, e as t };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { M as e, Q as t, Z as n, bi as r, ci as i, rt as a } from "./dist-CMMLi-qO.js";
|
|
2
|
+
import { t as o } from "./reshape-DJb1jgMt.js";
|
|
3
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_to.js
|
|
4
|
+
function s(n, s) {
|
|
5
|
+
let c = t(n, "broadcastTo", "x"), l = c.shape;
|
|
6
|
+
if (r(s), s.length < c.rank) throw Error(`broadcastTo(): shape.length=${s.length} < input.rank=${c.rank}.`);
|
|
7
|
+
if (s.length > c.rank) {
|
|
8
|
+
let e = c.shape.slice();
|
|
9
|
+
for (; e.length < s.length;) e.unshift(1);
|
|
10
|
+
c = o(c, e);
|
|
11
|
+
}
|
|
12
|
+
let u = c.shape, d = Array.from(s);
|
|
13
|
+
for (let e = s.length - 1; e >= 0; e--) if (u[e] === s[e]) d[e] = 1;
|
|
14
|
+
else if (c.shape[e] !== 1) throw Error(`broadcastTo(): [${l}] cannot be broadcast to [${s}].`);
|
|
15
|
+
if (d.map((e, t) => e > 1 ? t : -1).filter((e) => e >= 0).length === 0) return e(c);
|
|
16
|
+
let f = { x: c }, p = { reps: d };
|
|
17
|
+
return a.runKernel(i, f, p);
|
|
18
|
+
}
|
|
19
|
+
var c = /* @__PURE__ */ n({ broadcastTo_: s });
|
|
20
|
+
export { c as t };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { H as e, J as t } from "../dist-CMMLi-qO.js";
|
|
2
|
+
import { t as n } from "../tensor4d-D1zRBipJ.js";
|
|
3
|
+
// lib/checks/appendCache.ts
|
|
3
4
|
async function r(r) {
|
|
4
|
-
await
|
|
5
|
-
let i =
|
|
5
|
+
await t(r);
|
|
6
|
+
let i = n([[[
|
|
6
7
|
[
|
|
7
8
|
.1,
|
|
8
9
|
.2,
|
|
@@ -32,7 +33,7 @@ async function r(r) {
|
|
|
32
33
|
1,
|
|
33
34
|
4,
|
|
34
35
|
4
|
|
35
|
-
]), a =
|
|
36
|
+
]), a = n([[[[
|
|
36
37
|
.1,
|
|
37
38
|
.2,
|
|
38
39
|
.3,
|
|
@@ -43,7 +44,7 @@ async function r(r) {
|
|
|
43
44
|
1,
|
|
44
45
|
4
|
|
45
46
|
]);
|
|
46
|
-
return await
|
|
47
|
+
return await e().runKernel("AppendCache", {
|
|
47
48
|
cache: i,
|
|
48
49
|
item: a
|
|
49
50
|
}, {
|
|
@@ -51,5 +52,4 @@ async function r(r) {
|
|
|
51
52
|
pastLen: 2
|
|
52
53
|
}).array();
|
|
53
54
|
}
|
|
54
|
-
//#endregion
|
|
55
55
|
export { r as execute };
|