@genai-fi/nanogpt 0.7.2 → 0.8.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.d.ts +36 -4
- package/dist/Generator.js +183 -69
- package/dist/{RealDiv-Dy0p8Bvo.js → RealDiv-N8TpOMYv.js} +14 -14
- package/dist/{Reshape-DvudQDvJ.js → Reshape-B-lWQRnF.js} +1 -1
- package/dist/{Reshape-DH5srBP0.js → Reshape-Bo8HzP8V.js} +5 -5
- package/dist/TeachableLLM.d.ts +6 -6
- package/dist/TeachableLLM.js +51 -50
- package/dist/Trainer.d.ts +19 -3
- package/dist/Trainer.js +71 -28
- package/dist/{axis_util-BzbKo31C.js → axis_util-DubwyOhW.js} +3 -3
- package/dist/backend.js +2 -2
- package/dist/{backend_util-TE7aTPhZ.js → backend_util-BJ-_jSeK.js} +46 -46
- package/dist/{broadcast_to-CdbwV-Dj.js → broadcast_to-BYfCp5iL.js} +2 -2
- package/dist/{concat-CsxrgovM.js → concat-BmDqqFsa.js} +1 -1
- package/dist/{dataset-CtdBYwjo.js → dataset-CJmEGu6D.js} +5 -5
- package/dist/{dropout-DYs5QFGQ.js → dropout-sx0sjVAT.js} +8 -8
- package/dist/exports_initializers-DAKM8UO9.js +16 -0
- package/dist/{gather-CMMy2KEG.js → gather-C1siEkdp.js} +1 -1
- package/dist/{gelu-C-dPj6Ku.js → gelu-Bd3UBBxg.js} +1 -1
- package/dist/{gpgpu_math-DGNLNL4I.js → gpgpu_math-TFLxaLkw.js} +26 -26
- package/dist/{index-CLthM0TO.js → index-BaPo_0H8.js} +185 -185
- package/dist/{index-BoWRt-10.js → index-CUQrfsw_.js} +266 -265
- package/dist/{kernel_funcs_utils-BYKWV8Aa.js → kernel_funcs_utils-P9aFa232.js} +9 -9
- package/dist/layers/BaseLayer.d.ts +8 -13
- package/dist/layers/BaseLayer.js +25 -13
- package/dist/layers/CausalSelfAttention.d.ts +3 -2
- package/dist/layers/CausalSelfAttention.js +28 -28
- package/dist/layers/MLP.d.ts +3 -2
- package/dist/layers/MLP.js +16 -20
- package/dist/layers/PositionEmbedding.d.ts +9 -0
- package/dist/layers/PositionEmbedding.js +45 -0
- package/dist/layers/RMSNorm.d.ts +3 -2
- package/dist/layers/RMSNorm.js +6 -6
- package/dist/layers/RoPECache.d.ts +1 -1
- package/dist/layers/RoPECache.js +4 -4
- package/dist/layers/TiedEmbedding.d.ts +3 -2
- package/dist/layers/TiedEmbedding.js +29 -7
- package/dist/layers/TransformerBlock.d.ts +3 -2
- package/dist/layers/TransformerBlock.js +1 -1
- package/dist/loader/load.d.ts +2 -2
- package/dist/loader/loadHF.d.ts +2 -2
- package/dist/loader/loadTransformers.d.ts +4 -2
- package/dist/loader/loadTransformers.js +10 -9
- package/dist/loader/newZipLoad.d.ts +2 -2
- package/dist/loader/oldZipLoad.d.ts +2 -2
- package/dist/loader/oldZipLoad.js +42 -51
- package/dist/loader/save.d.ts +8 -0
- package/dist/loader/save.js +62 -0
- package/dist/{log_sum_exp-DbjkV734.js → log_sum_exp-C142qZqY.js} +14 -14
- package/dist/main.d.ts +5 -4
- package/dist/main.js +22 -18
- package/dist/{mat_mul-8m8pfdcx.js → mat_mul-DMkduNJu.js} +1 -1
- package/dist/{max-Ddnnb5xe.js → max-B3JOcNGb.js} +1 -1
- package/dist/mod-uUuj4gSb.js +27 -0
- package/dist/models/NanoGPTV1.d.ts +15 -0
- package/dist/models/NanoGPTV1.js +71 -0
- package/dist/{config.d.ts → models/config.d.ts} +1 -0
- package/dist/{config.js → models/config.js} +1 -0
- package/dist/models/factory.d.ts +3 -0
- package/dist/models/factory.js +14 -0
- package/dist/models/model.d.ts +26 -0
- package/dist/models/model.js +68 -0
- package/dist/{mulmat_packed_gpu-VSekgsNv.js → mulmat_packed_gpu-Cm2gw-c8.js} +1 -1
- package/dist/{ones-Dj0SDhHf.js → ones-ZdgQGBCP.js} +2 -2
- package/dist/ops/adamAdjust.js +1 -1
- package/dist/ops/adamMoments.js +1 -1
- package/dist/ops/appendCache.js +3 -3
- package/dist/ops/attentionMask.js +1 -1
- package/dist/ops/cpu/adamAdjust.js +9 -9
- package/dist/ops/cpu/adamMoments.js +2 -2
- package/dist/ops/cpu/appendCache.js +2 -2
- package/dist/ops/cpu/attentionMask.js +5 -5
- package/dist/ops/cpu/fusedSoftmax.js +2 -2
- package/dist/ops/cpu/gatherSub.js +3 -3
- package/dist/ops/cpu/gelu.js +1 -1
- package/dist/ops/cpu/matMulGelu.js +2 -2
- package/dist/ops/cpu/matMulMul.js +1 -1
- package/dist/ops/cpu/mulDropout.js +1 -1
- 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 +11 -11
- package/dist/ops/fusedSoftmax.js +1 -1
- package/dist/ops/gatherSub.js +1 -1
- package/dist/ops/gelu.js +2 -2
- package/dist/ops/grads/attentionMask.js +1 -1
- package/dist/ops/grads/fusedSoftmax.js +2 -2
- package/dist/ops/grads/gelu.js +2 -2
- package/dist/ops/grads/matMulGelu.js +1 -1
- package/dist/ops/grads/normRMS.js +1 -1
- package/dist/ops/grads/qkv.js +1 -1
- package/dist/ops/grads/rope.js +1 -1
- package/dist/ops/matMulGelu.js +1 -1
- package/dist/ops/matMulMul.js +1 -1
- package/dist/ops/mulDrop.js +1 -1
- package/dist/ops/normRMS.js +1 -1
- package/dist/ops/qkv.js +1 -1
- package/dist/ops/rope.js +4 -4
- package/dist/ops/scatterSub.js +1 -1
- 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/fusedSoftmax.js +4 -4
- package/dist/ops/webgl/gatherSub.js +1 -1
- package/dist/ops/webgl/gelu.js +2 -2
- package/dist/ops/webgl/log.js +3 -3
- package/dist/ops/webgl/matMulGelu.js +10 -10
- package/dist/ops/webgl/matMulMul.js +1 -1
- 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 +1 -1
- package/dist/ops/webgpu/adamAdjust.js +3 -3
- package/dist/ops/webgpu/adamMoments.js +3 -3
- package/dist/ops/webgpu/appendCache.js +3 -3
- package/dist/ops/webgpu/attentionMask.js +3 -3
- package/dist/ops/webgpu/gatherSub.js +3 -3
- package/dist/ops/webgpu/gelu.js +3 -3
- package/dist/ops/webgpu/normRMS.js +2 -2
- package/dist/ops/webgpu/normRMSGrad.js +5 -5
- package/dist/ops/webgpu/qkv.js +3 -3
- package/dist/ops/webgpu/rope.js +3 -3
- package/dist/ops/webgpu/scatterSub.js +3 -3
- package/dist/ops/webgpu/utils/reductions.js +4 -4
- package/dist/{ops-BFGCx8Ri.js → ops-C_1K_-35.js} +103 -103
- package/dist/{random_width-sZORGo5k.js → random_width-D8Pwy_na.js} +136 -136
- package/dist/{range-CRuAh-gd.js → range-LVHrSLdi.js} +1 -1
- package/dist/{reciprocal-BvGAyKyu.js → reciprocal-CaR9e67G.js} +1 -1
- package/dist/{register_all_kernels-BwDSRN-f.js → register_all_kernels-DUshvVWP.js} +2026 -2049
- package/dist/{reshape-CdBq1WJ6.js → reshape-DEfQGSin.js} +1 -1
- package/dist/{scatter_nd_util-DUstGbU1.js → scatter_nd_util-CUPPNLaA.js} +1 -1
- package/dist/{selu_util-BJEXVvjX.js → selu_util-8vv5JxQV.js} +3 -3
- package/dist/{shared-B8ztnyEk.js → shared-CkNorDcU.js} +83 -83
- package/dist/{shared-wS99K7_n.js → shared-D1elLckx.js} +1 -1
- package/dist/{sin-BeA3tsEd.js → sin-D2CKKmyR.js} +1 -1
- package/dist/{slice-BiOsknYS.js → slice-BnyE-M_7.js} +1 -1
- package/dist/{softmax-Bv_6lyMX.js → softmax-DLoZWYBx.js} +1 -1
- package/dist/{split-B-dikLRw.js → split-By_n4TKP.js} +1 -1
- package/dist/{stack-B17UN2nn.js → stack-DkdFLq37.js} +1 -1
- package/dist/{sum-66ew2byf.js → sum-l_0SqM4h.js} +3 -3
- package/dist/{tensor-JwS7ZYY6.js → tensor-BAQdLqoU.js} +1 -1
- package/dist/{tensor2d-wxPAnDQy.js → tensor2d-BHy261cI.js} +1 -1
- package/dist/training/Adam.js +2 -2
- package/dist/training/AdamExt.js +1 -1
- package/dist/training/DatasetBuilder.js +2 -2
- package/dist/training/Evaluator.d.ts +2 -2
- package/dist/training/FullTrainer.d.ts +16 -3
- package/dist/training/FullTrainer.js +91 -53
- package/dist/training/Trainer.d.ts +25 -3
- package/dist/training/Trainer.js +39 -47
- package/dist/training/sparseCrossEntropy.js +9 -9
- package/dist/utilities/dummy.d.ts +4 -4
- package/dist/utilities/dummy.js +13 -13
- package/dist/utilities/multinomialCPU.js +2 -2
- package/dist/utilities/parameters.d.ts +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/weights.js +2 -2
- package/dist/{variable-BuddVFLa.js → variable-C9hihzDB.js} +1 -1
- package/dist/{webgpu_program-PFzf1hAQ.js → webgpu_program-dFEVbDPL.js} +1 -1
- package/dist/{webgpu_util-D____QpY.js → webgpu_util-DLImlSc6.js} +27 -27
- package/dist/{zeros--BdLQ3oG.js → zeros-VZ72lWXM.js} +1 -1
- package/package.json +2 -3
- package/dist/NanoGPTModel.d.ts +0 -52
- package/dist/NanoGPTModel.js +0 -203
- package/dist/TiedEmbedding-BxOerUmB.js +0 -43
- package/dist/utilities/generate.d.ts +0 -3
- package/dist/utilities/generate.js +0 -22
- package/dist/utilities/save.d.ts +0 -9
- package/dist/utilities/save.js +0 -61
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as p,
|
|
1
|
+
import { j as p, a2 as w } from "./index-CUQrfsw_.js";
|
|
2
2
|
function k(o, t, r) {
|
|
3
3
|
const n = t.rank > 1 ? t.shape[t.rank - 1] : 1, e = t.rank > 1 ? t.rank - 1 : 1, h = `Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${r.shape}, indices.shape: ${t.shape}, shape: ${o}, sliceDim: ${n}, and batchDim: ${e}.`;
|
|
4
4
|
if (r.rank < e)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as ce } from "./reshape-
|
|
3
|
-
import { s as ae } from "./sum-
|
|
1
|
+
import { n as N, as as H, B as _, C as S, E as L, at as te, au as ne, ap as se, ar as re, av as ie, aw as oe, ax as le, a as ue, ay as fe, az as O } from "./index-CUQrfsw_.js";
|
|
2
|
+
import { r as ce } from "./reshape-DEfQGSin.js";
|
|
3
|
+
import { s as ae } from "./sum-l_0SqM4h.js";
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2020 Google LLC. All Rights Reserved.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { f as it, m as kt, g as
|
|
3
|
-
import { g as pn, a as wn, e as In, c as bn } from "./axis_util-
|
|
4
|
-
import { b as xn } from "./broadcast_to-
|
|
5
|
-
import { r as En } from "./reshape-
|
|
6
|
-
import { p as Fn, q as yn, r as kn, u as Nn } from "./selu_util-
|
|
1
|
+
import { n as Lt, bh as Ce, j as V, l as qt, a2 as H, bi as et, ad as ht, bj as dt, bk as at, a9 as De, aa as st, ao as We, b4 as $e, bl as Ue, bm as ze, bn as Be, bo as Pt, an as K, bp as At, bq as W, br as _t, bs as Vt, ag as Ct, bt as Dt, am as Wt, bu as $t, aY as Ut, aZ as zt, a$ as Bt, b0 as jt, ah as Gt, bv as Zt, b3 as Kt, bw as Ht, b1 as je, aq as Ge, bx as Xt, b7 as Ze, by as Ke, p as Yt, u as He, t as Xe, bz as Jt, bA as It, at as Qt, _ as Ye, bB as te, bC as ee, bD as ne, aO as pt, bE as se, bF as ot } from "./index-CUQrfsw_.js";
|
|
2
|
+
import { f as it, m as kt, g as Je, a as Qe, R as tn, v as en, d as nn, e as sn, h as on, i as rn, j as an, k as ln, l as cn, n as un, o as hn, p as fn, q as Nt, r as dn, s as gn, t as mn } from "./backend_util-BJ-_jSeK.js";
|
|
3
|
+
import { g as pn, a as wn, e as In, c as bn } from "./axis_util-DubwyOhW.js";
|
|
4
|
+
import { b as xn } from "./broadcast_to-BYfCp5iL.js";
|
|
5
|
+
import { r as En } from "./reshape-DEfQGSin.js";
|
|
6
|
+
import { p as Fn, q as yn, r as kn, u as Nn } from "./selu_util-8vv5JxQV.js";
|
|
7
7
|
import { g as vn } from "./_commonjsHelpers-ByX85dGu.js";
|
|
8
8
|
function Sn(e, t) {
|
|
9
9
|
for (var n = 0; n < t.length; n++) {
|
|
@@ -365,8 +365,8 @@ function Tn() {
|
|
|
365
365
|
throw Error("interior hyphen");
|
|
366
366
|
if (N === 0)
|
|
367
367
|
return u(I.substring(1), c, E).neg();
|
|
368
|
-
for (var L = r(l(E, 8)), R = g,
|
|
369
|
-
var U = Math.min(8, I.length -
|
|
368
|
+
for (var L = r(l(E, 8)), R = g, P = 0; P < I.length; P += 8) {
|
|
369
|
+
var U = Math.min(8, I.length - P), j = parseInt(I.substring(P, P + U), E);
|
|
370
370
|
if (U < 8) {
|
|
371
371
|
var C = r(l(E, U));
|
|
372
372
|
R = R.mul(C).add(r(j));
|
|
@@ -412,13 +412,13 @@ function Tn() {
|
|
|
412
412
|
return N.toString(c) + L.toInt().toString(c);
|
|
413
413
|
} else
|
|
414
414
|
return "-" + this.neg().toString(c);
|
|
415
|
-
for (var R = r(l(c, 6), this.unsigned),
|
|
416
|
-
var j =
|
|
417
|
-
if (
|
|
418
|
-
return
|
|
419
|
-
for (;
|
|
420
|
-
|
|
421
|
-
U = "" +
|
|
415
|
+
for (var R = r(l(c, 6), this.unsigned), P = this, U = ""; ; ) {
|
|
416
|
+
var j = P.div(R), C = P.sub(j.mul(R)).toInt() >>> 0, q = C.toString(c);
|
|
417
|
+
if (P = j, P.isZero())
|
|
418
|
+
return q + U;
|
|
419
|
+
for (; q.length < 6; )
|
|
420
|
+
q = "0" + q;
|
|
421
|
+
U = "" + q + U;
|
|
422
422
|
}
|
|
423
423
|
}, x.getHighBits = function() {
|
|
424
424
|
return this.high;
|
|
@@ -480,8 +480,8 @@ function Tn() {
|
|
|
480
480
|
return !this.unsigned && this.eq(S) ? S : this.not().add(k);
|
|
481
481
|
}, x.neg = x.negate, x.add = function(c) {
|
|
482
482
|
n(c) || (c = h(c));
|
|
483
|
-
var E = this.high >>> 16, N = this.high & 65535, L = this.low >>> 16, R = this.low & 65535,
|
|
484
|
-
return B += R + C, _ += B >>> 16, B &= 65535, _ += L + j, G += _ >>> 16, _ &= 65535, G += N + U,
|
|
483
|
+
var E = this.high >>> 16, N = this.high & 65535, L = this.low >>> 16, R = this.low & 65535, P = c.high >>> 16, U = c.high & 65535, j = c.low >>> 16, C = c.low & 65535, q = 0, G = 0, _ = 0, B = 0;
|
|
484
|
+
return B += R + C, _ += B >>> 16, B &= 65535, _ += L + j, G += _ >>> 16, _ &= 65535, G += N + U, q += G >>> 16, G &= 65535, q += E + P, q &= 65535, i(_ << 16 | B, q << 16 | G, this.unsigned);
|
|
485
485
|
}, x.subtract = function(c) {
|
|
486
486
|
return n(c) || (c = h(c)), this.add(c.neg());
|
|
487
487
|
}, x.sub = x.subtract, x.multiply = function(c) {
|
|
@@ -508,8 +508,8 @@ function Tn() {
|
|
|
508
508
|
return this.mul(c.neg()).neg();
|
|
509
509
|
if (this.lt(d) && c.lt(d))
|
|
510
510
|
return r(this.toNumber() * c.toNumber(), this.unsigned);
|
|
511
|
-
var N = this.high >>> 16, L = this.high & 65535, R = this.low >>> 16,
|
|
512
|
-
return ct +=
|
|
511
|
+
var N = this.high >>> 16, L = this.high & 65535, R = this.low >>> 16, P = this.low & 65535, U = c.high >>> 16, j = c.high & 65535, C = c.low >>> 16, q = c.low & 65535, G = 0, _ = 0, B = 0, ct = 0;
|
|
512
|
+
return ct += P * q, B += ct >>> 16, ct &= 65535, B += R * q, _ += B >>> 16, B &= 65535, B += P * C, _ += B >>> 16, B &= 65535, _ += L * q, G += _ >>> 16, _ &= 65535, _ += R * C, G += _ >>> 16, _ &= 65535, _ += P * j, G += _ >>> 16, _ &= 65535, G += N * q + L * C + R * j + P * U, G &= 65535, i(B << 16 | ct, G << 16 | _, this.unsigned);
|
|
513
513
|
}, x.mul = x.multiply, x.divide = function(c) {
|
|
514
514
|
if (n(c) || (c = h(c)), c.isZero())
|
|
515
515
|
throw Error("division by zero");
|
|
@@ -539,8 +539,8 @@ function Tn() {
|
|
|
539
539
|
return S;
|
|
540
540
|
if (c.eq(S))
|
|
541
541
|
return k;
|
|
542
|
-
var
|
|
543
|
-
return N =
|
|
542
|
+
var P = this.shr(1);
|
|
543
|
+
return N = P.div(c).shl(1), N.eq(g) ? c.isNegative() ? k : v : (L = this.sub(c.mul(N)), R = N.add(L.div(c)), R);
|
|
544
544
|
} else if (c.eq(S))
|
|
545
545
|
return this.unsigned ? b : g;
|
|
546
546
|
if (this.isNegative())
|
|
@@ -551,9 +551,9 @@ function Tn() {
|
|
|
551
551
|
}
|
|
552
552
|
for (L = this; L.gte(c); ) {
|
|
553
553
|
N = Math.max(1, Math.floor(L.toNumber() / c.toNumber()));
|
|
554
|
-
for (var U = Math.ceil(Math.log(N) / Math.LN2), j = U <= 48 ? 1 : l(2, U - 48), C = r(N),
|
|
555
|
-
N -= j, C = r(N, this.unsigned),
|
|
556
|
-
C.isZero() && (C = k), R = R.add(C), L = L.sub(
|
|
554
|
+
for (var U = Math.ceil(Math.log(N) / Math.LN2), j = U <= 48 ? 1 : l(2, U - 48), C = r(N), q = C.mul(c); q.isNegative() || q.gt(L); )
|
|
555
|
+
N -= j, C = r(N, this.unsigned), q = C.mul(c);
|
|
556
|
+
C.isZero() && (C = k), R = R.add(C), L = L.sub(q);
|
|
557
557
|
}
|
|
558
558
|
return R;
|
|
559
559
|
}, x.div = x.divide, x.modulo = function(c) {
|
|
@@ -661,7 +661,7 @@ const tt = (
|
|
|
661
661
|
function gt(e) {
|
|
662
662
|
return tt.fromString(e, !0, 16);
|
|
663
663
|
}
|
|
664
|
-
const ae = gt("c3a5c85c97cb3127"),
|
|
664
|
+
const ae = gt("c3a5c85c97cb3127"), Q = gt("b492b66fbe98f273"), D = gt("9ae16a3b2f90404f");
|
|
665
665
|
function bt(e) {
|
|
666
666
|
return e.xor(e.shru(47));
|
|
667
667
|
}
|
|
@@ -678,7 +678,7 @@ function St(e, t) {
|
|
|
678
678
|
function A(e, t) {
|
|
679
679
|
return t === 0 ? e : e.shru(t).or(e.shl(64 - t));
|
|
680
680
|
}
|
|
681
|
-
function
|
|
681
|
+
function Y(e, t, n = gt("9ddfea08eb382d69")) {
|
|
682
682
|
let s = e.xor(t).mul(n);
|
|
683
683
|
s = s.xor(s.shru(47));
|
|
684
684
|
let o = t.xor(s).mul(n);
|
|
@@ -695,11 +695,11 @@ function ut(e, t, n, s) {
|
|
|
695
695
|
function On(e, t = e.length) {
|
|
696
696
|
if (t >= 8) {
|
|
697
697
|
const n = D.add(t * 2), s = T(e, 0).add(D), o = T(e, t - 8), a = A(o, 37).mul(n).add(s), r = A(s, 25).add(o).mul(n);
|
|
698
|
-
return
|
|
698
|
+
return Y(a, r, n);
|
|
699
699
|
}
|
|
700
700
|
if (t >= 4) {
|
|
701
701
|
const n = D.add(t * 2), s = St(e, 0);
|
|
702
|
-
return
|
|
702
|
+
return Y(s.shl(3).add(t), St(e, t - 4), n);
|
|
703
703
|
}
|
|
704
704
|
if (t > 0) {
|
|
705
705
|
const n = e[0], s = e[t >> 1], o = e[t - 1], a = n + (s << 8), r = t + (o << 2);
|
|
@@ -708,28 +708,28 @@ function On(e, t = e.length) {
|
|
|
708
708
|
return D;
|
|
709
709
|
}
|
|
710
710
|
function Ln(e, t = e.length) {
|
|
711
|
-
const n = D.add(t * 2), s = T(e, 0).mul(
|
|
712
|
-
return
|
|
713
|
-
}
|
|
714
|
-
function Pn(e, t = e.length) {
|
|
715
|
-
const n = D.add(t * 2), s = T(e, 0).mul(D), o = T(e, 8), a = T(e, t - 8).mul(n), r = T(e, t - 16).mul(D), i = A(s.add(o), 43).add(A(a, 30)).add(r), l = J(i, s.add(A(o.add(D), 18)).add(a), n), u = T(e, 16).mul(n), h = T(e, 24), f = i.add(T(e, t - 32)).mul(n), p = l.add(T(e, t - 24)).mul(n);
|
|
716
|
-
return J(A(u.add(h), 43).add(A(f, 30)).add(p), u.add(A(h.add(s), 18)).add(f), n);
|
|
711
|
+
const n = D.add(t * 2), s = T(e, 0).mul(Q), o = T(e, 8), a = T(e, t - 8).mul(n), r = T(e, t - 16).mul(D);
|
|
712
|
+
return Y(A(s.add(o), 43).add(A(a, 30)).add(r), s.add(A(o.add(D), 18)).add(a), n);
|
|
717
713
|
}
|
|
718
714
|
function qn(e, t = e.length) {
|
|
715
|
+
const n = D.add(t * 2), s = T(e, 0).mul(D), o = T(e, 8), a = T(e, t - 8).mul(n), r = T(e, t - 16).mul(D), i = A(s.add(o), 43).add(A(a, 30)).add(r), l = Y(i, s.add(A(o.add(D), 18)).add(a), n), u = T(e, 16).mul(n), h = T(e, 24), f = i.add(T(e, t - 32)).mul(n), p = l.add(T(e, t - 24)).mul(n);
|
|
716
|
+
return Y(A(u.add(h), 43).add(A(f, 30)).add(p), u.add(A(h.add(s), 18)).add(f), n);
|
|
717
|
+
}
|
|
718
|
+
function Pn(e, t = e.length) {
|
|
719
719
|
const n = tt.fromNumber(81, !0);
|
|
720
720
|
if (t <= 32)
|
|
721
721
|
return t <= 16 ? On(e, t) : Ln(e, t);
|
|
722
722
|
if (t <= 64)
|
|
723
|
-
return
|
|
724
|
-
let s = n, o = n.mul(
|
|
723
|
+
return qn(e, t);
|
|
724
|
+
let s = n, o = n.mul(Q).add(113), a = bt(o.mul(D).add(113)).mul(D), r = [tt.UZERO, tt.UZERO], i = [tt.UZERO, tt.UZERO];
|
|
725
725
|
s = s.mul(D).add(T(e, 0));
|
|
726
726
|
let l = 0;
|
|
727
727
|
const u = (t - 1 >> 6) * 64, h = u + (t - 1 & 63) - 63;
|
|
728
728
|
do
|
|
729
|
-
s = A(s.add(o).add(r[0]).add(T(e, l + 8)), 37).mul(
|
|
729
|
+
s = A(s.add(o).add(r[0]).add(T(e, l + 8)), 37).mul(Q), o = A(o.add(r[1]).add(T(e, l + 48)), 42).mul(Q), s = s.xor(i[1]), o = o.add(r[0]).add(T(e, l + 40)), a = A(a.add(i[0]), 33).mul(Q), r = ut(e, l, r[1].mul(Q), s.add(i[0])), i = ut(e, l + 32, a.add(i[1]), o.add(T(e, l + 16))), [a, s] = [s, a], l += 64;
|
|
730
730
|
while (l !== u);
|
|
731
|
-
const f =
|
|
732
|
-
return l = h, i[0] = i[0].add(t - 1 & 63), r[0] = r[0].add(i[0]), i[0] = i[0].add(r[0]), s = A(s.add(o).add(r[0]).add(T(e, l + 8)), 37).mul(f), o = A(o.add(r[1]).add(T(e, l + 48)), 42).mul(f), s = s.xor(i[1].mul(9)), o = o.add(r[0].mul(9).add(T(e, l + 40))), a = A(a.add(i[0]), 33).mul(f), r = ut(e, l, r[1].mul(f), s.add(i[0])), i = ut(e, l + 32, a.add(i[1]), o.add(T(e, l + 16))), [a, s] = [s, a],
|
|
731
|
+
const f = Q.add(a.and(255).shl(1));
|
|
732
|
+
return l = h, i[0] = i[0].add(t - 1 & 63), r[0] = r[0].add(i[0]), i[0] = i[0].add(r[0]), s = A(s.add(o).add(r[0]).add(T(e, l + 8)), 37).mul(f), o = A(o.add(r[1]).add(T(e, l + 48)), 42).mul(f), s = s.xor(i[1].mul(9)), o = o.add(r[0].mul(9).add(T(e, l + 40))), a = A(a.add(i[0]), 33).mul(f), r = ut(e, l, r[1].mul(f), s.add(i[0])), i = ut(e, l + 32, a.add(i[1]), o.add(T(e, l + 16))), [a, s] = [s, a], Y(Y(r[0], i[0], f).add(bt(o).mul(ae)).add(a), Y(r[1], i[1], f).add(s), f);
|
|
733
733
|
}
|
|
734
734
|
/**
|
|
735
735
|
* @license
|
|
@@ -803,7 +803,7 @@ const An = (e) => {
|
|
|
803
803
|
*/
|
|
804
804
|
function $(e) {
|
|
805
805
|
return (t, n, s, o, a) => {
|
|
806
|
-
const r =
|
|
806
|
+
const r = qt(t, n), i = r.length, l = H(r), u = V(r), h = et(a, u), f = t.length, p = n.length, w = H(t), m = H(n), F = ht(t, r), d = ht(n, r);
|
|
807
807
|
if (F.length + d.length === 0)
|
|
808
808
|
for (let g = 0; g < h.length; ++g)
|
|
809
809
|
h[g] = e(s[g % s.length], o[g % o.length]);
|
|
@@ -842,7 +842,7 @@ function mt(e) {
|
|
|
842
842
|
imag: n.makeTensorInfo(o.shape, "float32", r)
|
|
843
843
|
}, i;
|
|
844
844
|
}
|
|
845
|
-
const
|
|
845
|
+
const Ys = {
|
|
846
846
|
kernelName: De,
|
|
847
847
|
backendName: "cpu",
|
|
848
848
|
kernelFunc: mt
|
|
@@ -891,7 +891,7 @@ function Et(e) {
|
|
|
891
891
|
const { inputs: t, backend: n } = e, { x: s } = t;
|
|
892
892
|
return n.incRef(s.dataId), { dataId: s.dataId, shape: s.shape, dtype: s.dtype };
|
|
893
893
|
}
|
|
894
|
-
const
|
|
894
|
+
const Js = {
|
|
895
895
|
kernelName: We,
|
|
896
896
|
backendName: "cpu",
|
|
897
897
|
kernelFunc: Et
|
|
@@ -916,7 +916,7 @@ function ce(e) {
|
|
|
916
916
|
const { inputs: t, backend: n } = e, { input: s } = t, o = n.data.get(s.dataId).complexTensorInfos.real, a = n.data.get(o.dataId).values;
|
|
917
917
|
return n.makeTensorInfo(o.shape, o.dtype, a);
|
|
918
918
|
}
|
|
919
|
-
const
|
|
919
|
+
const Qs = {
|
|
920
920
|
kernelName: $e,
|
|
921
921
|
backendName: "cpu",
|
|
922
922
|
kernelFunc: ce
|
|
@@ -1013,7 +1013,7 @@ function z(e, t, n, s) {
|
|
|
1013
1013
|
}
|
|
1014
1014
|
function Ft(e) {
|
|
1015
1015
|
return (t, n, s, o, a, r) => {
|
|
1016
|
-
const i =
|
|
1016
|
+
const i = qt(t, n), l = V(i), u = i.length, h = H(i), f = et("float32", l), p = et("float32", l), w = ht(t, i), m = ht(n, i), F = kt(s, o), d = kt(a, r), g = t.length, b = H(t), k = n.length, y = H(n);
|
|
1017
1017
|
if (w.length + m.length === 0)
|
|
1018
1018
|
for (let v = 0; v < f.length; v++) {
|
|
1019
1019
|
const M = v % F.length, O = v % d.length, S = e(F[M * 2], F[M * 2 + 1], d[O * 2], d[O * 2 + 1]);
|
|
@@ -1047,8 +1047,8 @@ function Ft(e) {
|
|
|
1047
1047
|
* limitations under the License.
|
|
1048
1048
|
* =============================================================================
|
|
1049
1049
|
*/
|
|
1050
|
-
const he = $((e, t) => e + t), _n = Ft((e, t, n, s) => ({ real: e + n, imag: t + s })), Vn = z(
|
|
1051
|
-
kernelName:
|
|
1050
|
+
const he = $((e, t) => e + t), _n = Ft((e, t, n, s) => ({ real: e + n, imag: t + s })), Vn = z(Pt, he, _n), eo = {
|
|
1051
|
+
kernelName: Pt,
|
|
1052
1052
|
backendName: "cpu",
|
|
1053
1053
|
kernelFunc: Vn
|
|
1054
1054
|
};
|
|
@@ -1152,9 +1152,9 @@ function X(e) {
|
|
|
1152
1152
|
*/
|
|
1153
1153
|
function de(e, t, n) {
|
|
1154
1154
|
const s = X(t);
|
|
1155
|
-
return
|
|
1155
|
+
return J(e, s, n);
|
|
1156
1156
|
}
|
|
1157
|
-
function
|
|
1157
|
+
function J(e, t, n) {
|
|
1158
1158
|
return ({ inputs: s, attrs: o, backend: a }) => {
|
|
1159
1159
|
const { x: r } = s;
|
|
1160
1160
|
nt(r, e);
|
|
@@ -1186,7 +1186,7 @@ function Q(e, t, n) {
|
|
|
1186
1186
|
* limitations under the License.
|
|
1187
1187
|
* =============================================================================
|
|
1188
1188
|
*/
|
|
1189
|
-
const ge = X((e) => Math.ceil(e)), $n =
|
|
1189
|
+
const ge = X((e) => Math.ceil(e)), $n = J(_t, ge), so = {
|
|
1190
1190
|
kernelName: _t,
|
|
1191
1191
|
backendName: "cpu",
|
|
1192
1192
|
kernelFunc: $n
|
|
@@ -1267,7 +1267,7 @@ const me = $((e, t) => e === t ? 1 : 0), zn = z(Vt, me, null, "bool"), oo = {
|
|
|
1267
1267
|
* limitations under the License.
|
|
1268
1268
|
* =============================================================================
|
|
1269
1269
|
*/
|
|
1270
|
-
const pe = X((e) => Math.exp(e)), Bn =
|
|
1270
|
+
const pe = X((e) => Math.exp(e)), Bn = J(Ct, pe, "float32"), ro = {
|
|
1271
1271
|
kernelName: Ct,
|
|
1272
1272
|
backendName: "cpu",
|
|
1273
1273
|
kernelFunc: Bn
|
|
@@ -1288,7 +1288,7 @@ const pe = X((e) => Math.exp(e)), Bn = Q(Ct, pe, "float32"), ro = {
|
|
|
1288
1288
|
* limitations under the License.
|
|
1289
1289
|
* =============================================================================
|
|
1290
1290
|
*/
|
|
1291
|
-
const we = X((e) => Math.expm1(e)), jn =
|
|
1291
|
+
const we = X((e) => Math.expm1(e)), jn = J(Dt, we), ao = {
|
|
1292
1292
|
kernelName: Dt,
|
|
1293
1293
|
backendName: "cpu",
|
|
1294
1294
|
kernelFunc: jn
|
|
@@ -1309,7 +1309,7 @@ const we = X((e) => Math.expm1(e)), jn = Q(Dt, we), ao = {
|
|
|
1309
1309
|
* limitations under the License.
|
|
1310
1310
|
* =============================================================================
|
|
1311
1311
|
*/
|
|
1312
|
-
const Ie = X((e) => Math.floor(e)), Gn =
|
|
1312
|
+
const Ie = X((e) => Math.floor(e)), Gn = J(Wt, Ie), io = {
|
|
1313
1313
|
kernelName: Wt,
|
|
1314
1314
|
backendName: "cpu",
|
|
1315
1315
|
kernelFunc: Gn
|
|
@@ -1430,10 +1430,10 @@ const xe = $((e, t) => e > t ? 1 : 0), Xn = z(Ut, xe, null, "bool"), co = {
|
|
|
1430
1430
|
* limitations under the License.
|
|
1431
1431
|
* =============================================================================
|
|
1432
1432
|
*/
|
|
1433
|
-
const Ee = $((e, t) => e >= t ? 1 : 0),
|
|
1433
|
+
const Ee = $((e, t) => e >= t ? 1 : 0), Yn = z(zt, Ee, null, "bool"), uo = {
|
|
1434
1434
|
kernelName: zt,
|
|
1435
1435
|
backendName: "cpu",
|
|
1436
|
-
kernelFunc:
|
|
1436
|
+
kernelFunc: Yn
|
|
1437
1437
|
};
|
|
1438
1438
|
/**
|
|
1439
1439
|
* @license
|
|
@@ -1451,10 +1451,10 @@ const Ee = $((e, t) => e >= t ? 1 : 0), Jn = z(zt, Ee, null, "bool"), uo = {
|
|
|
1451
1451
|
* limitations under the License.
|
|
1452
1452
|
* =============================================================================
|
|
1453
1453
|
*/
|
|
1454
|
-
const Fe = $((e, t) => e < t ? 1 : 0),
|
|
1454
|
+
const Fe = $((e, t) => e < t ? 1 : 0), Jn = z(Bt, Fe, null, "bool"), ho = {
|
|
1455
1455
|
kernelName: Bt,
|
|
1456
1456
|
backendName: "cpu",
|
|
1457
|
-
kernelFunc:
|
|
1457
|
+
kernelFunc: Jn
|
|
1458
1458
|
};
|
|
1459
1459
|
/**
|
|
1460
1460
|
* @license
|
|
@@ -1472,10 +1472,10 @@ const Fe = $((e, t) => e < t ? 1 : 0), Qn = z(Bt, Fe, null, "bool"), ho = {
|
|
|
1472
1472
|
* limitations under the License.
|
|
1473
1473
|
* =============================================================================
|
|
1474
1474
|
*/
|
|
1475
|
-
const ye = $((e, t) => e <= t ? 1 : 0),
|
|
1475
|
+
const ye = $((e, t) => e <= t ? 1 : 0), Qn = z(jt, ye, null, "bool"), fo = {
|
|
1476
1476
|
kernelName: jt,
|
|
1477
1477
|
backendName: "cpu",
|
|
1478
|
-
kernelFunc:
|
|
1478
|
+
kernelFunc: Qn
|
|
1479
1479
|
};
|
|
1480
1480
|
/**
|
|
1481
1481
|
* @license
|
|
@@ -1516,7 +1516,7 @@ function ts(e, t, n) {
|
|
|
1516
1516
|
* limitations under the License.
|
|
1517
1517
|
* =============================================================================
|
|
1518
1518
|
*/
|
|
1519
|
-
const ke = X((e) => Math.log(e)), es =
|
|
1519
|
+
const ke = X((e) => Math.log(e)), es = J(Gt, ke), go = {
|
|
1520
1520
|
kernelName: Gt,
|
|
1521
1521
|
backendName: "cpu",
|
|
1522
1522
|
kernelFunc: es
|
|
@@ -1755,7 +1755,7 @@ function Oe(e, t, n, s) {
|
|
|
1755
1755
|
function cs(e) {
|
|
1756
1756
|
const { inputs: t, backend: n, attrs: s } = e, { x: o } = t, { axis: a, keepDims: r } = s;
|
|
1757
1757
|
nt(o, "prod");
|
|
1758
|
-
const i = o.shape.length, l =
|
|
1758
|
+
const i = o.shape.length, l = Yt(a, o.shape), u = pn(l, i);
|
|
1759
1759
|
let h = l, f = o;
|
|
1760
1760
|
const p = [];
|
|
1761
1761
|
u != null && (f = Me({ inputs: { x: o }, backend: n, attrs: { perm: u } }), p.push(f), h = wn(h.length, i));
|
|
@@ -1948,7 +1948,7 @@ function ws(e, t, n, s, o, a, r) {
|
|
|
1948
1948
|
var Z = tn;
|
|
1949
1949
|
class ft {
|
|
1950
1950
|
constructor(t, n, s, o, a, r, i, l, u, h) {
|
|
1951
|
-
this.shape = t, this.shapeShape = n, this.values = s, this.valuesShape = o, this.valuesDType = a, this.defaultValue = r, this.defaultValueShape = i, this.rowPartitionValues = l, this.rowPartitionValuesShapes = u, this.rowPartitionTypes =
|
|
1951
|
+
this.shape = t, this.shapeShape = n, this.values = s, this.valuesShape = o, this.valuesDType = a, this.defaultValue = r, this.defaultValueShape = i, this.rowPartitionValues = l, this.rowPartitionValuesShapes = u, this.rowPartitionTypes = Je(h), this.raggedRank = Qe(this.rowPartitionTypes);
|
|
1952
1952
|
}
|
|
1953
1953
|
getRowPartitionTypeByDimension(t) {
|
|
1954
1954
|
return this.rowPartitionTypes[0] === Z.FIRST_DIM_SIZE ? this.rowPartitionTypes[t + 1] : this.rowPartitionTypes[t];
|
|
@@ -2236,8 +2236,8 @@ function bs(e, t, n, s) {
|
|
|
2236
2236
|
* limitations under the License.
|
|
2237
2237
|
* =============================================================================
|
|
2238
2238
|
*/
|
|
2239
|
-
const Le = X((e) => 1 / Math.sqrt(e)), xs =
|
|
2240
|
-
kernelName:
|
|
2239
|
+
const Le = X((e) => 1 / Math.sqrt(e)), xs = J(Jt, Le), Fo = {
|
|
2240
|
+
kernelName: Jt,
|
|
2241
2241
|
backendName: "cpu",
|
|
2242
2242
|
kernelFunc: xs
|
|
2243
2243
|
};
|
|
@@ -2293,8 +2293,8 @@ function Es(e, t, n, s, o, a, r, i, l, u) {
|
|
|
2293
2293
|
* limitations under the License.
|
|
2294
2294
|
* =============================================================================
|
|
2295
2295
|
*/
|
|
2296
|
-
const Fs = X((e) => 1 / (1 + Math.exp(-e))), ys = de(
|
|
2297
|
-
kernelName:
|
|
2296
|
+
const Fs = X((e) => 1 / (1 + Math.exp(-e))), ys = de(Qt, (e) => 1 / (1 + Math.exp(-e))), yo = {
|
|
2297
|
+
kernelName: Qt,
|
|
2298
2298
|
backendName: "cpu",
|
|
2299
2299
|
kernelFunc: ys
|
|
2300
2300
|
};
|
|
@@ -2314,7 +2314,7 @@ const Fs = X((e) => 1 / (1 + Math.exp(-e))), ys = de(Yt, (e) => 1 / (1 + Math.ex
|
|
|
2314
2314
|
* limitations under the License.
|
|
2315
2315
|
* =============================================================================
|
|
2316
2316
|
*/
|
|
2317
|
-
function
|
|
2317
|
+
function qe(e, t, n, s, o) {
|
|
2318
2318
|
const a = kn(s, t, n), r = V(n), i = H(s);
|
|
2319
2319
|
if (a) {
|
|
2320
2320
|
const f = Nn(t, i);
|
|
@@ -2332,11 +2332,11 @@ function ks(e) {
|
|
|
2332
2332
|
nt(o, "slice");
|
|
2333
2333
|
const [i, l] = Fn(o, a, r);
|
|
2334
2334
|
yn(o, i, l);
|
|
2335
|
-
const u = n.data.get(o.dataId).values, h =
|
|
2335
|
+
const u = n.data.get(o.dataId).values, h = qe(u, i, l, o.shape, o.dtype);
|
|
2336
2336
|
return n.makeTensorInfo(l, o.dtype, h);
|
|
2337
2337
|
}
|
|
2338
2338
|
const ko = {
|
|
2339
|
-
kernelName:
|
|
2339
|
+
kernelName: Ye,
|
|
2340
2340
|
backendName: "cpu",
|
|
2341
2341
|
kernelFunc: ks
|
|
2342
2342
|
};
|
|
@@ -2578,10 +2578,10 @@ const Ts = X((e) => Math.sqrt(e)), Rs = de(te, (e) => Math.sqrt(e)), No = {
|
|
|
2578
2578
|
* limitations under the License.
|
|
2579
2579
|
* =============================================================================
|
|
2580
2580
|
*/
|
|
2581
|
-
const
|
|
2581
|
+
const Pe = $((e, t) => {
|
|
2582
2582
|
const n = e - t;
|
|
2583
2583
|
return n * n;
|
|
2584
|
-
}), Ms = z(ee,
|
|
2584
|
+
}), Ms = z(ee, Pe), vo = {
|
|
2585
2585
|
kernelName: ee,
|
|
2586
2586
|
backendName: "cpu",
|
|
2587
2587
|
kernelFunc: Ms
|
|
@@ -2605,7 +2605,7 @@ const qe = $((e, t) => {
|
|
|
2605
2605
|
const Ae = X((e, t) => {
|
|
2606
2606
|
const { pattern: n, replaceGlobal: s, rewrite: o } = t;
|
|
2607
2607
|
return e.replace(new RegExp(n, s ? "g" : ""), o);
|
|
2608
|
-
}), Os =
|
|
2608
|
+
}), Os = J(ne, Ae), So = {
|
|
2609
2609
|
kernelName: ne,
|
|
2610
2610
|
backendName: "cpu",
|
|
2611
2611
|
kernelFunc: Os
|
|
@@ -2652,7 +2652,7 @@ function Ls(e, t, n, s) {
|
|
|
2652
2652
|
* limitations under the License.
|
|
2653
2653
|
* =============================================================================
|
|
2654
2654
|
*/
|
|
2655
|
-
class
|
|
2655
|
+
class qs {
|
|
2656
2656
|
constructor(t, n, s, o, a, r) {
|
|
2657
2657
|
this.separator = pt(t), this.nGramWidths = n, this.leftPad = pt(s), this.rightPad = pt(o), this.padWidth = a, this.preserveShort = r;
|
|
2658
2658
|
}
|
|
@@ -2742,8 +2742,8 @@ class Ps {
|
|
|
2742
2742
|
return [i, r];
|
|
2743
2743
|
}
|
|
2744
2744
|
}
|
|
2745
|
-
function
|
|
2746
|
-
return new
|
|
2745
|
+
function Ps(e, t, n, s, o, a, r, i) {
|
|
2746
|
+
return new qs(n, s, o, a, r, i).compute(e, t);
|
|
2747
2747
|
}
|
|
2748
2748
|
/**
|
|
2749
2749
|
* @license
|
|
@@ -2822,7 +2822,7 @@ function _s(e, t, n) {
|
|
|
2822
2822
|
function Vs(e, t) {
|
|
2823
2823
|
const n = W("int32", e.length);
|
|
2824
2824
|
for (let s = 0; s < e.length; ++s)
|
|
2825
|
-
n[s] =
|
|
2825
|
+
n[s] = Pn(e[s]).modulo(t).getLowBitsUnsigned();
|
|
2826
2826
|
return n;
|
|
2827
2827
|
}
|
|
2828
2828
|
/**
|
|
@@ -2946,7 +2946,7 @@ function $s(e, t, n, s, o) {
|
|
|
2946
2946
|
* =============================================================================
|
|
2947
2947
|
*/
|
|
2948
2948
|
function Us(e, t, n, s) {
|
|
2949
|
-
const o =
|
|
2949
|
+
const o = Yt(t, n)[0], a = [1, n[0], 1];
|
|
2950
2950
|
for (let m = 0; m < o; m++)
|
|
2951
2951
|
a[0] *= n[m];
|
|
2952
2952
|
a[1] = n[o];
|
|
@@ -3040,15 +3040,15 @@ const Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3040
3040
|
scatterImpl: Es,
|
|
3041
3041
|
sigmoidImpl: Fs,
|
|
3042
3042
|
simpleAbsImpl: le,
|
|
3043
|
-
sliceImpl:
|
|
3043
|
+
sliceImpl: qe,
|
|
3044
3044
|
sparseFillEmptyRowsImpl: Ns,
|
|
3045
3045
|
sparseReshapeImpl: vs,
|
|
3046
3046
|
sparseSegmentReductionImpl: Ss,
|
|
3047
3047
|
sqrtImpl: Ts,
|
|
3048
|
-
squaredDifferenceImpl:
|
|
3048
|
+
squaredDifferenceImpl: Pe,
|
|
3049
3049
|
staticRegexReplaceImpl: Ae,
|
|
3050
3050
|
stridedSliceImpl: Ls,
|
|
3051
|
-
stringNGramsImpl:
|
|
3051
|
+
stringNGramsImpl: Ps,
|
|
3052
3052
|
stringSplitImpl: _s,
|
|
3053
3053
|
stringToHashBucketFastImpl: Vs,
|
|
3054
3054
|
subImpl: _e,
|
|
@@ -3067,7 +3067,7 @@ export {
|
|
|
3067
3067
|
vs as F,
|
|
3068
3068
|
Ss as G,
|
|
3069
3069
|
Ls as H,
|
|
3070
|
-
|
|
3070
|
+
Ps as I,
|
|
3071
3071
|
_s as J,
|
|
3072
3072
|
Vs as K,
|
|
3073
3073
|
Ws as L,
|
|
@@ -3079,7 +3079,7 @@ export {
|
|
|
3079
3079
|
no as R,
|
|
3080
3080
|
to as S,
|
|
3081
3081
|
so as T,
|
|
3082
|
-
|
|
3082
|
+
Ys as U,
|
|
3083
3083
|
oo as V,
|
|
3084
3084
|
ro as W,
|
|
3085
3085
|
ao as X,
|
|
@@ -3087,7 +3087,7 @@ export {
|
|
|
3087
3087
|
lo as Z,
|
|
3088
3088
|
co as _,
|
|
3089
3089
|
nt as a,
|
|
3090
|
-
|
|
3090
|
+
Js as a0,
|
|
3091
3091
|
ho as a1,
|
|
3092
3092
|
fo as a2,
|
|
3093
3093
|
go as a3,
|
|
@@ -3097,7 +3097,7 @@ export {
|
|
|
3097
3097
|
Io as a7,
|
|
3098
3098
|
bo as a8,
|
|
3099
3099
|
Eo as a9,
|
|
3100
|
-
|
|
3100
|
+
Qs as aa,
|
|
3101
3101
|
Fo as ab,
|
|
3102
3102
|
yo as ac,
|
|
3103
3103
|
ko as ad,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as e, C as u,
|
|
1
|
+
import { B as e, C as u, $ as c, E as l, a0 as m } from "./index-CUQrfsw_.js";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2018 Google LLC. All Rights Reserved.
|
|
@@ -18,8 +18,8 @@ import { B as e, C as u, X as c, E as l, Y as m } from "./index-BoWRt-10.js";
|
|
|
18
18
|
function i(t, n = null, o = !1) {
|
|
19
19
|
let s = u(t, "x", "sum");
|
|
20
20
|
s.dtype === "bool" && (s = c(s, "int32"));
|
|
21
|
-
const
|
|
22
|
-
return l.runKernel(m,
|
|
21
|
+
const a = { x: s }, r = { axis: n, keepDims: o };
|
|
22
|
+
return l.runKernel(m, a, r);
|
|
23
23
|
}
|
|
24
24
|
const f = /* @__PURE__ */ e({ sum_: i });
|
|
25
25
|
export {
|
package/dist/training/Adam.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { adamAdjust as b } from "../ops/adamAdjust.js";
|
|
2
2
|
import { adamMoments as d } from "../ops/adamMoments.js";
|
|
3
|
-
import { O as g, e as h, t as o, d as B } from "../index-
|
|
4
|
-
import { z as M } from "../zeros
|
|
3
|
+
import { O as g, e as h, t as o, d as B } from "../index-CUQrfsw_.js";
|
|
4
|
+
import { z as M } from "../zeros-VZ72lWXM.js";
|
|
5
5
|
/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2018 Google LLC. All Rights Reserved.
|
package/dist/training/AdamExt.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { default as NanoGPT } from '../NanoGPTModel';
|
|
2
1
|
import { Dataset } from '@tensorflow/tfjs-data';
|
|
3
2
|
import { TensorContainer } from '@tensorflow/tfjs-core';
|
|
3
|
+
import { default as Model, ModelForwardAttributes } from '../models/model';
|
|
4
4
|
export default class Evaluator {
|
|
5
5
|
private model;
|
|
6
6
|
private iterator;
|
|
7
|
-
constructor(model:
|
|
7
|
+
constructor(model: Model<ModelForwardAttributes>, dataset: Dataset<TensorContainer>);
|
|
8
8
|
evaluate(maxBatches?: number): Promise<number>;
|
|
9
9
|
}
|