@genai-fi/nanogpt 0.18.0 → 0.19.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/Generator.js +30 -30
- package/dist/{RealDiv-ioj6Z-ox.js → RealDiv-CGwv0liw.js} +9 -9
- package/dist/{Reshape-BZC-ebeR.js → Reshape-BW__R4mZ.js} +7 -7
- package/dist/{Reshape-pwprEaej.js → Reshape-CPBkTIH2.js} +1 -1
- package/dist/TeachableLLM.js +17 -17
- package/dist/Trainer.js +97 -95
- package/dist/{axis_util-QWWgLjut.js → axis_util-GTVlo58H.js} +1 -1
- package/dist/backend.js +2 -2
- package/dist/{backend_util-qwSFfxYx.js → backend_util-GaFarB78.js} +21 -21
- package/dist/{backend_webgpu-DI2wXEC2.js → backend_webgpu-BqASlsbV.js} +8 -8
- package/dist/{broadcast_to-C_EJTVTZ.js → broadcast_to-eS93CCN_.js} +2 -2
- package/dist/checks/appendCache.js +2 -2
- package/dist/checks/attentionMask.js +5 -5
- package/dist/checks/gelu.js +2 -2
- package/dist/checks/matMulGelu.js +2 -2
- package/dist/checks/normRMS.js +6 -6
- package/dist/checks/normRMSGrad.js +3 -3
- package/dist/checks/packUnpack.js +6 -6
- package/dist/checks/qkv.js +2 -2
- package/dist/checks/rope.js +2 -2
- package/dist/{clip_by_value-CLAD4h_I.js → clip_by_value-DDA7rrcT.js} +1 -1
- package/dist/complex-DI35Q-gW.js +11 -0
- package/dist/{concat-Dqk7Xk7h.js → concat-CAQpCret.js} +5 -5
- package/dist/{concat_util-C1Mxe27t.js → concat_util-D18dJ4fD.js} +1 -1
- package/dist/{dataset-DlqAN81i.js → dataset-CGGp1z9P.js} +3 -3
- package/dist/{dropout_util-N0z8Os-K.js → dropout_util--NxWuYg2.js} +1 -1
- package/dist/{expand_dims-D0rBtgT1.js → expand_dims-Bkd1YD5x.js} +4 -4
- package/dist/{exports_initializers-DIOZQt_L.js → exports_initializers-CYzKLjN7.js} +1 -1
- package/dist/{floor-CymuCmTO.js → floor-BQtb-Azg.js} +1 -1
- package/dist/{gather-DEyjXNb1.js → gather-qIqEqaGn.js} +1 -1
- package/dist/{gelu-DpTCC3eB.js → gelu-B220X1Go.js} +1 -1
- package/dist/{gpgpu_math-3bCb5ooU.js → gpgpu_math-BwvV12df.js} +25 -25
- package/dist/{index-DSGwv2Yx.js → index-CUXkjxiT.js} +33 -33
- package/dist/{index-BQvB7LCC.js → index-CjOWnMXP.js} +15 -15
- package/dist/{kernel_funcs_utils-DGqzNlHT.js → kernel_funcs_utils-pq0CK9co.js} +6 -6
- package/dist/layers/BaseLayer.js +4 -4
- package/dist/layers/CausalSelfAttention.d.ts +1 -0
- package/dist/layers/CausalSelfAttention.js +14 -14
- package/dist/layers/LoRA.js +4 -4
- package/dist/layers/MLP.js +4 -4
- package/dist/layers/PositionEmbedding.js +5 -5
- package/dist/layers/RMSNorm.js +3 -3
- package/dist/layers/RoPECache.js +4 -4
- package/dist/layers/TiedEmbedding.js +6 -6
- package/dist/layers/TransformerBlock.d.ts +1 -0
- package/dist/layers/TransformerBlock.js +1 -1
- package/dist/layers/WeightStore.js +2 -2
- package/dist/loader/loadTransformers.js +9 -9
- package/dist/loader/oldZipLoad.js +9 -9
- package/dist/loader/save.js +38 -30
- package/dist/loader/types.d.ts +1 -0
- package/dist/main.js +9 -9
- package/dist/{matMul16-BIT70Vya.js → matMul16-BcVC_E62.js} +3 -3
- package/dist/{matMulGelu-CsZnh18H.js → matMulGelu-JNLZqKQp.js} +18 -18
- package/dist/mat_mul-DhG0Newp.js +11 -0
- package/dist/mod-CSdCpRjf.js +11 -0
- package/dist/models/NanoGPTV1.js +2 -2
- package/dist/models/NanoGPTV2.js +2 -2
- package/dist/models/model.d.ts +1 -0
- package/dist/models/model.js +9 -9
- package/dist/{not_equal-CkQKkKZy.js → not_equal-hurPF26l.js} +15 -15
- package/dist/{ones-DbVB5N58.js → ones-BytntneX.js} +3 -3
- package/dist/ops/adamAdjust.js +3 -3
- package/dist/ops/adamMoments.js +3 -3
- package/dist/ops/add16.js +1 -1
- package/dist/ops/appendCache.js +6 -6
- package/dist/ops/attentionMask.js +3 -3
- package/dist/ops/concat16.js +3 -3
- package/dist/ops/cpu/adamAdjust.js +9 -9
- package/dist/ops/cpu/adamMoments.js +5 -5
- package/dist/ops/cpu/appendCache.js +2 -2
- package/dist/ops/cpu/attentionMask.js +6 -6
- package/dist/ops/cpu/fusedSoftmax.js +4 -4
- package/dist/ops/cpu/gatherSub.js +5 -5
- package/dist/ops/cpu/gelu.js +4 -4
- package/dist/ops/cpu/matMul16.js +2 -2
- package/dist/ops/cpu/matMulGelu.js +7 -7
- package/dist/ops/cpu/matMulMul.js +2 -2
- package/dist/ops/cpu/mulDropout.js +5 -5
- package/dist/ops/cpu/normRMS.js +1 -1
- package/dist/ops/cpu/qkv.js +3 -3
- package/dist/ops/cpu/rope.js +5 -5
- package/dist/ops/cpu/scatterSub.js +5 -5
- package/dist/ops/dot16.js +2 -2
- package/dist/ops/dropout.js +6 -6
- package/dist/ops/dropout16.js +1 -1
- package/dist/ops/gatherSub.js +1 -1
- package/dist/ops/gelu.js +2 -2
- package/dist/ops/globalNorm.js +7 -7
- package/dist/ops/grads/add16.js +1 -1
- package/dist/ops/grads/attentionMask.js +2 -2
- package/dist/ops/grads/dropout16.js +1 -1
- package/dist/ops/grads/gelu.js +2 -2
- package/dist/ops/grads/matMul16.js +3 -3
- package/dist/ops/grads/matMulGelu.js +1 -1
- package/dist/ops/grads/mul16.js +1 -1
- package/dist/ops/grads/normRMS.js +7 -7
- package/dist/ops/grads/pack16.js +3 -3
- package/dist/ops/grads/qkv.js +11 -11
- package/dist/ops/grads/rope.js +2 -2
- package/dist/ops/grads/softmax16.js +1 -1
- package/dist/ops/grads/unpack16.js +2 -2
- package/dist/ops/matMul16.js +3 -3
- package/dist/ops/matMulGelu.js +6 -6
- package/dist/ops/matMulMul.js +3 -3
- package/dist/ops/mul16.js +1 -1
- package/dist/ops/mulDrop.js +3 -3
- package/dist/ops/normRMS.js +4 -4
- package/dist/ops/pack16.js +2 -2
- package/dist/ops/qkv.js +3 -3
- package/dist/ops/reshape16.js +6 -6
- package/dist/ops/rope.js +2 -2
- package/dist/ops/scatterSub.js +1 -1
- package/dist/ops/slice16.js +2 -2
- package/dist/ops/softmax16.js +1 -1
- package/dist/ops/sub16.js +1 -1
- package/dist/ops/sum16.js +6 -6
- package/dist/ops/transpose16.js +3 -3
- package/dist/ops/unpack16.js +2 -2
- package/dist/ops/webgl/adamAdjust.js +2 -2
- package/dist/ops/webgl/adamMoments.js +1 -1
- package/dist/ops/webgl/appendCache.js +1 -1
- package/dist/ops/webgl/attentionMask.js +1 -1
- package/dist/ops/webgl/dropout16.js +1 -1
- package/dist/ops/webgl/fusedSoftmax.js +7 -7
- package/dist/ops/webgl/gatherSub.js +3 -3
- package/dist/ops/webgl/gelu.js +2 -2
- package/dist/ops/webgl/log.js +3 -3
- package/dist/ops/webgl/matMul16.js +13 -13
- package/dist/ops/webgl/matMulGelu.js +4 -4
- package/dist/ops/webgl/matMulMul.js +2 -2
- package/dist/ops/webgl/mulDropout.js +1 -1
- package/dist/ops/webgl/normRMS.js +2 -2
- package/dist/ops/webgl/qkv.js +1 -1
- package/dist/ops/webgl/rope.js +1 -1
- package/dist/ops/webgl/scatterSub.js +2 -2
- package/dist/ops/webgpu/adamAdjust.js +3 -3
- package/dist/ops/webgpu/adamMoments.js +3 -3
- package/dist/ops/webgpu/add16.js +6 -6
- package/dist/ops/webgpu/appendCache.js +3 -3
- package/dist/ops/webgpu/attentionMask.js +2 -2
- package/dist/ops/webgpu/attentionMask32_program.js +2 -2
- package/dist/ops/webgpu/clipScale.js +7 -7
- package/dist/ops/webgpu/concat16.js +5 -5
- package/dist/ops/webgpu/dropout16.js +6 -6
- package/dist/ops/webgpu/gatherSub.js +3 -3
- package/dist/ops/webgpu/gelu.js +8 -8
- package/dist/ops/webgpu/matMul16.js +16 -16
- package/dist/ops/webgpu/matMul16_program.js +2 -2
- package/dist/ops/webgpu/mul16.js +5 -5
- package/dist/ops/webgpu/norm2.js +1 -1
- package/dist/ops/webgpu/normRMS.js +2 -2
- package/dist/ops/webgpu/normRMSGrad.js +4 -4
- package/dist/ops/webgpu/pack16.js +4 -4
- package/dist/ops/webgpu/pack16_program.js +2 -2
- package/dist/ops/webgpu/qkv.js +2 -2
- package/dist/ops/webgpu/rope.js +3 -3
- package/dist/ops/webgpu/scatterSub.js +3 -3
- package/dist/ops/webgpu/slice16.js +4 -4
- package/dist/ops/webgpu/softmax16.js +4 -4
- package/dist/ops/webgpu/softmax16_program.js +2 -2
- package/dist/ops/webgpu/softmax16_subgroup_program.js +2 -2
- package/dist/ops/webgpu/softmax16grad.js +4 -4
- package/dist/ops/webgpu/sub16.js +6 -6
- package/dist/ops/webgpu/sum16.js +3 -3
- package/dist/ops/webgpu/transpose16.js +8 -8
- package/dist/ops/webgpu/transpose16_program.js +2 -2
- package/dist/ops/webgpu/transpose16_shared_program.js +3 -3
- package/dist/ops/webgpu/unpack16.js +3 -3
- package/dist/ops/webgpu/utils/binary_op.js +3 -3
- package/dist/ops/webgpu/utils/reductions.js +5 -5
- package/dist/{ops-CURIZSVt.js → ops-CsXeTq1P.js} +100 -100
- package/dist/{pack16-WlOSOuZA.js → pack16-bqltoUlR.js} +2 -2
- package/dist/patches/webgpu_backend.js +6 -6
- package/dist/patches/webgpu_base.js +1 -1
- package/dist/patches/webgpu_program.js +2 -2
- package/dist/{random_normal-CIm8lk2-.js → random_normal-IBRrha8a.js} +1 -1
- package/dist/{random_width-B_fVXhGx.js → random_width-DN5ZtQkM.js} +131 -131
- package/dist/{range-BDxO73mk.js → range-C-CjF-LI.js} +1 -1
- package/dist/relu-J_X6MUzx.js +9 -0
- package/dist/{reshape-BIN71H3p.js → reshape-BDOuCSNW.js} +1 -1
- package/dist/{resize_nearest_neighbor-C6_0dAnK.js → resize_nearest_neighbor-BojqlfRe.js} +41 -41
- package/dist/{rope-CC5RjmKU.js → rope-DcrZM_e6.js} +5 -5
- package/dist/{scatter_nd_util-C-x73Cj6.js → scatter_nd_util-ByNJaL6I.js} +1 -1
- package/dist/{segment_util-4zuHV5IG.js → segment_util-Dasb2Zaf.js} +2 -2
- package/dist/{selu_util-BXdhy_W6.js → selu_util-BLhIqRkw.js} +5 -5
- package/dist/{shared-zTaJ5siv.js → shared-3agzAqQ_.js} +1 -1
- package/dist/{shared-DRWDyk9w.js → shared-CagdqkLh.js} +6 -6
- package/dist/slice-BzS11Qh0.js +12 -0
- package/dist/{slice_util-DPY56GzQ.js → slice_util-CC35pLmT.js} +5 -5
- package/dist/{softmax-BLGJqdwx.js → softmax-D4q1LJN7.js} +1 -1
- package/dist/split-C2Sj255c.js +9 -0
- package/dist/{squeeze-O_YWJpw_.js → squeeze-ho4wLUek.js} +2 -2
- package/dist/{stack-z6QE7kmP.js → stack-DudVrtmG.js} +1 -1
- package/dist/{step-DQY6_ABw.js → step-BTxPtq1r.js} +4 -4
- package/dist/{sum-D39FeU5h.js → sum-BpiwSWvg.js} +3 -3
- package/dist/{tensor-D8e0Gd7c.js → tensor-BWFldCso.js} +1 -1
- package/dist/{tensor1d-BMl0eZYV.js → tensor1d-LMGMIUlr.js} +1 -1
- package/dist/{tensor2d-DTtQ1QcT.js → tensor2d-BnXMKScO.js} +1 -1
- package/dist/{tensor4d-Dj4rDssL.js → tensor4d-C6UCG_u8.js} +1 -1
- package/dist/{tfjs_backend-Bk3PmK91.js → tfjs_backend-BGnG-ppu.js} +65 -65
- package/dist/{tile-CsWlVKKz.js → tile-CFy-xTO6.js} +1 -1
- package/dist/tokeniser/BaseTokeniser.d.ts +5 -1
- package/dist/tokeniser/BaseTokeniser.js +62 -53
- package/dist/tokeniser/type.d.ts +8 -0
- package/dist/training/AdamW.js +2 -2
- package/dist/training/BasicTrainer.d.ts +1 -0
- package/dist/training/BasicTrainer.js +95 -79
- package/dist/training/DatasetBuilder.d.ts +6 -2
- package/dist/training/DatasetBuilder.js +60 -41
- package/dist/training/Evaluator.d.ts +1 -2
- package/dist/training/Evaluator.js +21 -31
- package/dist/training/SFTTrainer.d.ts +3 -2
- package/dist/training/SFTTrainer.js +4 -3
- package/dist/training/orthoGrad.js +1 -1
- package/dist/training/sparseCrossEntropy.js +38 -38
- package/dist/training/tasks/ConversationTask.d.ts +4 -0
- package/dist/training/tasks/ConversationTask.js +7 -7
- package/dist/training/tasks/PretrainingTask.d.ts +4 -0
- package/dist/training/tasks/PretrainingTask.js +11 -7
- package/dist/training/tasks/StartSentenceTask.d.ts +4 -0
- package/dist/training/tasks/StartSentenceTask.js +5 -5
- package/dist/training/tasks/Task.d.ts +12 -0
- package/dist/training/tasks/Task.js +55 -31
- package/dist/training/types.d.ts +1 -0
- package/dist/training/validation.d.ts +1 -1
- package/dist/training/validation.js +33 -32
- package/dist/{transpose-Qxz-4os3.js → transpose-9kRxIXWR.js} +7 -7
- package/dist/{unsorted_segment_sum-BfFVV9Zm.js → unsorted_segment_sum-DJvk5xnh.js} +20 -20
- package/dist/utilities/dummy.js +6 -6
- package/dist/utilities/multinomialCPU.js +2 -2
- package/dist/utilities/packed.js +1 -1
- package/dist/utilities/performance.js +1 -1
- package/dist/utilities/profile.js +1 -1
- package/dist/utilities/safetensors.js +2 -2
- package/dist/utilities/sentences.js +5 -5
- package/dist/utilities/weights.js +2 -2
- package/dist/{variable-SSATClyt.js → variable-Ck482e3n.js} +1 -1
- package/dist/{webgpu_program-CbjdYLYk.js → webgpu_program-B4HmApL1.js} +1 -1
- package/dist/{webgpu_util-DuofJBMo.js → webgpu_util-DYlGSwOJ.js} +7 -7
- package/dist/{zeros-Bw0puq_w.js → zeros-DvZpK8s6.js} +2 -2
- package/dist/{zeros_like-rOHr54NY.js → zeros_like-CWjDdwr-.js} +69 -69
- package/package.json +1 -1
- package/dist/complex-3DpPEG9B.js +0 -11
- package/dist/mat_mul-DP86qZtZ.js +0 -11
- package/dist/mod-BXjLYwvM.js +0 -11
- package/dist/readers-17HLdxVM.js +0 -12
- package/dist/relu-DTvZKBsZ.js +0 -9
- package/dist/slice-BvItlgXu.js +0 -12
- package/dist/split-BN9LkEgS.js +0 -9
- package/dist/training/SFTDatasetBuilder.d.ts +0 -23
- package/dist/training/SFTDatasetBuilder.js +0 -85
package/dist/utilities/dummy.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { z as c } from "../zeros-
|
|
1
|
+
import { b as y, h as I, v as P } from "../index-CUXkjxiT.js";
|
|
2
|
+
import { z as c } from "../zeros-DvZpK8s6.js";
|
|
3
3
|
async function w(s) {
|
|
4
4
|
const t = c([1, s.config.blockSize], "int32"), n = s.forward({ training: !1 }, t);
|
|
5
5
|
await n.data(), n.dispose(), t.dispose();
|
|
6
6
|
}
|
|
7
|
-
async function
|
|
7
|
+
async function b(s) {
|
|
8
8
|
const t = y(), n = t.numBytesInGPUAllocated ?? t.numBytesAllocatedInGPU ?? t.numBytes;
|
|
9
9
|
await w(s);
|
|
10
10
|
const a = c([1, s.config.blockSize], "int32"), e = {
|
|
@@ -32,12 +32,12 @@ async function G(s) {
|
|
|
32
32
|
}
|
|
33
33
|
return e;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function v(s) {
|
|
36
36
|
const t = c([1, s.config.blockSize], "int32");
|
|
37
37
|
s.forward({ training: !1 }, t).dispose(), t.dispose();
|
|
38
38
|
}
|
|
39
39
|
export {
|
|
40
|
-
|
|
40
|
+
v as dummyPass,
|
|
41
41
|
w as dummyPassAsync,
|
|
42
|
-
|
|
42
|
+
b as dummyPassTrainAsync
|
|
43
43
|
};
|
package/dist/utilities/packed.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { m as w } from "../index-
|
|
2
|
-
import { t as f } from "../tensor2d-
|
|
3
|
-
import { e as y } from "../expand_dims-
|
|
4
|
-
import { s as g } from "../sum-
|
|
5
|
-
import { c as T } from "../concat-
|
|
1
|
+
import { m as w } from "../index-CUXkjxiT.js";
|
|
2
|
+
import { t as f } from "../tensor2d-BnXMKScO.js";
|
|
3
|
+
import { e as y } from "../expand_dims-Bkd1YD5x.js";
|
|
4
|
+
import { s as g } from "../sum-BpiwSWvg.js";
|
|
5
|
+
import { c as T } from "../concat-CAQpCret.js";
|
|
6
6
|
const p = 16;
|
|
7
7
|
function A(o, t) {
|
|
8
8
|
if (!t)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../index-
|
|
2
|
-
import { t as p } from "../tensor-
|
|
1
|
+
import "../index-CUXkjxiT.js";
|
|
2
|
+
import { t as p } from "../tensor-BWFldCso.js";
|
|
3
3
|
function h(n) {
|
|
4
4
|
const e = n.reduce((s, o) => s + o.length, 0), a = new Float32Array(e);
|
|
5
5
|
let t = 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ad as z, ac as F, ab as E, a9 as j,
|
|
1
|
+
import { ad as z, ac as F, ab as E, a9 as j, x as A } from "./index-CUXkjxiT.js";
|
|
2
2
|
function L(t, s) {
|
|
3
3
|
if (Math.max(...t) > 5)
|
|
4
4
|
throw new Error("Cannot symbolically compute strides for rank > 6 tensor.");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { x as u } from "./index-CUXkjxiT.js";
|
|
2
2
|
const c = (r) => {
|
|
3
3
|
let t = 1;
|
|
4
4
|
for (let n = 0; n < r.length; n++)
|
|
@@ -23,16 +23,16 @@ function p(r, t, n = !1) {
|
|
|
23
23
|
const a = c(r.x.map((i) => t[i])), o = c(r.y.map((i) => t[i]));
|
|
24
24
|
return a <= 4 ? [4, 16, 1] : o <= 4 ? [16, 4, 1] : [16, 16, 1];
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function x(r, t, n = !1) {
|
|
27
27
|
if (n)
|
|
28
28
|
return [4, 4, 1];
|
|
29
29
|
const a = c(r.x.map((i) => t[i])), o = c(r.y.map((i) => t[i]));
|
|
30
30
|
return a <= 4 ? [1, 2, 1] : o <= 4 ? [2, 1, 1] : [2, 2, 1];
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function M(r) {
|
|
33
33
|
return { x: r.map((t, n) => n) };
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function h(r) {
|
|
36
36
|
if (r === "float32" || r === "int32" || r === "bool" || r === "string" || r === "packedF16")
|
|
37
37
|
return 4;
|
|
38
38
|
if (r === "complex64")
|
|
@@ -52,13 +52,13 @@ var s;
|
|
|
52
52
|
r[r.MatMulReduceProgram = 0] = "MatMulReduceProgram", r[r.MatMulSplitKProgram = 1] = "MatMulSplitKProgram", r[r.MatMulSmallOutputSizeProgram = 2] = "MatMulSmallOutputSizeProgram", r[r.MatMulPackedProgram = 3] = "MatMulPackedProgram", r[r.MatMulMax = 4] = "MatMulMax";
|
|
53
53
|
})(s || (s = {}));
|
|
54
54
|
export {
|
|
55
|
-
|
|
55
|
+
h as G,
|
|
56
56
|
s as M,
|
|
57
57
|
d as a,
|
|
58
58
|
b,
|
|
59
59
|
m as c,
|
|
60
60
|
p as d,
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
x as e,
|
|
62
|
+
M as f,
|
|
63
63
|
g as i
|
|
64
64
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as f } from "./complex-
|
|
1
|
+
import { u as n, Q as m, U as i, E as c } from "./index-CUXkjxiT.js";
|
|
2
|
+
import { c as f } from "./complex-DI35Q-gW.js";
|
|
3
3
|
function e(o, r = "float32") {
|
|
4
4
|
if (n(o), r === "complex64") {
|
|
5
5
|
const s = e(o, "float32"), t = e(o, "float32");
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { o as u,
|
|
2
|
-
import { e as j, a as R, l as X, b as G, d as V, f as Z, m as
|
|
3
|
-
import { r as l } from "./reshape-
|
|
4
|
-
import { b as uo } from "./broadcast_to-
|
|
5
|
-
import { c as co } from "./clip_by_value-
|
|
6
|
-
import { c as _ } from "./concat-
|
|
7
|
-
import { w as
|
|
8
|
-
import { m as
|
|
9
|
-
import { s as
|
|
10
|
-
import { n as
|
|
11
|
-
import { e as Ao } from "./expand_dims-
|
|
12
|
-
import { f as Bo } from "./floor-
|
|
13
|
-
import { g as Ho } from "./gather-
|
|
14
|
-
import { c as q } from "./complex-
|
|
15
|
-
import { n as N, r as K, i as
|
|
16
|
-
import { s as T } from "./slice-
|
|
17
|
-
import { m as Wo } from "./mod-
|
|
18
|
-
import { r as jo } from "./relu-
|
|
19
|
-
import { s as z } from "./split-
|
|
20
|
-
import { z as Ro } from "./zeros-
|
|
21
|
-
import { s as Xo } from "./softmax-
|
|
22
|
-
import { s as Go } from "./squeeze-
|
|
23
|
-
import { s as Vo } from "./stack-
|
|
24
|
-
import { s as Zo } from "./sum-
|
|
25
|
-
import { t as
|
|
26
|
-
function
|
|
1
|
+
import { o as u, q as h, E as d, c7 as st, c8 as rt, c9 as nt, ca as et, cb as it, cc as pt, B, cd as at, ce as ht, bY as ut, x as D, cf as ct, cg as ft, i as H, a3 as C, bZ as lt, ch as dt, ci as mt, cj as Dt, aE as yt, ck as It, a2 as wt, m as M, _ as F, cl as xt, cm as gt, L as $, c1 as $t, cn as bt, co as kt, cp as vt, cq as Nt, a as _t, cr as Tt, cs as Et, ct as St, cu as qt, cv as r, a_ as Kt, j as zt, ag as W, cw as Pt, cx as Ct, p as Mt, l as Ot, n as At, a1 as Bt } from "./index-CUXkjxiT.js";
|
|
2
|
+
import { e as j, a as R, l as X, b as G, d as V, f as Z, m as U, r as E, g as Ht, h as Ft, i as Wt, j as jt, k as Rt, n as Xt, o as Gt, c as Vt, p as Zt, q as Ut, t as Yt, u as Jt, v as Lt, w as Qt, x as to, y as oo, z as so, A as ro, B as no, C as eo, s as io, D as po, E as ao, F as ho } from "./unsorted_segment_sum-DJvk5xnh.js";
|
|
3
|
+
import { r as l } from "./reshape-BDOuCSNW.js";
|
|
4
|
+
import { b as uo } from "./broadcast_to-eS93CCN_.js";
|
|
5
|
+
import { c as co } from "./clip_by_value-DDA7rrcT.js";
|
|
6
|
+
import { c as _ } from "./concat-CAQpCret.js";
|
|
7
|
+
import { w as Y, e as fo, l as lo, b as mo, m as Do, a as yo, n as Io } from "./not_equal-hurPF26l.js";
|
|
8
|
+
import { m as v } from "./mat_mul-DhG0Newp.js";
|
|
9
|
+
import { s as J, k as wo, h as xo, e as go, l as $o, p as bo, r as ko, a as vo } from "./step-BTxPtq1r.js";
|
|
10
|
+
import { n as L, b as S, c as No, g as _o, l as To, a as Eo, d as So, h as qo, m as Ko, f as zo, e as Po, r as Co, s as Mo, u as Oo } from "./resize_nearest_neighbor-BojqlfRe.js";
|
|
11
|
+
import { e as Ao } from "./expand_dims-Bkd1YD5x.js";
|
|
12
|
+
import { f as Bo } from "./floor-BQtb-Azg.js";
|
|
13
|
+
import { g as Ho } from "./gather-qIqEqaGn.js";
|
|
14
|
+
import { c as q } from "./complex-DI35Q-gW.js";
|
|
15
|
+
import { n as N, r as K, i as Q, t as Fo } from "./transpose-9kRxIXWR.js";
|
|
16
|
+
import { s as T } from "./slice-BzS11Qh0.js";
|
|
17
|
+
import { m as Wo } from "./mod-CSdCpRjf.js";
|
|
18
|
+
import { r as jo } from "./relu-J_X6MUzx.js";
|
|
19
|
+
import { s as z } from "./split-C2Sj255c.js";
|
|
20
|
+
import { z as Ro } from "./zeros-DvZpK8s6.js";
|
|
21
|
+
import { s as Xo } from "./softmax-D4q1LJN7.js";
|
|
22
|
+
import { s as Go } from "./squeeze-ho4wLUek.js";
|
|
23
|
+
import { s as Vo } from "./stack-DudVrtmG.js";
|
|
24
|
+
import { s as Zo } from "./sum-BpiwSWvg.js";
|
|
25
|
+
import { t as Uo } from "./tile-CFy-xTO6.js";
|
|
26
|
+
function Yo(t) {
|
|
27
27
|
const s = { x: h(t, "x", "acos") };
|
|
28
28
|
return d.runKernel(st, s);
|
|
29
29
|
}
|
|
30
|
-
const
|
|
31
|
-
function
|
|
30
|
+
const Jo = /* @__PURE__ */ u({ acos_: Yo });
|
|
31
|
+
function Lo(t) {
|
|
32
32
|
const s = { x: h(t, "x", "acosh") };
|
|
33
33
|
return d.runKernel(rt, s);
|
|
34
34
|
}
|
|
35
|
-
const
|
|
35
|
+
const Qo = /* @__PURE__ */ u({ acosh_: Lo });
|
|
36
36
|
function ts(t, o = 0) {
|
|
37
37
|
const n = { x: h(t, "x", "argMin") }, e = { axis: o };
|
|
38
38
|
return d.runKernel(nt, n, e);
|
|
@@ -94,7 +94,7 @@ function Is(t, o) {
|
|
|
94
94
|
let s = h(t, "a", "div"), n = h(o, "b", "div");
|
|
95
95
|
[s, n] = B(s, n);
|
|
96
96
|
const e = H(s, n), i = C(e), p = j(n, i);
|
|
97
|
-
return
|
|
97
|
+
return Y(p, i, e);
|
|
98
98
|
}
|
|
99
99
|
const ws = /* @__PURE__ */ u({ divNoNan_: Is });
|
|
100
100
|
function xs(t, o) {
|
|
@@ -102,29 +102,29 @@ function xs(t, o) {
|
|
|
102
102
|
D((s.rank === 1 || s.rank === 2) && (n.rank === 1 || n.rank === 2), () => `Error in dot: inputs must all be rank 1 or 2, but got ranks ${s.rank} and ${n.rank}.`);
|
|
103
103
|
const e = s.rank === 1 ? s.size : s.shape[1], i = n.rank === 1 ? n.size : n.shape[0];
|
|
104
104
|
if (D(e === i, () => `Error in dot: inner dimensions of inputs must match, but got ${e} and ${i}.`), s.rank === 1 && n.rank === 1) {
|
|
105
|
-
const p = l(s, [1, -1]), a = l(n, [-1, 1]), f =
|
|
105
|
+
const p = l(s, [1, -1]), a = l(n, [-1, 1]), f = v(p, a);
|
|
106
106
|
return l(f, []);
|
|
107
107
|
} else if (s.rank === 1 && n.rank === 2) {
|
|
108
|
-
const p = l(s, [1, -1]), a = l(n, [n.shape[0], n.shape[1]]), f =
|
|
108
|
+
const p = l(s, [1, -1]), a = l(n, [n.shape[0], n.shape[1]]), f = v(p, a);
|
|
109
109
|
return l(f, [f.size]);
|
|
110
110
|
} else if (s.rank === 2 && n.rank === 1) {
|
|
111
|
-
const p = l(n, [-1, 1]), a =
|
|
111
|
+
const p = l(n, [-1, 1]), a = v(s, p);
|
|
112
112
|
return l(a, [a.size]);
|
|
113
113
|
} else {
|
|
114
114
|
const p = l(n, [n.shape[0], n.shape[1]]);
|
|
115
|
-
return
|
|
115
|
+
return v(s, p);
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
const gs = /* @__PURE__ */ u({ dot_: xs });
|
|
119
119
|
function $s(t, o = null, s = !1) {
|
|
120
|
-
return
|
|
120
|
+
return L(t, "euclidean", o, s);
|
|
121
121
|
}
|
|
122
122
|
const bs = /* @__PURE__ */ u({ euclideanNorm_: $s });
|
|
123
|
-
function
|
|
123
|
+
function ks(t) {
|
|
124
124
|
const s = { x: h(t, "x", "expm1") };
|
|
125
125
|
return d.runKernel(lt, s);
|
|
126
126
|
}
|
|
127
|
-
const
|
|
127
|
+
const vs = /* @__PURE__ */ u({ expm1_: ks });
|
|
128
128
|
function Ns(t) {
|
|
129
129
|
const s = { x: h(t, "x", "isFinite") };
|
|
130
130
|
return d.runKernel(dt, s);
|
|
@@ -152,7 +152,7 @@ function Ks(t, o = 5, s = 1, n = 1, e = 0.5) {
|
|
|
152
152
|
const zs = /* @__PURE__ */ u({ localResponseNormalization_: Ks });
|
|
153
153
|
function Ps(t) {
|
|
154
154
|
const o = h(t, "x", "logSigmoid");
|
|
155
|
-
return wt((n) => ({ value: N(R(N(n))), gradFunc: (p) => M(p,
|
|
155
|
+
return wt((n) => ({ value: N(R(N(n))), gradFunc: (p) => M(p, J(N(n))) }))(o);
|
|
156
156
|
}
|
|
157
157
|
const Cs = /* @__PURE__ */ u({ logSigmoid_: Ps });
|
|
158
158
|
function Ms(t, o) {
|
|
@@ -188,8 +188,8 @@ function Fs(t, o, s, n, e, i, p) {
|
|
|
188
188
|
const c = xo(f.shape, o, i, e, n), m = [c.dilationHeight, c.dilationWidth];
|
|
189
189
|
let I;
|
|
190
190
|
n === "same" ? I = js([c.filterHeight, c.filterWidth], m) : I = [[0, 0], [0, 0]];
|
|
191
|
-
const w = m[0] === 1 && m[1] === 1, [x, g] = Ws([c.inHeight, c.inWidth], m, I), b = w ? n : "valid", O = w ? f : G(f, m, x), A = (s === "avg" ? () => Z(O, o, i, b, p) : () =>
|
|
192
|
-
return y ? l(
|
|
191
|
+
const w = m[0] === 1 && m[1] === 1, [x, g] = Ws([c.inHeight, c.inWidth], m, I), b = w ? n : "valid", O = w ? f : G(f, m, x), A = (s === "avg" ? () => Z(O, o, i, b, p) : () => U(O, o, i, b, p))(), k = w ? A : V(A, m, g);
|
|
192
|
+
return y ? l(k, [k.shape[1], k.shape[2], k.shape[3]]) : k;
|
|
193
193
|
}
|
|
194
194
|
function Ws(t, o, s) {
|
|
195
195
|
const n = s.map((c) => c[0]), e = s.map((c) => c[1]), i = t.concat(n, e), p = o.map((c, m) => (c - i[m] % c) % c), a = e.map((c, m) => c + p[m]), f = o.map((c, m) => [n[m], a[m]]), y = o.map((c, m) => [0, p[m]]);
|
|
@@ -212,31 +212,31 @@ function Vs(t) {
|
|
|
212
212
|
return d.runKernel(bt, s);
|
|
213
213
|
}
|
|
214
214
|
const Zs = /* @__PURE__ */ u({ reciprocal_: Vs });
|
|
215
|
-
function
|
|
215
|
+
function Us(t) {
|
|
216
216
|
const s = { x: h(t, "x", "sign") };
|
|
217
|
-
return d.runKernel(
|
|
217
|
+
return d.runKernel(kt, s);
|
|
218
218
|
}
|
|
219
|
-
const
|
|
220
|
-
function
|
|
219
|
+
const Ys = /* @__PURE__ */ u({ sign_: Us });
|
|
220
|
+
function Js(t) {
|
|
221
221
|
D(t.dtype === "complex64", () => `The dtype for tf.spectral.fft() must be complex64 but got ${t.dtype}.`);
|
|
222
222
|
const o = { input: t };
|
|
223
|
-
return d.runKernel(
|
|
223
|
+
return d.runKernel(vt, o);
|
|
224
224
|
}
|
|
225
|
-
const ot = /* @__PURE__ */ u({ fft_:
|
|
226
|
-
function
|
|
225
|
+
const ot = /* @__PURE__ */ u({ fft_: Js });
|
|
226
|
+
function Ls(t) {
|
|
227
227
|
D(t.dtype === "complex64", () => `The dtype for tf.spectral.ifft() must be complex64 but got ${t.dtype}.`);
|
|
228
228
|
const o = { input: t };
|
|
229
229
|
return d.runKernel(Nt, o);
|
|
230
230
|
}
|
|
231
|
-
const P = /* @__PURE__ */ u({ ifft_:
|
|
232
|
-
function
|
|
231
|
+
const P = /* @__PURE__ */ u({ ifft_: Ls });
|
|
232
|
+
function Qs(t) {
|
|
233
233
|
const o = t.shape[t.shape.length - 1], s = t.size / o;
|
|
234
234
|
let n;
|
|
235
235
|
if (o <= 2) {
|
|
236
236
|
const e = l(t, [s, o]);
|
|
237
237
|
n = P(e);
|
|
238
238
|
} else {
|
|
239
|
-
const e = [s, 2 * (o - 1)], i = l(K(t), [s, o]), p = l(
|
|
239
|
+
const e = [s, 2 * (o - 1)], i = l(K(t), [s, o]), p = l(Q(t), [s, o]), a = E(T(i, [0, 1], [s, o - 2]), 1), f = M(E(T(p, [0, 1], [s, o - 2]), 1), _t(-1)), y = _([i, a], 1), c = _([p, f], 1), m = l(q(y, c), [e[0], e[1]]);
|
|
240
240
|
n = P(m);
|
|
241
241
|
}
|
|
242
242
|
if (n = K(n), t.rank === 3 && t.shape[0] !== 0) {
|
|
@@ -245,7 +245,7 @@ function Ls(t) {
|
|
|
245
245
|
}
|
|
246
246
|
return n;
|
|
247
247
|
}
|
|
248
|
-
const tr = /* @__PURE__ */ u({ irfft_:
|
|
248
|
+
const tr = /* @__PURE__ */ u({ irfft_: Qs });
|
|
249
249
|
function or(t, o) {
|
|
250
250
|
D(t.dtype === "float32", () => `The dtype for rfft() must be real value but got ${t.dtype}`);
|
|
251
251
|
let s = t.shape[t.shape.length - 1];
|
|
@@ -259,7 +259,7 @@ function or(t, o) {
|
|
|
259
259
|
x[t.shape.length - 1] = o - s, e = _([t, Ro(x)], t.shape.length - 1), s = o;
|
|
260
260
|
} else
|
|
261
261
|
e = t;
|
|
262
|
-
const i = C(e), p = l(q(e, i), [n, s]), a = ot(p), f = Math.floor(s / 2) + 1, y = K(a), c =
|
|
262
|
+
const i = C(e), p = l(q(e, i), [n, s]), a = ot(p), f = Math.floor(s / 2) + 1, y = K(a), c = Q(a), m = z(y, [f, s - f], y.shape.length - 1), I = z(c, [f, s - f], c.shape.length - 1), w = e.shape.slice();
|
|
263
263
|
return w[e.shape.length - 1] = f, l(q(m[0], I[0]), w);
|
|
264
264
|
}
|
|
265
265
|
const sr = /* @__PURE__ */ u({ rfft_: or });
|
|
@@ -306,10 +306,10 @@ r().prototype.abs = function() {
|
|
|
306
306
|
return this.throwIfDisposed(), Kt(this);
|
|
307
307
|
};
|
|
308
308
|
r().prototype.acos = function() {
|
|
309
|
-
return this.throwIfDisposed(),
|
|
309
|
+
return this.throwIfDisposed(), Jo(this);
|
|
310
310
|
};
|
|
311
311
|
r().prototype.acosh = function() {
|
|
312
|
-
return this.throwIfDisposed(),
|
|
312
|
+
return this.throwIfDisposed(), Qo(this);
|
|
313
313
|
};
|
|
314
314
|
r().prototype.add = function(t) {
|
|
315
315
|
return this.throwIfDisposed(), zt(this, t);
|
|
@@ -402,16 +402,16 @@ r().prototype.cosh = function() {
|
|
|
402
402
|
return this.throwIfDisposed(), Zt(this);
|
|
403
403
|
};
|
|
404
404
|
r().prototype.cumprod = function(t, o, s) {
|
|
405
|
-
return this.throwIfDisposed(),
|
|
405
|
+
return this.throwIfDisposed(), Ut(this, t, o, s);
|
|
406
406
|
};
|
|
407
407
|
r().prototype.cumsum = function(t, o, s) {
|
|
408
|
-
return this.throwIfDisposed(),
|
|
408
|
+
return this.throwIfDisposed(), Yt(this, t, o, s);
|
|
409
409
|
};
|
|
410
410
|
r().prototype.depthToSpace = function(t, o) {
|
|
411
411
|
return this.throwIfDisposed(), ms(this, t, o);
|
|
412
412
|
};
|
|
413
413
|
r().prototype.depthwiseConv2d = function(t, o, s, n, e, i) {
|
|
414
|
-
return this.throwIfDisposed(),
|
|
414
|
+
return this.throwIfDisposed(), Jt(this, t, o, s, n, e, i);
|
|
415
415
|
};
|
|
416
416
|
r().prototype.dilation2d = function(t, o, s, n, e) {
|
|
417
417
|
return this.throwIfDisposed(), ys(this, t, o, s, n, e);
|
|
@@ -432,7 +432,7 @@ r().prototype.equal = function(t) {
|
|
|
432
432
|
return this.throwIfDisposed(), j(this, t);
|
|
433
433
|
};
|
|
434
434
|
r().prototype.erf = function() {
|
|
435
|
-
return this.throwIfDisposed(),
|
|
435
|
+
return this.throwIfDisposed(), Lt(this);
|
|
436
436
|
};
|
|
437
437
|
r().prototype.euclideanNorm = function(t, o) {
|
|
438
438
|
return this.throwIfDisposed(), bs(this, t, o);
|
|
@@ -444,7 +444,7 @@ r().prototype.expandDims = function(t) {
|
|
|
444
444
|
return this.throwIfDisposed(), Ao(this, t);
|
|
445
445
|
};
|
|
446
446
|
r().prototype.expm1 = function() {
|
|
447
|
-
return this.throwIfDisposed(),
|
|
447
|
+
return this.throwIfDisposed(), vs(this);
|
|
448
448
|
};
|
|
449
449
|
r().prototype.fft = function() {
|
|
450
450
|
return this.throwIfDisposed(), ot(this);
|
|
@@ -498,7 +498,7 @@ r().prototype.logSigmoid = function() {
|
|
|
498
498
|
return this.throwIfDisposed(), Cs(this);
|
|
499
499
|
};
|
|
500
500
|
r().prototype.logSoftmax = function(t) {
|
|
501
|
-
return this.throwIfDisposed(),
|
|
501
|
+
return this.throwIfDisposed(), Qt(this, t);
|
|
502
502
|
};
|
|
503
503
|
r().prototype.logSumExp = function(t, o) {
|
|
504
504
|
return this.throwIfDisposed(), lo(this, t, o);
|
|
@@ -522,10 +522,10 @@ r().prototype.logicalXor = function(t) {
|
|
|
522
522
|
return this.throwIfDisposed(), As(this, t);
|
|
523
523
|
};
|
|
524
524
|
r().prototype.matMul = function(t, o, s) {
|
|
525
|
-
return this.throwIfDisposed(),
|
|
525
|
+
return this.throwIfDisposed(), v(this, t, o, s);
|
|
526
526
|
};
|
|
527
527
|
r().prototype.maxPool = function(t, o, s, n) {
|
|
528
|
-
return this.throwIfDisposed(),
|
|
528
|
+
return this.throwIfDisposed(), U(this, t, o, s, n);
|
|
529
529
|
};
|
|
530
530
|
r().prototype.max = function(t, o) {
|
|
531
531
|
return this.throwIfDisposed(), Do(this, t, o);
|
|
@@ -555,7 +555,7 @@ r().prototype.neg = function() {
|
|
|
555
555
|
return this.throwIfDisposed(), N(this);
|
|
556
556
|
};
|
|
557
557
|
r().prototype.norm = function(t, o, s) {
|
|
558
|
-
return this.throwIfDisposed(),
|
|
558
|
+
return this.throwIfDisposed(), L(this, t, o, s);
|
|
559
559
|
};
|
|
560
560
|
r().prototype.notEqual = function(t) {
|
|
561
561
|
return this.throwIfDisposed(), Io(this, t);
|
|
@@ -588,7 +588,7 @@ r().prototype.relu = function() {
|
|
|
588
588
|
return this.throwIfDisposed(), jo(this);
|
|
589
589
|
};
|
|
590
590
|
r().prototype.relu6 = function() {
|
|
591
|
-
return this.throwIfDisposed(),
|
|
591
|
+
return this.throwIfDisposed(), ko(this);
|
|
592
592
|
};
|
|
593
593
|
r().prototype.reshapeAs = function(t) {
|
|
594
594
|
return this.throwIfDisposed(), l(this, t.shape);
|
|
@@ -621,10 +621,10 @@ r().prototype.separableConv2d = function(t, o, s, n, e, i) {
|
|
|
621
621
|
return this.throwIfDisposed(), eo(this, t, o, s, n, e, i);
|
|
622
622
|
};
|
|
623
623
|
r().prototype.sigmoid = function() {
|
|
624
|
-
return this.throwIfDisposed(),
|
|
624
|
+
return this.throwIfDisposed(), J(this);
|
|
625
625
|
};
|
|
626
626
|
r().prototype.sign = function() {
|
|
627
|
-
return this.throwIfDisposed(),
|
|
627
|
+
return this.throwIfDisposed(), Ys(this);
|
|
628
628
|
};
|
|
629
629
|
r().prototype.sin = function() {
|
|
630
630
|
return this.throwIfDisposed(), io(this);
|
|
@@ -665,7 +665,7 @@ r().prototype.stack = function(t, o) {
|
|
|
665
665
|
return Vo(s, o);
|
|
666
666
|
};
|
|
667
667
|
r().prototype.step = function(t) {
|
|
668
|
-
return this.throwIfDisposed(),
|
|
668
|
+
return this.throwIfDisposed(), vo(this, t);
|
|
669
669
|
};
|
|
670
670
|
r().prototype.stridedSlice = function(t, o, s, n, e, i, p, a) {
|
|
671
671
|
return this.throwIfDisposed(), nr(this, t, o, s, n, e, i, p, a);
|
|
@@ -683,7 +683,7 @@ r().prototype.tanh = function() {
|
|
|
683
683
|
return this.throwIfDisposed(), ao(this);
|
|
684
684
|
};
|
|
685
685
|
r().prototype.tile = function(t) {
|
|
686
|
-
return this.throwIfDisposed(),
|
|
686
|
+
return this.throwIfDisposed(), Uo(this, t);
|
|
687
687
|
};
|
|
688
688
|
r().prototype.toBool = function() {
|
|
689
689
|
return this.throwIfDisposed(), $(this, "bool");
|
|
@@ -710,7 +710,7 @@ r().prototype.unstack = function(t) {
|
|
|
710
710
|
return this.throwIfDisposed(), Oo(this, t);
|
|
711
711
|
};
|
|
712
712
|
r().prototype.where = function(t, o) {
|
|
713
|
-
return this.throwIfDisposed(),
|
|
713
|
+
return this.throwIfDisposed(), Y(t, this, o);
|
|
714
714
|
};
|
|
715
715
|
r().prototype.zerosLike = function() {
|
|
716
716
|
return this.throwIfDisposed(), C(this);
|
package/package.json
CHANGED
package/dist/complex-3DpPEG9B.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { o as t, n as s, a6 as c, E as m, a7 as r } from "./index-DSGwv2Yx.js";
|
|
2
|
-
function l(o, n) {
|
|
3
|
-
const a = s(o, "real", "complex"), e = s(n, "imag", "complex");
|
|
4
|
-
c(a.shape, e.shape, `real and imag shapes, ${a.shape} and ${e.shape}, must match in call to tf.complex().`);
|
|
5
|
-
const p = { real: a, imag: e };
|
|
6
|
-
return m.runKernel(r, p);
|
|
7
|
-
}
|
|
8
|
-
const i = /* @__PURE__ */ t({ complex_: l });
|
|
9
|
-
export {
|
|
10
|
-
i as c
|
|
11
|
-
};
|
package/dist/mat_mul-DP86qZtZ.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { o as m, n as s, z as c, E as M, B as p } from "./index-DSGwv2Yx.js";
|
|
2
|
-
function f(e, n, o = !1, l = !1) {
|
|
3
|
-
let a = s(e, "a", "matMul"), t = s(n, "b", "matMul");
|
|
4
|
-
[a, t] = c(a, t);
|
|
5
|
-
const r = { a, b: t }, u = { transposeA: o, transposeB: l };
|
|
6
|
-
return M.runKernel(p, r, u);
|
|
7
|
-
}
|
|
8
|
-
const i = /* @__PURE__ */ m({ matMul_: f });
|
|
9
|
-
export {
|
|
10
|
-
i as m
|
|
11
|
-
};
|
package/dist/mod-BXjLYwvM.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { o as r, n, z as m, E as c, M as d } from "./index-DSGwv2Yx.js";
|
|
2
|
-
function p(s, t) {
|
|
3
|
-
let o = n(s, "a", "mod"), a = n(t, "b", "mod");
|
|
4
|
-
[o, a] = m(o, a);
|
|
5
|
-
const e = { a: o, b: a };
|
|
6
|
-
return c.runKernel(d, e);
|
|
7
|
-
}
|
|
8
|
-
const b = /* @__PURE__ */ r({ mod_: p });
|
|
9
|
-
export {
|
|
10
|
-
b as m
|
|
11
|
-
};
|
package/dist/readers-17HLdxVM.js
DELETED
package/dist/relu-DTvZKBsZ.js
DELETED
package/dist/slice-BvItlgXu.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { o as c, n as e, E as a, S as l } from "./index-DSGwv2Yx.js";
|
|
2
|
-
function p(n, r, o) {
|
|
3
|
-
const s = e(n, "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: r, size: o };
|
|
7
|
-
return a.runKernel(l, t, i);
|
|
8
|
-
}
|
|
9
|
-
const x = /* @__PURE__ */ c({ slice_: p });
|
|
10
|
-
export {
|
|
11
|
-
x as s
|
|
12
|
-
};
|
package/dist/split-BN9LkEgS.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { o as p, n as i, E as a, H as c } from "./index-DSGwv2Yx.js";
|
|
2
|
-
function e(t, s, n = 0) {
|
|
3
|
-
const o = { x: i(t, "x", "split") }, r = { numOrSizeSplits: s, axis: n };
|
|
4
|
-
return a.runKernel(c, o, r);
|
|
5
|
-
}
|
|
6
|
-
const u = /* @__PURE__ */ p({ split_: e });
|
|
7
|
-
export {
|
|
8
|
-
u as s
|
|
9
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Tensor } from '@tensorflow/tfjs-core';
|
|
2
|
-
import { Conversation, ITokeniser } from '../tokeniser/type';
|
|
3
|
-
import { Dataset } from '@tensorflow/tfjs-data';
|
|
4
|
-
import { Task } from './tasks/Task';
|
|
5
|
-
export declare function buildSFTExample(conversation: Conversation[], ignoreIndex: number, tokenizer: ITokeniser, blockSize: number): {
|
|
6
|
-
xs: Int32Array;
|
|
7
|
-
ys: Int32Array;
|
|
8
|
-
} | null;
|
|
9
|
-
export declare class SFTDatasetBuilder {
|
|
10
|
-
tokenizer: ITokeniser;
|
|
11
|
-
blockSize: number;
|
|
12
|
-
constructor(tokenizer: ITokeniser, blockSize?: number);
|
|
13
|
-
/**
|
|
14
|
-
* Create SFT dataset from structured conversations.
|
|
15
|
-
* - Always starts from the beginning of each conversation.
|
|
16
|
-
* - Pads with eosToken and masks padding.
|
|
17
|
-
* - Masks non-assistant tokens in labels with ignoreIndex (default -100).
|
|
18
|
-
*/
|
|
19
|
-
createSFTDataset(conversations: Task[], batchSize?: number, ignoreIndex?: number): Promise<Dataset<{
|
|
20
|
-
xs: Tensor;
|
|
21
|
-
ys: Tensor;
|
|
22
|
-
}>>;
|
|
23
|
-
}
|