@genai-fi/nanogpt 0.7.3 → 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.
Files changed (173) hide show
  1. package/dist/Generator.d.ts +25 -2
  2. package/dist/Generator.js +150 -49
  3. package/dist/{RealDiv-Dy0p8Bvo.js → RealDiv-N8TpOMYv.js} +14 -14
  4. package/dist/{Reshape-DvudQDvJ.js → Reshape-B-lWQRnF.js} +1 -1
  5. package/dist/{Reshape-DH5srBP0.js → Reshape-Bo8HzP8V.js} +5 -5
  6. package/dist/TeachableLLM.d.ts +6 -6
  7. package/dist/TeachableLLM.js +31 -31
  8. package/dist/Trainer.d.ts +13 -2
  9. package/dist/Trainer.js +21 -12
  10. package/dist/{axis_util-BzbKo31C.js → axis_util-DubwyOhW.js} +3 -3
  11. package/dist/backend.js +2 -2
  12. package/dist/{backend_util-TE7aTPhZ.js → backend_util-BJ-_jSeK.js} +46 -46
  13. package/dist/{broadcast_to-CdbwV-Dj.js → broadcast_to-BYfCp5iL.js} +2 -2
  14. package/dist/{concat-CsxrgovM.js → concat-BmDqqFsa.js} +1 -1
  15. package/dist/{dataset-CtdBYwjo.js → dataset-CJmEGu6D.js} +5 -5
  16. package/dist/{dropout-DYs5QFGQ.js → dropout-sx0sjVAT.js} +8 -8
  17. package/dist/exports_initializers-DAKM8UO9.js +16 -0
  18. package/dist/{gather-CMMy2KEG.js → gather-C1siEkdp.js} +1 -1
  19. package/dist/{gelu-C-dPj6Ku.js → gelu-Bd3UBBxg.js} +1 -1
  20. package/dist/{gpgpu_math-DGNLNL4I.js → gpgpu_math-TFLxaLkw.js} +26 -26
  21. package/dist/{index-CLthM0TO.js → index-BaPo_0H8.js} +185 -185
  22. package/dist/{index-BoWRt-10.js → index-CUQrfsw_.js} +266 -265
  23. package/dist/{kernel_funcs_utils-BYKWV8Aa.js → kernel_funcs_utils-P9aFa232.js} +9 -9
  24. package/dist/layers/BaseLayer.d.ts +8 -13
  25. package/dist/layers/BaseLayer.js +25 -13
  26. package/dist/layers/CausalSelfAttention.d.ts +3 -2
  27. package/dist/layers/CausalSelfAttention.js +28 -28
  28. package/dist/layers/MLP.d.ts +3 -2
  29. package/dist/layers/MLP.js +16 -20
  30. package/dist/layers/PositionEmbedding.d.ts +9 -0
  31. package/dist/layers/PositionEmbedding.js +45 -0
  32. package/dist/layers/RMSNorm.d.ts +3 -2
  33. package/dist/layers/RMSNorm.js +6 -6
  34. package/dist/layers/RoPECache.d.ts +1 -1
  35. package/dist/layers/RoPECache.js +4 -4
  36. package/dist/layers/TiedEmbedding.d.ts +3 -2
  37. package/dist/layers/TiedEmbedding.js +29 -7
  38. package/dist/layers/TransformerBlock.d.ts +3 -2
  39. package/dist/layers/TransformerBlock.js +1 -1
  40. package/dist/loader/load.d.ts +2 -2
  41. package/dist/loader/loadHF.d.ts +2 -2
  42. package/dist/loader/loadTransformers.d.ts +4 -2
  43. package/dist/loader/loadTransformers.js +10 -9
  44. package/dist/loader/newZipLoad.d.ts +2 -2
  45. package/dist/loader/oldZipLoad.d.ts +2 -2
  46. package/dist/loader/oldZipLoad.js +42 -51
  47. package/dist/loader/save.d.ts +8 -0
  48. package/dist/loader/save.js +62 -0
  49. package/dist/{log_sum_exp-DbjkV734.js → log_sum_exp-C142qZqY.js} +14 -14
  50. package/dist/main.d.ts +5 -4
  51. package/dist/main.js +22 -18
  52. package/dist/{mat_mul-8m8pfdcx.js → mat_mul-DMkduNJu.js} +1 -1
  53. package/dist/{max-Ddnnb5xe.js → max-B3JOcNGb.js} +1 -1
  54. package/dist/mod-uUuj4gSb.js +27 -0
  55. package/dist/models/NanoGPTV1.d.ts +15 -0
  56. package/dist/models/NanoGPTV1.js +71 -0
  57. package/dist/{config.d.ts → models/config.d.ts} +1 -0
  58. package/dist/{config.js → models/config.js} +1 -0
  59. package/dist/models/factory.d.ts +3 -0
  60. package/dist/models/factory.js +14 -0
  61. package/dist/models/model.d.ts +26 -0
  62. package/dist/models/model.js +68 -0
  63. package/dist/{mulmat_packed_gpu-VSekgsNv.js → mulmat_packed_gpu-Cm2gw-c8.js} +1 -1
  64. package/dist/{ones-Dj0SDhHf.js → ones-ZdgQGBCP.js} +2 -2
  65. package/dist/ops/adamAdjust.js +1 -1
  66. package/dist/ops/adamMoments.js +1 -1
  67. package/dist/ops/appendCache.js +3 -3
  68. package/dist/ops/attentionMask.js +1 -1
  69. package/dist/ops/cpu/adamAdjust.js +9 -9
  70. package/dist/ops/cpu/adamMoments.js +2 -2
  71. package/dist/ops/cpu/appendCache.js +2 -2
  72. package/dist/ops/cpu/attentionMask.js +5 -5
  73. package/dist/ops/cpu/fusedSoftmax.js +2 -2
  74. package/dist/ops/cpu/gatherSub.js +3 -3
  75. package/dist/ops/cpu/gelu.js +1 -1
  76. package/dist/ops/cpu/matMulGelu.js +2 -2
  77. package/dist/ops/cpu/matMulMul.js +1 -1
  78. package/dist/ops/cpu/mulDropout.js +1 -1
  79. package/dist/ops/cpu/normRMS.js +1 -1
  80. package/dist/ops/cpu/qkv.js +3 -3
  81. package/dist/ops/cpu/rope.js +5 -5
  82. package/dist/ops/cpu/scatterSub.js +11 -11
  83. package/dist/ops/fusedSoftmax.js +1 -1
  84. package/dist/ops/gatherSub.js +1 -1
  85. package/dist/ops/gelu.js +2 -2
  86. package/dist/ops/grads/attentionMask.js +1 -1
  87. package/dist/ops/grads/fusedSoftmax.js +2 -2
  88. package/dist/ops/grads/gelu.js +2 -2
  89. package/dist/ops/grads/matMulGelu.js +1 -1
  90. package/dist/ops/grads/normRMS.js +1 -1
  91. package/dist/ops/grads/qkv.js +1 -1
  92. package/dist/ops/grads/rope.js +1 -1
  93. package/dist/ops/matMulGelu.js +1 -1
  94. package/dist/ops/matMulMul.js +1 -1
  95. package/dist/ops/mulDrop.js +1 -1
  96. package/dist/ops/normRMS.js +1 -1
  97. package/dist/ops/qkv.js +1 -1
  98. package/dist/ops/rope.js +4 -4
  99. package/dist/ops/scatterSub.js +1 -1
  100. package/dist/ops/webgl/adamAdjust.js +2 -2
  101. package/dist/ops/webgl/adamMoments.js +1 -1
  102. package/dist/ops/webgl/appendCache.js +1 -1
  103. package/dist/ops/webgl/attentionMask.js +1 -1
  104. package/dist/ops/webgl/fusedSoftmax.js +4 -4
  105. package/dist/ops/webgl/gatherSub.js +1 -1
  106. package/dist/ops/webgl/gelu.js +2 -2
  107. package/dist/ops/webgl/log.js +3 -3
  108. package/dist/ops/webgl/matMulGelu.js +10 -10
  109. package/dist/ops/webgl/matMulMul.js +1 -1
  110. package/dist/ops/webgl/mulDropout.js +1 -1
  111. package/dist/ops/webgl/normRMS.js +2 -2
  112. package/dist/ops/webgl/qkv.js +1 -1
  113. package/dist/ops/webgl/rope.js +1 -1
  114. package/dist/ops/webgl/scatterSub.js +1 -1
  115. package/dist/ops/webgpu/adamAdjust.js +3 -3
  116. package/dist/ops/webgpu/adamMoments.js +3 -3
  117. package/dist/ops/webgpu/appendCache.js +3 -3
  118. package/dist/ops/webgpu/attentionMask.js +3 -3
  119. package/dist/ops/webgpu/gatherSub.js +3 -3
  120. package/dist/ops/webgpu/gelu.js +3 -3
  121. package/dist/ops/webgpu/normRMS.js +2 -2
  122. package/dist/ops/webgpu/normRMSGrad.js +5 -5
  123. package/dist/ops/webgpu/qkv.js +3 -3
  124. package/dist/ops/webgpu/rope.js +3 -3
  125. package/dist/ops/webgpu/scatterSub.js +3 -3
  126. package/dist/ops/webgpu/utils/reductions.js +4 -4
  127. package/dist/{ops-BFGCx8Ri.js → ops-C_1K_-35.js} +103 -103
  128. package/dist/{random_width-sZORGo5k.js → random_width-D8Pwy_na.js} +136 -136
  129. package/dist/{range-CRuAh-gd.js → range-LVHrSLdi.js} +1 -1
  130. package/dist/{reciprocal-BvGAyKyu.js → reciprocal-CaR9e67G.js} +1 -1
  131. package/dist/{register_all_kernels-BwDSRN-f.js → register_all_kernels-DUshvVWP.js} +2026 -2049
  132. package/dist/{reshape-CdBq1WJ6.js → reshape-DEfQGSin.js} +1 -1
  133. package/dist/{scatter_nd_util-DUstGbU1.js → scatter_nd_util-CUPPNLaA.js} +1 -1
  134. package/dist/{selu_util-BJEXVvjX.js → selu_util-8vv5JxQV.js} +3 -3
  135. package/dist/{shared-B8ztnyEk.js → shared-CkNorDcU.js} +83 -83
  136. package/dist/{shared-wS99K7_n.js → shared-D1elLckx.js} +1 -1
  137. package/dist/{sin-BeA3tsEd.js → sin-D2CKKmyR.js} +1 -1
  138. package/dist/{slice-BiOsknYS.js → slice-BnyE-M_7.js} +1 -1
  139. package/dist/{softmax-Bv_6lyMX.js → softmax-DLoZWYBx.js} +1 -1
  140. package/dist/{split-B-dikLRw.js → split-By_n4TKP.js} +1 -1
  141. package/dist/{stack-B17UN2nn.js → stack-DkdFLq37.js} +1 -1
  142. package/dist/{sum-66ew2byf.js → sum-l_0SqM4h.js} +3 -3
  143. package/dist/{tensor-JwS7ZYY6.js → tensor-BAQdLqoU.js} +1 -1
  144. package/dist/{tensor2d-wxPAnDQy.js → tensor2d-BHy261cI.js} +1 -1
  145. package/dist/training/Adam.js +2 -2
  146. package/dist/training/AdamExt.js +1 -1
  147. package/dist/training/DatasetBuilder.js +2 -2
  148. package/dist/training/Evaluator.d.ts +2 -2
  149. package/dist/training/FullTrainer.d.ts +3 -3
  150. package/dist/training/FullTrainer.js +61 -69
  151. package/dist/training/Trainer.d.ts +15 -3
  152. package/dist/training/Trainer.js +39 -47
  153. package/dist/training/sparseCrossEntropy.js +9 -9
  154. package/dist/utilities/dummy.d.ts +4 -4
  155. package/dist/utilities/dummy.js +13 -13
  156. package/dist/utilities/multinomialCPU.js +2 -2
  157. package/dist/utilities/parameters.d.ts +1 -1
  158. package/dist/utilities/performance.js +1 -1
  159. package/dist/utilities/profile.js +1 -1
  160. package/dist/utilities/safetensors.js +2 -2
  161. package/dist/utilities/weights.js +2 -2
  162. package/dist/{variable-BuddVFLa.js → variable-C9hihzDB.js} +1 -1
  163. package/dist/{webgpu_program-PFzf1hAQ.js → webgpu_program-dFEVbDPL.js} +1 -1
  164. package/dist/{webgpu_util-D____QpY.js → webgpu_util-DLImlSc6.js} +27 -27
  165. package/dist/{zeros--BdLQ3oG.js → zeros-VZ72lWXM.js} +1 -1
  166. package/package.json +2 -3
  167. package/dist/NanoGPTModel.d.ts +0 -52
  168. package/dist/NanoGPTModel.js +0 -203
  169. package/dist/TiedEmbedding-BxOerUmB.js +0 -43
  170. package/dist/utilities/generate.d.ts +0 -3
  171. package/dist/utilities/generate.js +0 -22
  172. package/dist/utilities/save.d.ts +0 -9
  173. package/dist/utilities/save.js +0 -61
