@genai-fi/nanogpt 0.6.0 → 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 (121) hide show
  1. package/dist/Generator.js +7 -7
  2. package/dist/NanoGPTModel.js +70 -121
  3. package/dist/RealDiv-BYViZwhN.js +540 -0
  4. package/dist/Reshape-t7Kcikjk.js +127 -0
  5. package/dist/TeachableLLM.d.ts +2 -0
  6. package/dist/TeachableLLM.js +34 -27
  7. package/dist/{TiedEmbedding-BhxWO8QR.js → TiedEmbedding-9WeDwvjO.js} +12 -13
  8. package/dist/{axis_util-D17qZRQm.js → axis_util-Bu4h7XWV.js} +14 -12
  9. package/dist/{broadcast_to-BMQLjvt_.js → broadcast_to-DARN-DBD.js} +2 -2
  10. package/dist/{concat-DhZfF1GY.js → concat-5aPGqw3Z.js} +3 -3
  11. package/dist/{dataset-oilnemHf.js → dataset-pgqp-YfL.js} +3 -3
  12. package/dist/{dropout-CrMQPCeG.js → dropout-Bciw46HT.js} +7 -7
  13. package/dist/{gather-DZCMHZuN.js → gather-DjyCjmOD.js} +1 -1
  14. package/dist/gpgpu_math-CNslybmD.js +3115 -0
  15. package/dist/{index-bMBtI-WR.js → index-BAzbokzv.js} +846 -649
  16. package/dist/{kernel_funcs_utils-CNmjLWnB.js → kernel_funcs_utils-CUxJCg0g.js} +232 -138
  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/loader/load.d.ts +13 -0
  25. package/dist/loader/load.js +27 -0
  26. package/dist/loader/loadHF.d.ts +7 -0
  27. package/dist/loader/loadHF.js +22 -0
  28. package/dist/{utilities/load.d.ts → loader/loadTransformers.d.ts} +11 -11
  29. package/dist/loader/loadTransformers.js +28 -0
  30. package/dist/loader/newZipLoad.d.ts +8 -0
  31. package/dist/loader/newZipLoad.js +21 -0
  32. package/dist/loader/oldZipLoad.d.ts +7 -0
  33. package/dist/loader/oldZipLoad.js +76 -0
  34. package/dist/{log_sum_exp-BHdkCb4s.js → log_sum_exp-YEo2h3gb.js} +14 -14
  35. package/dist/main.js +23 -20
  36. package/dist/{mat_mul-BsrLfy81.js → mat_mul-7121rsJk.js} +1 -1
  37. package/dist/{max-DechV4Bc.js → max-DtlIuVeW.js} +1 -1
  38. package/dist/mulmat_packed_gpu-D4nKF7Je.js +71 -0
  39. package/dist/{norm-B9hWHZH1.js → norm-CzltS9Fz.js} +16 -16
  40. package/dist/{ones-g0K8jVwm.js → ones-BBlSRqn1.js} +2 -2
  41. package/dist/ops/appendCache.js +3 -3
  42. package/dist/ops/attentionMask.js +1 -1
  43. package/dist/ops/cpu/appendCache.js +2 -2
  44. package/dist/ops/cpu/attentionMask.js +6 -6
  45. package/dist/ops/cpu/fusedSoftmax.js +2 -2
  46. package/dist/ops/cpu/gatherSub.js +9 -9
  47. package/dist/ops/cpu/gelu.js +1 -1
  48. package/dist/ops/cpu/matMulGelu.js +1 -1
  49. package/dist/ops/cpu/matMulMul.js +1 -1
  50. package/dist/ops/cpu/mulDropout.js +1 -1
  51. package/dist/ops/cpu/normRMS.js +1 -1
  52. package/dist/ops/cpu/qkv.js +3 -3
  53. package/dist/ops/cpu/rope.js +5 -5
  54. package/dist/ops/cpu/scatterSub.js +17 -48
  55. package/dist/ops/fusedSoftmax.js +1 -1
  56. package/dist/ops/gatherSub.js +1 -1
  57. package/dist/ops/gelu.js +1 -1
  58. package/dist/ops/grads/attentionMask.js +1 -1
  59. package/dist/ops/grads/fusedSoftmax.js +4 -4
  60. package/dist/ops/grads/gelu.js +1 -1
  61. package/dist/ops/grads/matMulGelu.js +1 -1
  62. package/dist/ops/grads/normRMS.js +1 -1
  63. package/dist/ops/grads/qkv.js +1 -1
  64. package/dist/ops/grads/rope.js +1 -1
  65. package/dist/ops/matMulGelu.js +1 -1
  66. package/dist/ops/matMulMul.js +1 -1
  67. package/dist/ops/mulDrop.js +1 -1
  68. package/dist/ops/node/sparseCrossEntropy.js +1 -1
  69. package/dist/ops/normRMS.js +1 -1
  70. package/dist/ops/qkv.js +1 -1
  71. package/dist/ops/rope.js +8 -4
  72. package/dist/ops/scatterSub.js +1 -1
  73. package/dist/ops/webgl/appendCache.js +1 -1
  74. package/dist/ops/webgl/attentionMask.js +1 -1
  75. package/dist/ops/webgl/fusedSoftmax.js +29 -560
  76. package/dist/ops/webgl/gatherSub.js +1 -1
  77. package/dist/ops/webgl/gelu.js +2 -2
  78. package/dist/ops/webgl/log.js +3 -3
  79. package/dist/ops/webgl/matMulGelu.js +46 -113
  80. package/dist/ops/webgl/matMulMul.js +1 -1
  81. package/dist/ops/webgl/mulDropout.js +1 -1
  82. package/dist/ops/webgl/normRMS.js +2 -2
  83. package/dist/ops/webgl/qkv.js +1 -1
  84. package/dist/ops/webgl/rope.js +1 -1
  85. package/dist/ops/webgl/scatterSub.js +1 -1
  86. package/dist/{ops-Mv7Ta72x.js → ops-C0sQEcPw.js} +117 -109
  87. package/dist/{random_width-BBAWzDym.js → random_width-DWzaOgrn.js} +6925 -6291
  88. package/dist/{range-DMaG9A3G.js → range-DYsrnfiy.js} +1 -1
  89. package/dist/{gpgpu_math-Ctc31slO.js → reciprocal-CJQeasVa.js} +7 -5
  90. package/dist/register_all_kernels-BfFCQAqs.js +21397 -0
  91. package/dist/{reshape-T4yDEqoF.js → reshape-krWGKraP.js} +1 -1
  92. package/dist/scatter_nd_util-93ln7Hut.js +46 -0
  93. package/dist/selu_util-sntGesxr.js +740 -0
  94. package/dist/{shared-XNAoXhOa.js → shared-Ca6iDobD.js} +1462 -1089
  95. package/dist/{sin-EEhbrRO_.js → sin-D_h-qCSx.js} +1 -1
  96. package/dist/{softmax-B2_IKPDR.js → softmax-fsdtf6JC.js} +1 -1
  97. package/dist/{split-dcks18H1.js → split-eiktj-6L.js} +1 -1
  98. package/dist/{stack-lpJ5kYvE.js → stack-dfEEz2OY.js} +2 -2
  99. package/dist/{sum-CutF5lj2.js → sum-BE_Irnim.js} +1 -1
  100. package/dist/{tensor-C15NA2LA.js → tensor-Xyi595sG.js} +1 -1
  101. package/dist/{tensor2d-DZ_e5eKM.js → tensor2d-CPEkynbH.js} +1 -1
  102. package/dist/training/AdamExt.js +1 -1
  103. package/dist/training/DatasetBuilder.js +2 -2
  104. package/dist/training/FullTrainer.js +1 -1
  105. package/dist/training/Trainer.js +3 -3
  106. package/dist/training/sparseCrossEntropy.js +5 -5
  107. package/dist/utilities/dummy.d.ts +6 -0
  108. package/dist/utilities/dummy.js +31 -10
  109. package/dist/utilities/generate.js +3 -3
  110. package/dist/utilities/profile.d.ts +5 -0
  111. package/dist/utilities/profile.js +10 -7
  112. package/dist/utilities/safetensors.js +2 -2
  113. package/dist/utilities/save.js +1 -1
  114. package/dist/utilities/weights.js +2 -2
  115. package/dist/{variable-CdRKKp8x.js → variable-wSS22xj5.js} +1 -1
  116. package/dist/{zeros-CAbHfODe.js → zeros-YJDE7oRb.js} +4 -4
  117. package/package.json +2 -8
  118. package/dist/Reshape-CLOrdpve.js +0 -212
  119. package/dist/slice_util-Ddk0uxGJ.js +0 -49
  120. package/dist/tfjs_backend-BDb8r9qx.js +0 -1010
  121. package/dist/utilities/load.js +0 -99
