@genai-fi/nanogpt 0.6.1 → 0.6.2

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 (115) hide show
  1. package/dist/Generator.js +6 -6
  2. package/dist/NanoGPTModel.js +9 -9
  3. package/dist/{RealDiv-7xu-pkZN.js → RealDiv-BYViZwhN.js} +6 -6
  4. package/dist/{Reshape-BYC1oUku.js → Reshape-t7Kcikjk.js} +2 -2
  5. package/dist/TeachableLLM.js +5 -5
  6. package/dist/{TiedEmbedding-C1HBot-5.js → TiedEmbedding-9WeDwvjO.js} +4 -4
  7. package/dist/{axis_util-CCNL7jea.js → axis_util-Bu4h7XWV.js} +1 -1
  8. package/dist/{broadcast_to-CddAF879.js → broadcast_to-DARN-DBD.js} +2 -2
  9. package/dist/{concat-XOK9ANZu.js → concat-5aPGqw3Z.js} +8 -8
  10. package/dist/{dataset-BFFipD1c.js → dataset-pgqp-YfL.js} +5 -5
  11. package/dist/{dropout-xlKRoJyU.js → dropout-Bciw46HT.js} +10 -10
  12. package/dist/{gather-DKtUaTtA.js → gather-DjyCjmOD.js} +1 -1
  13. package/dist/{gpgpu_math-B_ycgZ4W.js → gpgpu_math-CNslybmD.js} +31 -31
  14. package/dist/{index-CamYe_M8.js → index-BAzbokzv.js} +31 -31
  15. package/dist/{kernel_funcs_utils-D5MS0JFg.js → kernel_funcs_utils-CUxJCg0g.js} +5 -5
  16. package/dist/layers/BaseLayer.js +2 -2
  17. package/dist/layers/CausalSelfAttention.js +6 -6
  18. package/dist/layers/MLP.js +5 -5
  19. package/dist/layers/RMSNorm.js +3 -3
  20. package/dist/layers/RoPECache.js +4 -4
  21. package/dist/layers/TiedEmbedding.js +5 -5
  22. package/dist/layers/TransformerBlock.js +1 -1
  23. package/dist/loader/load.d.ts +13 -0
  24. package/dist/loader/load.js +27 -0
  25. package/dist/loader/loadHF.d.ts +7 -0
  26. package/dist/loader/loadHF.js +22 -0
  27. package/dist/{utilities/load.d.ts → loader/loadTransformers.d.ts} +11 -11
  28. package/dist/loader/loadTransformers.js +28 -0
  29. package/dist/loader/newZipLoad.d.ts +8 -0
  30. package/dist/loader/newZipLoad.js +21 -0
  31. package/dist/loader/oldZipLoad.d.ts +7 -0
  32. package/dist/loader/oldZipLoad.js +76 -0
  33. package/dist/{log_sum_exp-CV_5-TTu.js → log_sum_exp-YEo2h3gb.js} +16 -16
  34. package/dist/main.js +4 -4
  35. package/dist/{mat_mul-CAbRFWUj.js → mat_mul-7121rsJk.js} +4 -4
  36. package/dist/{max-JBBv7aUf.js → max-DtlIuVeW.js} +3 -3
  37. package/dist/{mulmat_packed_gpu-DW4doKL_.js → mulmat_packed_gpu-D4nKF7Je.js} +1 -1
  38. package/dist/{norm-B9dQTFYn.js → norm-CzltS9Fz.js} +10 -10
  39. package/dist/{ones-CMHNqMr6.js → ones-BBlSRqn1.js} +2 -2
  40. package/dist/ops/appendCache.js +3 -3
  41. package/dist/ops/attentionMask.js +1 -1
  42. package/dist/ops/cpu/appendCache.js +2 -2
  43. package/dist/ops/cpu/attentionMask.js +6 -6
  44. package/dist/ops/cpu/fusedSoftmax.js +2 -2
  45. package/dist/ops/cpu/gatherSub.js +9 -9
  46. package/dist/ops/cpu/gelu.js +1 -1
  47. package/dist/ops/cpu/matMulGelu.js +1 -1
  48. package/dist/ops/cpu/matMulMul.js +1 -1
  49. package/dist/ops/cpu/mulDropout.js +1 -1
  50. package/dist/ops/cpu/normRMS.js +1 -1
  51. package/dist/ops/cpu/qkv.js +3 -3
  52. package/dist/ops/cpu/rope.js +5 -5
  53. package/dist/ops/cpu/scatterSub.js +14 -14
  54. package/dist/ops/fusedSoftmax.js +1 -1
  55. package/dist/ops/gatherSub.js +1 -1
  56. package/dist/ops/gelu.js +1 -1
  57. package/dist/ops/grads/attentionMask.js +1 -1
  58. package/dist/ops/grads/fusedSoftmax.js +4 -4
  59. package/dist/ops/grads/gelu.js +1 -1
  60. package/dist/ops/grads/matMulGelu.js +1 -1
  61. package/dist/ops/grads/normRMS.js +1 -1
  62. package/dist/ops/grads/qkv.js +1 -1
  63. package/dist/ops/grads/rope.js +1 -1
  64. package/dist/ops/matMulGelu.js +1 -1
  65. package/dist/ops/matMulMul.js +1 -1
  66. package/dist/ops/mulDrop.js +1 -1
  67. package/dist/ops/node/sparseCrossEntropy.js +1 -1
  68. package/dist/ops/normRMS.js +1 -1
  69. package/dist/ops/qkv.js +1 -1
  70. package/dist/ops/rope.js +4 -4
  71. package/dist/ops/scatterSub.js +1 -1
  72. package/dist/ops/webgl/appendCache.js +1 -1
  73. package/dist/ops/webgl/attentionMask.js +1 -1
  74. package/dist/ops/webgl/fusedSoftmax.js +4 -4
  75. package/dist/ops/webgl/gatherSub.js +1 -1
  76. package/dist/ops/webgl/gelu.js +2 -2
  77. package/dist/ops/webgl/log.js +3 -3
  78. package/dist/ops/webgl/matMulGelu.js +17 -17
  79. package/dist/ops/webgl/matMulMul.js +1 -1
  80. package/dist/ops/webgl/mulDropout.js +1 -1
  81. package/dist/ops/webgl/normRMS.js +2 -2
  82. package/dist/ops/webgl/qkv.js +1 -1
  83. package/dist/ops/webgl/rope.js +1 -1
  84. package/dist/ops/webgl/scatterSub.js +1 -1
  85. package/dist/{ops-DqtYemmV.js → ops-C0sQEcPw.js} +78 -78
  86. package/dist/{random_width-CLMQG5Jn.js → random_width-DWzaOgrn.js} +22 -22
  87. package/dist/{range-DqYjKnuG.js → range-DYsrnfiy.js} +1 -1
  88. package/dist/{reciprocal-z49filta.js → reciprocal-CJQeasVa.js} +1 -1
  89. package/dist/{register_all_kernels-COt6wLD0.js → register_all_kernels-BfFCQAqs.js} +28 -28
  90. package/dist/{reshape-C45vIIRU.js → reshape-krWGKraP.js} +1 -1
  91. package/dist/{scatter_nd_util-qgtnviTE.js → scatter_nd_util-93ln7Hut.js} +3 -3
  92. package/dist/{selu_util-4QV_GXTB.js → selu_util-sntGesxr.js} +41 -41
  93. package/dist/{shared-ByfrGA97.js → shared-Ca6iDobD.js} +6 -6
  94. package/dist/{sin-9JBrfVaB.js → sin-D_h-qCSx.js} +1 -1
  95. package/dist/{softmax-DvMvui-_.js → softmax-fsdtf6JC.js} +1 -1
  96. package/dist/{split-DxrHrPFK.js → split-eiktj-6L.js} +4 -4
  97. package/dist/{stack-DgaoDmnF.js → stack-dfEEz2OY.js} +2 -2
  98. package/dist/{sum-BpcpxNEh.js → sum-BE_Irnim.js} +3 -3
  99. package/dist/{tensor-CDz5x1mP.js → tensor-Xyi595sG.js} +1 -1
  100. package/dist/{tensor2d-jO8JY5Jd.js → tensor2d-CPEkynbH.js} +1 -1
  101. package/dist/training/AdamExt.js +1 -1
  102. package/dist/training/DatasetBuilder.js +2 -2
  103. package/dist/training/FullTrainer.js +1 -1
  104. package/dist/training/Trainer.js +3 -3
  105. package/dist/training/sparseCrossEntropy.js +5 -5
  106. package/dist/utilities/dummy.js +2 -2
  107. package/dist/utilities/generate.js +3 -3
  108. package/dist/utilities/profile.js +1 -1
  109. package/dist/utilities/safetensors.js +2 -2
  110. package/dist/utilities/save.js +1 -1
  111. package/dist/utilities/weights.js +2 -2
  112. package/dist/{variable-CLVXjN7F.js → variable-wSS22xj5.js} +1 -1
  113. package/dist/{zeros-DUkkVccu.js → zeros-YJDE7oRb.js} +10 -10
  114. package/package.json +3 -3
  115. package/dist/utilities/load.js +0 -99