@@ -1,4 +1,4 @@
1
- import { B as o, C as t, E as a, K as p } from "./index-BoWRt-10.js";
1
+ import { B as o, C as t, E as a, U as p } from "./index-CUQrfsw_.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2020 Google LLC. All Rights Reserved.
@@ -1,4 +1,4 @@
1
- import { j as p, a1 as w } from "./index-BoWRt-10.js";
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 { l as N, aq as H, B as _, C as S, E as L, ar as te, as as ne, an as se, ap as re, at as ie, au as oe, av as le, a as ue, aw as fe, ax as O } from "./index-BoWRt-10.js";
2
- import { r as ce } from "./reshape-CdBq1WJ6.js";
3
- import { s as ae } from "./sum-66ew2byf.js";
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 { l as Lt, bf as Ce, j as V, k as Pt, a1 as H, bg as et, aa as ht, bh as dt, bi as at, a6 as De, a7 as st, am as We, b2 as $e, bj as Ue, bk as ze, bl as Be, bm as qt, al as K, bn as At, bo as W, bp as _t, bq as Vt, ae as Ct, br as Dt, ak as Wt, bs as $t, aW as Ut, aX as zt, aZ as Bt, a_ as jt, af as Gt, bt as Zt, b1 as Kt, bu as Ht, a$ as je, ao as Ge, bv as Xt, b5 as Ze, bw as Ke, p as Jt, u as He, t as Xe, bx as Qt, by as It, ar as Yt, W as Je, bz as te, bA as ee, bB as ne, aM as pt, bC as se, bD as ot } from "./index-BoWRt-10.js";
2
- import { f as it, m as kt, g as Qe, a as Ye, 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-TE7aTPhZ.js";
3
- import { g as pn, a as wn, e as In, c as bn } from "./axis_util-BzbKo31C.js";
4
- import { b as xn } from "./broadcast_to-CdbwV-Dj.js";
5
- import { r as En } from "./reshape-CdBq1WJ6.js";
6
- import { p as Fn, q as yn, r as kn, u as Nn } from "./selu_util-BJEXVvjX.js";
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, q = 0; q < I.length; q += 8) {
369
- var U = Math.min(8, I.length - q), j = parseInt(I.substring(q, q + U), E);
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), q = this, U = ""; ; ) {
416
- var j = q.div(R), C = q.sub(j.mul(R)).toInt() >>> 0, P = C.toString(c);
417
- if (q = j, q.isZero())
418
- return P + U;
419
- for (; P.length < 6; )
420
- P = "0" + P;
421
- U = "" + P + 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, q = c.high >>> 16, U = c.high & 65535, j = c.low >>> 16, C = c.low & 65535, P = 0, G = 0, _ = 0, B = 0;
484
- return B += R + C, _ += B >>> 16, B &= 65535, _ += L + j, G += _ >>> 16, _ &= 65535, G += N + U, P += G >>> 16, G &= 65535, P += E + q, P &= 65535, i(_ << 16 | B, P << 16 | G, this.unsigned);
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, q = this.low & 65535, U = c.high >>> 16, j = c.high & 65535, C = c.low >>> 16, P = c.low & 65535, G = 0, _ = 0, B = 0, ct = 0;
512
- return ct += q * P, B += ct >>> 16, ct &= 65535, B += R * P, _ += B >>> 16, B &= 65535, B += q * C, _ += B >>> 16, B &= 65535, _ += L * P, G += _ >>> 16, _ &= 65535, _ += R * C, G += _ >>> 16, _ &= 65535, _ += q * j, G += _ >>> 16, _ &= 65535, G += N * P + L * C + R * j + q * U, G &= 65535, i(B << 16 | ct, G << 16 | _, this.unsigned);
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 q = this.shr(1);
543
- return N = q.div(c).shl(1), N.eq(g) ? c.isNegative() ? k : v : (L = this.sub(c.mul(N)), R = N.add(L.div(c)), R);
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), P = C.mul(c); P.isNegative() || P.gt(L); )
555
- N -= j, C = r(N, this.unsigned), P = C.mul(c);
556
- C.isZero() && (C = k), R = R.add(C), L = L.sub(P);
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"), Y = gt("b492b66fbe98f273"), D = gt("9ae16a3b2f90404f");
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 J(e, t, n = gt("9ddfea08eb382d69")) {
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 J(a, r, n);
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 J(s.shl(3).add(t), St(e, t - 4), n);
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(Y), o = T(e, 8), a = T(e, t - 8).mul(n), r = T(e, t - 16).mul(D);
712
- return J(A(s.add(o), 43).add(A(a, 30)).add(r), s.add(A(o.add(D), 18)).add(a), n);
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 Pn(e, t);
724
- let s = n, o = n.mul(Y).add(113), a = bt(o.mul(D).add(113)).mul(D), r = [tt.UZERO, tt.UZERO], i = [tt.UZERO, tt.UZERO];
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(Y), o = A(o.add(r[1]).add(T(e, l + 48)), 42).mul(Y), s = s.xor(i[1]), o = o.add(r[0]).add(T(e, l + 40)), a = A(a.add(i[0]), 33).mul(Y), r = ut(e, l, r[1].mul(Y), 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;
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 = Y.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], J(J(r[0], i[0], f).add(bt(o).mul(ae)).add(a), J(r[1], i[1], f).add(s), f);
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 = Pt(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);
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 Js = {
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 Qs = {
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 Ys = {
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 = Pt(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);
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(qt, he, _n), eo = {
1051
- kernelName: qt,
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 Q(e, s, n);
1155
+ return J(e, s, n);
1156
1156
  }
1157
- function Q(e, t, n) {
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 = Q(_t, ge), so = {
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 = Q(Ct, pe, "float32"), ro = {
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 = Q(Dt, we), ao = {
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 = Q(Wt, Ie), io = {
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), Jn = z(zt, Ee, null, "bool"), uo = {
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: Jn
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), Qn = z(Bt, Fe, null, "bool"), ho = {
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: Qn
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), Yn = z(jt, ye, null, "bool"), fo = {
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: Yn
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 = Q(Gt, ke), go = {
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 = Jt(a, o.shape), u = pn(l, i);
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 = Qe(h), this.raggedRank = Ye(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 = Q(Qt, Le), Fo = {
2240
- kernelName: Qt,
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(Yt, (e) => 1 / (1 + Math.exp(-e))), yo = {
2297
- kernelName: Yt,
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 Pe(e, t, n, s, o) {
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 = Pe(u, i, l, o.shape, o.dtype);
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: Je,
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 qe = $((e, t) => {
2581
+ const Pe = $((e, t) => {
2582
2582
  const n = e - t;
2583
2583
  return n * n;
2584
- }), Ms = z(ee, qe), vo = {
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 = Q(ne, Ae), So = {
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 Ps {
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 qs(e, t, n, s, o, a, r, i) {
2746
- return new Ps(n, s, o, a, r, i).compute(e, t);
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] = qn(e[s]).modulo(t).getLowBitsUnsigned();
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 = Jt(t, n)[0], a = [1, n[0], 1];
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: Pe,
3043
+ sliceImpl: qe,
3044
3044
  sparseFillEmptyRowsImpl: Ns,
3045
3045
  sparseReshapeImpl: vs,
3046
3046
  sparseSegmentReductionImpl: Ss,
3047
3047
  sqrtImpl: Ts,
3048
- squaredDifferenceImpl: qe,
3048
+ squaredDifferenceImpl: Pe,
3049
3049
  staticRegexReplaceImpl: Ae,
3050
3050
  stridedSliceImpl: Ls,
3051
- stringNGramsImpl: qs,
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
- qs as I,
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
- Js as U,
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
- Qs as a0,
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
- Ys as aa,
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 { s as l } from "./shared-B8ztnyEk.js";
1
+ import { s as l } from "./shared-CkNorDcU.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2020 Google LLC. All Rights Reserved.
@@ -1,4 +1,4 @@
1
- import { B as o, C as t, E as c, a8 as a, a9 as e } from "./index-BoWRt-10.js";
1
+ import { B as o, C as t, E as c, ab as a, ac as e } from "./index-CUQrfsw_.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2018 Google LLC. All Rights Reserved.
@@ -1,4 +1,4 @@
1
- import { B as c, C as e, E as a, W as l } from "./index-BoWRt-10.js";
1
+ import { B as c, C as e, E as a, _ as l } from "./index-CUQrfsw_.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2018 Google LLC. All Rights Reserved.
@@ -1,4 +1,4 @@
1
- import { B as r, C as f, E as e, S as i } from "./index-BoWRt-10.js";
1
+ import { B as r, C as f, E as e, S as i } from "./index-CUQrfsw_.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2018 Google LLC. All Rights Reserved.
@@ -1,4 +1,4 @@
1
- import { B as p, C as i, E as a, L as c } from "./index-BoWRt-10.js";
1
+ import { B as p, C as i, E as a, V as c } from "./index-CUQrfsw_.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2020 Google LLC. All Rights Reserved.
@@ -1,4 +1,4 @@
1
- import { B as e, D as c, l as n, E as k, P as i } from "./index-BoWRt-10.js";
1
+ import { B as e, D as c, n, E as k, P as i } from "./index-CUQrfsw_.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2020 Google LLC. All Rights Reserved.
@@ -1,4 +1,4 @@
1
- import { B as e, C as u, X as c, E as l, Y as m } from "./index-BoWRt-10.js";
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 r = { x: s }, a = { axis: n, keepDims: o };
22
- return l.runKernel(m, r, a);
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 {
@@ -1,4 +1,4 @@
1
- import { Z as t, _ as a } from "./index-BoWRt-10.js";
1
+ import { z as t, A as a } from "./index-CUQrfsw_.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2018 Google LLC. All Rights Reserved.
@@ -1,4 +1,4 @@
1
- import { $ as t, Z as s, _ as a } from "./index-BoWRt-10.js";
1
+ import { y as t, z as s, A as a } from "./index-CUQrfsw_.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2018 Google LLC. All Rights Reserved.
@@ -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-BoWRt-10.js";
4
- import { z as M } from "../zeros--BdLQ3oG.js";
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.
@@ -1,4 +1,4 @@
1
- import { a as r, b as c, c as h, e as o } from "../index-BoWRt-10.js";
1
+ import { a as r, b as c, c as h, e as o } from "../index-CUQrfsw_.js";
2
2
  import { AdamOptimizer as g } from "./Adam.js";
3
3
  class y extends g {
4
4
  constructor(t, e, s, i, a) {
@@ -1,5 +1,5 @@
1
- import { t as g } from "../index-BoWRt-10.js";
2
- import { d as u, i as d } from "../dataset-CtdBYwjo.js";
1
+ import { t as g } from "../index-CUQrfsw_.js";
2
+ import { d as u, i as d } from "../dataset-CJmEGu6D.js";
3
3
  import "../index-Tf7vU29b.js";
4
4
  /**
5
5
  * @license
@@ -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: NanoGPT, dataset: Dataset<TensorContainer>);
7
+ constructor(model: Model<ModelForwardAttributes>, dataset: Dataset<TensorContainer>);
8
8
  evaluate(maxBatches?: number): Promise<number>;
9
9
  }
@@ -1,10 +1,10 @@
1
1
  import { ITokeniser } from '../tokeniser/type';
2
- import { default as NanoGPT, TrainingLogEntry } from '../NanoGPTModel';
3
- import { default as GPTTrainer, TrainingOptions, TrainingProgress } from './Trainer';
2
+ import { default as GPTTrainer, TrainingLogEntry, TrainingOptions, TrainingProgress } from './Trainer';
4
3
  import { Tensor } from '@tensorflow/tfjs-core';
5
4
  import { Dataset } from '@tensorflow/tfjs-data';
5
+ import { default as Model, ModelForwardAttributes } from '../models/model';
6
6
  export default class FullTrainer extends GPTTrainer {
7
- constructor(model: NanoGPT, tokenizer: ITokeniser, learningRate?: number);
7
+ constructor(model: Model<ModelForwardAttributes>, tokenizer: ITokeniser, learningRate?: number);
8
8
  private createEmptyState;
9
9
  private createLogEntry;
10
10
  private createProgress;