@genai-fi/nanogpt 0.5.6 → 0.6.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 (116) hide show
  1. package/dist/Generator.js +10 -9
  2. package/dist/NanoGPTModel.js +70 -121
  3. package/dist/RealDiv-7xu-pkZN.js +540 -0
  4. package/dist/Reshape-BYC1oUku.js +127 -0
  5. package/dist/TeachableLLM.d.ts +2 -0
  6. package/dist/TeachableLLM.js +42 -34
  7. package/dist/{TiedEmbedding-8S8xn8e6.js → TiedEmbedding-C1HBot-5.js} +12 -13
  8. package/dist/{axis_util-BczFISHz.js → axis_util-CCNL7jea.js} +14 -12
  9. package/dist/{broadcast_to-B7NGsBSh.js → broadcast_to-CddAF879.js} +2 -2
  10. package/dist/{concat-DdKPyAtw.js → concat-XOK9ANZu.js} +7 -7
  11. package/dist/{dataset-iqT4Otvb.js → dataset-BFFipD1c.js} +5 -5
  12. package/dist/{dropout-B09InSJS.js → dropout-xlKRoJyU.js} +9 -9
  13. package/dist/{gather-D6MsdXqc.js → gather-DKtUaTtA.js} +1 -1
  14. package/dist/gpgpu_math-B_ycgZ4W.js +3115 -0
  15. package/dist/{index-Du-bmOP8.js → index-CamYe_M8.js} +844 -647
  16. package/dist/{kernel_funcs_utils-DShm7-0k.js → kernel_funcs_utils-D5MS0JFg.js} +232 -136
  17. package/dist/layers/BaseLayer.js +2 -2
  18. package/dist/layers/CausalSelfAttention.js +6 -6
  19. package/dist/layers/MLP.js +5 -5
  20. package/dist/layers/RMSNorm.js +3 -3
  21. package/dist/layers/RoPECache.js +13 -33
  22. package/dist/layers/TiedEmbedding.js +6 -7
  23. package/dist/layers/TransformerBlock.js +1 -1
  24. package/dist/{log_sum_exp-CxfBtUaG.js → log_sum_exp-CV_5-TTu.js} +15 -15
  25. package/dist/main.js +24 -20
  26. package/dist/{mat_mul-CbiqIe2d.js → mat_mul-CAbRFWUj.js} +4 -4
  27. package/dist/{max-0Xnlpv8k.js → max-JBBv7aUf.js} +3 -3
  28. package/dist/mulmat_packed_gpu-DW4doKL_.js +71 -0
  29. package/dist/{norm-01kY9I2B.js → norm-B9dQTFYn.js} +12 -12
  30. package/dist/{ones-CrutWGas.js → ones-CMHNqMr6.js} +2 -2
  31. package/dist/ops/appendCache.js +3 -3
  32. package/dist/ops/attentionMask.js +1 -1
  33. package/dist/ops/cpu/appendCache.js +2 -2
  34. package/dist/ops/cpu/attentionMask.js +5 -5
  35. package/dist/ops/cpu/fusedSoftmax.js +2 -2
  36. package/dist/ops/cpu/gatherSub.js +5 -5
  37. package/dist/ops/cpu/gelu.js +1 -1
  38. package/dist/ops/cpu/matMulGelu.js +1 -1
  39. package/dist/ops/cpu/matMulMul.js +1 -1
  40. package/dist/ops/cpu/mulDropout.js +1 -1
  41. package/dist/ops/cpu/normRMS.js +1 -1
  42. package/dist/ops/cpu/qkv.js +3 -3
  43. package/dist/ops/cpu/rope.js +5 -5
  44. package/dist/ops/cpu/scatterSub.js +18 -49
  45. package/dist/ops/fusedSoftmax.js +1 -1
  46. package/dist/ops/gatherSub.js +1 -1
  47. package/dist/ops/gelu.js +1 -1
  48. package/dist/ops/grads/attentionMask.js +15 -11
  49. package/dist/ops/grads/fusedSoftmax.js +12 -10
  50. package/dist/ops/grads/gelu.js +1 -1
  51. package/dist/ops/grads/matMulGelu.js +1 -1
  52. package/dist/ops/grads/normRMS.js +1 -1
  53. package/dist/ops/grads/qkv.js +1 -1
  54. package/dist/ops/grads/rope.js +1 -1
  55. package/dist/ops/log.d.ts +0 -0
  56. package/dist/ops/log.js +1 -0
  57. package/dist/ops/matMulGelu.js +1 -1
  58. package/dist/ops/matMulMul.js +1 -1
  59. package/dist/ops/mulDrop.js +1 -1
  60. package/dist/ops/node/sparseCrossEntropy.js +1 -1
  61. package/dist/ops/normRMS.js +1 -1
  62. package/dist/ops/qkv.js +1 -1
  63. package/dist/ops/rope.js +8 -4
  64. package/dist/ops/scatterSub.js +1 -1
  65. package/dist/ops/webgl/appendCache.js +1 -1
  66. package/dist/ops/webgl/attentionMask.js +1 -1
  67. package/dist/ops/webgl/fusedSoftmax.js +31 -3379
  68. package/dist/ops/webgl/gatherSub.js +1 -1
  69. package/dist/ops/webgl/gelu.js +2 -2
  70. package/dist/{gpgpu_math-BFbOyvk4.js → ops/webgl/log.d.ts} +2 -8
  71. package/dist/ops/webgl/log.js +39 -0
  72. package/dist/ops/webgl/matMulGelu.js +48 -115
  73. package/dist/ops/webgl/matMulMul.js +1 -1
  74. package/dist/ops/webgl/mulDropout.js +1 -1
  75. package/dist/ops/webgl/normRMS.js +2 -2
  76. package/dist/ops/webgl/qkv.js +1 -1
  77. package/dist/ops/webgl/rope.js +1 -1
  78. package/dist/ops/webgl/scatterSub.js +1 -1
  79. package/dist/{ops-CJNniCAV.js → ops-DqtYemmV.js} +143 -135
  80. package/dist/{random_width-C-v-35bY.js → random_width-CLMQG5Jn.js} +6925 -6291
  81. package/dist/{range-Bvs1hidm.js → range-DqYjKnuG.js} +1 -1
  82. package/dist/reciprocal-z49filta.js +25 -0
  83. package/dist/register_all_kernels-COt6wLD0.js +21397 -0
  84. package/dist/{reshape-BH7eBpwq.js → reshape-C45vIIRU.js} +1 -1
  85. package/dist/scatter_nd_util-qgtnviTE.js +46 -0
  86. package/dist/selu_util-4QV_GXTB.js +740 -0
  87. package/dist/shared-ByfrGA97.js +3199 -0
  88. package/dist/{sin-CPAZXNjH.js → sin-9JBrfVaB.js} +1 -1
  89. package/dist/{softmax-DhWoBa7r.js → softmax-DvMvui-_.js} +1 -1
  90. package/dist/{split-BCUhuU7B.js → split-DxrHrPFK.js} +4 -4
  91. package/dist/{stack-BV1v7l3S.js → stack-DgaoDmnF.js} +1 -1
  92. package/dist/{sum-Cvq06317.js → sum-BpcpxNEh.js} +3 -3
  93. package/dist/{tensor-DgTOPY6h.js → tensor-CDz5x1mP.js} +1 -1
  94. package/dist/{tensor2d-CRWjDyUe.js → tensor2d-jO8JY5Jd.js} +1 -1
  95. package/dist/training/AdamExt.js +1 -1
  96. package/dist/training/DatasetBuilder.js +2 -2
  97. package/dist/training/FullTrainer.js +1 -1
  98. package/dist/training/Trainer.js +3 -3
  99. package/dist/training/sparseCrossEntropy.js +4 -4
  100. package/dist/utilities/dummy.d.ts +6 -0
  101. package/dist/utilities/dummy.js +31 -10
  102. package/dist/utilities/generate.js +3 -3
  103. package/dist/utilities/load.d.ts +25 -0
  104. package/dist/utilities/load.js +89 -37
  105. package/dist/utilities/profile.d.ts +5 -0
  106. package/dist/utilities/profile.js +12 -9
  107. package/dist/utilities/safetensors.d.ts +3 -0
  108. package/dist/utilities/safetensors.js +83 -0
  109. package/dist/utilities/save.js +47 -29
  110. package/dist/utilities/weights.js +2 -2
  111. package/dist/{variable-DZ3fF0R2.js → variable-CLVXjN7F.js} +1 -1
  112. package/dist/{zeros-BaHhQTWf.js → zeros-DUkkVccu.js} +8 -8
  113. package/package.json +3 -9
  114. package/dist/Reshape-Biok_3X1.js +0 -212
  115. package/dist/slice_util-DskXqRZa.js +0 -49
  116. package/dist/tfjs_backend-D9Ytje0G.js +0 -1010