package/dist/Generator.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import { E as u } from "./index-Dwqa6Zy2.js";
2
- import "./index-CamYe_M8.js";
2
+ import "./index-BAzbokzv.js";
3
3
  import "./ops/cpu/attentionMask.js";
4
4
  import "./ops/webgl/attentionMask.js";
5
5
  import "./ops/grads/attentionMask.js";
6
6
  import "./ops/cpu/qkv.js";
7
7
  import "./ops/webgl/qkv.js";
8
8
  import "./ops/grads/qkv.js";
9
- import "./random_width-CLMQG5Jn.js";
10
- import "./register_all_kernels-COt6wLD0.js";
9
+ import "./random_width-DWzaOgrn.js";
10
+ import "./register_all_kernels-BfFCQAqs.js";
11
11
  import "./index-Tf7vU29b.js";
12
- import "./dataset-BFFipD1c.js";
12
+ import "./dataset-pgqp-YfL.js";
13
13
  import "./ops/cpu/rope.js";
14
14
  import "./ops/webgl/rope.js";
15
15
  import "./ops/grads/rope.js";
@@ -35,8 +35,8 @@ import "./ops/cpu/gelu.js";
35
35
  import "./ops/webgl/gelu.js";
36
36
  import "./ops/grads/gelu.js";
37
37
  import "./ops/webgl/log.js";
