@genai-fi/nanogpt 0.19.0 → 0.20.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/package.json +9 -10
- package/dist/Generator.d.ts +0 -82
- package/dist/Generator.js +0 -11941
- package/dist/RealDiv-CGwv0liw.js +0 -365
- package/dist/Reshape-BW__R4mZ.js +0 -79
- package/dist/Reshape-CPBkTIH2.js +0 -14
- package/dist/TeachableLLM.d.ts +0 -70
- package/dist/TeachableLLM.js +0 -273
- package/dist/Trainer.d.ts +0 -43
- package/dist/Trainer.js +0 -244
- package/dist/_commonjsHelpers-ByX85dGu.js +0 -33
- package/dist/axis_util-GTVlo58H.js +0 -55
- package/dist/backend.d.ts +0 -2
- package/dist/backend.js +0 -13
- package/dist/backend_util-GaFarB78.js +0 -425
- package/dist/backend_webgpu-BqASlsbV.js +0 -545
- package/dist/binary_op_util-pKXltfxI.js +0 -192
- package/dist/broadcast_to-eS93CCN_.js +0 -28
- package/dist/checks/appendCache.d.ts +0 -1
- package/dist/checks/appendCache.js +0 -22
- package/dist/checks/attentionMask.d.ts +0 -1
- package/dist/checks/attentionMask.js +0 -37
- package/dist/checks/check.d.ts +0 -9
- package/dist/checks/check.js +0 -20
- package/dist/checks/gelu.d.ts +0 -1
- package/dist/checks/gelu.js +0 -18
- package/dist/checks/index.d.ts +0 -26
- package/dist/checks/index.js +0 -28
- package/dist/checks/matMulGelu.d.ts +0 -1
- package/dist/checks/matMulGelu.js +0 -28
- package/dist/checks/normRMS.d.ts +0 -1
- package/dist/checks/normRMS.js +0 -16
- package/dist/checks/normRMSGrad.d.ts +0 -1
- package/dist/checks/normRMSGrad.js +0 -12
- package/dist/checks/packUnpack.d.ts +0 -1
- package/dist/checks/packUnpack.js +0 -18
- package/dist/checks/qkv.d.ts +0 -1
- package/dist/checks/qkv.js +0 -34
- package/dist/checks/rope.d.ts +0 -1
- package/dist/checks/rope.js +0 -36
- package/dist/checks/weights.d.ts +0 -14
- package/dist/checks/weights.js +0 -31
- package/dist/clip_by_value-DDA7rrcT.js +0 -12
- package/dist/complex-DI35Q-gW.js +0 -11
- package/dist/complex_util-Yc1A_gV1.js +0 -55
- package/dist/concat-CAQpCret.js +0 -17
- package/dist/concat_util-D18dJ4fD.js +0 -22
- package/dist/data/docx.d.ts +0 -2
- package/dist/data/docx.js +0 -15
- package/dist/data/parquet.d.ts +0 -2
- package/dist/data/parquet.js +0 -17
- package/dist/data/pdf.d.ts +0 -2
- package/dist/data/pdf.js +0 -14
- package/dist/data/textLoader.d.ts +0 -7
- package/dist/data/textLoader.js +0 -108
- package/dist/dataset-CGGp1z9P.js +0 -1124
- package/dist/dropout_util--NxWuYg2.js +0 -27
- package/dist/expand_dims-Bkd1YD5x.js +0 -11
- package/dist/exports_initializers-CYzKLjN7.js +0 -7
- package/dist/floor-BQtb-Azg.js +0 -9
- package/dist/gather-qIqEqaGn.js +0 -9
- package/dist/gelu-B220X1Go.js +0 -26
- package/dist/gpgpu_math-BwvV12df.js +0 -2022
- package/dist/index-CUXkjxiT.js +0 -3516
- package/dist/index-CieiGp4Y.js +0 -349
- package/dist/index-CjOWnMXP.js +0 -7308
- package/dist/index-Cp39cXWe.js +0 -1016
- package/dist/index-D5v913EJ.js +0 -4
- package/dist/index-DmeWGGmS.js +0 -1074
- package/dist/index-DvYrXKkX.js +0 -113
- package/dist/index-Ksja3su6.js +0 -151
- package/dist/index-xuotMAFm.js +0 -118
- package/dist/inference/types.d.ts +0 -16
- package/dist/inference/types.js +0 -1
- package/dist/jszip.min-BZhlzntC.js +0 -2313
- package/dist/kernel_funcs_utils-pq0CK9co.js +0 -306
- package/dist/layers/BaseLayer.d.ts +0 -44
- package/dist/layers/BaseLayer.js +0 -74
- package/dist/layers/CausalSelfAttention.d.ts +0 -39
- package/dist/layers/CausalSelfAttention.js +0 -86
- package/dist/layers/LoRA.d.ts +0 -14
- package/dist/layers/LoRA.js +0 -58
- package/dist/layers/MLP.d.ts +0 -17
- package/dist/layers/MLP.js +0 -44
- package/dist/layers/PositionEmbedding.d.ts +0 -8
- package/dist/layers/PositionEmbedding.js +0 -31
- package/dist/layers/RMSNorm.d.ts +0 -12
- package/dist/layers/RMSNorm.js +0 -22
- package/dist/layers/RoPECache.d.ts +0 -18
- package/dist/layers/RoPECache.js +0 -50
- package/dist/layers/TiedEmbedding.d.ts +0 -13
- package/dist/layers/TiedEmbedding.js +0 -36
- package/dist/layers/TransformerBlock.d.ts +0 -27
- package/dist/layers/TransformerBlock.js +0 -40
- package/dist/layers/WeightStore.d.ts +0 -20
- package/dist/layers/WeightStore.js +0 -76
- package/dist/loader/load.d.ts +0 -6
- package/dist/loader/load.js +0 -68
- package/dist/loader/loadHF.d.ts +0 -8
- package/dist/loader/loadHF.js +0 -22
- package/dist/loader/loadTransformers.d.ts +0 -4
- package/dist/loader/loadTransformers.js +0 -44
- package/dist/loader/loadZipMeta.d.ts +0 -3
- package/dist/loader/loadZipMeta.js +0 -16
- package/dist/loader/newZipLoad.d.ts +0 -3
- package/dist/loader/newZipLoad.js +0 -31
- package/dist/loader/oldZipLoad.d.ts +0 -9
- package/dist/loader/oldZipLoad.js +0 -80
- package/dist/loader/save.d.ts +0 -16
- package/dist/loader/save.js +0 -90
- package/dist/loader/types.d.ts +0 -67
- package/dist/loader/types.js +0 -1
- package/dist/main.d.ts +0 -50
- package/dist/main.js +0 -109
- package/dist/matMul16-BcVC_E62.js +0 -80
- package/dist/matMulGelu-JNLZqKQp.js +0 -163
- package/dist/mat_mul-DhG0Newp.js +0 -11
- package/dist/mod-CSdCpRjf.js +0 -11
- package/dist/models/NanoGPTV1.d.ts +0 -16
- package/dist/models/NanoGPTV1.js +0 -99
- package/dist/models/NanoGPTV2.d.ts +0 -16
- package/dist/models/NanoGPTV2.js +0 -90
- package/dist/models/config.d.ts +0 -27
- package/dist/models/config.js +0 -50
- package/dist/models/factory.d.ts +0 -3
- package/dist/models/factory.js +0 -16
- package/dist/models/model.d.ts +0 -44
- package/dist/models/model.js +0 -134
- package/dist/non_max_suppression_impl-B2W7YjZB.js +0 -102
- package/dist/not_equal-hurPF26l.js +0 -64
- package/dist/ones-BytntneX.js +0 -14
- package/dist/ops/adamAdjust.d.ts +0 -2
- package/dist/ops/adamAdjust.js +0 -9
- package/dist/ops/adamMoments.d.ts +0 -2
- package/dist/ops/adamMoments.js +0 -9
- package/dist/ops/add16.d.ts +0 -2
- package/dist/ops/add16.js +0 -9
- package/dist/ops/appendCache.d.ts +0 -2
- package/dist/ops/appendCache.js +0 -22
- package/dist/ops/attentionMask.d.ts +0 -2
- package/dist/ops/attentionMask.js +0 -10
- package/dist/ops/concat16.d.ts +0 -2
- package/dist/ops/concat16.js +0 -9
- package/dist/ops/cpu/adamAdjust.d.ts +0 -1
- package/dist/ops/cpu/adamAdjust.js +0 -18
- package/dist/ops/cpu/adamMoments.d.ts +0 -1
- package/dist/ops/cpu/adamMoments.js +0 -16
- package/dist/ops/cpu/appendCache.d.ts +0 -1
- package/dist/ops/cpu/appendCache.js +0 -23
- package/dist/ops/cpu/attentionMask.d.ts +0 -1
- package/dist/ops/cpu/attentionMask.js +0 -22
- package/dist/ops/cpu/fusedSoftmax.d.ts +0 -9
- package/dist/ops/cpu/fusedSoftmax.js +0 -29
- package/dist/ops/cpu/gatherSub.d.ts +0 -1
- package/dist/ops/cpu/gatherSub.js +0 -18
- package/dist/ops/cpu/gelu.d.ts +0 -1
- package/dist/ops/cpu/gelu.js +0 -40
- package/dist/ops/cpu/matMul16.d.ts +0 -1
- package/dist/ops/cpu/matMul16.js +0 -15
- package/dist/ops/cpu/matMulGelu.d.ts +0 -1
- package/dist/ops/cpu/matMulGelu.js +0 -53
- package/dist/ops/cpu/matMulMul.d.ts +0 -1
- package/dist/ops/cpu/matMulMul.js +0 -23
- package/dist/ops/cpu/mulDropout.d.ts +0 -1
- package/dist/ops/cpu/mulDropout.js +0 -23
- package/dist/ops/cpu/normRMS.d.ts +0 -1
- package/dist/ops/cpu/normRMS.js +0 -39
- package/dist/ops/cpu/qkv.d.ts +0 -5
- package/dist/ops/cpu/qkv.js +0 -41
- package/dist/ops/cpu/rope.d.ts +0 -6
- package/dist/ops/cpu/rope.js +0 -38
- package/dist/ops/cpu/scatterSub.d.ts +0 -1
- package/dist/ops/cpu/scatterSub.js +0 -23
- package/dist/ops/dot16.d.ts +0 -2
- package/dist/ops/dot16.js +0 -42
- package/dist/ops/dropout.d.ts +0 -2
- package/dist/ops/dropout.js +0 -14
- package/dist/ops/dropout16.d.ts +0 -2
- package/dist/ops/dropout16.js +0 -25
- package/dist/ops/gatherSub.d.ts +0 -2
- package/dist/ops/gatherSub.js +0 -9
- package/dist/ops/gelu.d.ts +0 -3
- package/dist/ops/gelu.js +0 -8
- package/dist/ops/globalNorm.d.ts +0 -2
- package/dist/ops/globalNorm.js +0 -13
- package/dist/ops/grads/add16.d.ts +0 -1
- package/dist/ops/grads/add16.js +0 -26
- package/dist/ops/grads/attentionMask.d.ts +0 -1
- package/dist/ops/grads/attentionMask.js +0 -21
- package/dist/ops/grads/dropout16.d.ts +0 -1
- package/dist/ops/grads/dropout16.js +0 -2
- package/dist/ops/grads/gelu.d.ts +0 -2
- package/dist/ops/grads/gelu.js +0 -5
- package/dist/ops/grads/matMul16.d.ts +0 -2
- package/dist/ops/grads/matMul16.js +0 -9
- package/dist/ops/grads/matMulGelu.d.ts +0 -1
- package/dist/ops/grads/matMulGelu.js +0 -17
- package/dist/ops/grads/mul16.d.ts +0 -1
- package/dist/ops/grads/mul16.js +0 -4
- package/dist/ops/grads/normRMS.d.ts +0 -3
- package/dist/ops/grads/normRMS.js +0 -33
- package/dist/ops/grads/pack16.d.ts +0 -2
- package/dist/ops/grads/pack16.js +0 -6
- package/dist/ops/grads/qkv.d.ts +0 -3
- package/dist/ops/grads/qkv.js +0 -34
- package/dist/ops/grads/rope.d.ts +0 -2
- package/dist/ops/grads/rope.js +0 -5
- package/dist/ops/grads/softmax16.d.ts +0 -2
- package/dist/ops/grads/softmax16.js +0 -25
- package/dist/ops/grads/unpack16.d.ts +0 -2
- package/dist/ops/grads/unpack16.js +0 -5
- package/dist/ops/grads/utils.d.ts +0 -4
- package/dist/ops/grads/utils.js +0 -14
- package/dist/ops/log.d.ts +0 -0
- package/dist/ops/log.js +0 -1
- package/dist/ops/matMul16.d.ts +0 -15
- package/dist/ops/matMul16.js +0 -13
- package/dist/ops/matMulGelu.d.ts +0 -3
- package/dist/ops/matMulGelu.js +0 -14
- package/dist/ops/matMulMul.d.ts +0 -2
- package/dist/ops/matMulMul.js +0 -9
- package/dist/ops/mul16.d.ts +0 -2
- package/dist/ops/mul16.js +0 -39
- package/dist/ops/mulDrop.d.ts +0 -2
- package/dist/ops/mulDrop.js +0 -9
- package/dist/ops/normRMS.d.ts +0 -2
- package/dist/ops/normRMS.js +0 -19
- package/dist/ops/pack16.d.ts +0 -2
- package/dist/ops/pack16.js +0 -5
- package/dist/ops/qkv.d.ts +0 -2
- package/dist/ops/qkv.js +0 -10
- package/dist/ops/reshape16.d.ts +0 -2
- package/dist/ops/reshape16.js +0 -41
- package/dist/ops/rope.d.ts +0 -3
- package/dist/ops/rope.js +0 -7
- package/dist/ops/scatterSub.d.ts +0 -2
- package/dist/ops/scatterSub.js +0 -9
- package/dist/ops/slice16.d.ts +0 -2
- package/dist/ops/slice16.js +0 -9
- package/dist/ops/softmax16.d.ts +0 -2
- package/dist/ops/softmax16.js +0 -9
- package/dist/ops/sub16.d.ts +0 -2
- package/dist/ops/sub16.js +0 -8
- package/dist/ops/sum16.d.ts +0 -2
- package/dist/ops/sum16.js +0 -13
- package/dist/ops/transpose16.d.ts +0 -3
- package/dist/ops/transpose16.js +0 -40
- package/dist/ops/unpack16.d.ts +0 -2
- package/dist/ops/unpack16.js +0 -6
- package/dist/ops/webgl/adamAdjust.d.ts +0 -1
- package/dist/ops/webgl/adamAdjust.js +0 -49
- package/dist/ops/webgl/adamMoments.d.ts +0 -1
- package/dist/ops/webgl/adamMoments.js +0 -40
- package/dist/ops/webgl/appendCache.d.ts +0 -1
- package/dist/ops/webgl/appendCache.js +0 -44
- package/dist/ops/webgl/attentionMask.d.ts +0 -1
- package/dist/ops/webgl/attentionMask.js +0 -45
- package/dist/ops/webgl/dropout16.d.ts +0 -1
- package/dist/ops/webgl/dropout16.js +0 -11
- package/dist/ops/webgl/fusedSoftmax.d.ts +0 -11
- package/dist/ops/webgl/fusedSoftmax.js +0 -80
- package/dist/ops/webgl/gatherSub.d.ts +0 -1
- package/dist/ops/webgl/gatherSub.js +0 -27
- package/dist/ops/webgl/gelu.d.ts +0 -2
- package/dist/ops/webgl/gelu.js +0 -50
- package/dist/ops/webgl/log.d.ts +0 -17
- package/dist/ops/webgl/log.js +0 -23
- package/dist/ops/webgl/matMul16.d.ts +0 -1
- package/dist/ops/webgl/matMul16.js +0 -45
- package/dist/ops/webgl/matMulGelu.d.ts +0 -21
- package/dist/ops/webgl/matMulGelu.js +0 -9
- package/dist/ops/webgl/matMulMul.d.ts +0 -14
- package/dist/ops/webgl/matMulMul.js +0 -28
- package/dist/ops/webgl/mulDropout.d.ts +0 -1
- package/dist/ops/webgl/mulDropout.js +0 -41
- package/dist/ops/webgl/normRMS.d.ts +0 -1
- package/dist/ops/webgl/normRMS.js +0 -93
- package/dist/ops/webgl/qkv.d.ts +0 -1
- package/dist/ops/webgl/qkv.js +0 -46
- package/dist/ops/webgl/rope.d.ts +0 -1
- package/dist/ops/webgl/rope.js +0 -56
- package/dist/ops/webgl/scatterSub.d.ts +0 -1
- package/dist/ops/webgl/scatterSub.js +0 -27
- package/dist/ops/webgpu/adamAdjust.d.ts +0 -1
- package/dist/ops/webgpu/adamAdjust.js +0 -57
- package/dist/ops/webgpu/adamMoments.d.ts +0 -1
- package/dist/ops/webgpu/adamMoments.js +0 -60
- package/dist/ops/webgpu/add16.d.ts +0 -1
- package/dist/ops/webgpu/add16.js +0 -13
- package/dist/ops/webgpu/appendCache.d.ts +0 -1
- package/dist/ops/webgpu/appendCache.js +0 -105
- package/dist/ops/webgpu/attentionMask.d.ts +0 -1
- package/dist/ops/webgpu/attentionMask.js +0 -26
- package/dist/ops/webgpu/attentionMask32_program.d.ts +0 -19
- package/dist/ops/webgpu/attentionMask32_program.js +0 -54
- package/dist/ops/webgpu/clipScale.d.ts +0 -1
- package/dist/ops/webgpu/clipScale.js +0 -58
- package/dist/ops/webgpu/concat16.d.ts +0 -19
- package/dist/ops/webgpu/concat16.js +0 -126
- package/dist/ops/webgpu/dropout16.d.ts +0 -1
- package/dist/ops/webgpu/dropout16.js +0 -51
- package/dist/ops/webgpu/gatherSub.d.ts +0 -1
- package/dist/ops/webgpu/gatherSub.js +0 -39
- package/dist/ops/webgpu/gelu.d.ts +0 -14
- package/dist/ops/webgpu/gelu.js +0 -141
- package/dist/ops/webgpu/index.d.ts +0 -0
- package/dist/ops/webgpu/index.js +0 -26
- package/dist/ops/webgpu/matMul16.d.ts +0 -1
- package/dist/ops/webgpu/matMul16.js +0 -65
- package/dist/ops/webgpu/matMul16_program.d.ts +0 -42
- package/dist/ops/webgpu/matMul16_program.js +0 -343
- package/dist/ops/webgpu/mul16.d.ts +0 -1
- package/dist/ops/webgpu/mul16.js +0 -13
- package/dist/ops/webgpu/norm2.d.ts +0 -1
- package/dist/ops/webgpu/norm2.js +0 -76
- package/dist/ops/webgpu/normRMS.d.ts +0 -1
- package/dist/ops/webgpu/normRMS.js +0 -34
- package/dist/ops/webgpu/normRMS16_program.d.ts +0 -10
- package/dist/ops/webgpu/normRMS16_program.js +0 -25
- package/dist/ops/webgpu/normRMS32_program.d.ts +0 -10
- package/dist/ops/webgpu/normRMS32_program.js +0 -25
- package/dist/ops/webgpu/normRMSGrad.d.ts +0 -1
- package/dist/ops/webgpu/normRMSGrad.js +0 -284
- package/dist/ops/webgpu/pack16.d.ts +0 -1
- package/dist/ops/webgpu/pack16.js +0 -18
- package/dist/ops/webgpu/pack16_program.d.ts +0 -19
- package/dist/ops/webgpu/pack16_program.js +0 -92
- package/dist/ops/webgpu/qkv.d.ts +0 -1
- package/dist/ops/webgpu/qkv.js +0 -24
- package/dist/ops/webgpu/rope.d.ts +0 -1
- package/dist/ops/webgpu/rope.js +0 -135
- package/dist/ops/webgpu/scatterSub.d.ts +0 -1
- package/dist/ops/webgpu/scatterSub.js +0 -40
- package/dist/ops/webgpu/slice16.d.ts +0 -7
- package/dist/ops/webgpu/slice16.js +0 -69
- package/dist/ops/webgpu/softmax16.d.ts +0 -17
- package/dist/ops/webgpu/softmax16.js +0 -21
- package/dist/ops/webgpu/softmax16_program.d.ts +0 -13
- package/dist/ops/webgpu/softmax16_program.js +0 -73
- package/dist/ops/webgpu/softmax16_subgroup_program.d.ts +0 -17
- package/dist/ops/webgpu/softmax16_subgroup_program.js +0 -75
- package/dist/ops/webgpu/softmax16grad.d.ts +0 -1
- package/dist/ops/webgpu/softmax16grad.js +0 -37
- package/dist/ops/webgpu/sub16.d.ts +0 -1
- package/dist/ops/webgpu/sub16.js +0 -13
- package/dist/ops/webgpu/sum16.d.ts +0 -1
- package/dist/ops/webgpu/sum16.js +0 -38
- package/dist/ops/webgpu/transpose16.d.ts +0 -1
- package/dist/ops/webgpu/transpose16.js +0 -34
- package/dist/ops/webgpu/transpose16_program.d.ts +0 -16
- package/dist/ops/webgpu/transpose16_program.js +0 -50
- package/dist/ops/webgpu/transpose16_shared_program.d.ts +0 -15
- package/dist/ops/webgpu/transpose16_shared_program.js +0 -70
- package/dist/ops/webgpu/unpack16.d.ts +0 -1
- package/dist/ops/webgpu/unpack16.js +0 -48
- package/dist/ops/webgpu/utils/binary_op.d.ts +0 -35
- package/dist/ops/webgpu/utils/binary_op.js +0 -139
- package/dist/ops/webgpu/utils/deviceInfo.d.ts +0 -7
- package/dist/ops/webgpu/utils/deviceInfo.js +0 -11
- package/dist/ops/webgpu/utils/reductions.d.ts +0 -43
- package/dist/ops/webgpu/utils/reductions.js +0 -275
- package/dist/ops-CsXeTq1P.js +0 -476
- package/dist/pack16-bqltoUlR.js +0 -39
- package/dist/papaparse.min-C0cScC2i.js +0 -418
- package/dist/parquet-Bqjmp2vo.js +0 -44231
- package/dist/patches/webgpu_backend.d.ts +0 -18
- package/dist/patches/webgpu_backend.js +0 -56
- package/dist/patches/webgpu_base.d.ts +0 -21
- package/dist/patches/webgpu_base.js +0 -34
- package/dist/patches/webgpu_program.d.ts +0 -36
- package/dist/patches/webgpu_program.js +0 -400
- package/dist/pdf-NIhmP3sq.js +0 -19477
- package/dist/rand_util-CZ7yLoUm.js +0 -50
- package/dist/random_normal-IBRrha8a.js +0 -14
- package/dist/random_width-DN5ZtQkM.js +0 -9796
- package/dist/range-C-CjF-LI.js +0 -10
- package/dist/relu-J_X6MUzx.js +0 -9
- package/dist/reshape-BDOuCSNW.js +0 -9
- package/dist/resize_nearest_neighbor-BojqlfRe.js +0 -150
- package/dist/rope-DcrZM_e6.js +0 -24
- package/dist/scatter_nd_util-ByNJaL6I.js +0 -46
- package/dist/segment_util-Dasb2Zaf.js +0 -43
- package/dist/selu_util-BLhIqRkw.js +0 -44
- package/dist/shared-3agzAqQ_.js +0 -53
- package/dist/shared-CagdqkLh.js +0 -2143
- package/dist/slice-BzS11Qh0.js +0 -12
- package/dist/slice_util-CC35pLmT.js +0 -153
- package/dist/softmax-D4q1LJN7.js +0 -12
- package/dist/split-C2Sj255c.js +0 -9
- package/dist/squeeze-ho4wLUek.js +0 -10
- package/dist/stack-DudVrtmG.js +0 -11
- package/dist/step-BTxPtq1r.js +0 -261
- package/dist/sum-BpiwSWvg.js +0 -11
- package/dist/tensor-BWFldCso.js +0 -8
- package/dist/tensor1d-LMGMIUlr.js +0 -11
- package/dist/tensor2d-BnXMKScO.js +0 -14
- package/dist/tensor4d-C6UCG_u8.js +0 -14
- package/dist/tfjs_backend-BGnG-ppu.js +0 -654
- package/dist/tile-CFy-xTO6.js +0 -11
- package/dist/tokeniser/BaseTokeniser.d.ts +0 -33
- package/dist/tokeniser/BaseTokeniser.js +0 -124
- package/dist/tokeniser/CharTokeniser.d.ts +0 -24
- package/dist/tokeniser/CharTokeniser.js +0 -107
- package/dist/tokeniser/bpe.d.ts +0 -28
- package/dist/tokeniser/bpe.js +0 -173
- package/dist/tokeniser/messages.d.ts +0 -61
- package/dist/tokeniser/messages.js +0 -1
- package/dist/tokeniser/type.d.ts +0 -34
- package/dist/tokeniser/type.js +0 -1
- package/dist/training/AdamW.d.ts +0 -36
- package/dist/training/AdamW.js +0 -138
- package/dist/training/BasicTrainer.d.ts +0 -63
- package/dist/training/BasicTrainer.js +0 -265
- package/dist/training/DatasetBuilder.d.ts +0 -26
- package/dist/training/DatasetBuilder.js +0 -86
- package/dist/training/Evaluator.d.ts +0 -19
- package/dist/training/Evaluator.js +0 -39
- package/dist/training/LRScheduler.d.ts +0 -12
- package/dist/training/LRScheduler.js +0 -34
- package/dist/training/PreTrainer.d.ts +0 -11
- package/dist/training/PreTrainer.js +0 -20
- package/dist/training/SFTTrainer.d.ts +0 -12
- package/dist/training/SFTTrainer.js +0 -22
- package/dist/training/loss.d.ts +0 -3
- package/dist/training/loss.js +0 -24
- package/dist/training/orthoGrad.d.ts +0 -2
- package/dist/training/orthoGrad.js +0 -10
- package/dist/training/sparseCrossEntropy.d.ts +0 -7
- package/dist/training/sparseCrossEntropy.js +0 -69
- package/dist/training/tasks/ConversationTask.d.ts +0 -18
- package/dist/training/tasks/ConversationTask.js +0 -40
- package/dist/training/tasks/PretrainingTask.d.ts +0 -17
- package/dist/training/tasks/PretrainingTask.js +0 -47
- package/dist/training/tasks/StartSentenceTask.d.ts +0 -18
- package/dist/training/tasks/StartSentenceTask.js +0 -49
- package/dist/training/tasks/Task.d.ts +0 -22
- package/dist/training/tasks/Task.js +0 -68
- package/dist/training/tasks/splitter.d.ts +0 -5
- package/dist/training/tasks/splitter.js +0 -21
- package/dist/training/types.d.ts +0 -78
- package/dist/training/types.js +0 -1
- package/dist/training/validation.d.ts +0 -17
- package/dist/training/validation.js +0 -84
- package/dist/transpose-9kRxIXWR.js +0 -36
- package/dist/unsorted_segment_sum-DJvk5xnh.js +0 -277
- package/dist/utilities/arrayClose.d.ts +0 -1
- package/dist/utilities/arrayClose.js +0 -20
- package/dist/utilities/datasetID.d.ts +0 -2
- package/dist/utilities/datasetID.js +0 -21
- package/dist/utilities/dummy.d.ts +0 -9
- package/dist/utilities/dummy.js +0 -43
- package/dist/utilities/multinomialCPU.d.ts +0 -2
- package/dist/utilities/multinomialCPU.js +0 -13
- package/dist/utilities/naming.d.ts +0 -4
- package/dist/utilities/naming.js +0 -1
- package/dist/utilities/packed.d.ts +0 -4
- package/dist/utilities/packed.js +0 -15
- package/dist/utilities/parameters.d.ts +0 -11
- package/dist/utilities/parameters.js +0 -57
- package/dist/utilities/performance.d.ts +0 -2
- package/dist/utilities/performance.js +0 -16
- package/dist/utilities/profile.d.ts +0 -17
- package/dist/utilities/profile.js +0 -38
- package/dist/utilities/safetensors.d.ts +0 -3
- package/dist/utilities/safetensors.js +0 -83
- package/dist/utilities/sentences.d.ts +0 -5
- package/dist/utilities/sentences.js +0 -41
- package/dist/utilities/tokenParse.d.ts +0 -1
- package/dist/utilities/tokenParse.js +0 -21
- package/dist/utilities/topP.d.ts +0 -1
- package/dist/utilities/topP.js +0 -13
- package/dist/utilities/waitForModel.d.ts +0 -2
- package/dist/utilities/waitForModel.js +0 -12
- package/dist/utilities/weights.d.ts +0 -12
- package/dist/utilities/weights.js +0 -45
- package/dist/utilities/yielder.d.ts +0 -1
- package/dist/utilities/yielder.js +0 -7
- package/dist/variable-Ck482e3n.js +0 -7
- package/dist/webgpu_program-B4HmApL1.js +0 -525
- package/dist/webgpu_util-DYlGSwOJ.js +0 -64
- package/dist/zeros-DvZpK8s6.js +0 -13
- package/dist/zeros_like-CWjDdwr-.js +0 -721
package/dist/slice-BzS11Qh0.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { o as c, q as e, E as a, S as l } from "./index-CUXkjxiT.js";
|
|
2
|
-
function p(r, n, o) {
|
|
3
|
-
const s = e(r, "x", "slice", "string_or_numeric");
|
|
4
|
-
if (s.rank === 0)
|
|
5
|
-
throw new Error("Slicing scalar is not possible");
|
|
6
|
-
const t = { x: s }, i = { begin: n, size: o };
|
|
7
|
-
return a.runKernel(l, t, i);
|
|
8
|
-
}
|
|
9
|
-
const x = /* @__PURE__ */ c({ slice_: p });
|
|
10
|
-
export {
|
|
11
|
-
x as s
|
|
12
|
-
};
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { x as b } from "./index-CUXkjxiT.js";
|
|
2
|
-
const y = -2, N = -1;
|
|
3
|
-
function L(r, e, n) {
|
|
4
|
-
const t = r.shape.length;
|
|
5
|
-
b(t === e.length, () => `Error in slice${t}D: Length of begin ${e} must match the rank of the array (${t}).`), b(t === n.length, () => `Error in slice${t}D: Length of size ${n} must match the rank of the array (${t}).`);
|
|
6
|
-
for (let l = 0; l < t; ++l)
|
|
7
|
-
b(e[l] + n[l] <= r.shape[l], () => `Error in slice${t}D: begin[${l}] + size[${l}] (${e[l] + n[l]}) would overflow input.shape[${l}] (${r.shape[l]})`);
|
|
8
|
-
}
|
|
9
|
-
function v(r, e, n) {
|
|
10
|
-
const t = [];
|
|
11
|
-
for (let l = 0; l < r.length; l++)
|
|
12
|
-
t[l] = Math.ceil((e[l] - r[l]) / n[l]);
|
|
13
|
-
return t;
|
|
14
|
-
}
|
|
15
|
-
function P(r, e, n) {
|
|
16
|
-
let t = n.length;
|
|
17
|
-
for (let l = 0; l < n.length; l++)
|
|
18
|
-
if (n[l] > 1) {
|
|
19
|
-
t = l;
|
|
20
|
-
break;
|
|
21
|
-
}
|
|
22
|
-
for (let l = t + 1; l < n.length; l++)
|
|
23
|
-
if (e[l] > 0 || n[l] !== r[l])
|
|
24
|
-
return !1;
|
|
25
|
-
return !0;
|
|
26
|
-
}
|
|
27
|
-
function X(r, e) {
|
|
28
|
-
let n = r.length > 0 ? r[r.length - 1] : 1;
|
|
29
|
-
for (let t = 0; t < r.length - 1; t++)
|
|
30
|
-
n += r[t] * e[t];
|
|
31
|
-
return n;
|
|
32
|
-
}
|
|
33
|
-
function C(r, e, n) {
|
|
34
|
-
let t;
|
|
35
|
-
const l = r.shape.length;
|
|
36
|
-
typeof e == "number" ? t = [e, ...new Array(l - 1).fill(0)] : e.length < l ? t = e.concat(new Array(l - e.length).fill(0)) : t = e.slice(), t.forEach((f) => {
|
|
37
|
-
b(f !== -1, () => "slice() does not support negative begin indexing.");
|
|
38
|
-
});
|
|
39
|
-
let a;
|
|
40
|
-
return n == null ? a = new Array(l).fill(-1) : typeof n == "number" ? a = [n, ...new Array(l - 1).fill(-1)] : n.length < l ? a = n.concat(new Array(l - n.length).fill(-1)) : a = n, a = a.map((f, u) => f >= 0 ? f : (b(f === -1, () => `Negative size values should be exactly -1 but got ${f} for the slice() size at index ${u}.`), r.shape[u] - t[u])), [t, a];
|
|
41
|
-
}
|
|
42
|
-
function H(r, e, n, t, l, a, f, u, D) {
|
|
43
|
-
let g;
|
|
44
|
-
if (t == null ? (g = new Array(e.length), g.fill(1)) : g = t, f != null && (f & f - 1) !== 0)
|
|
45
|
-
throw new Error("Multiple ellipses in slice is not allowed.");
|
|
46
|
-
let w = !1;
|
|
47
|
-
const d = {
|
|
48
|
-
dims: g.length,
|
|
49
|
-
numAddAxisAfterEllipsis: 0,
|
|
50
|
-
begin: e.slice(),
|
|
51
|
-
end: n.slice(),
|
|
52
|
-
strides: g.slice(),
|
|
53
|
-
beginMask: l,
|
|
54
|
-
endMask: a,
|
|
55
|
-
ellipsisMask: f,
|
|
56
|
-
newAxisMask: u,
|
|
57
|
-
shrinkAxisMask: D
|
|
58
|
-
};
|
|
59
|
-
for (let i = 0; i < d.dims; i++)
|
|
60
|
-
w && (1 << i & u) !== 0 && d.numAddAxisAfterEllipsis++, 1 << i & f && (w = !0);
|
|
61
|
-
w || (d.ellipsisMask |= 1 << d.dims, d.dims++);
|
|
62
|
-
const s = {
|
|
63
|
-
dims: r.length,
|
|
64
|
-
beginMask: 0,
|
|
65
|
-
endMask: 0,
|
|
66
|
-
beginValid: !1,
|
|
67
|
-
endValid: !1
|
|
68
|
-
};
|
|
69
|
-
O(d, s);
|
|
70
|
-
let m = !0, S = !0, M = !0;
|
|
71
|
-
const k = [], I = [];
|
|
72
|
-
for (let i = 0; i < r.length; ++i) {
|
|
73
|
-
if (s.strides[i] === 0)
|
|
74
|
-
throw Error(`strides[${i}] must be non-zero`);
|
|
75
|
-
const o = !!(s.shrinkAxisMask & 1 << i), h = r[i];
|
|
76
|
-
if (h === -1) {
|
|
77
|
-
k.push(o ? 1 : -1);
|
|
78
|
-
continue;
|
|
79
|
-
}
|
|
80
|
-
const G = [s.beginMask & 1 << i, s.endMask & 1 << i], E = [
|
|
81
|
-
s.strides[i] > 0 ? 0 : -1,
|
|
82
|
-
s.strides[i] > 0 ? h : h - 1
|
|
83
|
-
];
|
|
84
|
-
if (o && s.strides[i] <= 0)
|
|
85
|
-
throw Error("only stride 1 allowed on non-range indexing.");
|
|
86
|
-
M = M && s.strides[i] === 1;
|
|
87
|
-
const $ = !!(s.beginMask & 1 << i && s.endMask & 1 << i);
|
|
88
|
-
if (s.beginValid && s.endValid) {
|
|
89
|
-
if (o) {
|
|
90
|
-
const x = s.begin[i] < 0 ? h + s.begin[i] : s.begin[i];
|
|
91
|
-
if (s.begin[i] = x, s.end[i] = s.begin[i] + 1, x < 0 || x >= h)
|
|
92
|
-
throw Error(`slice index ${s.begin[i]} of dimension ${i} out of bounds.`);
|
|
93
|
-
} else
|
|
94
|
-
s.begin[i] = V(s.begin[i], 0, s.strides[i], h, G, E), s.end[i] = V(s.end[i], 1, s.strides[i], h, G, E);
|
|
95
|
-
const p = s.strides[i] === 1 && s.begin[i] === 0 && s.end[i] === h;
|
|
96
|
-
m = m && p, S = S && (i === 0 && s.strides[i] === 1 || p);
|
|
97
|
-
} else
|
|
98
|
-
m = m && s.strides[i] === 1 && $, S = S && (i === 0 && s.strides[i] === 1 || $);
|
|
99
|
-
let c, A = !1;
|
|
100
|
-
if (s.beginValid && s.endValid ? (c = s.end[i] - s.begin[i], A = !0) : o ? (c = 1, A = !0) : $ && h >= 0 && (s.strides[i] < 0 ? c = -h : c = h, A = !0), A) {
|
|
101
|
-
let p;
|
|
102
|
-
c === 0 || c < 0 != s.strides[i] < 0 ? p = 0 : p = Math.trunc(c / s.strides[i]) + (c % s.strides[i] !== 0 ? 1 : 0), k.push(p);
|
|
103
|
-
} else
|
|
104
|
-
k.push(-1);
|
|
105
|
-
}
|
|
106
|
-
for (let i = 0; i < s.finalShapeGatherIndices.length; ++i) {
|
|
107
|
-
const o = s.finalShapeGatherIndices[i];
|
|
108
|
-
o >= 0 ? I.push(k[o]) : o === y && I.push(1);
|
|
109
|
-
}
|
|
110
|
-
return {
|
|
111
|
-
finalShapeSparse: I.filter((i, o) => s.finalShapeGatherIndices[o] !== y),
|
|
112
|
-
finalShape: I,
|
|
113
|
-
isIdentity: m,
|
|
114
|
-
sliceDim0: S,
|
|
115
|
-
isSimpleSlice: M,
|
|
116
|
-
begin: s.begin,
|
|
117
|
-
end: s.end,
|
|
118
|
-
strides: s.strides
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
function O(r, e) {
|
|
122
|
-
e.beginMask = 0, e.endMask = 0, e.shrinkAxisMask = 0;
|
|
123
|
-
let n = 0;
|
|
124
|
-
e.beginValid = r.begin != null, e.endValid = r.end != null, e.begin = new Array(e.dims), e.end = new Array(e.dims), e.strides = new Array(e.dims), e.finalShapeGatherIndices = [], e.finalShapeGatherIndicesSparse = [], e.inputShapeGatherIndicesSparse = new Array(e.dims);
|
|
125
|
-
for (let t = 0; t < r.dims; t++)
|
|
126
|
-
if (1 << t & r.ellipsisMask) {
|
|
127
|
-
const l = Math.min(e.dims - (r.dims - t) + 1 + r.numAddAxisAfterEllipsis, e.dims);
|
|
128
|
-
for (; n < l; n++)
|
|
129
|
-
e.begin[n] = 0, e.end[n] = 0, e.strides[n] = 1, e.beginMask |= 1 << n, e.endMask |= 1 << n, e.finalShapeGatherIndices.push(n), e.finalShapeGatherIndicesSparse.push(-1), e.inputShapeGatherIndicesSparse[n] = t;
|
|
130
|
-
} else if (1 << t & r.newAxisMask)
|
|
131
|
-
e.finalShapeGatherIndices.push(y), e.finalShapeGatherIndicesSparse.push(-1);
|
|
132
|
-
else {
|
|
133
|
-
if (n === e.begin.length)
|
|
134
|
-
throw Error(`Index out of range using input dim ${n}; input has only ${e.dims} dims, ${e.begin.length}.`);
|
|
135
|
-
r.begin != null && (e.begin[n] = r.begin[t]), r.end != null && (e.end[n] = r.end[t]), e.strides[n] = r.strides[t], r.beginMask & 1 << t && (e.beginMask |= 1 << n), r.endMask & 1 << t && (e.endMask |= 1 << n), r.shrinkAxisMask & 1 << t ? (e.finalShapeGatherIndices.push(N), e.finalShapeGatherIndicesSparse.push(-1), e.shrinkAxisMask |= 1 << n) : (e.finalShapeGatherIndices.push(n), e.finalShapeGatherIndicesSparse.push(t)), e.inputShapeGatherIndicesSparse[n] = t, n++;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
function V(r, e, n, t, l, a) {
|
|
139
|
-
if (l[e])
|
|
140
|
-
return n > 0 ? a[e] : a[e + 1 & 1];
|
|
141
|
-
{
|
|
142
|
-
const f = r < 0 ? t + r : r;
|
|
143
|
-
return f < a[0] ? a[0] : f > a[1] ? a[1] : f;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
export {
|
|
147
|
-
L as a,
|
|
148
|
-
v as b,
|
|
149
|
-
X as c,
|
|
150
|
-
P as i,
|
|
151
|
-
C as p,
|
|
152
|
-
H as s
|
|
153
|
-
};
|
package/dist/softmax-D4q1LJN7.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { o as r, q as f, E as e, I as i } from "./index-CUXkjxiT.js";
|
|
2
|
-
function l(s, o = -1) {
|
|
3
|
-
const t = f(s, "logits", "softmax", "float32");
|
|
4
|
-
if (o === -1 && (o = t.rank - 1), o !== t.rank - 1)
|
|
5
|
-
throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${t.rank} and dim was ${o}`);
|
|
6
|
-
const n = { logits: t }, a = { dim: o };
|
|
7
|
-
return e.runKernel(i, n, a);
|
|
8
|
-
}
|
|
9
|
-
const p = /* @__PURE__ */ r({ softmax_: l });
|
|
10
|
-
export {
|
|
11
|
-
p as s
|
|
12
|
-
};
|
package/dist/split-C2Sj255c.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { o as p, q as i, E as a, J as c } from "./index-CUXkjxiT.js";
|
|
2
|
-
function e(t, s, o = 0) {
|
|
3
|
-
const n = { x: i(t, "x", "split") }, r = { numOrSizeSplits: s, axis: o };
|
|
4
|
-
return a.runKernel(c, n, r);
|
|
5
|
-
}
|
|
6
|
-
const u = /* @__PURE__ */ p({ split_: e });
|
|
7
|
-
export {
|
|
8
|
-
u as s
|
|
9
|
-
};
|
package/dist/squeeze-ho4wLUek.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { o as r, q as n, K as a } from "./index-CUXkjxiT.js";
|
|
2
|
-
import { r as t } from "./reshape-BDOuCSNW.js";
|
|
3
|
-
function p(s, o) {
|
|
4
|
-
const e = n(s, "x", "squeeze", "string_or_numeric");
|
|
5
|
-
return t(e, a(e.shape, o).newShape);
|
|
6
|
-
}
|
|
7
|
-
const i = /* @__PURE__ */ r({ squeeze_: p });
|
|
8
|
-
export {
|
|
9
|
-
i as s
|
|
10
|
-
};
|
package/dist/stack-DudVrtmG.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { o as e, y as c, x as n, E as k, P as i } from "./index-CUXkjxiT.js";
|
|
2
|
-
function u(r, t = 0) {
|
|
3
|
-
const s = c(r, "tensors", "stack", "string_or_numeric");
|
|
4
|
-
n(s.length >= 1, () => "Pass at least one tensor to tf.stack"), s.length > 0 && n(t <= s[0].rank, () => "Axis must be <= rank of the tensor");
|
|
5
|
-
const o = s, a = { axis: t };
|
|
6
|
-
return k.runKernel(i, o, a);
|
|
7
|
-
}
|
|
8
|
-
const l = /* @__PURE__ */ e({ stack_: u });
|
|
9
|
-
export {
|
|
10
|
-
l as s
|
|
11
|
-
};
|
package/dist/step-BTxPtq1r.js
DELETED
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
import { x as _, aE as P, o as A, q as I, E as v, aF as G, aG as q, aH as J, aI as X, aJ as Q, aK as Y } from "./index-CUXkjxiT.js";
|
|
2
|
-
function it(t, n, e, o, s = "NHWC", f) {
|
|
3
|
-
const l = t[3], r = [...n, l], c = nt(s);
|
|
4
|
-
return j(t, r, e, f, o, null, null, c);
|
|
5
|
-
}
|
|
6
|
-
function ft(t, n, e, o, s, f, l = "channelsLast") {
|
|
7
|
-
const [r, c] = T(n);
|
|
8
|
-
let u;
|
|
9
|
-
if (l === "channelsLast")
|
|
10
|
-
u = [r, c, t[3], t[3]];
|
|
11
|
-
else if (l === "channelsFirst")
|
|
12
|
-
u = [r, c, t[1], t[1]];
|
|
13
|
-
else
|
|
14
|
-
throw new Error(`Unknown dataFormat ${l}`);
|
|
15
|
-
return j(t, u, e, o, s, f, !1, l);
|
|
16
|
-
}
|
|
17
|
-
function ht(t, n, e, o, s, f, l = "NDHWC") {
|
|
18
|
-
const [r, c, u] = K(n);
|
|
19
|
-
let h, i;
|
|
20
|
-
if (l === "NDHWC")
|
|
21
|
-
i = "channelsLast", h = [r, c, u, t[4], t[4]];
|
|
22
|
-
else if (l === "NCDHW")
|
|
23
|
-
i = "channelsFirst", h = [r, c, u, t[1], t[1]];
|
|
24
|
-
else
|
|
25
|
-
throw new Error(`Unknown dataFormat ${l}`);
|
|
26
|
-
return Z(t, h, e, o, s, !1, i, f);
|
|
27
|
-
}
|
|
28
|
-
function j(t, n, e, o, s, f, l = !1, r = "channelsLast") {
|
|
29
|
-
let [c, u, h, i] = [-1, -1, -1, -1];
|
|
30
|
-
if (r === "channelsLast")
|
|
31
|
-
[c, u, h, i] = t;
|
|
32
|
-
else if (r === "channelsFirst")
|
|
33
|
-
[c, i, u, h] = t;
|
|
34
|
-
else
|
|
35
|
-
throw new Error(`Unknown dataFormat ${r}`);
|
|
36
|
-
const [a, p, , $] = n, [w, g] = T(e), [x, y] = T(o), C = k(a, x), b = k(p, y), { padInfo: L, outHeight: E, outWidth: D } = d(s, u, h, w, g, C, b, f, r), M = l ? $ * i : $;
|
|
37
|
-
let m;
|
|
38
|
-
return r === "channelsFirst" ? m = [c, M, E, D] : r === "channelsLast" && (m = [c, E, D, M]), {
|
|
39
|
-
batchSize: c,
|
|
40
|
-
dataFormat: r,
|
|
41
|
-
inHeight: u,
|
|
42
|
-
inWidth: h,
|
|
43
|
-
inChannels: i,
|
|
44
|
-
outHeight: E,
|
|
45
|
-
outWidth: D,
|
|
46
|
-
outChannels: M,
|
|
47
|
-
padInfo: L,
|
|
48
|
-
strideHeight: w,
|
|
49
|
-
strideWidth: g,
|
|
50
|
-
filterHeight: a,
|
|
51
|
-
filterWidth: p,
|
|
52
|
-
effectiveFilterHeight: C,
|
|
53
|
-
effectiveFilterWidth: b,
|
|
54
|
-
dilationHeight: x,
|
|
55
|
-
dilationWidth: y,
|
|
56
|
-
inShape: t,
|
|
57
|
-
outShape: m,
|
|
58
|
-
filterShape: n
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
function Z(t, n, e, o, s, f = !1, l = "channelsLast", r) {
|
|
62
|
-
let [c, u, h, i, a] = [-1, -1, -1, -1, -1];
|
|
63
|
-
if (l === "channelsLast")
|
|
64
|
-
[c, u, h, i, a] = t;
|
|
65
|
-
else if (l === "channelsFirst")
|
|
66
|
-
[c, a, u, h, i] = t;
|
|
67
|
-
else
|
|
68
|
-
throw new Error(`Unknown dataFormat ${l}`);
|
|
69
|
-
const [p, $, w, , g] = n, [x, y, C] = K(e), [b, L, E] = K(o), D = k(p, b), M = k($, L), m = k(w, E), { padInfo: F, outDepth: N, outHeight: R, outWidth: W } = tt(s, u, h, i, x, y, C, D, M, m, r), H = f ? g * a : g;
|
|
70
|
-
let O;
|
|
71
|
-
return l === "channelsFirst" ? O = [c, H, N, R, W] : l === "channelsLast" && (O = [c, N, R, W, H]), {
|
|
72
|
-
batchSize: c,
|
|
73
|
-
dataFormat: l,
|
|
74
|
-
inDepth: u,
|
|
75
|
-
inHeight: h,
|
|
76
|
-
inWidth: i,
|
|
77
|
-
inChannels: a,
|
|
78
|
-
outDepth: N,
|
|
79
|
-
outHeight: R,
|
|
80
|
-
outWidth: W,
|
|
81
|
-
outChannels: H,
|
|
82
|
-
padInfo: F,
|
|
83
|
-
strideDepth: x,
|
|
84
|
-
strideHeight: y,
|
|
85
|
-
strideWidth: C,
|
|
86
|
-
filterDepth: p,
|
|
87
|
-
filterHeight: $,
|
|
88
|
-
filterWidth: w,
|
|
89
|
-
effectiveFilterDepth: D,
|
|
90
|
-
effectiveFilterHeight: M,
|
|
91
|
-
effectiveFilterWidth: m,
|
|
92
|
-
dilationDepth: b,
|
|
93
|
-
dilationHeight: L,
|
|
94
|
-
dilationWidth: E,
|
|
95
|
-
inShape: t,
|
|
96
|
-
outShape: O,
|
|
97
|
-
filterShape: n
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
function z(t, n, e, o, s) {
|
|
101
|
-
o == null && (o = B(t, n, e));
|
|
102
|
-
const f = t[0], l = t[1], r = U((f - n + 2 * o) / e + 1, s), c = U((l - n + 2 * o) / e + 1, s);
|
|
103
|
-
return [r, c];
|
|
104
|
-
}
|
|
105
|
-
function S(t, n, e, o, s, f) {
|
|
106
|
-
s == null && (s = B(t, n[0], o[0]));
|
|
107
|
-
const l = [0, 0, 0, e];
|
|
108
|
-
for (let r = 0; r < 3; r++)
|
|
109
|
-
t[r] + 2 * s >= n[r] && (l[r] = U((t[r] - n[r] + 2 * s) / o[r] + 1, f));
|
|
110
|
-
return l;
|
|
111
|
-
}
|
|
112
|
-
function B(t, n, e, o = 1) {
|
|
113
|
-
const s = k(n, o);
|
|
114
|
-
return Math.floor((t[0] * (e - 1) - e + s) / 2);
|
|
115
|
-
}
|
|
116
|
-
function T(t) {
|
|
117
|
-
return typeof t == "number" ? [t, t, t] : t.length === 2 ? [t[0], t[1], 1] : t;
|
|
118
|
-
}
|
|
119
|
-
function K(t) {
|
|
120
|
-
return typeof t == "number" ? [t, t, t] : t;
|
|
121
|
-
}
|
|
122
|
-
function k(t, n) {
|
|
123
|
-
return n <= 1 ? t : t + (t - 1) * (n - 1);
|
|
124
|
-
}
|
|
125
|
-
function d(t, n, e, o, s, f, l, r, c) {
|
|
126
|
-
let u, h, i;
|
|
127
|
-
if (typeof t == "number") {
|
|
128
|
-
u = { top: t, bottom: t, left: t, right: t, type: t === 0 ? "VALID" : "NUMBER" };
|
|
129
|
-
const p = z([n, e], f, o, t, r);
|
|
130
|
-
h = p[0], i = p[1];
|
|
131
|
-
} else if (t === "same") {
|
|
132
|
-
h = Math.ceil(n / o), i = Math.ceil(e / s);
|
|
133
|
-
const a = Math.max(0, (h - 1) * o + f - n), p = Math.max(0, (i - 1) * s + l - e), $ = Math.floor(a / 2), w = a - $, g = Math.floor(p / 2), x = p - g;
|
|
134
|
-
u = { top: $, bottom: w, left: g, right: x, type: "SAME" };
|
|
135
|
-
} else if (t === "valid")
|
|
136
|
-
u = { top: 0, bottom: 0, left: 0, right: 0, type: "VALID" }, h = Math.ceil((n - f + 1) / o), i = Math.ceil((e - l + 1) / s);
|
|
137
|
-
else if (typeof t == "object") {
|
|
138
|
-
const a = c === "channelsLast" ? t[1][0] : t[2][0], p = c === "channelsLast" ? t[1][1] : t[2][1], $ = c === "channelsLast" ? t[2][0] : t[3][0], w = c === "channelsLast" ? t[2][1] : t[3][1];
|
|
139
|
-
u = { top: a, bottom: p, left: $, right: w, type: a === 0 && p === 0 && $ === 0 && w === 0 ? "VALID" : "EXPLICIT" }, h = U((n - f + a + p) / o + 1, r), i = U((e - l + $ + w) / s + 1, r);
|
|
140
|
-
} else
|
|
141
|
-
throw Error(`Unknown padding parameter: ${t}`);
|
|
142
|
-
return { padInfo: u, outHeight: h, outWidth: i };
|
|
143
|
-
}
|
|
144
|
-
function tt(t, n, e, o, s, f, l, r, c, u, h) {
|
|
145
|
-
let i, a, p, $;
|
|
146
|
-
if (t === "valid" && (t = 0), typeof t == "number") {
|
|
147
|
-
i = {
|
|
148
|
-
top: t,
|
|
149
|
-
bottom: t,
|
|
150
|
-
left: t,
|
|
151
|
-
right: t,
|
|
152
|
-
front: t,
|
|
153
|
-
back: t,
|
|
154
|
-
type: t === 0 ? "VALID" : "NUMBER"
|
|
155
|
-
};
|
|
156
|
-
const g = S([n, e, o, 1], [r, c, u], 1, [s, f, l], t, h);
|
|
157
|
-
a = g[0], p = g[1], $ = g[2];
|
|
158
|
-
} else if (t === "same") {
|
|
159
|
-
a = Math.ceil(n / s), p = Math.ceil(e / f), $ = Math.ceil(o / l);
|
|
160
|
-
const w = (a - 1) * s + r - n, g = (p - 1) * f + c - e, x = ($ - 1) * l + u - o, y = Math.floor(w / 2), C = w - y, b = Math.floor(g / 2), L = g - b, E = Math.floor(x / 2), D = x - E;
|
|
161
|
-
i = { top: b, bottom: L, left: E, right: D, front: y, back: C, type: "SAME" };
|
|
162
|
-
} else
|
|
163
|
-
throw Error(`Unknown padding parameter: ${t}`);
|
|
164
|
-
return { padInfo: i, outDepth: a, outHeight: p, outWidth: $ };
|
|
165
|
-
}
|
|
166
|
-
function U(t, n) {
|
|
167
|
-
if (!n)
|
|
168
|
-
return Math.trunc(t);
|
|
169
|
-
switch (n) {
|
|
170
|
-
case "round":
|
|
171
|
-
return Math.round(t);
|
|
172
|
-
case "ceil":
|
|
173
|
-
return Math.ceil(t);
|
|
174
|
-
case "floor":
|
|
175
|
-
return Math.floor(t);
|
|
176
|
-
default:
|
|
177
|
-
throw new Error(`Unknown roundingMode ${n}`);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
function V(t) {
|
|
181
|
-
const [n, e, o] = T(t);
|
|
182
|
-
return n === 1 && e === 1 && o === 1;
|
|
183
|
-
}
|
|
184
|
-
function at(t, n) {
|
|
185
|
-
return V(t) || V(n);
|
|
186
|
-
}
|
|
187
|
-
function pt(t) {
|
|
188
|
-
return T(t).every((n) => n > 0);
|
|
189
|
-
}
|
|
190
|
-
function nt(t) {
|
|
191
|
-
if (t === "NHWC")
|
|
192
|
-
return "channelsLast";
|
|
193
|
-
if (t === "NCHW")
|
|
194
|
-
return "channelsFirst";
|
|
195
|
-
throw new Error(`Unknown dataFormat ${t}`);
|
|
196
|
-
}
|
|
197
|
-
function $t(t, n, e) {
|
|
198
|
-
if (e != null) {
|
|
199
|
-
if (typeof n == "string")
|
|
200
|
-
throw Error(`Error in ${t}: pad must be an integer when using dimRoundingMode ${e} but got pad ${n}.`);
|
|
201
|
-
if (typeof n == "number")
|
|
202
|
-
_(P(n), () => `Error in ${t}: pad must be an integer when using dimRoundingMode ${e} but got pad ${n}.`);
|
|
203
|
-
else if (typeof n == "object")
|
|
204
|
-
n.forEach((o) => {
|
|
205
|
-
o.forEach((s) => {
|
|
206
|
-
_(P(s), () => `Error in ${t}: pad must be an integer when using dimRoundingMode ${e} but got pad ${s}.`);
|
|
207
|
-
});
|
|
208
|
-
});
|
|
209
|
-
else
|
|
210
|
-
throw Error(`Error in ${t}: Unknown padding parameter: ${n}`);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
function et(t) {
|
|
214
|
-
const e = { x: I(t, "x", "sigmoid", "float32") };
|
|
215
|
-
return v.runKernel(G, e);
|
|
216
|
-
}
|
|
217
|
-
const gt = /* @__PURE__ */ A({ sigmoid_: et });
|
|
218
|
-
function ot(t) {
|
|
219
|
-
const e = { x: I(t, "x", "elu", "float32") };
|
|
220
|
-
return v.runKernel(q, e);
|
|
221
|
-
}
|
|
222
|
-
const wt = /* @__PURE__ */ A({ elu_: ot });
|
|
223
|
-
function st(t, n = 0.2) {
|
|
224
|
-
const o = { x: I(t, "x", "leakyRelu") }, s = { alpha: n };
|
|
225
|
-
return v.runKernel(J, o, s);
|
|
226
|
-
}
|
|
227
|
-
const xt = /* @__PURE__ */ A({ leakyRelu_: st });
|
|
228
|
-
function rt(t, n) {
|
|
229
|
-
const e = I(t, "x", "prelu"), o = I(n, "alpha", "prelu"), s = { x: e, alpha: o };
|
|
230
|
-
return v.runKernel(X, s);
|
|
231
|
-
}
|
|
232
|
-
const Et = /* @__PURE__ */ A({ prelu_: rt });
|
|
233
|
-
function lt(t) {
|
|
234
|
-
const e = { x: I(t, "x", "relu6") };
|
|
235
|
-
return v.runKernel(Q, e);
|
|
236
|
-
}
|
|
237
|
-
const yt = /* @__PURE__ */ A({ relu6_: lt });
|
|
238
|
-
function ct(t, n = 0) {
|
|
239
|
-
const o = { x: I(t, "x", "step") }, s = { alpha: n };
|
|
240
|
-
return v.runKernel(Y, o, s);
|
|
241
|
-
}
|
|
242
|
-
const bt = /* @__PURE__ */ A({ step_: ct });
|
|
243
|
-
export {
|
|
244
|
-
bt as a,
|
|
245
|
-
j as b,
|
|
246
|
-
$t as c,
|
|
247
|
-
Z as d,
|
|
248
|
-
wt as e,
|
|
249
|
-
B as f,
|
|
250
|
-
it as g,
|
|
251
|
-
ft as h,
|
|
252
|
-
ht as i,
|
|
253
|
-
nt as j,
|
|
254
|
-
at as k,
|
|
255
|
-
xt as l,
|
|
256
|
-
pt as m,
|
|
257
|
-
Et as p,
|
|
258
|
-
yt as r,
|
|
259
|
-
gt as s,
|
|
260
|
-
V as t
|
|
261
|
-
};
|
package/dist/sum-BpiwSWvg.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { o as e, q as u, L as c, E as l, N as m } from "./index-CUXkjxiT.js";
|
|
2
|
-
function i(t, o = null, n = !1) {
|
|
3
|
-
let s = u(t, "x", "sum");
|
|
4
|
-
s.dtype === "bool" && (s = c(s, "int32"));
|
|
5
|
-
const r = { x: s }, a = { axis: o, keepDims: n };
|
|
6
|
-
return l.runKernel(m, r, a);
|
|
7
|
-
}
|
|
8
|
-
const f = /* @__PURE__ */ e({ sum_: i });
|
|
9
|
-
export {
|
|
10
|
-
f as s
|
|
11
|
-
};
|
package/dist/tensor-BWFldCso.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { W as o, X as s, Y as t } from "./index-CUXkjxiT.js";
|
|
2
|
-
function h(r, e) {
|
|
3
|
-
o(r);
|
|
4
|
-
const n = s(r, e);
|
|
5
|
-
if (n.length !== 1)
|
|
6
|
-
throw new Error("tensor1d() requires values to be a flat/TypedArray");
|
|
7
|
-
return t(r, null, n, e);
|
|
8
|
-
}
|
|
9
|
-
export {
|
|
10
|
-
h as t
|
|
11
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { W as t, X as s, Y as a } from "./index-CUXkjxiT.js";
|
|
2
|
-
function i(n, r, o) {
|
|
3
|
-
if (t(n), r != null && r.length !== 2)
|
|
4
|
-
throw new Error("tensor2d() requires shape to have two numbers");
|
|
5
|
-
const e = s(n, o);
|
|
6
|
-
if (e.length !== 2 && e.length !== 1)
|
|
7
|
-
throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");
|
|
8
|
-
if (e.length === 1 && r == null)
|
|
9
|
-
throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");
|
|
10
|
-
return a(n, r, e, o);
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
i as t
|
|
14
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { W as t, X as a, Y as s } from "./index-CUXkjxiT.js";
|
|
2
|
-
function i(n, r, o) {
|
|
3
|
-
if (t(n), r != null && r.length !== 4)
|
|
4
|
-
throw new Error("tensor4d() requires shape to have four numbers");
|
|
5
|
-
const e = a(n, o);
|
|
6
|
-
if (e.length !== 4 && e.length !== 1)
|
|
7
|
-
throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");
|
|
8
|
-
if (e.length === 1 && r == null)
|
|
9
|
-
throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");
|
|
10
|
-
return s(n, r, e, o);
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
i as t
|
|
14
|
-
};
|