@genai-fi/nanogpt 1.4.1 → 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.d.ts +1 -0
- package/dist/api/beamer.js +19 -10
- 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.d.ts +14 -2
- package/dist/inference/Beamer.js +170 -105
- package/dist/inference/Generator.js +1 -259
- package/dist/inference/tokenisePrompt.d.ts +2 -1
- package/dist/inference/tokenisePrompt.js +15 -11
- package/dist/inference/types.d.ts +7 -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/{CausalSelfAttention.d.ts → GQA.d.ts} +8 -3
- package/dist/layers/GQA.js +102 -0
- package/dist/layers/HeadLayer.d.ts +12 -0
- package/dist/layers/HeadLayer.js +28 -0
- package/dist/layers/LoRA.js +17 -20
- package/dist/layers/MHA.d.ts +43 -0
- package/dist/layers/MHA.js +102 -0
- package/dist/layers/MLP.d.ts +5 -1
- package/dist/layers/MLP.js +33 -20
- package/dist/layers/PositionEmbedding.js +14 -13
- package/dist/layers/RMSNorm.d.ts +2 -0
- package/dist/layers/RMSNorm.js +16 -11
- package/dist/layers/RoPECache.js +1 -337
- package/dist/layers/TiedEmbedding.js +15 -14
- package/dist/layers/TransformerBlock.d.ts +4 -10
- package/dist/layers/TransformerBlock.js +29 -30
- package/dist/layers/WeightStore.js +4 -5
- package/dist/layers-CFqEip3s.js +13 -0
- package/dist/layers.d.ts +1 -1
- package/dist/layers.js +4 -12
- package/dist/loader/load.js +27 -24
- package/dist/loader/loadHF.js +3 -3
- package/dist/loader/loadTransformers.js +22 -7
- 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 +31 -17
- package/dist/loader/types.d.ts +8 -2
- package/dist/main.js +3281 -3463
- package/dist/matMul16-tE26fnhf.js +87 -0
- package/dist/{matMulGelu-CBoqTZM7.js → matMulGelu-ASUWlKqu.js} +33 -33
- package/dist/mat_mul-R9_DWmIT.js +16 -0
- package/dist/models/Llama.d.ts +16 -0
- package/dist/models/Llama.js +88 -0
- package/dist/models/NanoGPTV1.js +53 -54
- package/dist/models/NanoGPTV2.js +48 -49
- package/dist/models/Qwen3.d.ts +16 -0
- package/dist/models/Qwen3.js +88 -0
- package/dist/models/config.d.ts +18 -1
- package/dist/models/config.js +3 -8
- package/dist/models/factory.js +14 -11
- 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 +14 -14
- 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.d.ts +2 -0
- package/dist/ops/grads/silu.js +1 -0
- 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 +2 -2
- 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.d.ts +1 -1
- package/dist/ops/normRMS.js +10 -11
- 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.d.ts +1 -1
- package/dist/ops/rope.js +1 -2
- package/dist/ops/scatterSub.js +3 -4
- package/dist/ops/silu.d.ts +3 -0
- package/dist/ops/silu.js +1 -0
- 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 +10 -9
- 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 -16
- package/dist/ops/webgpu/matMul16.js +74 -57
- package/dist/ops/webgpu/matMul16_program.d.ts +4 -3
- package/dist/ops/webgpu/matMul16_program.js +30 -22
- package/dist/ops/webgpu/mul16.js +3 -4
- package/dist/ops/webgpu/norm2.js +9 -10
- package/dist/ops/webgpu/normRMS.js +13 -14
- package/dist/ops/webgpu/normRMS16_program.d.ts +2 -1
- package/dist/ops/webgpu/normRMS16_program.js +5 -5
- package/dist/ops/webgpu/normRMS32_program.d.ts +2 -1
- package/dist/ops/webgpu/normRMS32_program.js +5 -5
- 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 +113 -49
- package/dist/ops/webgpu/scatterSub.js +12 -13
- package/dist/ops/webgpu/silu.d.ts +14 -0
- package/dist/ops/webgpu/silu.js +117 -0
- 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-JjBVufF_.js +24 -0
- 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 +8 -5
- 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.d.ts +16 -0
- package/dist/utilities/maxHeap.js +54 -0
- 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 +34 -19
- 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/layers/CausalSelfAttention.js +0 -99
- package/dist/matMul16-DGtlziMn.js +0 -81
- package/dist/rope-C8EAiSGY.js +0 -25
- package/dist/selu_util-B_AFEfoz.js +0 -24
- package/dist/shared-24EoeHJl.js +0 -1314
- package/dist/tfjs_backend-h5weiy1O.js +0 -614
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./shared-
|
|
2
|
-
|
|
1
|
+
import { t as e } from "./shared-BIDMUBCs.js";
|
|
2
|
+
// node_modules/@tensorflow/tfjs-backend-webgl/dist/kernel_utils/shared.js
|
|
3
3
|
var { addImpl: t, bincountImpl: n, bincountReduceImpl: r, bitwiseAndImpl: i, castImpl: a, ceilImpl: o, concatImpl: s, equalImpl: c, expImpl: l, expm1Impl: u, floorImpl: d, gatherNdImpl: f, gatherV2Impl: p, greaterImpl: m, greaterEqualImpl: h, lessImpl: g, lessEqualImpl: _, linSpaceImpl: v, logImpl: y, maxImpl: b, maximumImpl: x, minimumImpl: S, multiplyImpl: C, negImpl: w, notEqualImpl: T, prodImpl: E, raggedGatherImpl: D, raggedRangeImpl: O, raggedTensorToTensorImpl: k, rangeImpl: A, rsqrtImpl: j, scatterImpl: M, sigmoidImpl: N, simpleAbsImpl: P, sliceImpl: F, sparseFillEmptyRowsImpl: I, sparseReshapeImpl: L, sparseSegmentReductionImpl: R, sqrtImpl: z, staticRegexReplaceImpl: B, stridedSliceImpl: V, stringNGramsImpl: H, stringSplitImpl: U, stringToHashBucketFastImpl: W, subImpl: G, tileImpl: K, topKImpl: q, transposeImpl: J, uniqueImpl: Y } = e;
|
|
4
|
-
//#endregion
|
|
5
4
|
export { A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, R, S, T, U, V, W, Y, g as _, a, b, c, d, f, _ as g, m as h, i, j, k, l, h as m, n, o, p, q, r, s, t, u, v, w, x, y, z };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { H as e, bt as t } from "./dist-CMMLi-qO.js";
|
|
2
|
+
// lib/ops/grads/silu.ts
|
|
3
|
+
var n = {
|
|
4
|
+
kernelName: "Silu",
|
|
5
|
+
inputsToSave: ["x"],
|
|
6
|
+
outputsToSave: [],
|
|
7
|
+
gradFunc: (e, t) => {
|
|
8
|
+
let [n] = t;
|
|
9
|
+
return { x: () => i(e, n) };
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
t(n);
|
|
13
|
+
// lib/ops/silu.ts
|
|
14
|
+
function r(t) {
|
|
15
|
+
return e().runKernel("Silu", { x: t });
|
|
16
|
+
}
|
|
17
|
+
function i(t, n) {
|
|
18
|
+
return e().runKernel("SiluGrad", {
|
|
19
|
+
dy: t,
|
|
20
|
+
x: n
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export { r as n, n as r, i as t };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Q as e, Vr as t, Z as n, rt as r } from "./dist-CMMLi-qO.js";
|
|
2
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/slice.js
|
|
3
|
+
function i(n, i, a) {
|
|
4
|
+
let o = e(n, "x", "slice", "string_or_numeric");
|
|
5
|
+
if (o.rank === 0) throw Error("Slicing scalar is not possible");
|
|
6
|
+
let s = { x: o }, c = {
|
|
7
|
+
begin: i,
|
|
8
|
+
size: a
|
|
9
|
+
};
|
|
10
|
+
return r.runKernel(t, s, c);
|
|
11
|
+
}
|
|
12
|
+
var a = /* @__PURE__ */ n({ slice_: i });
|
|
13
|
+
export { a as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as e } from "./
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { n as e } from "./rolldown-runtime-CwxnZyOB.js";
|
|
2
|
+
import { wi as t, yi as n } from "./dist-CMMLi-qO.js";
|
|
3
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.js
|
|
4
4
|
var r = /* @__PURE__ */ e({
|
|
5
5
|
assertParamsValid: () => o,
|
|
6
6
|
computeFlatOffset: () => y,
|
|
@@ -204,5 +204,4 @@ function C(e, t, n, r, i, a) {
|
|
|
204
204
|
return t < a[0] ? a[0] : t > a[1] ? a[1] : t;
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
-
//#endregion
|
|
208
207
|
export { b as a, v as i, y as n, x as o, c as r, r as s, o as t };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Hr as e, Q as t, Z as n, rt as r } from "./dist-CMMLi-qO.js";
|
|
2
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/softmax.js
|
|
3
|
+
function i(n, i = -1) {
|
|
4
|
+
let a = t(n, "logits", "softmax", "float32");
|
|
5
|
+
if (i === -1 && (i = a.rank - 1), i !== a.rank - 1) throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${a.rank} and dim was ${i}`);
|
|
6
|
+
let o = { logits: a }, s = { dim: i };
|
|
7
|
+
return r.runKernel(e, o, s);
|
|
8
|
+
}
|
|
9
|
+
var a = /* @__PURE__ */ n({ softmax_: i });
|
|
10
|
+
export { a as t };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Q as e, Xr as t, Z as n, rt as r } from "./dist-CMMLi-qO.js";
|
|
2
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/split.js
|
|
3
|
+
function i(n, i, a = 0) {
|
|
4
|
+
let o = { x: e(n, "x", "split") }, s = {
|
|
5
|
+
numOrSizeSplits: i,
|
|
6
|
+
axis: a
|
|
7
|
+
};
|
|
8
|
+
return r.runKernel(t, o, s);
|
|
9
|
+
}
|
|
10
|
+
var a = /* @__PURE__ */ n({ split_: i });
|
|
11
|
+
export { a as t };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Q as e, Yi as t, Z as n } from "./dist-CMMLi-qO.js";
|
|
2
|
+
import { t as r } from "./reshape-DJb1jgMt.js";
|
|
3
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/squeeze.js
|
|
4
|
+
function i(n, i) {
|
|
5
|
+
let a = e(n, "x", "squeeze", "string_or_numeric");
|
|
6
|
+
return r(a, t(a.shape, i).newShape);
|
|
7
|
+
}
|
|
8
|
+
var a = /* @__PURE__ */ n({ squeeze_: i });
|
|
9
|
+
export { a as t };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { $ as e, Z as t, fr as n, rt as r, yi as i } from "./dist-CMMLi-qO.js";
|
|
2
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/stack.js
|
|
3
|
+
function a(t, a = 0) {
|
|
4
|
+
let o = e(t, "tensors", "stack", "string_or_numeric");
|
|
5
|
+
i(o.length >= 1, () => "Pass at least one tensor to tf.stack"), o.length > 0 && i(a <= o[0].rank, () => "Axis must be <= rank of the tensor");
|
|
6
|
+
let s = o, c = { axis: a };
|
|
7
|
+
return r.runKernel(n, s, c);
|
|
8
|
+
}
|
|
9
|
+
var o = /* @__PURE__ */ t({ stack_: a });
|
|
10
|
+
export { o as t };
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import { Bn as e, Ni as t, Q as n, Rr as r, Z as i, mr as a, rt as o, ti as s, wr as c, yi as l } from "./dist-CMMLi-qO.js";
|
|
2
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.js
|
|
3
|
+
function u(e, t, n, r, i = "NHWC", a) {
|
|
4
|
+
let o = e[3];
|
|
5
|
+
return p(e, [...t, o], n, a, r, null, null, D(i));
|
|
6
|
+
}
|
|
7
|
+
function d(e, t, n, r, i, a, o = "channelsLast") {
|
|
8
|
+
let [s, c] = v(t), l;
|
|
9
|
+
if (o === "channelsLast") l = [
|
|
10
|
+
s,
|
|
11
|
+
c,
|
|
12
|
+
e[3],
|
|
13
|
+
e[3]
|
|
14
|
+
];
|
|
15
|
+
else if (o === "channelsFirst") l = [
|
|
16
|
+
s,
|
|
17
|
+
c,
|
|
18
|
+
e[1],
|
|
19
|
+
e[1]
|
|
20
|
+
];
|
|
21
|
+
else throw Error(`Unknown dataFormat ${o}`);
|
|
22
|
+
return p(e, l, n, r, i, a, !1, o);
|
|
23
|
+
}
|
|
24
|
+
function f(e, t, n, r, i, a, o = "NDHWC") {
|
|
25
|
+
let [s, c, l] = y(t), u, d;
|
|
26
|
+
if (o === "NDHWC") d = "channelsLast", u = [
|
|
27
|
+
s,
|
|
28
|
+
c,
|
|
29
|
+
l,
|
|
30
|
+
e[4],
|
|
31
|
+
e[4]
|
|
32
|
+
];
|
|
33
|
+
else if (o === "NCDHW") d = "channelsFirst", u = [
|
|
34
|
+
s,
|
|
35
|
+
c,
|
|
36
|
+
l,
|
|
37
|
+
e[1],
|
|
38
|
+
e[1]
|
|
39
|
+
];
|
|
40
|
+
else throw Error(`Unknown dataFormat ${o}`);
|
|
41
|
+
return m(e, u, n, r, i, !1, d, a);
|
|
42
|
+
}
|
|
43
|
+
function p(e, t, n, r, i, a, o = !1, s = "channelsLast") {
|
|
44
|
+
let [c, l, u, d] = [
|
|
45
|
+
-1,
|
|
46
|
+
-1,
|
|
47
|
+
-1,
|
|
48
|
+
-1
|
|
49
|
+
];
|
|
50
|
+
if (s === "channelsLast") [c, l, u, d] = e;
|
|
51
|
+
else if (s === "channelsFirst") [c, d, l, u] = e;
|
|
52
|
+
else throw Error(`Unknown dataFormat ${s}`);
|
|
53
|
+
let [f, p, , m] = t, [h, g] = v(n), [_, y] = v(r), S = b(f, _), C = b(p, y), { padInfo: w, outHeight: T, outWidth: E } = x(i, l, u, h, g, S, C, a, s), D = o ? m * d : m, O;
|
|
54
|
+
return s === "channelsFirst" ? O = [
|
|
55
|
+
c,
|
|
56
|
+
D,
|
|
57
|
+
T,
|
|
58
|
+
E
|
|
59
|
+
] : s === "channelsLast" && (O = [
|
|
60
|
+
c,
|
|
61
|
+
T,
|
|
62
|
+
E,
|
|
63
|
+
D
|
|
64
|
+
]), {
|
|
65
|
+
batchSize: c,
|
|
66
|
+
dataFormat: s,
|
|
67
|
+
inHeight: l,
|
|
68
|
+
inWidth: u,
|
|
69
|
+
inChannels: d,
|
|
70
|
+
outHeight: T,
|
|
71
|
+
outWidth: E,
|
|
72
|
+
outChannels: D,
|
|
73
|
+
padInfo: w,
|
|
74
|
+
strideHeight: h,
|
|
75
|
+
strideWidth: g,
|
|
76
|
+
filterHeight: f,
|
|
77
|
+
filterWidth: p,
|
|
78
|
+
effectiveFilterHeight: S,
|
|
79
|
+
effectiveFilterWidth: C,
|
|
80
|
+
dilationHeight: _,
|
|
81
|
+
dilationWidth: y,
|
|
82
|
+
inShape: e,
|
|
83
|
+
outShape: O,
|
|
84
|
+
filterShape: t
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function m(e, t, n, r, i, a = !1, o = "channelsLast", s) {
|
|
88
|
+
let [c, l, u, d, f] = [
|
|
89
|
+
-1,
|
|
90
|
+
-1,
|
|
91
|
+
-1,
|
|
92
|
+
-1,
|
|
93
|
+
-1
|
|
94
|
+
];
|
|
95
|
+
if (o === "channelsLast") [c, l, u, d, f] = e;
|
|
96
|
+
else if (o === "channelsFirst") [c, f, l, u, d] = e;
|
|
97
|
+
else throw Error(`Unknown dataFormat ${o}`);
|
|
98
|
+
let [p, m, h, , g] = t, [_, v, x] = y(n), [C, w, T] = y(r), E = b(p, C), D = b(m, w), O = b(h, T), { padInfo: k, outDepth: A, outHeight: j, outWidth: M } = S(i, l, u, d, _, v, x, E, D, O, s), N = a ? g * f : g, P;
|
|
99
|
+
return o === "channelsFirst" ? P = [
|
|
100
|
+
c,
|
|
101
|
+
N,
|
|
102
|
+
A,
|
|
103
|
+
j,
|
|
104
|
+
M
|
|
105
|
+
] : o === "channelsLast" && (P = [
|
|
106
|
+
c,
|
|
107
|
+
A,
|
|
108
|
+
j,
|
|
109
|
+
M,
|
|
110
|
+
N
|
|
111
|
+
]), {
|
|
112
|
+
batchSize: c,
|
|
113
|
+
dataFormat: o,
|
|
114
|
+
inDepth: l,
|
|
115
|
+
inHeight: u,
|
|
116
|
+
inWidth: d,
|
|
117
|
+
inChannels: f,
|
|
118
|
+
outDepth: A,
|
|
119
|
+
outHeight: j,
|
|
120
|
+
outWidth: M,
|
|
121
|
+
outChannels: N,
|
|
122
|
+
padInfo: k,
|
|
123
|
+
strideDepth: _,
|
|
124
|
+
strideHeight: v,
|
|
125
|
+
strideWidth: x,
|
|
126
|
+
filterDepth: p,
|
|
127
|
+
filterHeight: m,
|
|
128
|
+
filterWidth: h,
|
|
129
|
+
effectiveFilterDepth: E,
|
|
130
|
+
effectiveFilterHeight: D,
|
|
131
|
+
effectiveFilterWidth: O,
|
|
132
|
+
dilationDepth: C,
|
|
133
|
+
dilationHeight: w,
|
|
134
|
+
dilationWidth: T,
|
|
135
|
+
inShape: e,
|
|
136
|
+
outShape: P,
|
|
137
|
+
filterShape: t
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function h(e, t, n, r, i) {
|
|
141
|
+
r ??= _(e, t, n);
|
|
142
|
+
let a = e[0], o = e[1];
|
|
143
|
+
return [C((a - t + 2 * r) / n + 1, i), C((o - t + 2 * r) / n + 1, i)];
|
|
144
|
+
}
|
|
145
|
+
function g(e, t, n, r, i, a) {
|
|
146
|
+
i ??= _(e, t[0], r[0]);
|
|
147
|
+
let o = [
|
|
148
|
+
0,
|
|
149
|
+
0,
|
|
150
|
+
0,
|
|
151
|
+
n
|
|
152
|
+
];
|
|
153
|
+
for (let n = 0; n < 3; n++) e[n] + 2 * i >= t[n] && (o[n] = C((e[n] - t[n] + 2 * i) / r[n] + 1, a));
|
|
154
|
+
return o;
|
|
155
|
+
}
|
|
156
|
+
function _(e, t, n, r = 1) {
|
|
157
|
+
let i = b(t, r);
|
|
158
|
+
return Math.floor((e[0] * (n - 1) - n + i) / 2);
|
|
159
|
+
}
|
|
160
|
+
function v(e) {
|
|
161
|
+
return typeof e == "number" ? [
|
|
162
|
+
e,
|
|
163
|
+
e,
|
|
164
|
+
e
|
|
165
|
+
] : e.length === 2 ? [
|
|
166
|
+
e[0],
|
|
167
|
+
e[1],
|
|
168
|
+
1
|
|
169
|
+
] : e;
|
|
170
|
+
}
|
|
171
|
+
function y(e) {
|
|
172
|
+
return typeof e == "number" ? [
|
|
173
|
+
e,
|
|
174
|
+
e,
|
|
175
|
+
e
|
|
176
|
+
] : e;
|
|
177
|
+
}
|
|
178
|
+
function b(e, t) {
|
|
179
|
+
return t <= 1 ? e : e + (e - 1) * (t - 1);
|
|
180
|
+
}
|
|
181
|
+
function x(e, t, n, r, i, a, o, s, c) {
|
|
182
|
+
let l, u, d;
|
|
183
|
+
if (typeof e == "number") {
|
|
184
|
+
l = {
|
|
185
|
+
top: e,
|
|
186
|
+
bottom: e,
|
|
187
|
+
left: e,
|
|
188
|
+
right: e,
|
|
189
|
+
type: e === 0 ? "VALID" : "NUMBER"
|
|
190
|
+
};
|
|
191
|
+
let i = h([t, n], a, r, e, s);
|
|
192
|
+
u = i[0], d = i[1];
|
|
193
|
+
} else if (e === "same") {
|
|
194
|
+
u = Math.ceil(t / r), d = Math.ceil(n / i);
|
|
195
|
+
let e = Math.max(0, (u - 1) * r + a - t), s = Math.max(0, (d - 1) * i + o - n), c = Math.floor(e / 2), f = e - c, p = Math.floor(s / 2);
|
|
196
|
+
l = {
|
|
197
|
+
top: c,
|
|
198
|
+
bottom: f,
|
|
199
|
+
left: p,
|
|
200
|
+
right: s - p,
|
|
201
|
+
type: "SAME"
|
|
202
|
+
};
|
|
203
|
+
} else if (e === "valid") l = {
|
|
204
|
+
top: 0,
|
|
205
|
+
bottom: 0,
|
|
206
|
+
left: 0,
|
|
207
|
+
right: 0,
|
|
208
|
+
type: "VALID"
|
|
209
|
+
}, u = Math.ceil((t - a + 1) / r), d = Math.ceil((n - o + 1) / i);
|
|
210
|
+
else if (typeof e == "object") {
|
|
211
|
+
let f = c === "channelsLast" ? e[1][0] : e[2][0], p = c === "channelsLast" ? e[1][1] : e[2][1], m = c === "channelsLast" ? e[2][0] : e[3][0], h = c === "channelsLast" ? e[2][1] : e[3][1];
|
|
212
|
+
l = {
|
|
213
|
+
top: f,
|
|
214
|
+
bottom: p,
|
|
215
|
+
left: m,
|
|
216
|
+
right: h,
|
|
217
|
+
type: f === 0 && p === 0 && m === 0 && h === 0 ? "VALID" : "EXPLICIT"
|
|
218
|
+
}, u = C((t - a + f + p) / r + 1, s), d = C((n - o + m + h) / i + 1, s);
|
|
219
|
+
} else throw Error(`Unknown padding parameter: ${e}`);
|
|
220
|
+
return {
|
|
221
|
+
padInfo: l,
|
|
222
|
+
outHeight: u,
|
|
223
|
+
outWidth: d
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
function S(e, t, n, r, i, a, o, s, c, l, u) {
|
|
227
|
+
let d, f, p, m;
|
|
228
|
+
if (e === "valid" && (e = 0), typeof e == "number") {
|
|
229
|
+
d = {
|
|
230
|
+
top: e,
|
|
231
|
+
bottom: e,
|
|
232
|
+
left: e,
|
|
233
|
+
right: e,
|
|
234
|
+
front: e,
|
|
235
|
+
back: e,
|
|
236
|
+
type: e === 0 ? "VALID" : "NUMBER"
|
|
237
|
+
};
|
|
238
|
+
let h = g([
|
|
239
|
+
t,
|
|
240
|
+
n,
|
|
241
|
+
r,
|
|
242
|
+
1
|
|
243
|
+
], [
|
|
244
|
+
s,
|
|
245
|
+
c,
|
|
246
|
+
l
|
|
247
|
+
], 1, [
|
|
248
|
+
i,
|
|
249
|
+
a,
|
|
250
|
+
o
|
|
251
|
+
], e, u);
|
|
252
|
+
f = h[0], p = h[1], m = h[2];
|
|
253
|
+
} else if (e === "same") {
|
|
254
|
+
f = Math.ceil(t / i), p = Math.ceil(n / a), m = Math.ceil(r / o);
|
|
255
|
+
let e = (f - 1) * i + s - t, u = (p - 1) * a + c - n, h = (m - 1) * o + l - r, g = Math.floor(e / 2), _ = e - g, v = Math.floor(u / 2), y = u - v, b = Math.floor(h / 2);
|
|
256
|
+
d = {
|
|
257
|
+
top: v,
|
|
258
|
+
bottom: y,
|
|
259
|
+
left: b,
|
|
260
|
+
right: h - b,
|
|
261
|
+
front: g,
|
|
262
|
+
back: _,
|
|
263
|
+
type: "SAME"
|
|
264
|
+
};
|
|
265
|
+
} else throw Error(`Unknown padding parameter: ${e}`);
|
|
266
|
+
return {
|
|
267
|
+
padInfo: d,
|
|
268
|
+
outDepth: f,
|
|
269
|
+
outHeight: p,
|
|
270
|
+
outWidth: m
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
function C(e, t) {
|
|
274
|
+
if (!t) return Math.trunc(e);
|
|
275
|
+
switch (t) {
|
|
276
|
+
case "round": return Math.round(e);
|
|
277
|
+
case "ceil": return Math.ceil(e);
|
|
278
|
+
case "floor": return Math.floor(e);
|
|
279
|
+
default: throw Error(`Unknown roundingMode ${t}`);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
function w(e) {
|
|
283
|
+
let [t, n, r] = v(e);
|
|
284
|
+
return t === 1 && n === 1 && r === 1;
|
|
285
|
+
}
|
|
286
|
+
function T(e, t) {
|
|
287
|
+
return w(e) || w(t);
|
|
288
|
+
}
|
|
289
|
+
function E(e) {
|
|
290
|
+
return v(e).every((e) => e > 0);
|
|
291
|
+
}
|
|
292
|
+
function D(e) {
|
|
293
|
+
if (e === "NHWC") return "channelsLast";
|
|
294
|
+
if (e === "NCHW") return "channelsFirst";
|
|
295
|
+
throw Error(`Unknown dataFormat ${e}`);
|
|
296
|
+
}
|
|
297
|
+
function O(e, n, r) {
|
|
298
|
+
if (r != null) {
|
|
299
|
+
if (typeof n == "string") throw Error(`Error in ${e}: pad must be an integer when using dimRoundingMode ${r} but got pad ${n}.`);
|
|
300
|
+
if (typeof n == "number") l(t(n), () => `Error in ${e}: pad must be an integer when using dimRoundingMode ${r} but got pad ${n}.`);
|
|
301
|
+
else if (typeof n == "object") n.forEach((n) => {
|
|
302
|
+
n.forEach((n) => {
|
|
303
|
+
l(t(n), () => `Error in ${e}: pad must be an integer when using dimRoundingMode ${r} but got pad ${n}.`);
|
|
304
|
+
});
|
|
305
|
+
});
|
|
306
|
+
else throw Error(`Error in ${e}: Unknown padding parameter: ${n}`);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/sigmoid.js
|
|
310
|
+
function k(e) {
|
|
311
|
+
let t = { x: n(e, "x", "sigmoid", "float32") };
|
|
312
|
+
return o.runKernel(r, t);
|
|
313
|
+
}
|
|
314
|
+
var A = /* @__PURE__ */ i({ sigmoid_: k });
|
|
315
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/elu.js
|
|
316
|
+
function j(e) {
|
|
317
|
+
let t = { x: n(e, "x", "elu", "float32") };
|
|
318
|
+
return o.runKernel("Elu", t);
|
|
319
|
+
}
|
|
320
|
+
var M = /* @__PURE__ */ i({ elu_: j });
|
|
321
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/leaky_relu.js
|
|
322
|
+
function N(t, r = .2) {
|
|
323
|
+
let i = { x: n(t, "x", "leakyRelu") }, a = { alpha: r };
|
|
324
|
+
return o.runKernel(e, i, a);
|
|
325
|
+
}
|
|
326
|
+
var P = /* @__PURE__ */ i({ leakyRelu_: N });
|
|
327
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/prelu.js
|
|
328
|
+
function F(e, t) {
|
|
329
|
+
let r = {
|
|
330
|
+
x: n(e, "x", "prelu"),
|
|
331
|
+
alpha: n(t, "alpha", "prelu")
|
|
332
|
+
};
|
|
333
|
+
return o.runKernel(a, r);
|
|
334
|
+
}
|
|
335
|
+
var I = /* @__PURE__ */ i({ prelu_: F });
|
|
336
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/relu6.js
|
|
337
|
+
function L(e) {
|
|
338
|
+
let t = { x: n(e, "x", "relu6") };
|
|
339
|
+
return o.runKernel(c, t);
|
|
340
|
+
}
|
|
341
|
+
var R = /* @__PURE__ */ i({ relu6_: L });
|
|
342
|
+
// node_modules/@tensorflow/tfjs-core/dist/ops/step.js
|
|
343
|
+
function z(e, t = 0) {
|
|
344
|
+
let r = { x: n(e, "x", "step") }, i = { alpha: t };
|
|
345
|
+
return o.runKernel(s, r, i);
|
|
346
|
+
}
|
|
347
|
+
var B = /* @__PURE__ */ i({ step_: z });
|
|
348
|
+
export { w as _, M as a, p as c, u as d, d as f, E as g, T as h, P as i, m as l, D as m, R as n, A as o, f as p, I as r, O as s, B as t, _ as u };
|