@genai-fi/nanogpt 0.7.3 → 0.8.1

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 (197) hide show
  1. package/dist/Generator.d.ts +25 -2
  2. package/dist/Generator.js +152 -49
  3. package/dist/{RealDiv-Dy0p8Bvo.js → RealDiv-D_q39E3A.js} +13 -13
  4. package/dist/{Reshape-DvudQDvJ.js → Reshape-41YpQqEo.js} +1 -1
  5. package/dist/{Reshape-DH5srBP0.js → Reshape-Bh_jzKzV.js} +5 -5
  6. package/dist/TeachableLLM.d.ts +6 -6
  7. package/dist/TeachableLLM.js +33 -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-Did9235A.js} +3 -3
  11. package/dist/backend.js +2 -2
  12. package/dist/{backend_util-TE7aTPhZ.js → backend_util-yC3YH1jo.js} +58 -58
  13. package/dist/{broadcast_to-CdbwV-Dj.js → broadcast_to-CUvOdOT5.js} +2 -2
  14. package/dist/checks/appendCache.d.ts +1 -0
  15. package/dist/checks/appendCache.js +22 -0
  16. package/dist/checks/attentionMask.d.ts +1 -0
  17. package/dist/checks/attentionMask.js +37 -0
  18. package/dist/checks/check.d.ts +9 -0
  19. package/dist/checks/check.js +20 -0
  20. package/dist/checks/gelu.d.ts +1 -0
  21. package/dist/checks/gelu.js +18 -0
  22. package/dist/checks/index.d.ts +19 -0
  23. package/dist/checks/index.js +21 -0
  24. package/dist/checks/normRMS.d.ts +1 -0
  25. package/dist/checks/normRMS.js +16 -0
  26. package/dist/checks/normRMSGrad.d.ts +1 -0
  27. package/dist/checks/normRMSGrad.js +12 -0
  28. package/dist/checks/qkv.d.ts +1 -0
  29. package/dist/checks/qkv.js +25 -0
  30. package/dist/checks/rope.d.ts +1 -0
  31. package/dist/checks/rope.js +21 -0
  32. package/dist/{concat-CsxrgovM.js → concat-pHiVqR3L.js} +1 -1
  33. package/dist/{dataset-CtdBYwjo.js → dataset-DPPl-iLT.js} +9 -9
  34. package/dist/{dropout-DYs5QFGQ.js → dropout-CcKSfOYE.js} +18 -18
  35. package/dist/exports_initializers-DKk7-bsx.js +16 -0
  36. package/dist/{gather-CMMy2KEG.js → gather-CPg6ZlQA.js} +1 -1
  37. package/dist/{gelu-C-dPj6Ku.js → gelu-BkcmEEyD.js} +1 -1
  38. package/dist/{gpgpu_math-DGNLNL4I.js → gpgpu_math-D_ODOLix.js} +26 -26
  39. package/dist/{index-BoWRt-10.js → index-DdmHGZjq.js} +659 -650
  40. package/dist/{index-CLthM0TO.js → index-evZ57wr4.js} +185 -185
  41. package/dist/{kernel_funcs_utils-BYKWV8Aa.js → kernel_funcs_utils-CDfFpUab.js} +21 -21
  42. package/dist/layers/BaseLayer.d.ts +8 -13
  43. package/dist/layers/BaseLayer.js +25 -13
  44. package/dist/layers/CausalSelfAttention.d.ts +3 -2
  45. package/dist/layers/CausalSelfAttention.js +28 -28
  46. package/dist/layers/MLP.d.ts +3 -2
  47. package/dist/layers/MLP.js +16 -20
  48. package/dist/layers/PositionEmbedding.d.ts +9 -0
  49. package/dist/layers/PositionEmbedding.js +45 -0
  50. package/dist/layers/RMSNorm.d.ts +3 -2
  51. package/dist/layers/RMSNorm.js +6 -6
  52. package/dist/layers/RoPECache.d.ts +1 -1
  53. package/dist/layers/RoPECache.js +4 -4
  54. package/dist/layers/TiedEmbedding.d.ts +3 -2
  55. package/dist/layers/TiedEmbedding.js +29 -7
  56. package/dist/layers/TransformerBlock.d.ts +3 -2
  57. package/dist/layers/TransformerBlock.js +1 -1
  58. package/dist/loader/load.d.ts +2 -2
  59. package/dist/loader/loadHF.d.ts +2 -2
  60. package/dist/loader/loadTransformers.d.ts +4 -2
  61. package/dist/loader/loadTransformers.js +10 -9
  62. package/dist/loader/newZipLoad.d.ts +2 -2
  63. package/dist/loader/oldZipLoad.d.ts +2 -2
  64. package/dist/loader/oldZipLoad.js +44 -51
  65. package/dist/loader/save.d.ts +8 -0
  66. package/dist/loader/save.js +62 -0
  67. package/dist/{log_sum_exp-DbjkV734.js → log_sum_exp-C8yFJfZz.js} +45 -24
  68. package/dist/main.d.ts +6 -4
  69. package/dist/main.js +24 -18
  70. package/dist/{mat_mul-8m8pfdcx.js → mat_mul-Dpy2mMRu.js} +1 -1
  71. package/dist/mod-CbibJi3D.js +27 -0
  72. package/dist/models/NanoGPTV1.d.ts +15 -0
  73. package/dist/models/NanoGPTV1.js +71 -0
  74. package/dist/{config.d.ts → models/config.d.ts} +1 -0
  75. package/dist/{config.js → models/config.js} +1 -0
  76. package/dist/models/factory.d.ts +3 -0
  77. package/dist/models/factory.js +14 -0
  78. package/dist/models/model.d.ts +26 -0
  79. package/dist/models/model.js +70 -0
  80. package/dist/{mulmat_packed_gpu-VSekgsNv.js → mulmat_packed_gpu-q_Gmwyld.js} +1 -1
  81. package/dist/{ones-Dj0SDhHf.js → ones-BAqVh-eA.js} +2 -2
  82. package/dist/ops/adamAdjust.js +1 -1
  83. package/dist/ops/adamMoments.js +1 -1
  84. package/dist/ops/appendCache.js +3 -3
  85. package/dist/ops/attentionMask.js +1 -1
  86. package/dist/ops/cpu/adamAdjust.js +9 -9
  87. package/dist/ops/cpu/adamMoments.js +2 -2
  88. package/dist/ops/cpu/appendCache.js +2 -2
  89. package/dist/ops/cpu/attentionMask.js +5 -5
  90. package/dist/ops/cpu/fusedSoftmax.js +2 -2
  91. package/dist/ops/cpu/gatherSub.js +5 -5
  92. package/dist/ops/cpu/gelu.js +1 -1
  93. package/dist/ops/cpu/matMulGelu.js +2 -2
  94. package/dist/ops/cpu/matMulMul.js +1 -1
  95. package/dist/ops/cpu/mulDropout.js +1 -1
  96. package/dist/ops/cpu/normRMS.js +1 -1
  97. package/dist/ops/cpu/qkv.js +3 -3
  98. package/dist/ops/cpu/rope.js +5 -5
  99. package/dist/ops/cpu/scatterSub.js +7 -7
  100. package/dist/ops/fusedSoftmax.js +1 -1
  101. package/dist/ops/gatherSub.js +1 -1
  102. package/dist/ops/gelu.js +2 -2
  103. package/dist/ops/grads/attentionMask.js +1 -1
  104. package/dist/ops/grads/fusedSoftmax.js +2 -2
  105. package/dist/ops/grads/gelu.js +2 -2
  106. package/dist/ops/grads/matMulGelu.js +1 -1
  107. package/dist/ops/grads/normRMS.js +1 -1
  108. package/dist/ops/grads/qkv.js +1 -1
  109. package/dist/ops/grads/rope.js +1 -1
  110. package/dist/ops/matMulGelu.js +1 -1
  111. package/dist/ops/matMulMul.js +1 -1
  112. package/dist/ops/mulDrop.js +1 -1
  113. package/dist/ops/normRMS.js +1 -1
  114. package/dist/ops/qkv.js +1 -1
  115. package/dist/ops/rope.js +4 -4
  116. package/dist/ops/scatterSub.js +1 -1
  117. package/dist/ops/webgl/adamAdjust.js +2 -2
  118. package/dist/ops/webgl/adamMoments.js +1 -1
  119. package/dist/ops/webgl/appendCache.js +1 -1
  120. package/dist/ops/webgl/attentionMask.js +1 -1
  121. package/dist/ops/webgl/fusedSoftmax.js +4 -4
  122. package/dist/ops/webgl/gatherSub.js +1 -1
  123. package/dist/ops/webgl/gelu.js +2 -2
  124. package/dist/ops/webgl/log.js +3 -3
  125. package/dist/ops/webgl/matMulGelu.js +10 -10
  126. package/dist/ops/webgl/matMulMul.js +1 -1
  127. package/dist/ops/webgl/mulDropout.js +1 -1
  128. package/dist/ops/webgl/normRMS.js +2 -2
  129. package/dist/ops/webgl/qkv.js +1 -1
  130. package/dist/ops/webgl/rope.js +1 -1
  131. package/dist/ops/webgl/scatterSub.js +1 -1
  132. package/dist/ops/webgpu/adamAdjust.js +3 -3
  133. package/dist/ops/webgpu/adamMoments.js +3 -3
  134. package/dist/ops/webgpu/appendCache.js +3 -3
  135. package/dist/ops/webgpu/attentionMask.js +3 -3
  136. package/dist/ops/webgpu/gatherSub.js +3 -3
  137. package/dist/ops/webgpu/gelu.js +3 -3
  138. package/dist/ops/webgpu/normRMS.js +2 -2
  139. package/dist/ops/webgpu/normRMSGrad.js +5 -5
  140. package/dist/ops/webgpu/qkv.js +3 -3
  141. package/dist/ops/webgpu/rope.js +3 -3
  142. package/dist/ops/webgpu/scatterSub.js +3 -3
  143. package/dist/ops/webgpu/utils/reductions.js +4 -4
  144. package/dist/ops-542ai2vG.js +1525 -0
  145. package/dist/{random_width-sZORGo5k.js → random_width-DKGeiFuR.js} +1471 -1538
  146. package/dist/{range-CRuAh-gd.js → range-BcUvLuf5.js} +1 -1
  147. package/dist/{reciprocal-BvGAyKyu.js → reciprocal-DhDWSKiD.js} +1 -1
  148. package/dist/{register_all_kernels-BwDSRN-f.js → register_all_kernels-Do9VvZmo.js} +2488 -2534
  149. package/dist/{max-Ddnnb5xe.js → relu-B1AXs7p5.js} +6 -6
  150. package/dist/{reshape-CdBq1WJ6.js → reshape-WeJkT3ja.js} +1 -1
  151. package/dist/{scatter_nd_util-DUstGbU1.js → scatter_nd_util-B7yDhiQr.js} +1 -1
  152. package/dist/{selu_util-BJEXVvjX.js → selu_util-BgUO9gHY.js} +125 -146
  153. package/dist/{shared-wS99K7_n.js → shared-CZiWmQCI.js} +1 -1
  154. package/dist/{shared-B8ztnyEk.js → shared-V6D_md-c.js} +72 -72
  155. package/dist/{sin-BeA3tsEd.js → sin-CPxad7Am.js} +1 -1
  156. package/dist/{slice-BiOsknYS.js → slice-B7jXtPnp.js} +1 -1
  157. package/dist/{softmax-Bv_6lyMX.js → softmax-BfsyI4As.js} +1 -1
  158. package/dist/{split-B-dikLRw.js → split-BPxr8_8m.js} +1 -1
  159. package/dist/{stack-B17UN2nn.js → stack-BNwLzE43.js} +1 -1
  160. package/dist/{sum-66ew2byf.js → sum-ByFINZgi.js} +3 -3
  161. package/dist/{tensor-JwS7ZYY6.js → tensor-DbqgIV9B.js} +1 -1
  162. package/dist/tensor1d-CtJq5BOv.js +27 -0
  163. package/dist/{tensor2d-wxPAnDQy.js → tensor2d-CObBWBkW.js} +1 -1
  164. package/dist/tensor3d-BOukqWwr.js +30 -0
  165. package/dist/tensor4d-DLtk7Nxh.js +30 -0
  166. package/dist/training/Adam.js +2 -2
  167. package/dist/training/AdamExt.js +1 -1
  168. package/dist/training/DatasetBuilder.js +2 -2
  169. package/dist/training/Evaluator.d.ts +2 -2
  170. package/dist/training/FullTrainer.d.ts +3 -3
  171. package/dist/training/FullTrainer.js +61 -69
  172. package/dist/training/Trainer.d.ts +15 -3
  173. package/dist/training/Trainer.js +39 -47
  174. package/dist/training/sparseCrossEntropy.js +12 -13
  175. package/dist/utilities/arrayClose.d.ts +1 -1
  176. package/dist/utilities/arrayClose.js +16 -7
  177. package/dist/utilities/dummy.d.ts +4 -4
  178. package/dist/utilities/dummy.js +13 -13
  179. package/dist/utilities/multinomialCPU.js +2 -2
  180. package/dist/utilities/parameters.d.ts +1 -1
  181. package/dist/utilities/performance.js +1 -1
  182. package/dist/utilities/profile.js +1 -1
  183. package/dist/utilities/safetensors.js +2 -2
  184. package/dist/utilities/weights.js +2 -2
  185. package/dist/{variable-BuddVFLa.js → variable-DPFOJyRG.js} +1 -1
  186. package/dist/{webgpu_program-PFzf1hAQ.js → webgpu_program-Dhk9R5aG.js} +1 -1
  187. package/dist/{webgpu_util-D____QpY.js → webgpu_util-BqGnZg8t.js} +27 -27
  188. package/dist/{zeros--BdLQ3oG.js → zeros-Dnwix0p4.js} +1 -1
  189. package/package.json +2 -3
  190. package/dist/NanoGPTModel.d.ts +0 -52
  191. package/dist/NanoGPTModel.js +0 -203
  192. package/dist/TiedEmbedding-BxOerUmB.js +0 -43
  193. package/dist/ops-BFGCx8Ri.js +0 -1202
  194. package/dist/utilities/generate.d.ts +0 -3
  195. package/dist/utilities/generate.js +0 -22
  196. package/dist/utilities/save.d.ts +0 -9
  197. package/dist/utilities/save.js +0 -61