@@ -1,17 +1,17 @@
1
- import { defaultConfig as h } from "./config.js";
1
+ import { defaultConfig as d } from "./config.js";
2
2
  import l from "./NanoGPTModel.js";
3
- import { saveModel as d } from "./utilities/save.js";
4
- import { loadModel as f } from "./utilities/load.js";
5
- import u from "./Generator.js";
6
- import p from "./Trainer.js";
7
- import { E as _ } from "./index-Dwqa6Zy2.js";
8
- import { dummyPassAsync as m } from "./utilities/dummy.js";
9
- import c from "./tokeniser/CharTokeniser.js";
10
- import g from "./tokeniser/bpe.js";
3
+ import { saveModel as f } from "./utilities/save.js";
4
+ import { loadModel as u } from "./utilities/load.js";
5
+ import p from "./Generator.js";
6
+ import _ from "./Trainer.js";
7
+ import { E as c } from "./index-Dwqa6Zy2.js";
8
+ import { dummyPassTrainAsync as m } from "./utilities/dummy.js";
9
+ import g from "./tokeniser/CharTokeniser.js";
10
+ 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-Du-bmOP8.js";
14
+ import "./index-CamYe_M8.js";
15
15
  import "./ops/cpu/scatterSub.js";
16
16
  import "./ops/webgl/scatterSub.js";