38
- import { t as d } from "./tensor2d-jO8JY5Jd.js";
39
- import { c as g } from "./concat-XOK9ANZu.js";
38
+ import { t as d } from "./tensor2d-CPEkynbH.js";
39
+ import { c as g } from "./concat-5aPGqw3Z.js";
40
40
  const k = [
41
41
  ...Array.from({ length: 95 }, (a, t) => String.fromCharCode(t + 32)),
42
42
  // ASCII
@@ -1,19 +1,19 @@
1
1
  import { defaultConfig as F } from "./config.js";
2
2
  import O from "./layers/TransformerBlock.js";
3
- import { T as _, r as D } from "./TiedEmbedding-C1HBot-5.js";
3
+ import { T as _, r as D } from "./TiedEmbedding-9WeDwvjO.js";
4
4
  import K from "./layers/RoPECache.js";
5
5
  import N from "./layers/RMSNorm.js";
6
6
  import { estimateParameterCount as R } from "./utilities/parameters.js";
7
7
  import { createSoftmaxCrossEntropyWithGrad as A } from "./training/sparseCrossEntropy.js";
8
8
  import G from "./layers/BaseLayer.js";
9
- import { E as B, D as V, p as j } from "./random_width-CLMQG5Jn.js";
10
- import { q as W, w as H, E as J, a6 as Q, t as z, a7 as U, f as v, n as X } from "./index-CamYe_M8.js";
11
- import { m as Y, t as Z } from "./register_all_kernels-COt6wLD0.js";
12
- import { r as L } from "./reshape-C45vIIRU.js";
13
- import { r as tt } from "./range-DqYjKnuG.js";
14
- import { s as M } from "./softmax-DvMvui-_.js";
15
- import { t as et } from "./ops-DqtYemmV.js";
16
- import { g as ot } from "./gather-DKtUaTtA.js";
9
+ import { E as B, D as V, p as j } from "./random_width-DWzaOgrn.js";
10
+ import { o as W, q as H, E as J, a6 as Q, t as z, a7 as U, s as v, k as X } from "./index-BAzbokzv.js";
11
+ import { m as Y, t as Z } from "./register_all_kernels-BfFCQAqs.js";
12
+ import { r as L } from "./reshape-krWGKraP.js";
13
+ import { r as tt } from "./range-DYsrnfiy.js";
14
+ import { s as M } from "./softmax-fsdtf6JC.js";
15
+ import { t as et } from "./ops-C0sQEcPw.js";
16
+ import { g as ot } from "./gather-DjyCjmOD.js";
17
17
  /**
18
18
  * @license
19
19
  * Copyright 2020 Google LLC. All Rights Reserved.
@@ -1,9 +1,9 @@
1
- import { ao as T, ac as E, p as O, i as V, aw as B, O as F, M as j, ax as K } from "./index-CamYe_M8.js";
2
- import { r as $ } from "./Reshape-BYC1oUku.js";
3
- import { g as A, a as k, b as C, c as N, e as R } from "./axis_util-CCNL7jea.js";
4
- import { t as U, m as W } from "./shared-ByfrGA97.js";
5
- import { j as _, f as y } from "./gpgpu_math-B_ycgZ4W.js";
6
- import { g as G, b as L } from "./kernel_funcs_utils-D5MS0JFg.js";
1
+ import { ao as T, ac as E, p as O, g as V, aw as B, N as F, M as j, ax as K } from "./index-BAzbokzv.js";
2
+ import { r as $ } from "./Reshape-t7Kcikjk.js";
3
+ import { g as A, a as k, b as C, c as N, e as R } from "./axis_util-Bu4h7XWV.js";
4
+ import { t as U, m as W } from "./shared-Ca6iDobD.js";
5
+ import { j as _, f as y } from "./gpgpu_math-CNslybmD.js";
6
+ import { g as G, b as L } from "./kernel_funcs_utils-CUxJCg0g.js";
7
7
  /**
8
8
  * @license
9
9
  * Copyright 2020 Google LLC. All Rights Reserved.
@@ -1,5 +1,5 @@
1
- import { i as c, aa as C, k as f, F as R } from "./index-CamYe_M8.js";
2
- import { u as g, g as I, a as x, b as F, c as $, d as u, e as m, i as l } from "./gpgpu_math-B_ycgZ4W.js";
1
+ import { g as c, aa as C, i as f, D as R } from "./index-BAzbokzv.js";
2
+ import { u as g, g as I, a as x, b as F, c as $, d as u, e as m, i as l } from "./gpgpu_math-CNslybmD.js";
3
3
  /**
4
4
  * @license
5
5
  * Copyright 2018 Google LLC. All Rights Reserved.
@@ -1,7 +1,7 @@
1
1
  import { defaultConfig as d } from "./config.js";
2
2
  import l from "./NanoGPTModel.js";
3
3
  import { saveModel as f } from "./utilities/save.js";
4
- import { loadModel as u } from "./utilities/load.js";
4
+ import { loadModel as u } from "./loader/load.js";
5
5
  import p from "./Generator.js";
6
6
  import _ from "./Trainer.js";
7
7
  import { E as c } from "./index-Dwqa6Zy2.js";
@@ -11,7 +11,7 @@ import w from "./tokeniser/bpe.js";
11
11
  import "./papaparse.min-C8l2Kvo1.js";
12
12
  import "./index-Tf7vU29b.js";
13
13
  import "./jszip.min-CjP2V1VV.js";
14
- import "./index-CamYe_M8.js";
14
+ import "./index-BAzbokzv.js";
15
15
  import "./ops/cpu/scatterSub.js";
16
16
  import "./ops/webgl/scatterSub.js";
17
17
  import "./ops/cpu/gatherSub.js";
@@ -22,9 +22,9 @@ import "./ops/grads/attentionMask.js";
22
22
  import "./ops/cpu/qkv.js";
23
23
  import "./ops/webgl/qkv.js";
24
24
  import "./ops/grads/qkv.js";
25
- import "./random_width-CLMQG5Jn.js";
26
- import "./register_all_kernels-COt6wLD0.js";
27
- import "./dataset-BFFipD1c.js";
25
+ import "./random_width-DWzaOgrn.js";
26
+ import "./register_all_kernels-BfFCQAqs.js";
27
+ import "./dataset-pgqp-YfL.js";
28
28
  import "./ops/cpu/rope.js";
29
29
  import "./ops/webgl/rope.js";
30
30
  import "./ops/grads/rope.js";
@@ -1,8 +1,8 @@
1
- import { R as a, d as s } from "./random_width-CLMQG5Jn.js";
2
- import "./index-CamYe_M8.js";
1
+ import { R as a, d as s } from "./random_width-DWzaOgrn.js";
2
+ import "./index-BAzbokzv.js";
3
3
  import o from "./layers/BaseLayer.js";
4
- import { v as m } from "./variable-CLVXjN7F.js";
5
- import { g as d } from "./gather-DKtUaTtA.js";
4
+ import { v as m } from "./variable-wSS22xj5.js";
5
+ import { g as d } from "./gather-DjyCjmOD.js";
6
6
  /**
7
7
  * @license
8
8
  * Copyright 2018 Google LLC
@@ -1,4 +1,4 @@
1
- import { k as c } from "./index-CamYe_M8.js";
1
+ import { i as c } from "./index-BAzbokzv.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2017 Google LLC. All Rights Reserved.
@@ -1,5 +1,5 @@
1
- import { q as h, w as f, y as p, I as g, E as u, J as b } from "./index-CamYe_M8.js";
2
- import { r as T } from "./reshape-C45vIIRU.js";
1
+ import { o as h, q as f, x as p, H as g, E as u, I as b } from "./index-BAzbokzv.js";
2
+ import { r as T } from "./reshape-krWGKraP.js";
3
3
  /**
4
4
  * @license
5
5
  * Copyright 2020 Google LLC. All Rights Reserved.
@@ -1,4 +1,4 @@
1
- import { q as s, k as a, x as p, I as i, E as l, K as f } from "./index-CamYe_M8.js";
1
+ import { o as s, i as a, w as i, H as p, E as l, J as f } from "./index-BAzbokzv.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2020 Google LLC. All Rights Reserved.
@@ -15,15 +15,15 @@ import { q as s, k as a, x as p, I as i, E as l, K as f } from "./index-CamYe_M8
15
15
  * limitations under the License.
16
16
  * =============================================================================
17
17
  */
18
- function h(n, e = 0) {
19
- a(n.length >= 1, () => "Pass at least one tensor to concat");
20
- const t = p(n, "tensors", "concat", "string_or_numeric");
21
- if (t[0].dtype === "complex64" && t.forEach((o) => {
22
- if (o.dtype !== "complex64")
18
+ function h(o, e = 0) {
19
+ a(o.length >= 1, () => "Pass at least one tensor to concat");
20
+ const t = i(o, "tensors", "concat", "string_or_numeric");
21
+ if (t[0].dtype === "complex64" && t.forEach((n) => {
22
+ if (n.dtype !== "complex64")
23
23
  throw new Error(`Cannot concatenate complex64 tensors with a tensor
24
- with dtype ${o.dtype}. `);
24
+ with dtype ${n.dtype}. `);
25
25
  }), t.length === 1)
26
- return i(t[0]);
26
+ return p(t[0]);
27
27
  const r = t, c = { axis: e };
28
28
  return l.runKernel(f, r, c);
29
29
  }
@@ -1,7 +1,7 @@
1
- import { ab as S, T as h, ac as k, a as v, ad as o, ae as p, af as g, k as N, t as y } from "./index-CamYe_M8.js";
1
+ import { ab as S, T as h, ac as N, d as v, ad as o, ae as p, af as g, i as k, t as y } from "./index-BAzbokzv.js";
2
2
  import { s as R } from "./index-C4L8Cm77.js";
3
- import { s as $ } from "./stack-DgaoDmnF.js";
4
- import { t as B } from "./tensor-CDz5x1mP.js";
3
+ import { s as $ } from "./stack-dfEEz2OY.js";
4
+ import { t as B } from "./tensor-Xyi595sG.js";
5
5
  /**
6
6
  * @license
7
7
  * Copyright 2018 Google LLC. All Rights Reserved.
@@ -75,7 +75,7 @@ function I(s) {
75
75
  }
76
76
  function c(s) {
77
77
  let t = !1;
78
- if (k().get("IS_BROWSER"))
78
+ if (N().get("IS_BROWSER"))
79
79
  t = s instanceof TextDecoder;
80
80
  else {
81
81
  const { StringDecoder: e } = require("string_decoder");
@@ -930,7 +930,7 @@ class T {
930
930
  */
931
931
  batch(t, e = !0) {
932
932
  const r = this;
933
- N(t > 0, () => `batchSize needs to be positive, but it is
933
+ k(t > 0, () => `batchSize needs to be positive, but it is
934
934
  ${t}`);
935
935
  let n;
936
936
  return this.size === 1 / 0 || this.size == null ? n = this.size : e ? n = Math.ceil(this.size / t) : n = Math.floor(this.size / t), u(async () => (await r.iterator()).columnMajorBatch(t, e, st), n);
@@ -1,4 +1,4 @@
1
- import { q as l, w as h, E as m, ag as p, y as c, ah as d, ai as g, k as u, T as V, aj as v, a7 as w, b as N } from "./index-CamYe_M8.js";
1
+ import { o as l, q as h, E as m, ag as p, x as c, ah as d, ai as g, i as u, T as V, aj as v, a7 as N, a as w } from "./index-BAzbokzv.js";
2
2
  import { s as f } from "./index-C4L8Cm77.js";
3
3
  /**
4
4
  * @license
@@ -16,11 +16,11 @@ import { s as f } from "./index-C4L8Cm77.js";
16
16
  * limitations under the License.
17
17
  * =============================================================================
18
18
  */
19
- function b(r) {
19
+ function x(r) {
20
20
  const e = { x: h(r, "x", "floor", "float32") };
21
21
  return m.runKernel(p, e);
22
22
  }
23
- const x = /* @__PURE__ */ l({ floor_: b });
23
+ const b = /* @__PURE__ */ l({ floor_: x });
24
24
  /**
25
25
  * @license
26
26
  * Copyright 2018 Google LLC. All Rights Reserved.
@@ -69,7 +69,7 @@ class T {
69
69
  return t <= this.upper && t >= this.lower;
70
70
  }
71
71
  }
72
- class y {
72
+ class $ {
73
73
  constructor(t = 0, e = 1, s, n) {
74
74
  if (this.canReturnFloat = () => this.dtype == null || this.dtype === "float32", this.min = t, this.range = e - t, this.dtype = s, n == null && (n = Math.random()), typeof n == "number" && (n = n.toString()), !this.canReturnFloat() && this.range <= 1)
75
75
  throw new Error(`The difference between ${t} - ${e} <= 1 and dtype is not float`);
@@ -98,7 +98,7 @@ class y {
98
98
  * limitations under the License.
99
99
  * =============================================================================
100
100
  */
101
- function $(r, t = 0, e = 1, s, n) {
101
+ function y(r, t = 0, e = 1, s, n) {
102
102
  if (c(r), s != null && s === "bool")
103
103
  throw new Error(`Unsupported data type ${s}`);
104
104
  const o = new T(t, e, s, !1, n), a = d(r, s);
@@ -106,7 +106,7 @@ function $(r, t = 0, e = 1, s, n) {
106
106
  a.values[i] = o.nextValue();
107
107
  return a.toTensor();
108
108
  }
109
- const _ = /* @__PURE__ */ l({ randomNormal_: $ });
109
+ const _ = /* @__PURE__ */ l({ randomNormal_: y });
110
110
  /**
111
111
  * @license
112
112
  * Copyright 2020 Google LLC. All Rights Reserved.
@@ -125,7 +125,7 @@ const _ = /* @__PURE__ */ l({ randomNormal_: $ });
125
125
  */
126
126
  function M(r, t = 0, e = 1, s = "float32", n) {
127
127
  c(r);
128
- const o = d(r, s), a = new y(t, e, null, n);
128
+ const o = d(r, s), a = new $(t, e, null, n);
129
129
  for (let i = 0; i < o.values.length; i++)
130
130
  o.values[i] = a.nextValue();
131
131
  return o.toTensor();
@@ -180,14 +180,14 @@ function R(r, t, e, s) {
180
180
  const n = h(r, "x", "dropout");
181
181
  if (u(n.dtype === "float32", () => `x has to be a floating point tensor since it's going to be scaled, but got a ${n.dtype} tensor instead.`), u(t >= 0 && t < 1, () => `rate must be a float in the range [0, 1), but got ${t}.`), t === 0)
182
182
  return r instanceof V ? n.clone() : n;
183
- const o = E(n, e), a = 1 - t, i = v(x(w(D(o, 0, 1, "float32", s), a)), a);
184
- return N(n, i);
183
+ const o = E(n, e), a = 1 - t, i = v(b(N(D(o, 0, 1, "float32", s), a)), a);
184
+ return w(n, i);
185
185
  }
186
186
  const q = /* @__PURE__ */ l({ dropout_: R });
187
187
  export {
188
188
  T as M,
189
189
  D as a,
190
190
  q as d,
191
- x as f,
191
+ b as f,
192
192
  _ as r
193
193
  };
@@ -1,4 +1,4 @@
1
- import { q as g, w as t, E as h, G as p } from "./index-CamYe_M8.js";
1
+ import { o as g, q as t, E as h, G as p } from "./index-BAzbokzv.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2018 Google LLC. All Rights Reserved.
@@ -1,8 +1,8 @@
1
- import { ay as J, ac as m, az as le, aA as fe, aB as he, k as $, aC as we, aD as Q, i as T, W as D, aE as z, aF as Ce, aG as Fe, j as Ae, aH as de, au as _e, aI as Ie, u as Oe, aJ as Ne, aK as N, ai as E, aL as q, aM as ye, aN as ee } from "./index-CamYe_M8.js";
1
+ import { ay as J, ac as m, az as le, aA as fe, aB as he, i as $, aC as we, aD as Q, g as T, W as D, aE as z, aF as Ce, aG as Fe, h as Ae, aH as de, au as _e, aI as Ie, u as Oe, aJ as Ne, aK as N, ai as E, aL as q, aM as ye, aN as ee } from "./index-BAzbokzv.js";
2
2
  import "./index-Tf7vU29b.js";
3
- import { b as Le, d as De, f as be, c as Ue, e as Me, g as Be, a as ke, h as Pe } from "./axis_util-CCNL7jea.js";
4
- import { S as We, a as Ve, b as He, c as Xe, d as Ge, e as ze, f as qe, g as je, h as Je, i as Ye, j as Ke, k as Ze, l as Qe, m as et, s as tt, n as nt, o as rt, t as ot } from "./selu_util-4QV_GXTB.js";
5
- import { c as at, v as st, a as it } from "./scatter_nd_util-qgtnviTE.js";
3
+ import { b as Le, d as De, f as be, c as Ue, e as Me, g as Be, a as Pe, h as ke } from "./axis_util-Bu4h7XWV.js";
4
+ import { S as We, a as Ve, b as He, c as Xe, d as Ge, e as ze, f as qe, g as je, h as Je, i as Ye, j as Ke, k as Ze, l as Qe, m as et, s as tt, n as nt, o as rt, t as ot } from "./selu_util-sntGesxr.js";
5
+ import { c as at, v as st, a as it } from "./scatter_nd_util-93ln7Hut.js";
6
6
  /**
7
7
  * @license
8
8
  * Copyright 2018 Google LLC. All Rights Reserved.
@@ -509,7 +509,7 @@ const Lt = 0.3275911, Dt = 0.254829592, bt = -0.284496736, Ut = 1.421413741, Mt
509
509
  * limitations under the License.
510
510
  * =============================================================================
511
511
  */
512
- function kt(e, t) {
512
+ function Pt(e, t) {
513
513
  if (e.length !== t.length)
514
514
  throw new Error(`Cannot merge real and imag arrays of different lengths. real:${e.length}, imag: ${t.length}.`);
515
515
  const n = new Float32Array(e.length * 2);
@@ -517,7 +517,7 @@ function kt(e, t) {
517
517
  n[r] = e[r / 2], n[r + 1] = t[r / 2];
518
518
  return n;
519
519
  }
520
- function Pt(e) {
520
+ function kt(e) {
521
521
  const t = new Float32Array(e.length / 2), n = new Float32Array(e.length / 2);
522
522
  for (let r = 0; r < e.length; r += 2)
523
523
  t[r / 2] = e[r], n[r / 2] = e[r + 1];
@@ -890,7 +890,7 @@ const Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
890
890
  getFusedBiasGradient: Qe,
891
891
  getFusedDyActivation: et,
892
892
  getImageCenter: At,
893
- getInnerMostAxes: ke,
893
+ getInnerMostAxes: Pe,
894
894
  getPermuted: It,
895
895
  getRaggedRank: wt,
896
896
  getReductionAxes: _e,
@@ -911,16 +911,16 @@ const Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
911
911
  getSparseSegmentReductionNegativeSegmentIdsErrorMessage: ln,
912
912
  getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage: fn,
913
913
  getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage: hn,
914
- getUndoAxesPermutation: Pe,
914
+ getUndoAxesPermutation: ke,
915
915
  isIdentityPermutation: Zt,
916
916
  log: Ie,
917
- mergeRealAndImagArrays: kt,
917
+ mergeRealAndImagArrays: Pt,
918
918
  prepareAndValidate: Tt,
919
919
  prepareSplitSize: en,
920
920
  segment_util: vn,
921
921
  shouldFuse: tt,
922
922
  slice_util: nt,
923
- splitRealAndImagArrays: Pt,
923
+ splitRealAndImagArrays: kt,
924
924
  stridesOrDilationsArePositive: rt,
925
925
  tupleValuesAreOne: ot,
926
926
  upcastType: Oe,
@@ -1245,9 +1245,9 @@ function Cn(e, t, n) {
1245
1245
  case 3:
1246
1246
  return Mn(e, t, n);
1247
1247
  case 4:
1248
- return kn(e, t, n);
1248
+ return Pn(e, t, n);
1249
1249
  case 5:
1250
- return Pn(e, t);
1250
+ return kn(e, t);
1251
1251
  case 6:
1252
1252
  return Wn(e, t);
1253
1253
  default:
@@ -1557,7 +1557,7 @@ function Bn(e, t, n) {
1557
1557
  }
1558
1558
  `;
1559
1559
  }
1560
- function kn(e, t, n) {
1560
+ function Pn(e, t, n) {
1561
1561
  if (n)
1562
1562
  return `
1563
1563
  ivec4 getOutputCoords() {
@@ -1579,7 +1579,7 @@ function kn(e, t, n) {
1579
1579
  }
1580
1580
  `;
1581
1581
  }
1582
- function Pn(e, t) {
1582
+ function kn(e, t) {
1583
1583
  const n = V(["r", "c", "d", "d2", "d3"], e);
1584
1584
  return `
1585
1585
  ivec5 getOutputCoords() {
@@ -1870,7 +1870,7 @@ function Jn(e, t) {
1870
1870
  return `
1871
1871
  ${U(h, t)}
1872
1872
  float ${o}(int row, int col) {
1873
- return ${o}(${k(d, i)});
1873
+ return ${o}(${P(d, i)});
1874
1874
  }
1875
1875
  `;
1876
1876
  }
@@ -1929,7 +1929,7 @@ function Yn(e, t) {
1929
1929
  return `
1930
1930
  ${ve(p, t)}
1931
1931
  vec4 ${o}(int b, int row, int col) {
1932
- return ${o}(${k(x, d)});
1932
+ return ${o}(${P(x, d)});
1933
1933
  }
1934
1934
  `;
1935
1935
  }
@@ -1961,7 +1961,7 @@ function Kn(e, t) {
1961
1961
  return `
1962
1962
  ${U(x, t)}
1963
1963
  float ${o}(int row, int col, int depth) {
1964
- return ${o}(${k(S, c)});
1964
+ return ${o}(${P(S, c)});
1965
1965
  }
1966
1966
  `;
1967
1967
  }
@@ -2065,7 +2065,7 @@ function Qn(e, t) {
2065
2065
  return `
2066
2066
  ${U(w, t)}
2067
2067
  float ${o}(int row, int col, int depth, int depth2) {
2068
- return ${o}(${k(F, l)});
2068
+ return ${o}(${P(F, l)});
2069
2069
  }
2070
2070
  `;
2071
2071
  }
@@ -2151,7 +2151,7 @@ function er(e) {
2151
2151
  return `
2152
2152
  ${U(x)}
2153
2153
  float ${r}(int row, int col, int depth, int depth2, int depth3) {
2154
- return ${r}(${k(S, l)});
2154
+ return ${r}(${P(S, l)});
2155
2155
  }
2156
2156
  `;
2157
2157
  }
@@ -2209,7 +2209,7 @@ function tr(e) {
2209
2209
  ${U(S)}
2210
2210
  float ${r}(int row, int col, int depth,
2211
2211
  int depth2, int depth3, int depth4) {
2212
- return ${r}(${k(g, a)});
2212
+ return ${r}(${P(g, a)});
2213
2213
  }
2214
2214
  `;
2215
2215
  }
@@ -2356,7 +2356,7 @@ function B(e, t) {
2356
2356
  const n = JSON.parse(JSON.stringify(e));
2357
2357
  return n.shapeInfo.logicalShape = t, n;
2358
2358
  }
2359
- function k(e, t) {
2359
+ function P(e, t) {
2360
2360
  return t.map((n) => e[n]).join(", ");
2361
2361
  }
2362
2362
  /**
@@ -2375,7 +2375,7 @@ function k(e, t) {
2375
2375
  * limitations under the License.
2376
2376
  * =============================================================================
2377
2377
  */
2378
- const I = {}, P = {
2378
+ const I = {}, k = {
2379
2379
  alpha: !1,
2380
2380
  antialias: !1,
2381
2381
  premultipliedAlpha: !1,
@@ -2411,10 +2411,10 @@ function ar(e, t) {
2411
2411
  const n = t ?? or(e);
2412
2412
  return n.addEventListener("webglcontextlost", (r) => {
2413
2413
  r.preventDefault(), delete I[e];
2414
- }, !1), m().getBool("SOFTWARE_WEBGL_ENABLED") && (P.failIfMajorPerformanceCaveat = !1), e === 1 ? (
2414
+ }, !1), m().getBool("SOFTWARE_WEBGL_ENABLED") && (k.failIfMajorPerformanceCaveat = !1), e === 1 ? (
2415
2415
  // tslint:disable-next-line
2416
- n.getContext("webgl", P) || n.getContext("experimental-webgl", P)
2417
- ) : n.getContext("webgl2", P);
2416
+ n.getContext("webgl", k) || n.getContext("experimental-webgl", k)
2417
+ ) : n.getContext("webgl2", k);
2418
2418
  }
2419
2419
  /**
2420
2420
  * @license
@@ -2575,11 +2575,11 @@ function Br(e, t) {
2575
2575
  if (v(e, () => e.validateProgram(t)), e.getProgramParameter(t, e.VALIDATE_STATUS) === !1)
2576
2576
  throw console.log(e.getProgramInfoLog(t)), new Error("Shader program validation failed.");
2577
2577
  }
2578
- function kr(e, t) {
2578
+ function Pr(e, t) {
2579
2579
  const n = C(e, () => e.createBuffer(), "Unable to create WebGLBuffer");
2580
2580
  return v(e, () => e.bindBuffer(e.ARRAY_BUFFER, n)), v(e, () => e.bufferData(e.ARRAY_BUFFER, t, e.STATIC_DRAW)), n;
2581
2581
  }
2582
- function Pr(e, t) {
2582
+ function kr(e, t) {
2583
2583
  const n = C(e, () => e.createBuffer(), "Unable to create WebGLBuffer");
2584
2584
  return v(e, () => e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, n)), v(e, () => e.bufferData(e.ELEMENT_ARRAY_BUFFER, t, e.STATIC_DRAW)), n;
2585
2585
  }
@@ -3026,7 +3026,7 @@ export {
3026
3026
  Dt as U,
3027
3027
  Lt as V,
3028
3028
  Ht as W,
3029
- Pt as X,
3029
+ kt as X,
3030
3030
  Wt as Y,
3031
3031
  Vt as Z,
3032
3032
  Gt as _,
@@ -3068,8 +3068,8 @@ export {
3068
3068
  xe as ae,
3069
3069
  ie as af,
3070
3070
  Ar as ag,
3071
- kr as ah,
3072
- Pr as ai,
3071
+ Pr as ah,
3072
+ kr as ai,
3073
3073
  v as aj,
3074
3074
  Ir as ak,
3075
3075
  br as al,
@@ -3098,7 +3098,7 @@ export {
3098
3098
  Ft as j,
3099
3099
  gt as k,
3100
3100
  wt as l,
3101
- kt as m,
3101
+ Pt as m,
3102
3102
  Rt as n,
3103
3103
  Tn as o,
3104
3104
  tn as p,
@@ -4142,33 +4142,33 @@ Bs();
4142
4142
  export {
4143
4143
  ne as $,
4144
4144
  Is as A,
4145
- Ge as B,
4146
- K as C,
4147
- ur as D,
4145
+ K as B,
4146
+ ur as C,
4147
+ Ja as D,
4148
4148
  g as E,
4149
- Ja as F,
4149
+ wo as F,
4150
4150
  Qr as G,
4151
- wo as H,
4152
- Xn as I,
4153
- Co as J,
4154
- wr as K,
4155
- Ha as L,
4151
+ Xn as H,
4152
+ Co as I,
4153
+ wr as J,
4154
+ Ha as K,
4155
+ Rt as L,
4156
4156
  Sa as M,
4157
- Rt as N,
4158
- yo as O,
4157
+ yo as N,
4158
+ In as O,
4159
4159
  Oa as P,
4160
- In as Q,
4160
+ An as Q,
4161
4161
  qa as R,
4162
4162
  So as S,
4163
4163
  x as T,
4164
- An as U,
4164
+ ei as U,
4165
4165
  Ps as V,
4166
4166
  $t as W,
4167
4167
  ao as X,
4168
4168
  ta as Y,
4169
4169
  xe as Z,
4170
4170
  br as _,
4171
- M as a,
4171
+ b as a,
4172
4172
  Ka as a$,
4173
4173
  vr as a0,
4174
4174
  ho as a1,
@@ -4233,7 +4233,7 @@ export {
4233
4233
  Xe as ax,
4234
4234
  A as ay,
4235
4235
  st as az,
4236
- b,
4236
+ tt as b,
4237
4237
  La as b$,
4238
4238
  so as b0,
4239
4239
  Go as b1,
@@ -4298,7 +4298,7 @@ export {
4298
4298
  vo as bx,
4299
4299
  Mo as by,
4300
4300
  nn as bz,
4301
- mi as c,
4301
+ Jo as c,
4302
4302
  xr as c$,
4303
4303
  Ga as c0,
4304
4304
  bo as c1,
@@ -4363,7 +4363,7 @@ export {
4363
4363
  _r as cx,
4364
4364
  Vr as cy,
4365
4365
  aa as cz,
4366
- ei as d,
4366
+ M as d,
4367
4367
  pa as d0,
4368
4368
  Xr as d1,
4369
4369
  sa as d2,
@@ -4408,25 +4408,25 @@ export {
4408
4408
  Ro as dy,
4409
4409
  xo as dz,
4410
4410
  ni as e,
4411
- q as f,
4412
- as as g,
4413
- Jo as h,
4414
- z as i,
4415
- os as j,
4416
- y as k,
4417
- Qt as l,
4411
+ as as f,
4412
+ z as g,
4413
+ os as h,
4414
+ y as i,
4415
+ Qt as j,
4416
+ Bn as k,
4417
+ mi as l,
4418
4418
  si as m,
4419
- Bn as n,
4420
- gi as o,
4419
+ gi as n,
4420
+ D as o,
4421
4421
  $e as p,
4422
- D as q,
4422
+ T as q,
4423
4423
  Xo as r,
4424
- tt as s,
4424
+ q as s,
4425
4425
  E as t,
4426
4426
  fe as u,
4427
4427
  hs as v,
4428
- T as w,
4429
- Tn as x,
4430
- Ct as y,
4428
+ Tn as w,
4429
+ Ct as x,
4430
+ Ge as y,
4431
4431
  C as z
4432
4432
  };
@@ -1,5 +1,5 @@
1
- import { j as B, i as G, ak as K, _ as W, al as z, am as V, ac as N, an as F, u as S } from "./index-CamYe_M8.js";
2
- import { u as O, f as Y, h as v } from "./gpgpu_math-B_ycgZ4W.js";
1
+ import { h as B, g as G, ak as K, _ as W, al as z, am as V, ac as N, an as F, u as S } from "./index-BAzbokzv.js";
2
+ import { u as O, f as Y, h as v } from "./gpgpu_math-CNslybmD.js";
3
3
  /**
4
4
  * @license
5
5
  * Copyright 2018 Google LLC. All Rights Reserved.
@@ -62,7 +62,7 @@ class q {
62
62
  `;
63
63
  }
64
64
  }
65
- const T = "if (isnan(x)) return x;", j = "return x;", pe = "return abs(x);", M = "return (x >= 0.0) ? x : (exp(x) - 1.0);", J = T + `
65
+ const T = "if (isnan(x)) return x;", M = "return x;", pe = "return abs(x);", j = "return (x >= 0.0) ? x : (exp(x) - 1.0);", J = T + `
66
66
  return (x < 0.0) ? 0.0 : x;
67
67
  `, Q = T + `
68
68
  return (x < 0.0) ? 0.0 : min(6.0, x);
@@ -424,11 +424,11 @@ function ye({ opSnippet: t, packedOpSnippet: e, checkOutOfBounds: s = !1, suppor
424
424
  }
425
425
  function Ie(t, e = !1) {
426
426
  if (t === "linear")
427
- return e ? ee : j;
427
+ return e ? ee : M;
428
428
  if (t === "relu")
429
429
  return e ? se : J;
430
430
  if (t === "elu")
431
- return e ? te : M;
431
+ return e ? te : j;
432
432
  if (t === "relu6")
433
433
  return e ? ae : Q;
434
434
  if (t === "prelu")
@@ -1,5 +1,5 @@
1
- import { T as g, c as p, e as o, o as v } from "../index-CamYe_M8.js";
2
- import { v as _ } from "../variable-CLVXjN7F.js";
1
+ import { T as g, l as p, e as o, n as v } from "../index-BAzbokzv.js";
2
+ import { v as _ } from "../variable-wSS22xj5.js";
3
3
  class M {
4
4
  parent;
5
5
  config;