@@ -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, bm as Ce, j as V, l as Pt, a3 as K, bn as et, ae as ht, bo as dt, bp as at, aa as De, ab as st, az as We, b8 as $e, bq as Ue, br as ze, bs as Be, bt as At, ap as H, bu as qt, bv as W, bw as _t, bx as Vt, ai as Ct, by as Dt, ao as Wt, bz as $t, aZ as Ut, a_ as zt, b0 as Bt, b1 as jt, aj as Gt, bA as Zt, b6 as Ht, bB as Kt, b3 as je, aA as Ge, b7 as Xt, bc as Ze, bC as He, p as Jt, u as Ke, t as Xe, bD as Qt, bE as It, ar as Yt, $ as Je, bF as te, ba as ee, bG as ne, aP as pt, bH as se, bI as ot } from "./index-DdmHGZjq.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-yC3YH1jo.js";
3
+ import { g as pn, a as wn, e as In, c as bn } from "./axis_util-Did9235A.js";
4
+ import { b as xn } from "./broadcast_to-CUvOdOT5.js";
5
+ import { r as En } from "./reshape-WeJkT3ja.js";
6
+ import { p as Fn, q as yn, r as kn, u as Nn } from "./selu_util-BgUO9gHY.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, A = 0; A < I.length; A += 8) {
369
+ var U = Math.min(8, I.length - A), j = parseInt(I.substring(A, A + 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,9 +412,9 @@ 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())
415
+ for (var R = r(l(c, 6), this.unsigned), A = this, U = ""; ; ) {
416
+ var j = A.div(R), C = A.sub(j.mul(R)).toInt() >>> 0, P = C.toString(c);
417
+ if (A = j, A.isZero())
418
418
  return P + U;
419
419
  for (; P.length < 6; )
420
420
  P = "0" + P;
@@ -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, A = 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 + A, P &= 65535, i(_ << 16 | B, P << 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, A = 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 += A * P, B += ct >>> 16, ct &= 65535, B += R * P, _ += B >>> 16, B &= 65535, B += A * C, _ += B >>> 16, B &= 65535, _ += L * P, G += _ >>> 16, _ &= 65535, _ += R * C, G += _ >>> 16, _ &= 65535, _ += A * j, G += _ >>> 16, _ &= 65535, G += N * P + L * C + R * j + A * 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 A = this.shr(1);
543
+ return N = A.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())
@@ -675,7 +675,7 @@ function T(e, t) {
675
675
  function St(e, t) {
676
676
  return ie(e, t, 4);
677
677
  }
678
- function A(e, t) {
678
+ function q(e, t) {
679
679
  return t === 0 ? e : e.shru(t).or(e.shl(64 - t));
680
680
  }
681
681
  function J(e, t, n = gt("9ddfea08eb382d69")) {
@@ -685,16 +685,16 @@ function J(e, t, n = gt("9ddfea08eb382d69")) {
685
685
  return o = o.xor(o.shru(47)), o = o.mul(n), o;
686
686
  }
687
687
  function Mn(e, t, n, s, o, a) {
688
- o = o.add(e), a = A(a.add(o).add(s), 21);
688
+ o = o.add(e), a = q(a.add(o).add(s), 21);
689
689
  const r = o;
690
- return o = o.add(t), o = o.add(n), a = a.add(A(o, 44)), [o.add(s), a.add(r)];
690
+ return o = o.add(t), o = o.add(n), a = a.add(q(o, 44)), [o.add(s), a.add(r)];
691
691
  }
692
692
  function ut(e, t, n, s) {
693
693
  return Mn(T(e, t), T(e, t + 8), T(e, t + 16), T(e, t + 24), n, s);
694
694
  }
695
695
  function On(e, t = e.length) {
696
696
  if (t >= 8) {
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);
697
+ const n = D.add(t * 2), s = T(e, 0).add(D), o = T(e, t - 8), a = q(o, 37).mul(n).add(s), r = q(s, 25).add(o).mul(n);
698
698
  return J(a, r, n);
699
699
  }
700
700
  if (t >= 4) {
@@ -709,13 +709,13 @@ function On(e, t = e.length) {
709
709
  }
710
710
  function Ln(e, t = e.length) {
711
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);
712
+ return J(q(s.add(o), 43).add(q(a, 30)).add(r), s.add(q(o.add(D), 18)).add(a), n);
713
713
  }
714
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);
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 = q(s.add(o), 43).add(q(a, 30)).add(r), l = J(i, s.add(q(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(q(u.add(h), 43).add(q(f, 30)).add(p), u.add(q(h.add(s), 18)).add(f), n);
717
717
  }
718
- function qn(e, t = e.length) {
718
+ function An(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);
@@ -726,10 +726,10 @@ function qn(e, t = e.length) {
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 = q(s.add(o).add(r[0]).add(T(e, l + 8)), 37).mul(Y), o = q(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 = q(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;
730
730
  while (l !== u);
731
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);
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 = q(s.add(o).add(r[0]).add(T(e, l + 8)), 37).mul(f), o = q(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 = q(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);
733
733
  }
734
734
  /**
735
735
  * @license
@@ -774,7 +774,7 @@ function le(e) {
774
774
  t[n] = Math.abs(e[n]);
775
775
  return t;
776
776
  }
777
- const An = (e) => {
777
+ const qn = (e) => {
778
778
  const { x: t } = e.inputs, n = e.backend;
779
779
  nt(t, "abs");
780
780
  let s = new Float32Array(V(t.shape));
@@ -783,7 +783,7 @@ const An = (e) => {
783
783
  }, Xs = {
784
784
  kernelName: Ce,
785
785
  backendName: "cpu",
786
- kernelFunc: An
786
+ kernelFunc: qn
787
787
  };
788
788
  /**
789
789
  * @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 = Pt(t, n), i = r.length, l = K(r), u = V(r), h = et(a, u), f = t.length, p = n.length, w = K(t), m = K(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]);
@@ -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 = Pt(t, n), l = V(i), u = i.length, h = K(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 = K(t), k = n.length, y = K(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(At, he, _n), eo = {
1051
+ kernelName: At,
1052
1052
  backendName: "cpu",
1053
1053
  kernelFunc: Vn
1054
1054
  };
@@ -1079,7 +1079,7 @@ function Cn(e, t, n, s, o) {
1079
1079
  return r;
1080
1080
  }
1081
1081
  function Dn(e, t, n, s = !1) {
1082
- const o = e.shape[0], a = e.shape[1], r = K([o, n], t.dtype);
1082
+ const o = e.shape[0], a = e.shape[1], r = H([o, n], t.dtype);
1083
1083
  for (let i = 0; i < o; i++)
1084
1084
  for (let l = 0; l < a; l++) {
1085
1085
  const u = e.get(i, l);
@@ -1105,8 +1105,8 @@ function Dn(e, t, n, s = !1) {
1105
1105
  * limitations under the License.
1106
1106
  * =============================================================================
1107
1107
  */
1108
- const fe = $((e, t) => e & t), Wn = z(At, fe), no = {
1109
- kernelName: At,
1108
+ const fe = $((e, t) => e & t), Wn = z(qt, fe), no = {
1109
+ kernelName: qt,
1110
1110
  backendName: "cpu",
1111
1111
  kernelFunc: Wn
1112
1112
  };
@@ -1351,8 +1351,8 @@ const be = $((e, t) => Math.floor(e / t)), Zn = z($t, be, null, "int32"), lo = {
1351
1351
  * limitations under the License.
1352
1352
  * =============================================================================
1353
1353
  */
1354
- function Kn(e, t, n, s, o, a, r, i, l) {
1355
- const u = K([s, a], n);
1354
+ function Hn(e, t, n, s, o, a, r, i, l) {
1355
+ const u = H([s, a], n);
1356
1356
  for (let h = 0; h < s; h++) {
1357
1357
  const f = [];
1358
1358
  let p = 0;
@@ -1383,8 +1383,8 @@ function Kn(e, t, n, s, o, a, r, i, l) {
1383
1383
  * limitations under the License.
1384
1384
  * =============================================================================
1385
1385
  */
1386
- function Hn(e, t, n) {
1387
- const s = K(n, e.dtype);
1386
+ function Kn(e, t, n) {
1387
+ const s = H(n, e.dtype);
1388
1388
  for (let o = 0; o < s.size; ++o) {
1389
1389
  const r = s.indexToLoc(o).slice(), i = r[0], l = r[2], u = t.locToIndex([i, l]);
1390
1390
  r[2] = t.values[u];
@@ -1587,8 +1587,8 @@ const Ne = $((e, t) => Math.max(e, t)), ss = z(Zt, Ne), mo = {
1587
1587
  * limitations under the License.
1588
1588
  * =============================================================================
1589
1589
  */
1590
- const ve = $((e, t) => Math.min(e, t)), os = z(Kt, ve), po = {
1591
- kernelName: Kt,
1590
+ const ve = $((e, t) => Math.min(e, t)), os = z(Ht, ve), po = {
1591
+ kernelName: Ht,
1592
1592
  backendName: "cpu",
1593
1593
  kernelFunc: os
1594
1594
  };
@@ -1611,8 +1611,8 @@ const ve = $((e, t) => Math.min(e, t)), os = z(Kt, ve), po = {
1611
1611
  const yt = $((e, t) => e * t), rs = Ft((e, t, n, s) => ({
1612
1612
  real: e * n - t * s,
1613
1613
  imag: e * s + t * n
1614
- })), as = z(Ht, yt, rs), wo = {
1615
- kernelName: Ht,
1614
+ })), as = z(Kt, yt, rs), wo = {
1615
+ kernelName: Kt,
1616
1616
  backendName: "cpu",
1617
1617
  kernelFunc: as
1618
1618
  };
@@ -1685,7 +1685,7 @@ const Te = $((e, t) => e !== t ? 1 : 0), ls = z(Xt, Te, null, "bool"), bo = {
1685
1685
  * =============================================================================
1686
1686
  */
1687
1687
  function Re(e, t, n, s, o) {
1688
- const a = t.length, r = V(t), i = H(t), l = H(o), u = et(n, V(o));
1688
+ const a = t.length, r = V(t), i = K(t), l = K(o), u = et(n, V(o));
1689
1689
  for (let h = 0; h < r; ++h) {
1690
1690
  const f = dt(h, a, i), p = new Array(f.length);
1691
1691
  for (let m = 0; m < p.length; m++)
@@ -1742,7 +1742,7 @@ const xo = {
1742
1742
  * =============================================================================
1743
1743
  */
1744
1744
  function Oe(e, t, n, s) {
1745
- const [o, a] = bn(e, s), r = He(t, "int32"), i = st(V(o), r), l = V(a);
1745
+ const [o, a] = bn(e, s), r = Ke(t, "int32"), i = st(V(o), r), l = V(a);
1746
1746
  for (let u = 0; u < i.length; ++u) {
1747
1747
  const h = u * l;
1748
1748
  let f = 1;
@@ -1764,7 +1764,7 @@ function cs(e) {
1764
1764
  return r && (g = In(F, l)), p.forEach((b) => n.disposeIntermediateTensorInfo(b)), n.makeTensorInfo(g, d, m);
1765
1765
  }
1766
1766
  const Eo = {
1767
- kernelName: Ke,
1767
+ kernelName: He,
1768
1768
  backendName: "cpu",
1769
1769
  kernelFunc: cs
1770
1770
  };
@@ -1787,7 +1787,7 @@ const Eo = {
1787
1787
  function us(e, t, n) {
1788
1788
  e.forEach((s, o) => {
1789
1789
  if (s < 0 || s >= n) {
1790
- const a = dt(o, t.length, H(t)).join(",");
1790
+ const a = dt(o, t.length, K(t)).join(",");
1791
1791
  throw new Error(`indices[${a}] = ${s} is not in [0, ${n})`);
1792
1792
  }
1793
1793
  });
@@ -2260,8 +2260,8 @@ const Le = X((e) => 1 / Math.sqrt(e)), xs = Q(Qt, Le), Fo = {
2260
2260
  function Es(e, t, n, s, o, a, r, i, l, u) {
2261
2261
  const h = [s / o, o], f = e.values, p = t.values;
2262
2262
  if (s === 0)
2263
- return K(n, t.dtype);
2264
- const w = l instanceof It ? l : K(h, t.dtype);
2263
+ return H(n, t.dtype);
2264
+ const w = l instanceof It ? l : H(h, t.dtype);
2265
2265
  typeof l == "string" || typeof l == "number" ? w.values.fill(l) : typeof l == "boolean" && w.values.fill(+l);
2266
2266
  for (let m = 0; m < a; m++) {
2267
2267
  const F = [];
@@ -2315,12 +2315,12 @@ const Fs = X((e) => 1 / (1 + Math.exp(-e))), ys = de(Yt, (e) => 1 / (1 + Math.ex
2315
2315
  * =============================================================================
2316
2316
  */
2317
2317
  function Pe(e, t, n, s, o) {
2318
- const a = kn(s, t, n), r = V(n), i = H(s);
2318
+ const a = kn(s, t, n), r = V(n), i = K(s);
2319
2319
  if (a) {
2320
2320
  const f = Nn(t, i);
2321
2321
  return o === "string" ? e.slice(f, f + r) : e.subarray(f, f + r);
2322
2322
  }
2323
- const l = o === "string" ? it(e) : e, u = K(s, o, l), h = K(n, o);
2323
+ const l = o === "string" ? it(e) : e, u = H(s, o, l), h = H(n, o);
2324
2324
  for (let f = 0; f < h.size; ++f) {
2325
2325
  const p = h.indexToLoc(f), w = p.map((m, F) => m + t[F]);
2326
2326
  h.set(u.get(...w), ...p);
@@ -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 Ae = $((e, t) => {
2582
2582
  const n = e - t;
2583
2583
  return n * n;
2584
- }), Ms = z(ee, qe), vo = {
2584
+ }), Ms = z(ee, Ae), vo = {
2585
2585
  kernelName: ee,
2586
2586
  backendName: "cpu",
2587
2587
  kernelFunc: Ms
@@ -2602,10 +2602,10 @@ const qe = $((e, t) => {
2602
2602
  * limitations under the License.
2603
2603
  * =============================================================================
2604
2604
  */
2605
- const Ae = X((e, t) => {
2605
+ const qe = 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 = Q(ne, qe), So = {
2609
2609
  kernelName: ne,
2610
2610
  backendName: "cpu",
2611
2611
  kernelFunc: Os
@@ -2627,7 +2627,7 @@ const Ae = X((e, t) => {
2627
2627
  * =============================================================================
2628
2628
  */
2629
2629
  function Ls(e, t, n, s) {
2630
- const o = K(e, t.dtype);
2630
+ const o = H(e, t.dtype);
2631
2631
  for (let a = 0; a < o.size; a++) {
2632
2632
  const r = o.indexToLoc(a), i = new Array(r.length);
2633
2633
  for (let l = 0; l < i.length; l++)
@@ -2742,7 +2742,7 @@ class Ps {
2742
2742
  return [i, r];
2743
2743
  }
2744
2744
  }
2745
- function qs(e, t, n, s, o, a, r, i) {
2745
+ function As(e, t, n, s, o, a, r, i) {
2746
2746
  return new Ps(n, s, o, a, r, i).compute(e, t);
2747
2747
  }
2748
2748
  /**
@@ -2761,7 +2761,7 @@ function qs(e, t, n, s, o, a, r, i) {
2761
2761
  * limitations under the License.
2762
2762
  * =============================================================================
2763
2763
  */
2764
- function As(e, t, n, s) {
2764
+ function qs(e, t, n, s) {
2765
2765
  if (!e.length)
2766
2766
  return;
2767
2767
  if (t.length === 0) {
@@ -2792,7 +2792,7 @@ function _s(e, t, n) {
2792
2792
  const i = new Array(s);
2793
2793
  for (let p = 0; p < s; ++p) {
2794
2794
  const w = o.length;
2795
- As(e[p], t, n, o);
2795
+ qs(e[p], t, n, o);
2796
2796
  const m = o.length - w;
2797
2797
  i[p] = m, a += m, r = Math.max(r, m);
2798
2798
  }
@@ -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] = An(e[s]).modulo(t).getLowBitsUnsigned();
2826
2826
  return n;
2827
2827
  }
2828
2828
  /**
@@ -2866,7 +2866,7 @@ function Ws(e, t) {
2866
2866
  const n = new Array(e.rank);
2867
2867
  for (let o = 0; o < n.length; o++)
2868
2868
  n[o] = e.shape[o] * t[o];
2869
- const s = K(n, e.dtype);
2869
+ const s = H(n, e.dtype);
2870
2870
  for (let o = 0; o < s.values.length; ++o) {
2871
2871
  const a = s.indexToLoc(o), r = new Array(e.rank);
2872
2872
  for (let l = 0; l < r.length; l++)
@@ -2925,8 +2925,8 @@ function $s(e, t, n, s, o) {
2925
2925
  }
2926
2926
  const h = t.slice();
2927
2927
  return h[h.length - 1] = s, [
2928
- K(h, n, l),
2929
- K(h, "int32", u)
2928
+ H(h, n, l),
2929
+ H(h, "int32", u)
2930
2930
  ];
2931
2931
  }
2932
2932
  /**
@@ -3017,8 +3017,8 @@ const Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3017
3017
  expm1Impl: we,
3018
3018
  floorDivImpl: be,
3019
3019
  floorImpl: Ie,
3020
- gatherNdImpl: Kn,
3021
- gatherV2Impl: Hn,
3020
+ gatherNdImpl: Hn,
3021
+ gatherV2Impl: Kn,
3022
3022
  greaterEqualImpl: Ee,
3023
3023
  greaterImpl: xe,
3024
3024
  lessEqualImpl: ye,
@@ -3045,10 +3045,10 @@ const Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3045
3045
  sparseReshapeImpl: vs,
3046
3046
  sparseSegmentReductionImpl: Ss,
3047
3047
  sqrtImpl: Ts,
3048
- squaredDifferenceImpl: qe,
3049
- staticRegexReplaceImpl: Ae,
3048
+ squaredDifferenceImpl: Ae,
3049
+ staticRegexReplaceImpl: qe,
3050
3050
  stridedSliceImpl: Ls,
3051
- stringNGramsImpl: qs,
3051
+ stringNGramsImpl: As,
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
+ As as I,
3071
3071
  _s as J,
3072
3072
  Vs as K,
3073
3073
  Ws as L,
@@ -3119,8 +3119,8 @@ export {
3119
3119
  lt as l,
3120
3120
  as as m,
3121
3121
  Ds as n,
3122
- Kn as o,
3123
- Hn as p,
3122
+ Hn as o,
3123
+ Kn as p,
3124
3124
  ts as q,
3125
3125
  ce as r,
3126
3126
  Ro as s,
@@ -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 { C as o, D as t, E as c, ac as a, ad as e } from "./index-DdmHGZjq.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 { C as c, D as e, E as a, $ as l } from "./index-DdmHGZjq.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 { C as r, D as f, E as e, S as i } from "./index-DdmHGZjq.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 { C as p, D as i, E as a, W as c } from "./index-DdmHGZjq.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 { C as e, F as c, n, E as k, P as i } from "./index-DdmHGZjq.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 { C as e, D as u, a0 as c, E as l, a1 as m } from "./index-DdmHGZjq.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 { A as t, B as a } from "./index-DdmHGZjq.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2018 Google LLC. All Rights Reserved.
@@ -0,0 +1,27 @@
1
+ import { z as o, A as s, B as t } from "./index-DdmHGZjq.js";
2
+ /**
3
+ * @license
4
+ * Copyright 2018 Google LLC. All Rights Reserved.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ * =============================================================================
17
+ */
18
+ function h(r, e) {
19
+ o(r);
20
+ const n = s(r, e);
21
+ if (n.length !== 1)
22
+ throw new Error("tensor1d() requires values to be a flat/TypedArray");
23
+ return t(r, null, n, e);
24
+ }
25
+ export {
26
+ h as t
27
+ };
@@ -1,4 +1,4 @@
1
- import { $ as t, Z as s, _ as a } from "./index-BoWRt-10.js";
1
+ import { z as t, A as s, B as a } from "./index-DdmHGZjq.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2018 Google LLC. All Rights Reserved.
@@ -0,0 +1,30 @@
1
+ import { z as o, A as a, B as s } from "./index-DdmHGZjq.js";
2
+ /**
3
+ * @license
4
+ * Copyright 2018 Google LLC. All Rights Reserved.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ * =============================================================================
17
+ */
18
+ function h(n, r, t) {
19
+ if (o(n), r != null && r.length !== 3)
20
+ throw new Error("tensor3d() requires shape to have three numbers");
21
+ const e = a(n, t);
22
+ if (e.length !== 3 && e.length !== 1)
23
+ throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");
24
+ if (e.length === 1 && r == null)
25
+ throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");
26
+ return s(n, r, e, t);
27
+ }
28
+ export {
29
+ h as t
30
+ };
@@ -0,0 +1,30 @@
1
+ import { z as t, A as a, B as s } from "./index-DdmHGZjq.js";
2
+ /**
3
+ * @license
4
+ * Copyright 2018 Google LLC. All Rights Reserved.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ * =============================================================================
17
+ */
18
+ function i(n, r, o) {
19
+ if (t(n), r != null && r.length !== 4)
20
+ throw new Error("tensor4d() requires shape to have four numbers");
21
+ const e = a(n, o);
22
+ if (e.length !== 4 && e.length !== 1)
23
+ throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");
24
+ if (e.length === 1 && r == null)
25
+ throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");
26
+ return s(n, r, e, o);
27
+ }
28
+ export {
29
+ i as t
30
+ };
@@ -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-DdmHGZjq.js";
4
+ import { z as M } from "../zeros-Dnwix0p4.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-DdmHGZjq.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-DdmHGZjq.js";
2
+ import { d as u, i as d } from "../dataset-DPPl-iLT.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;