17
17
  import "./ops/cpu/gatherSub.js";
@@ -22,7 +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 "@tensorflow/tfjs";
25
+ import "./random_width-CLMQG5Jn.js";
26
+ import "./register_all_kernels-COt6wLD0.js";
27
+ import "./dataset-BFFipD1c.js";
26
28
  import "./ops/cpu/rope.js";
27
29
  import "./ops/webgl/rope.js";
28
30
  import "./ops/grads/rope.js";
@@ -40,13 +42,15 @@ import "./ops/grads/gelu.js";
40
42
  import "./ops/cpu/normRMS.js";
41
43
  import "./ops/webgl/normRMS.js";
42
44
  import "./ops/grads/normRMS.js";
43
- import w from "./utilities/profile.js";
45
+ import "./ops/webgl/log.js";
46
+ import k from "./utilities/profile.js";
44
47
  class a {
45
- ee = new _();
48
+ ee = new c();
46
49
  _config;
47
50
  _model;
48
51
  _tokeniser;
49
52
  _status = "loading";
53
+ _memoryRequirements;
50
54
  meta = {};
51
55
  constructor(t, e) {
52
56
  this._config = e?.config, this._tokeniser = t, this._model = e;
@@ -78,38 +82,42 @@ class a {
78
82
  get ready() {
79
83
  return this._status === "ready" && !!this._model && !!this._tokeniser && this.tokeniser.trained;
80
84
  }
85
+ estimateTrainingMemoryUsage(t) {
86
+ const e = this._memoryRequirements ?? { perBatch: 0, gradients: 0 }, r = e.perBatch * t, o = e.gradients;
87
+ return r * 0.66 + o * 4;
88
+ }
81
89
  setStatus(t) {
82
90
  this._status !== t && (this._status = t, this.ee.emit("status", t));
83
91
  }
84
92
  saveModel(t) {
85
93
  if (!this._model || !this._tokeniser)
86
94
  throw new Error("Model or tokeniser is not initialized.");
87
- return d(this._model, this._tokeniser, {
95
+ return f(this._model, this._tokeniser, {
88
96
  ...t,
89
97
  name: t?.name || this.meta.name
90
98
  });
91
99
  }
92
100
  static loadModel(t) {
93
101
  const e = new a();
94
- return f(t).then(({ model: i, tokeniser: s }) => {
95
- e._model = i, e._tokeniser = s, e._config = i.config, e.setStatus("warmup"), m(i).then(() => {
96
- e.setStatus("ready"), e.ee.emit("loaded");
97
- }).catch((o) => {
98
- e.setStatus("error"), e.ee.emit("error", o);
102
+ return u(t).then(({ model: r, tokeniser: o, name: s }) => {
103
+ e._model = r, e._tokeniser = o, e._config = r.config, s && (e.meta.name = s), e.setStatus("warmup"), m(r).then((i) => {
104
+ e._memoryRequirements = i, e.setStatus("ready"), e.ee.emit("loaded");
105
+ }).catch((i) => {
106
+ e.setStatus("error"), e.ee.emit("error", i);
99
107
  });
100
- }).catch((i) => {
101
- e.setStatus("error"), e.ee.emit("error", i);
108
+ }).catch((r) => {
109
+ e.setStatus("error"), e.ee.emit("error", r);
102
110
  }), e;
103
111
  }
104
112
  static create(t, e = {}) {
105
- const i = { ...h, ...e }, s = t === "char" ? new c(i.vocabSize) : new g(i.vocabSize), o = new l(i), r = new a(s, o);
106
- return r.setStatus("warmup"), m(o).then(() => {
107
- r.tokeniser.trained ? (r.setStatus("ready"), r.ee.emit("loaded")) : (r.setStatus("awaitingTokens"), r.ee.emit("loaded"), r.tokeniser.once("trainStatus", (n) => {
108
- n === "trained" && r.setStatus("ready");
113
+ const r = { ...d, ...e }, o = t === "char" ? new g(r.vocabSize) : new w(r.vocabSize), s = new l(r), i = new a(o, s);
114
+ return i.setStatus("warmup"), m(s).then((n) => {
115
+ i._memoryRequirements = n, i.tokeniser.trained ? (i.setStatus("ready"), i.ee.emit("loaded")) : (i.setStatus("awaitingTokens"), i.ee.emit("loaded"), i.tokeniser.once("trainStatus", (h) => {
116
+ h === "trained" && i.setStatus("ready");
109
117
  }));
110
118
  }).catch((n) => {
111
- r.setStatus("error"), r.ee.emit("error", n);
112
- }), r;
119
+ i.setStatus("error"), i.ee.emit("error", n);
120
+ }), i;
113
121
  }
114
122
  getProfiler() {
115
123
  return this._model?.getProfiler();
@@ -121,7 +129,7 @@ class a {
121
129
  if (t) {
122
130
  if (!this._config)
123
131
  throw new Error("Model is not initialized.");
124
- this._config.layerConfig.profiler || (this._config.layerConfig.profiler = new w());
132
+ this._config.layerConfig.profiler || (this._config.layerConfig.profiler = new k());
125
133
  } else
126
134
  this._config?.layerConfig.profiler && (this._config.layerConfig.profiler = void 0);
127
135
  }
@@ -133,11 +141,11 @@ class a {
133
141
  trainer() {
134
142
  if (!this._model || !this._tokeniser)
135
143
  throw new Error("Model or tokeniser is not initialized.");
136
- const t = new p(this._model, this._tokeniser);
137
- return t.on("start", () => this.setStatus("training")), t.on("stop", () => this.setStatus("ready")), t.on("log", async (e, i) => {
138
- const s = this.ee.listeners("trainStep");
139
- for (const o of s)
140
- await o(e, i);
144
+ const t = new _(this._model, this._tokeniser);
145
+ return t.on("start", () => this.setStatus("training")), t.on("stop", () => this.setStatus("ready")), t.on("log", async (e, r) => {
146
+ const o = this.ee.listeners("trainStep");
147
+ for (const s of o)
148
+ await s(e, r);
141
149
  }), t;
142
150
  }
143
151
  train(t, e) {
@@ -152,7 +160,7 @@ class a {
152
160
  generator() {
153
161
  if (!this._model || !this._tokeniser)
154
162
  throw new Error("model_or_tokeniser_not_initialized.");
155
- const t = new u(this._model, this._tokeniser);
163
+ const t = new p(this._model, this._tokeniser);
156
164
  return t.on("start", () => {
157
165
  this.status === "ready" && this.setStatus("busy");
158
166
  }), t.on("stop", () => {
@@ -1,9 +1,8 @@
1
- import { R as a } from "./random_width-C-v-35bY.js";
2
- import "./index-Du-bmOP8.js";
3
- import { d as s } from "./tfjs_backend-D9Ytje0G.js";
1
+ import { R as a, d as s } from "./random_width-CLMQG5Jn.js";
2
+ import "./index-CamYe_M8.js";
4
3
  import o from "./layers/BaseLayer.js";
5
- import { v as m } from "./variable-DZ3fF0R2.js";
6
- import { g as d } from "./gather-D6MsdXqc.js";
4
+ import { v as m } from "./variable-CLVXjN7F.js";
5
+ import { g as d } from "./gather-DKtUaTtA.js";
7
6
  /**
8
7
  * @license
9
8
  * Copyright 2018 Google LLC
@@ -13,16 +12,16 @@ import { g as d } from "./gather-D6MsdXqc.js";
13
12
  * https://opensource.org/licenses/MIT.
14
13
  * =============================================================================
15
14
  */
16
- function n(e) {
17
- return new a(e);
15
+ function n(i) {
16
+ return new a(i);
18
17
  }
19
- class c extends o {
18
+ class S extends o {
20
19
  vocabSize;
21
20
  embedDim;
22
21
  initializer;
23
22
  WEIGHTS;
24
- constructor(t, i, r) {
25
- super(t, r), this.WEIGHTS = i, this.vocabSize = t.gpt.vocabSize, this.embedDim = t.gpt.nEmbed, this.initializer = n({
23
+ constructor(t, e, r) {
24
+ super(t, r), this.WEIGHTS = e, this.vocabSize = t.gpt.vocabSize, this.embedDim = t.gpt.nEmbed, this.initializer = n({
26
25
  mean: 0,
27
26
  stddev: 0.02
28
27
  }), this.addVariable(this.WEIGHTS, m(this.initializer.apply([this.vocabSize, this.embedDim]), !0));
@@ -34,11 +33,11 @@ class c extends o {
34
33
  return s(t, this.getVariable(this.WEIGHTS).transpose());
35
34
  }
36
35
  // Dummy, should not be used.
37
- forward(t, i) {
38
- return this.project(i);
36
+ forward(t, e) {
37
+ return this.project(e);
39
38
  }
40
39
  }
41
40
  export {
42
- c as T,
41
+ S as T,
43
42
  n as r
44
43
  };
@@ -1,4 +1,4 @@
1
- import { l as c } from "./index-Du-bmOP8.js";
1
+ import { k as c } from "./index-CamYe_M8.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2017 Google LLC. All Rights Reserved.
@@ -21,28 +21,28 @@ function i(e, n) {
21
21
  return !1;
22
22
  return !0;
23
23
  }
24
- function l(e, n, t) {
24
+ function a(e, n, t) {
25
25
  const r = e.length + n.length, s = [];
26
26
  let o = 0, f = 0;
27
27
  for (let u = 0; u < r; u++)
28
28
  t.indexOf(u) === -1 ? s.push(e[o++]) : s.push(n[f++]);
29
29
  return s;
30
30
  }
31
- function a(e, n) {
31
+ function l(e, n) {
32
32
  const t = [], r = e.length;
33
33
  for (let o = 0; o < r; o++)
34
34
  n.indexOf(o) === -1 && t.push(e[o]);
35
35
  const s = n.map((o) => e[o]);
36
36
  return [t, s];
37
37
  }
38
- function m(e, n) {
38
+ function h(e, n) {
39
39
  const t = n.map((r) => 1);
40
- return l(e, t, n);
40
+ return a(e, t, n);
41
41
  }
42
- function d(e, n, t) {
42
+ function m(e, n, t) {
43
43
  c(i(n, t), () => `${e} supports only inner-most axes for now. Got axes ${n} and rank-${t} input.`);
44
44
  }
45
- function h(e, n) {
45
+ function d(e, n) {
46
46
  if (i(e, n))
47
47
  return null;
48
48
  const t = [];
@@ -61,9 +61,11 @@ function x(e, n) {
61
61
  }
62
62
  export {
63
63
  x as a,
64
- d as b,
65
- a as c,
66
- g as d,
67
- m as e,
68
- h as g
64
+ m as b,
65
+ l as c,
66
+ i as d,
67
+ h as e,
68
+ a as f,
69
+ d as g,
70
+ g as h
69
71
  };
@@ -1,5 +1,5 @@
1
- import { o as h, j as f, n as p, y as g, E as u, L as b } from "./index-Du-bmOP8.js";
2
- import { r as T } from "./reshape-BH7eBpwq.js";
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";
3
3
  /**
4
4
  * @license
5
5
  * Copyright 2020 Google LLC. All Rights Reserved.
@@ -1,4 +1,4 @@
1
- import { o as s, l as a, k as p, y as i, E as l, C as f } from "./index-Du-bmOP8.js";
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";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2020 Google LLC. All Rights Reserved.
@@ -15,13 +15,13 @@ import { o as s, l as a, k as p, y as i, E as l, C as f } from "./index-Du-bmOP8
15
15
  * limitations under the License.
16
16
  * =============================================================================
17
17
  */
18
- function h(o, e = 0) {
19
- a(o.length >= 1, () => "Pass at least one tensor to concat");
20
- const t = p(o, "tensors", "concat", "string_or_numeric");
21
- if (t[0].dtype === "complex64" && t.forEach((n) => {
22
- if (n.dtype !== "complex64")
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")
23
23
  throw new Error(`Cannot concatenate complex64 tensors with a tensor
24
- with dtype ${n.dtype}. `);
24
+ with dtype ${o.dtype}. `);
25
25
  }), t.length === 1)
26
26
  return i(t[0]);
27
27
  const r = t, c = { axis: e };
@@ -1,7 +1,7 @@
1
- import { af as S, T as h, N, a as v, ag as o, ah as p, ai as g, l as k, t as y } from "./index-Du-bmOP8.js";
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";
2
2
  import { s as R } from "./index-C4L8Cm77.js";
3
- import { s as $ } from "./stack-BV1v7l3S.js";
4
- import { t as B } from "./tensor-DgTOPY6h.js";
3
+ import { s as $ } from "./stack-DgaoDmnF.js";
4
+ import { t as B } from "./tensor-CDz5x1mP.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 (N().get("IS_BROWSER"))
78
+ if (k().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
- k(t > 0, () => `batchSize needs to be positive, but it is
933
+ N(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 { o as l, j as h, E as m, aj as p, n as c, ak as d, ad as g, l as u, T as V, al as v, a8 as N, b as w } from "./index-Du-bmOP8.js";
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";
2
2
  import { s as f } from "./index-C4L8Cm77.js";
3
3
  /**
4
4
  * @license
@@ -69,7 +69,7 @@ class T {
69
69
  return t <= this.upper && t >= this.lower;
70
70
  }
71
71
  }
72
- class $ {
72
+ class y {
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 $ {
98
98
  * limitations under the License.
99
99
  * =============================================================================
100
100
  */
101
- function y(r, t = 0, e = 1, s, n) {
101
+ function $(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 y(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_: y });
109
+ const _ = /* @__PURE__ */ l({ randomNormal_: $ });
110
110
  /**
111
111
  * @license
112
112
  * Copyright 2020 Google LLC. All Rights Reserved.
@@ -125,7 +125,7 @@ const _ = /* @__PURE__ */ l({ randomNormal_: y });
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 $(t, e, null, n);
128
+ const o = d(r, s), a = new y(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(N(D(o, 0, 1, "float32", s), a)), a);
184
- return w(n, i);
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);
185
185
  }
186
- const G = /* @__PURE__ */ l({ dropout_: R });
186
+ const q = /* @__PURE__ */ l({ dropout_: R });
187
187
  export {
188
188
  T as M,
189
189
  D as a,
190
- G as d,
190
+ q as d,
191
191
  x as f,
192
192
  _ as r
193
193
  };
@@ -1,4 +1,4 @@
1
- import { o as g, j as t, E as h, G as p } from "./index-Du-bmOP8.js";
1
+ import { q as g, w as t, E as h, G as p } from "./index-CamYe_M8.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2018 Google LLC. All Rights Reserved.