@@ -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 "./loader/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-bMBtI-WR.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,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-DWzaOgrn.js";
26
+ import "./register_all_kernels-BfFCQAqs.js";
27
+ import "./dataset-pgqp-YfL.js";
26
28
  import "./ops/cpu/rope.js";
27
29
  import "./ops/webgl/rope.js";
28
30
  import "./ops/grads/rope.js";
@@ -41,13 +43,14 @@ import "./ops/cpu/normRMS.js";
41
43
  import "./ops/webgl/normRMS.js";
42
44
  import "./ops/grads/normRMS.js";
43
45
  import "./ops/webgl/log.js";
44
- import w from "./utilities/profile.js";
46
+ import k from "./utilities/profile.js";
45
47
  class a {
46
- ee = new _();
48
+ ee = new c();
47
49
  _config;
48
50
  _model;
49
51
  _tokeniser;
50
52
  _status = "loading";
53
+ _memoryRequirements;
51
54
  meta = {};
52
55
  constructor(t, e) {
53
56
  this._config = e?.config, this._tokeniser = t, this._model = e;
@@ -79,22 +82,26 @@ class a {
79
82
  get ready() {
80
83
  return this._status === "ready" && !!this._model && !!this._tokeniser && this.tokeniser.trained;
81
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
+ }
82
89
  setStatus(t) {
83
90
  this._status !== t && (this._status = t, this.ee.emit("status", t));
84
91
  }
85
92
  saveModel(t) {
86
93
  if (!this._model || !this._tokeniser)
87
94
  throw new Error("Model or tokeniser is not initialized.");
88
- return d(this._model, this._tokeniser, {
95
+ return f(this._model, this._tokeniser, {
89
96
  ...t,
90
97
  name: t?.name || this.meta.name
91
98
  });
92
99
  }
93
100
  static loadModel(t) {
94
101
  const e = new a();
95
- return f(t).then(({ model: r, tokeniser: s, name: o }) => {
96
- e._model = r, e._tokeniser = s, e._config = r.config, o && (e.meta.name = o), e.setStatus("warmup"), m(r).then(() => {
97
- e.setStatus("ready"), e.ee.emit("loaded");
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");
98
105
  }).catch((i) => {
99
106
  e.setStatus("error"), e.ee.emit("error", i);
100
107
  });
@@ -103,10 +110,10 @@ class a {
103
110
  }), e;
104
111
  }
105
112
  static create(t, e = {}) {
106
- const r = { ...h, ...e }, s = t === "char" ? new c(r.vocabSize) : new g(r.vocabSize), o = new l(r), i = new a(s, o);
107
- return i.setStatus("warmup"), m(o).then(() => {
108
- i.tokeniser.trained ? (i.setStatus("ready"), i.ee.emit("loaded")) : (i.setStatus("awaitingTokens"), i.ee.emit("loaded"), i.tokeniser.once("trainStatus", (n) => {
109
- n === "trained" && i.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");
110
117
  }));
111
118
  }).catch((n) => {
112
119
  i.setStatus("error"), i.ee.emit("error", n);
@@ -122,7 +129,7 @@ class a {
122
129
  if (t) {
123
130
  if (!this._config)
124
131
  throw new Error("Model is not initialized.");
125
- this._config.layerConfig.profiler || (this._config.layerConfig.profiler = new w());
132
+ this._config.layerConfig.profiler || (this._config.layerConfig.profiler = new k());
126
133
  } else
127
134
  this._config?.layerConfig.profiler && (this._config.layerConfig.profiler = void 0);
128
135
  }
@@ -134,11 +141,11 @@ class a {
134
141
  trainer() {
135
142
  if (!this._model || !this._tokeniser)
136
143
  throw new Error("Model or tokeniser is not initialized.");
137
- const t = new p(this._model, this._tokeniser);
144
+ const t = new _(this._model, this._tokeniser);
138
145
  return t.on("start", () => this.setStatus("training")), t.on("stop", () => this.setStatus("ready")), t.on("log", async (e, r) => {
139
- const s = this.ee.listeners("trainStep");
140
- for (const o of s)
141
- await o(e, r);
146
+ const o = this.ee.listeners("trainStep");
147
+ for (const s of o)
148
+ await s(e, r);
142
149
  }), t;
143
150
  }
144
151
  train(t, e) {
@@ -153,7 +160,7 @@ class a {
153
160
  generator() {
154
161
  if (!this._model || !this._tokeniser)
155
162
  throw new Error("model_or_tokeniser_not_initialized.");
156
- const t = new u(this._model, this._tokeniser);
163
+ const t = new p(this._model, this._tokeniser);
157
164
  return t.on("start", () => {
158
165
  this.status === "ready" && this.setStatus("busy");
159
166
  }), t.on("stop", () => {
@@ -1,9 +1,8 @@
1
- import { R as a } from "./random_width-BBAWzDym.js";
2
- import "./index-bMBtI-WR.js";
3
- import { d as s } from "./tfjs_backend-BDb8r9qx.js";
1
+ import { R as a, d as s } from "./random_width-DWzaOgrn.js";
2
+ import "./index-BAzbokzv.js";
4
3
  import o from "./layers/BaseLayer.js";
5
- import { v as m } from "./variable-CdRKKp8x.js";
6
- import { g as d } from "./gather-DZCMHZuN.js";
4
+ import { v as m } from "./variable-wSS22xj5.js";
5
+ import { g as d } from "./gather-DjyCjmOD.js";
7
6
  /**
8
7
  * @license
9
8
  * Copyright 2018 Google LLC
@@ -13,16 +12,16 @@ import { g as d } from "./gather-DZCMHZuN.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-bMBtI-WR.js";
1
+ import { i as c } from "./index-BAzbokzv.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-bMBtI-WR.js";
2
- import { r as T } from "./reshape-T4yDEqoF.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 { o as s, l as a, k as p, y as i, E as l, C as f } from "./index-bMBtI-WR.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.
@@ -17,13 +17,13 @@ import { o as s, l as a, k as p, y as i, E as l, C as f } from "./index-bMBtI-WR
17
17
  */
18
18
  function h(o, e = 0) {
19
19
  a(o.length >= 1, () => "Pass at least one tensor to concat");
20
- const t = p(o, "tensors", "concat", "string_or_numeric");
20
+ const t = i(o, "tensors", "concat", "string_or_numeric");
21
21
  if (t[0].dtype === "complex64" && t.forEach((n) => {
22
22
  if (n.dtype !== "complex64")
23
23
  throw new Error(`Cannot concatenate complex64 tensors with a tensor
24
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 { 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-bMBtI-WR.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-lpJ5kYvE.js";
4
- import { t as B } from "./tensor-C15NA2LA.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.
@@ -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-bMBtI-WR.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.
@@ -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);
183
+ const o = E(n, e), a = 1 - t, i = v(b(N(D(o, 0, 1, "float32", s), a)), a);
184
184
  return w(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,
191
- x as f,
190
+ q as d,
191
+ b 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-bMBtI-WR.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.