@genai-fi/nanogpt 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/dist/Generator.js +30 -30
  2. package/dist/{RealDiv-ioj6Z-ox.js → RealDiv-CGwv0liw.js} +9 -9
  3. package/dist/{Reshape-BZC-ebeR.js → Reshape-BW__R4mZ.js} +7 -7
  4. package/dist/{Reshape-pwprEaej.js → Reshape-CPBkTIH2.js} +1 -1
  5. package/dist/TeachableLLM.js +17 -17
  6. package/dist/Trainer.js +97 -95
  7. package/dist/{axis_util-QWWgLjut.js → axis_util-GTVlo58H.js} +1 -1
  8. package/dist/backend.js +2 -2
  9. package/dist/{backend_util-qwSFfxYx.js → backend_util-GaFarB78.js} +21 -21
  10. package/dist/{backend_webgpu-DI2wXEC2.js → backend_webgpu-BqASlsbV.js} +8 -8
  11. package/dist/{broadcast_to-C_EJTVTZ.js → broadcast_to-eS93CCN_.js} +2 -2
  12. package/dist/checks/appendCache.js +2 -2
  13. package/dist/checks/attentionMask.js +5 -5
  14. package/dist/checks/gelu.js +2 -2
  15. package/dist/checks/matMulGelu.js +2 -2
  16. package/dist/checks/normRMS.js +6 -6
  17. package/dist/checks/normRMSGrad.js +3 -3
  18. package/dist/checks/packUnpack.js +6 -6
  19. package/dist/checks/qkv.js +2 -2
  20. package/dist/checks/rope.js +2 -2
  21. package/dist/{clip_by_value-CLAD4h_I.js → clip_by_value-DDA7rrcT.js} +1 -1
  22. package/dist/complex-DI35Q-gW.js +11 -0
  23. package/dist/{concat-Dqk7Xk7h.js → concat-CAQpCret.js} +5 -5
  24. package/dist/{concat_util-C1Mxe27t.js → concat_util-D18dJ4fD.js} +1 -1
  25. package/dist/{dataset-DlqAN81i.js → dataset-CGGp1z9P.js} +3 -3
  26. package/dist/{dropout_util-N0z8Os-K.js → dropout_util--NxWuYg2.js} +1 -1
  27. package/dist/{expand_dims-D0rBtgT1.js → expand_dims-Bkd1YD5x.js} +4 -4
  28. package/dist/{exports_initializers-DIOZQt_L.js → exports_initializers-CYzKLjN7.js} +1 -1
  29. package/dist/{floor-CymuCmTO.js → floor-BQtb-Azg.js} +1 -1
  30. package/dist/{gather-DEyjXNb1.js → gather-qIqEqaGn.js} +1 -1
  31. package/dist/{gelu-DpTCC3eB.js → gelu-B220X1Go.js} +1 -1
  32. package/dist/{gpgpu_math-3bCb5ooU.js → gpgpu_math-BwvV12df.js} +25 -25
  33. package/dist/{index-DSGwv2Yx.js → index-CUXkjxiT.js} +33 -33
  34. package/dist/{index-BQvB7LCC.js → index-CjOWnMXP.js} +15 -15
  35. package/dist/{kernel_funcs_utils-DGqzNlHT.js → kernel_funcs_utils-pq0CK9co.js} +6 -6
  36. package/dist/layers/BaseLayer.js +4 -4
  37. package/dist/layers/CausalSelfAttention.d.ts +1 -0
  38. package/dist/layers/CausalSelfAttention.js +14 -14
  39. package/dist/layers/LoRA.js +4 -4
  40. package/dist/layers/MLP.js +4 -4
  41. package/dist/layers/PositionEmbedding.js +5 -5
  42. package/dist/layers/RMSNorm.js +3 -3
  43. package/dist/layers/RoPECache.js +4 -4
  44. package/dist/layers/TiedEmbedding.js +6 -6
  45. package/dist/layers/TransformerBlock.d.ts +1 -0
  46. package/dist/layers/TransformerBlock.js +1 -1
  47. package/dist/layers/WeightStore.js +2 -2
  48. package/dist/loader/loadTransformers.js +9 -9
  49. package/dist/loader/oldZipLoad.js +9 -9
  50. package/dist/loader/save.js +38 -30
  51. package/dist/loader/types.d.ts +1 -0
  52. package/dist/main.js +9 -9
  53. package/dist/{matMul16-BIT70Vya.js → matMul16-BcVC_E62.js} +3 -3
  54. package/dist/{matMulGelu-CsZnh18H.js → matMulGelu-JNLZqKQp.js} +18 -18
  55. package/dist/mat_mul-DhG0Newp.js +11 -0
  56. package/dist/mod-CSdCpRjf.js +11 -0
  57. package/dist/models/NanoGPTV1.js +2 -2
  58. package/dist/models/NanoGPTV2.js +2 -2
  59. package/dist/models/model.d.ts +1 -0
  60. package/dist/models/model.js +9 -9
  61. package/dist/{not_equal-CkQKkKZy.js → not_equal-hurPF26l.js} +15 -15
  62. package/dist/{ones-DbVB5N58.js → ones-BytntneX.js} +3 -3
  63. package/dist/ops/adamAdjust.js +3 -3
  64. package/dist/ops/adamMoments.js +3 -3
  65. package/dist/ops/add16.js +1 -1
  66. package/dist/ops/appendCache.js +6 -6
  67. package/dist/ops/attentionMask.js +3 -3
  68. package/dist/ops/concat16.js +3 -3
  69. package/dist/ops/cpu/adamAdjust.js +9 -9
  70. package/dist/ops/cpu/adamMoments.js +5 -5
  71. package/dist/ops/cpu/appendCache.js +2 -2
  72. package/dist/ops/cpu/attentionMask.js +6 -6
  73. package/dist/ops/cpu/fusedSoftmax.js +4 -4
  74. package/dist/ops/cpu/gatherSub.js +5 -5
  75. package/dist/ops/cpu/gelu.js +4 -4
  76. package/dist/ops/cpu/matMul16.js +2 -2
  77. package/dist/ops/cpu/matMulGelu.js +7 -7
  78. package/dist/ops/cpu/matMulMul.js +2 -2
  79. package/dist/ops/cpu/mulDropout.js +5 -5
  80. package/dist/ops/cpu/normRMS.js +1 -1
  81. package/dist/ops/cpu/qkv.js +3 -3
  82. package/dist/ops/cpu/rope.js +5 -5
  83. package/dist/ops/cpu/scatterSub.js +5 -5
  84. package/dist/ops/dot16.js +2 -2
  85. package/dist/ops/dropout.js +6 -6
  86. package/dist/ops/dropout16.js +1 -1
  87. package/dist/ops/gatherSub.js +1 -1
  88. package/dist/ops/gelu.js +2 -2
  89. package/dist/ops/globalNorm.js +7 -7
  90. package/dist/ops/grads/add16.js +1 -1
  91. package/dist/ops/grads/attentionMask.js +2 -2
  92. package/dist/ops/grads/dropout16.js +1 -1
  93. package/dist/ops/grads/gelu.js +2 -2
  94. package/dist/ops/grads/matMul16.js +3 -3
  95. package/dist/ops/grads/matMulGelu.js +1 -1
  96. package/dist/ops/grads/mul16.js +1 -1
  97. package/dist/ops/grads/normRMS.js +7 -7
  98. package/dist/ops/grads/pack16.js +3 -3
  99. package/dist/ops/grads/qkv.js +11 -11
  100. package/dist/ops/grads/rope.js +2 -2
  101. package/dist/ops/grads/softmax16.js +1 -1
  102. package/dist/ops/grads/unpack16.js +2 -2
  103. package/dist/ops/matMul16.js +3 -3
  104. package/dist/ops/matMulGelu.js +6 -6
  105. package/dist/ops/matMulMul.js +3 -3
  106. package/dist/ops/mul16.js +1 -1
  107. package/dist/ops/mulDrop.js +3 -3
  108. package/dist/ops/normRMS.js +4 -4
  109. package/dist/ops/pack16.js +2 -2
  110. package/dist/ops/qkv.js +3 -3
  111. package/dist/ops/reshape16.js +6 -6
  112. package/dist/ops/rope.js +2 -2
  113. package/dist/ops/scatterSub.js +1 -1
  114. package/dist/ops/slice16.js +2 -2
  115. package/dist/ops/softmax16.js +1 -1
  116. package/dist/ops/sub16.js +1 -1
  117. package/dist/ops/sum16.js +6 -6
  118. package/dist/ops/transpose16.js +3 -3
  119. package/dist/ops/unpack16.js +2 -2
  120. package/dist/ops/webgl/adamAdjust.js +2 -2
  121. package/dist/ops/webgl/adamMoments.js +1 -1
  122. package/dist/ops/webgl/appendCache.js +1 -1
  123. package/dist/ops/webgl/attentionMask.js +1 -1
  124. package/dist/ops/webgl/dropout16.js +1 -1
  125. package/dist/ops/webgl/fusedSoftmax.js +7 -7
  126. package/dist/ops/webgl/gatherSub.js +3 -3
  127. package/dist/ops/webgl/gelu.js +2 -2
  128. package/dist/ops/webgl/log.js +3 -3
  129. package/dist/ops/webgl/matMul16.js +13 -13
  130. package/dist/ops/webgl/matMulGelu.js +4 -4
  131. package/dist/ops/webgl/matMulMul.js +2 -2
  132. package/dist/ops/webgl/mulDropout.js +1 -1
  133. package/dist/ops/webgl/normRMS.js +2 -2
  134. package/dist/ops/webgl/qkv.js +1 -1
  135. package/dist/ops/webgl/rope.js +1 -1
  136. package/dist/ops/webgl/scatterSub.js +2 -2
  137. package/dist/ops/webgpu/adamAdjust.js +3 -3
  138. package/dist/ops/webgpu/adamMoments.js +3 -3
  139. package/dist/ops/webgpu/add16.js +6 -6
  140. package/dist/ops/webgpu/appendCache.js +3 -3
  141. package/dist/ops/webgpu/attentionMask.js +2 -2
  142. package/dist/ops/webgpu/attentionMask32_program.js +2 -2
  143. package/dist/ops/webgpu/clipScale.js +7 -7
  144. package/dist/ops/webgpu/concat16.js +5 -5
  145. package/dist/ops/webgpu/dropout16.js +6 -6
  146. package/dist/ops/webgpu/gatherSub.js +3 -3
  147. package/dist/ops/webgpu/gelu.js +8 -8
  148. package/dist/ops/webgpu/matMul16.js +16 -16
  149. package/dist/ops/webgpu/matMul16_program.js +2 -2
  150. package/dist/ops/webgpu/mul16.js +5 -5
  151. package/dist/ops/webgpu/norm2.js +1 -1
  152. package/dist/ops/webgpu/normRMS.js +2 -2
  153. package/dist/ops/webgpu/normRMSGrad.js +4 -4
  154. package/dist/ops/webgpu/pack16.js +4 -4
  155. package/dist/ops/webgpu/pack16_program.js +2 -2
  156. package/dist/ops/webgpu/qkv.js +2 -2
  157. package/dist/ops/webgpu/rope.js +3 -3
  158. package/dist/ops/webgpu/scatterSub.js +3 -3
  159. package/dist/ops/webgpu/slice16.js +4 -4
  160. package/dist/ops/webgpu/softmax16.js +4 -4
  161. package/dist/ops/webgpu/softmax16_program.js +2 -2
  162. package/dist/ops/webgpu/softmax16_subgroup_program.js +2 -2
  163. package/dist/ops/webgpu/softmax16grad.js +4 -4
  164. package/dist/ops/webgpu/sub16.js +6 -6
  165. package/dist/ops/webgpu/sum16.js +3 -3
  166. package/dist/ops/webgpu/transpose16.js +8 -8
  167. package/dist/ops/webgpu/transpose16_program.js +2 -2
  168. package/dist/ops/webgpu/transpose16_shared_program.js +3 -3
  169. package/dist/ops/webgpu/unpack16.js +3 -3
  170. package/dist/ops/webgpu/utils/binary_op.js +3 -3
  171. package/dist/ops/webgpu/utils/reductions.js +5 -5
  172. package/dist/{ops-CURIZSVt.js → ops-CsXeTq1P.js} +100 -100
  173. package/dist/{pack16-WlOSOuZA.js → pack16-bqltoUlR.js} +2 -2
  174. package/dist/patches/webgpu_backend.js +6 -6
  175. package/dist/patches/webgpu_base.js +1 -1
  176. package/dist/patches/webgpu_program.js +2 -2
  177. package/dist/{random_normal-CIm8lk2-.js → random_normal-IBRrha8a.js} +1 -1
  178. package/dist/{random_width-B_fVXhGx.js → random_width-DN5ZtQkM.js} +131 -131
  179. package/dist/{range-BDxO73mk.js → range-C-CjF-LI.js} +1 -1
  180. package/dist/relu-J_X6MUzx.js +9 -0
  181. package/dist/{reshape-BIN71H3p.js → reshape-BDOuCSNW.js} +1 -1
  182. package/dist/{resize_nearest_neighbor-C6_0dAnK.js → resize_nearest_neighbor-BojqlfRe.js} +41 -41
  183. package/dist/{rope-CC5RjmKU.js → rope-DcrZM_e6.js} +5 -5
  184. package/dist/{scatter_nd_util-C-x73Cj6.js → scatter_nd_util-ByNJaL6I.js} +1 -1
  185. package/dist/{segment_util-4zuHV5IG.js → segment_util-Dasb2Zaf.js} +2 -2
  186. package/dist/{selu_util-BXdhy_W6.js → selu_util-BLhIqRkw.js} +5 -5
  187. package/dist/{shared-zTaJ5siv.js → shared-3agzAqQ_.js} +1 -1
  188. package/dist/{shared-DRWDyk9w.js → shared-CagdqkLh.js} +6 -6
  189. package/dist/slice-BzS11Qh0.js +12 -0
  190. package/dist/{slice_util-DPY56GzQ.js → slice_util-CC35pLmT.js} +5 -5
  191. package/dist/{softmax-BLGJqdwx.js → softmax-D4q1LJN7.js} +1 -1
  192. package/dist/split-C2Sj255c.js +9 -0
  193. package/dist/{squeeze-O_YWJpw_.js → squeeze-ho4wLUek.js} +2 -2
  194. package/dist/{stack-z6QE7kmP.js → stack-DudVrtmG.js} +1 -1
  195. package/dist/{step-DQY6_ABw.js → step-BTxPtq1r.js} +4 -4
  196. package/dist/{sum-D39FeU5h.js → sum-BpiwSWvg.js} +3 -3
  197. package/dist/{tensor-D8e0Gd7c.js → tensor-BWFldCso.js} +1 -1
  198. package/dist/{tensor1d-BMl0eZYV.js → tensor1d-LMGMIUlr.js} +1 -1
  199. package/dist/{tensor2d-DTtQ1QcT.js → tensor2d-BnXMKScO.js} +1 -1
  200. package/dist/{tensor4d-Dj4rDssL.js → tensor4d-C6UCG_u8.js} +1 -1
  201. package/dist/{tfjs_backend-Bk3PmK91.js → tfjs_backend-BGnG-ppu.js} +65 -65
  202. package/dist/{tile-CsWlVKKz.js → tile-CFy-xTO6.js} +1 -1
  203. package/dist/tokeniser/BaseTokeniser.d.ts +5 -1
  204. package/dist/tokeniser/BaseTokeniser.js +62 -53
  205. package/dist/tokeniser/type.d.ts +8 -0
  206. package/dist/training/AdamW.js +2 -2
  207. package/dist/training/BasicTrainer.d.ts +1 -0
  208. package/dist/training/BasicTrainer.js +95 -79
  209. package/dist/training/DatasetBuilder.d.ts +6 -2
  210. package/dist/training/DatasetBuilder.js +60 -41
  211. package/dist/training/Evaluator.d.ts +1 -2
  212. package/dist/training/Evaluator.js +21 -31
  213. package/dist/training/SFTTrainer.d.ts +3 -2
  214. package/dist/training/SFTTrainer.js +4 -3
  215. package/dist/training/orthoGrad.js +1 -1
  216. package/dist/training/sparseCrossEntropy.js +38 -38
  217. package/dist/training/tasks/ConversationTask.d.ts +4 -0
  218. package/dist/training/tasks/ConversationTask.js +7 -7
  219. package/dist/training/tasks/PretrainingTask.d.ts +4 -0
  220. package/dist/training/tasks/PretrainingTask.js +11 -7
  221. package/dist/training/tasks/StartSentenceTask.d.ts +4 -0
  222. package/dist/training/tasks/StartSentenceTask.js +5 -5
  223. package/dist/training/tasks/Task.d.ts +12 -0
  224. package/dist/training/tasks/Task.js +55 -31
  225. package/dist/training/types.d.ts +1 -0
  226. package/dist/training/validation.d.ts +1 -1
  227. package/dist/training/validation.js +33 -32
  228. package/dist/{transpose-Qxz-4os3.js → transpose-9kRxIXWR.js} +7 -7
  229. package/dist/{unsorted_segment_sum-BfFVV9Zm.js → unsorted_segment_sum-DJvk5xnh.js} +20 -20
  230. package/dist/utilities/dummy.js +6 -6
  231. package/dist/utilities/multinomialCPU.js +2 -2
  232. package/dist/utilities/packed.js +1 -1
  233. package/dist/utilities/performance.js +1 -1
  234. package/dist/utilities/profile.js +1 -1
  235. package/dist/utilities/safetensors.js +2 -2
  236. package/dist/utilities/sentences.js +5 -5
  237. package/dist/utilities/weights.js +2 -2
  238. package/dist/{variable-SSATClyt.js → variable-Ck482e3n.js} +1 -1
  239. package/dist/{webgpu_program-CbjdYLYk.js → webgpu_program-B4HmApL1.js} +1 -1
  240. package/dist/{webgpu_util-DuofJBMo.js → webgpu_util-DYlGSwOJ.js} +7 -7
  241. package/dist/{zeros-Bw0puq_w.js → zeros-DvZpK8s6.js} +2 -2
  242. package/dist/{zeros_like-rOHr54NY.js → zeros_like-CWjDdwr-.js} +69 -69
  243. package/package.json +1 -1
  244. package/dist/complex-3DpPEG9B.js +0 -11
  245. package/dist/mat_mul-DP86qZtZ.js +0 -11
  246. package/dist/mod-BXjLYwvM.js +0 -11
  247. package/dist/readers-17HLdxVM.js +0 -12
  248. package/dist/relu-DTvZKBsZ.js +0 -9
  249. package/dist/slice-BvItlgXu.js +0 -12
  250. package/dist/split-BN9LkEgS.js +0 -9
  251. package/dist/training/SFTDatasetBuilder.d.ts +0 -23
  252. package/dist/training/SFTDatasetBuilder.js +0 -85
@@ -1,10 +1,10 @@
1
- import { Y as y, e as I, Z as P } from "../index-DSGwv2Yx.js";
2
- import { z as c } from "../zeros-Bw0puq_w.js";
1
+ import { b as y, h as I, v as P } from "../index-CUXkjxiT.js";
2
+ import { z as c } from "../zeros-DvZpK8s6.js";
3
3
  async function w(s) {
4
4
  const t = c([1, s.config.blockSize], "int32"), n = s.forward({ training: !1 }, t);
5
5
  await n.data(), n.dispose(), t.dispose();
6
6
  }
7
- async function G(s) {
7
+ async function b(s) {
8
8
  const t = y(), n = t.numBytesInGPUAllocated ?? t.numBytesAllocatedInGPU ?? t.numBytes;
9
9
  await w(s);
10
10
  const a = c([1, s.config.blockSize], "int32"), e = {
@@ -32,12 +32,12 @@ async function G(s) {
32
32
  }
33
33
  return e;
34
34
  }
35
- function b(s) {
35
+ function v(s) {
36
36
  const t = c([1, s.config.blockSize], "int32");
37
37
  s.forward({ training: !1 }, t).dispose(), t.dispose();
38
38
  }
39
39
  export {
40
- b as dummyPass,
40
+ v as dummyPass,
41
41
  w as dummyPassAsync,
42
- G as dummyPassTrainAsync
42
+ b as dummyPassTrainAsync
43
43
  };
@@ -1,5 +1,5 @@
1
- import "../index-DSGwv2Yx.js";
2
- import { t as e } from "../tensor2d-DTtQ1QcT.js";
1
+ import "../index-CUXkjxiT.js";
2
+ import { t as e } from "../tensor2d-BnXMKScO.js";
3
3
  function f(n, i) {
4
4
  let r = 0;
5
5
  const o = i ?? Math.random();
@@ -1,4 +1,4 @@
1
- import { e as n } from "../index-DSGwv2Yx.js";
1
+ import { h as n } from "../index-CUXkjxiT.js";
2
2
  function o() {
3
3
  return n().backendName === "webgpu";
4
4
  }
@@ -1,4 +1,4 @@
1
- import { t as s } from "../index-DSGwv2Yx.js";
1
+ import { t as s } from "../index-CUXkjxiT.js";
2
2
  async function f(e, o = 10, r = !1) {
3
3
  for (let t = 0; t < 100; t++) {
4
4
  const a = r ? await e() : s(e);
@@ -1,4 +1,4 @@
1
- import { Y as a } from "../index-DSGwv2Yx.js";
1
+ import { b as a } from "../index-CUXkjxiT.js";
2
2
  const s = 1024 * 1024;
3
3
  class l {
4
4
  log = /* @__PURE__ */ new Map();
@@ -1,5 +1,5 @@
1
- import "../index-DSGwv2Yx.js";
2
- import { t as y } from "../tensor-D8e0Gd7c.js";
1
+ import "../index-CUXkjxiT.js";
2
+ import { t as y } from "../tensor-BWFldCso.js";
3
3
  function l(t) {
4
4
  if (t === "float32") return "F32";
5
5
  if (t === "int32") return "I32";
@@ -1,8 +1,8 @@
1
- import { m as w } from "../index-DSGwv2Yx.js";
2
- import { t as f } from "../tensor2d-DTtQ1QcT.js";
3
- import { e as y } from "../expand_dims-D0rBtgT1.js";
4
- import { s as g } from "../sum-D39FeU5h.js";
5
- import { c as T } from "../concat-Dqk7Xk7h.js";
1
+ import { m as w } from "../index-CUXkjxiT.js";
2
+ import { t as f } from "../tensor2d-BnXMKScO.js";
3
+ import { e as y } from "../expand_dims-Bkd1YD5x.js";
4
+ import { s as g } from "../sum-BpiwSWvg.js";
5
+ import { c as T } from "../concat-CAQpCret.js";
6
6
  const p = 16;
7
7
  function A(o, t) {
8
8
  if (!t)
@@ -1,5 +1,5 @@
1
- import "../index-DSGwv2Yx.js";
2
- import { t as p } from "../tensor-D8e0Gd7c.js";
1
+ import "../index-CUXkjxiT.js";
2
+ import { t as p } from "../tensor-BWFldCso.js";
3
3
  function h(n) {
4
4
  const e = n.reduce((s, o) => s + o.length, 0), a = new Float32Array(e);
5
5
  let t = 0;
@@ -1,4 +1,4 @@
1
- import { E as i } from "./index-DSGwv2Yx.js";
1
+ import { E as i } from "./index-CUXkjxiT.js";
2
2
  function m(r, a = !0, e, t) {
3
3
  return i.makeVariable(r, a, e, t);
4
4
  }
@@ -1,4 +1,4 @@
1
- import { ad as z, ac as F, ab as E, a9 as j, v as A } from "./index-DSGwv2Yx.js";
1
+ import { ad as z, ac as F, ab as E, a9 as j, x as A } from "./index-CUXkjxiT.js";
2
2
  function L(t, s) {
3
3
  if (Math.max(...t) > 5)
4
4
  throw new Error("Cannot symbolically compute strides for rank > 6 tensor.");
@@ -1,4 +1,4 @@
1
- import { v as u } from "./index-DSGwv2Yx.js";
1
+ import { x as u } from "./index-CUXkjxiT.js";
2
2
  const c = (r) => {
3
3
  let t = 1;
4
4
  for (let n = 0; n < r.length; n++)
@@ -23,16 +23,16 @@ function p(r, t, n = !1) {
23
23
  const a = c(r.x.map((i) => t[i])), o = c(r.y.map((i) => t[i]));
24
24
  return a <= 4 ? [4, 16, 1] : o <= 4 ? [16, 4, 1] : [16, 16, 1];
25
25
  }
26
- function M(r, t, n = !1) {
26
+ function x(r, t, n = !1) {
27
27
  if (n)
28
28
  return [4, 4, 1];
29
29
  const a = c(r.x.map((i) => t[i])), o = c(r.y.map((i) => t[i]));
30
30
  return a <= 4 ? [1, 2, 1] : o <= 4 ? [2, 1, 1] : [2, 2, 1];
31
31
  }
32
- function h(r) {
32
+ function M(r) {
33
33
  return { x: r.map((t, n) => n) };
34
34
  }
35
- function x(r) {
35
+ function h(r) {
36
36
  if (r === "float32" || r === "int32" || r === "bool" || r === "string" || r === "packedF16")
37
37
  return 4;
38
38
  if (r === "complex64")
@@ -52,13 +52,13 @@ var s;
52
52
  r[r.MatMulReduceProgram = 0] = "MatMulReduceProgram", r[r.MatMulSplitKProgram = 1] = "MatMulSplitKProgram", r[r.MatMulSmallOutputSizeProgram = 2] = "MatMulSmallOutputSizeProgram", r[r.MatMulPackedProgram = 3] = "MatMulPackedProgram", r[r.MatMulMax = 4] = "MatMulMax";
53
53
  })(s || (s = {}));
54
54
  export {
55
- x as G,
55
+ h as G,
56
56
  s as M,
57
57
  d as a,
58
58
  b,
59
59
  m as c,
60
60
  p as d,
61
- M as e,
62
- h as f,
61
+ x as e,
62
+ M as f,
63
63
  g as i
64
64
  };
@@ -1,5 +1,5 @@
1
- import { q as n, L as m, N as i, E as c } from "./index-DSGwv2Yx.js";
2
- import { c as f } from "./complex-3DpPEG9B.js";
1
+ import { u as n, Q as m, U as i, E as c } from "./index-CUXkjxiT.js";
2
+ import { c as f } from "./complex-DI35Q-gW.js";
3
3
  function e(o, r = "float32") {
4
4
  if (n(o), r === "complex64") {
5
5
  const s = e(o, "float32"), t = e(o, "float32");
@@ -1,38 +1,38 @@
1
- import { o as u, n as h, E as d, c7 as st, c8 as rt, c9 as nt, ca as et, cb as it, cc as pt, z as B, cd as at, ce as ht, bY as ut, v as D, cf as ct, cg as ft, d as H, a3 as C, bZ as lt, ch as dt, ci as mt, cj as Dt, aE as yt, ck as It, a2 as wt, m as M, _ as F, cl as xt, cm as gt, J as $, c1 as $t, cn as bt, co as vt, cp as kt, cq as Nt, b as _t, cr as Tt, cs as Et, ct as St, cu as qt, cv as r, a_ as Kt, h as zt, ag as W, cw as Pt, cx as Ct, p as Mt, i as Ot, j as At, a1 as Bt } from "./index-DSGwv2Yx.js";
2
- import { e as j, a as R, l as X, b as G, d as V, f as Z, m as J, r as E, g as Ht, h as Ft, i as Wt, j as jt, k as Rt, n as Xt, o as Gt, c as Vt, p as Zt, q as Jt, t as Ut, u as Yt, v as Qt, w as Lt, x as to, y as oo, z as so, A as ro, B as no, C as eo, s as io, D as po, E as ao, F as ho } from "./unsorted_segment_sum-BfFVV9Zm.js";
3
- import { r as l } from "./reshape-BIN71H3p.js";
4
- import { b as uo } from "./broadcast_to-C_EJTVTZ.js";
5
- import { c as co } from "./clip_by_value-CLAD4h_I.js";
6
- import { c as _ } from "./concat-Dqk7Xk7h.js";
7
- import { w as U, e as fo, l as lo, b as mo, m as Do, a as yo, n as Io } from "./not_equal-CkQKkKZy.js";
8
- import { m as k } from "./mat_mul-DP86qZtZ.js";
9
- import { s as Y, k as wo, h as xo, e as go, l as $o, p as bo, r as vo, a as ko } from "./step-DQY6_ABw.js";
10
- import { n as Q, b as S, c as No, g as _o, l as To, a as Eo, d as So, h as qo, m as Ko, f as zo, e as Po, r as Co, s as Mo, u as Oo } from "./resize_nearest_neighbor-C6_0dAnK.js";
11
- import { e as Ao } from "./expand_dims-D0rBtgT1.js";
12
- import { f as Bo } from "./floor-CymuCmTO.js";
13
- import { g as Ho } from "./gather-DEyjXNb1.js";
14
- import { c as q } from "./complex-3DpPEG9B.js";
15
- import { n as N, r as K, i as L, t as Fo } from "./transpose-Qxz-4os3.js";
16
- import { s as T } from "./slice-BvItlgXu.js";
17
- import { m as Wo } from "./mod-BXjLYwvM.js";
18
- import { r as jo } from "./relu-DTvZKBsZ.js";
19
- import { s as z } from "./split-BN9LkEgS.js";
20
- import { z as Ro } from "./zeros-Bw0puq_w.js";
21
- import { s as Xo } from "./softmax-BLGJqdwx.js";
22
- import { s as Go } from "./squeeze-O_YWJpw_.js";
23
- import { s as Vo } from "./stack-z6QE7kmP.js";
24
- import { s as Zo } from "./sum-D39FeU5h.js";
25
- import { t as Jo } from "./tile-CsWlVKKz.js";
26
- function Uo(t) {
1
+ import { o as u, q as h, E as d, c7 as st, c8 as rt, c9 as nt, ca as et, cb as it, cc as pt, B, cd as at, ce as ht, bY as ut, x as D, cf as ct, cg as ft, i as H, a3 as C, bZ as lt, ch as dt, ci as mt, cj as Dt, aE as yt, ck as It, a2 as wt, m as M, _ as F, cl as xt, cm as gt, L as $, c1 as $t, cn as bt, co as kt, cp as vt, cq as Nt, a as _t, cr as Tt, cs as Et, ct as St, cu as qt, cv as r, a_ as Kt, j as zt, ag as W, cw as Pt, cx as Ct, p as Mt, l as Ot, n as At, a1 as Bt } from "./index-CUXkjxiT.js";
2
+ import { e as j, a as R, l as X, b as G, d as V, f as Z, m as U, r as E, g as Ht, h as Ft, i as Wt, j as jt, k as Rt, n as Xt, o as Gt, c as Vt, p as Zt, q as Ut, t as Yt, u as Jt, v as Lt, w as Qt, x as to, y as oo, z as so, A as ro, B as no, C as eo, s as io, D as po, E as ao, F as ho } from "./unsorted_segment_sum-DJvk5xnh.js";
3
+ import { r as l } from "./reshape-BDOuCSNW.js";
4
+ import { b as uo } from "./broadcast_to-eS93CCN_.js";
5
+ import { c as co } from "./clip_by_value-DDA7rrcT.js";
6
+ import { c as _ } from "./concat-CAQpCret.js";
7
+ import { w as Y, e as fo, l as lo, b as mo, m as Do, a as yo, n as Io } from "./not_equal-hurPF26l.js";
8
+ import { m as v } from "./mat_mul-DhG0Newp.js";
9
+ import { s as J, k as wo, h as xo, e as go, l as $o, p as bo, r as ko, a as vo } from "./step-BTxPtq1r.js";
10
+ import { n as L, b as S, c as No, g as _o, l as To, a as Eo, d as So, h as qo, m as Ko, f as zo, e as Po, r as Co, s as Mo, u as Oo } from "./resize_nearest_neighbor-BojqlfRe.js";
11
+ import { e as Ao } from "./expand_dims-Bkd1YD5x.js";
12
+ import { f as Bo } from "./floor-BQtb-Azg.js";
13
+ import { g as Ho } from "./gather-qIqEqaGn.js";
14
+ import { c as q } from "./complex-DI35Q-gW.js";
15
+ import { n as N, r as K, i as Q, t as Fo } from "./transpose-9kRxIXWR.js";
16
+ import { s as T } from "./slice-BzS11Qh0.js";
17
+ import { m as Wo } from "./mod-CSdCpRjf.js";
18
+ import { r as jo } from "./relu-J_X6MUzx.js";
19
+ import { s as z } from "./split-C2Sj255c.js";
20
+ import { z as Ro } from "./zeros-DvZpK8s6.js";
21
+ import { s as Xo } from "./softmax-D4q1LJN7.js";
22
+ import { s as Go } from "./squeeze-ho4wLUek.js";
23
+ import { s as Vo } from "./stack-DudVrtmG.js";
24
+ import { s as Zo } from "./sum-BpiwSWvg.js";
25
+ import { t as Uo } from "./tile-CFy-xTO6.js";
26
+ function Yo(t) {
27
27
  const s = { x: h(t, "x", "acos") };
28
28
  return d.runKernel(st, s);
29
29
  }
30
- const Yo = /* @__PURE__ */ u({ acos_: Uo });
31
- function Qo(t) {
30
+ const Jo = /* @__PURE__ */ u({ acos_: Yo });
31
+ function Lo(t) {
32
32
  const s = { x: h(t, "x", "acosh") };
33
33
  return d.runKernel(rt, s);
34
34
  }
35
- const Lo = /* @__PURE__ */ u({ acosh_: Qo });
35
+ const Qo = /* @__PURE__ */ u({ acosh_: Lo });
36
36
  function ts(t, o = 0) {
37
37
  const n = { x: h(t, "x", "argMin") }, e = { axis: o };
38
38
  return d.runKernel(nt, n, e);
@@ -94,7 +94,7 @@ function Is(t, o) {
94
94
  let s = h(t, "a", "div"), n = h(o, "b", "div");
95
95
  [s, n] = B(s, n);
96
96
  const e = H(s, n), i = C(e), p = j(n, i);
97
- return U(p, i, e);
97
+ return Y(p, i, e);
98
98
  }
99
99
  const ws = /* @__PURE__ */ u({ divNoNan_: Is });
100
100
  function xs(t, o) {
@@ -102,29 +102,29 @@ function xs(t, o) {
102
102
  D((s.rank === 1 || s.rank === 2) && (n.rank === 1 || n.rank === 2), () => `Error in dot: inputs must all be rank 1 or 2, but got ranks ${s.rank} and ${n.rank}.`);
103
103
  const e = s.rank === 1 ? s.size : s.shape[1], i = n.rank === 1 ? n.size : n.shape[0];
104
104
  if (D(e === i, () => `Error in dot: inner dimensions of inputs must match, but got ${e} and ${i}.`), s.rank === 1 && n.rank === 1) {
105
- const p = l(s, [1, -1]), a = l(n, [-1, 1]), f = k(p, a);
105
+ const p = l(s, [1, -1]), a = l(n, [-1, 1]), f = v(p, a);
106
106
  return l(f, []);
107
107
  } else if (s.rank === 1 && n.rank === 2) {
108
- const p = l(s, [1, -1]), a = l(n, [n.shape[0], n.shape[1]]), f = k(p, a);
108
+ const p = l(s, [1, -1]), a = l(n, [n.shape[0], n.shape[1]]), f = v(p, a);
109
109
  return l(f, [f.size]);
110
110
  } else if (s.rank === 2 && n.rank === 1) {
111
- const p = l(n, [-1, 1]), a = k(s, p);
111
+ const p = l(n, [-1, 1]), a = v(s, p);
112
112
  return l(a, [a.size]);
113
113
  } else {
114
114
  const p = l(n, [n.shape[0], n.shape[1]]);
115
- return k(s, p);
115
+ return v(s, p);
116
116
  }
117
117
  }
118
118
  const gs = /* @__PURE__ */ u({ dot_: xs });
119
119
  function $s(t, o = null, s = !1) {
120
- return Q(t, "euclidean", o, s);
120
+ return L(t, "euclidean", o, s);
121
121
  }
122
122
  const bs = /* @__PURE__ */ u({ euclideanNorm_: $s });
123
- function vs(t) {
123
+ function ks(t) {
124
124
  const s = { x: h(t, "x", "expm1") };
125
125
  return d.runKernel(lt, s);
126
126
  }
127
- const ks = /* @__PURE__ */ u({ expm1_: vs });
127
+ const vs = /* @__PURE__ */ u({ expm1_: ks });
128
128
  function Ns(t) {
129
129
  const s = { x: h(t, "x", "isFinite") };
130
130
  return d.runKernel(dt, s);
@@ -152,7 +152,7 @@ function Ks(t, o = 5, s = 1, n = 1, e = 0.5) {
152
152
  const zs = /* @__PURE__ */ u({ localResponseNormalization_: Ks });
153
153
  function Ps(t) {
154
154
  const o = h(t, "x", "logSigmoid");
155
- return wt((n) => ({ value: N(R(N(n))), gradFunc: (p) => M(p, Y(N(n))) }))(o);
155
+ return wt((n) => ({ value: N(R(N(n))), gradFunc: (p) => M(p, J(N(n))) }))(o);
156
156
  }
157
157
  const Cs = /* @__PURE__ */ u({ logSigmoid_: Ps });
158
158
  function Ms(t, o) {
@@ -188,8 +188,8 @@ function Fs(t, o, s, n, e, i, p) {
188
188
  const c = xo(f.shape, o, i, e, n), m = [c.dilationHeight, c.dilationWidth];
189
189
  let I;
190
190
  n === "same" ? I = js([c.filterHeight, c.filterWidth], m) : I = [[0, 0], [0, 0]];
191
- const w = m[0] === 1 && m[1] === 1, [x, g] = Ws([c.inHeight, c.inWidth], m, I), b = w ? n : "valid", O = w ? f : G(f, m, x), A = (s === "avg" ? () => Z(O, o, i, b, p) : () => J(O, o, i, b, p))(), v = w ? A : V(A, m, g);
192
- return y ? l(v, [v.shape[1], v.shape[2], v.shape[3]]) : v;
191
+ const w = m[0] === 1 && m[1] === 1, [x, g] = Ws([c.inHeight, c.inWidth], m, I), b = w ? n : "valid", O = w ? f : G(f, m, x), A = (s === "avg" ? () => Z(O, o, i, b, p) : () => U(O, o, i, b, p))(), k = w ? A : V(A, m, g);
192
+ return y ? l(k, [k.shape[1], k.shape[2], k.shape[3]]) : k;
193
193
  }
194
194
  function Ws(t, o, s) {
195
195
  const n = s.map((c) => c[0]), e = s.map((c) => c[1]), i = t.concat(n, e), p = o.map((c, m) => (c - i[m] % c) % c), a = e.map((c, m) => c + p[m]), f = o.map((c, m) => [n[m], a[m]]), y = o.map((c, m) => [0, p[m]]);
@@ -212,31 +212,31 @@ function Vs(t) {
212
212
  return d.runKernel(bt, s);
213
213
  }
214
214
  const Zs = /* @__PURE__ */ u({ reciprocal_: Vs });
215
- function Js(t) {
215
+ function Us(t) {
216
216
  const s = { x: h(t, "x", "sign") };
217
- return d.runKernel(vt, s);
217
+ return d.runKernel(kt, s);
218
218
  }
219
- const Us = /* @__PURE__ */ u({ sign_: Js });
220
- function Ys(t) {
219
+ const Ys = /* @__PURE__ */ u({ sign_: Us });
220
+ function Js(t) {
221
221
  D(t.dtype === "complex64", () => `The dtype for tf.spectral.fft() must be complex64 but got ${t.dtype}.`);
222
222
  const o = { input: t };
223
- return d.runKernel(kt, o);
223
+ return d.runKernel(vt, o);
224
224
  }
225
- const ot = /* @__PURE__ */ u({ fft_: Ys });
226
- function Qs(t) {
225
+ const ot = /* @__PURE__ */ u({ fft_: Js });
226
+ function Ls(t) {
227
227
  D(t.dtype === "complex64", () => `The dtype for tf.spectral.ifft() must be complex64 but got ${t.dtype}.`);
228
228
  const o = { input: t };
229
229
  return d.runKernel(Nt, o);
230
230
  }
231
- const P = /* @__PURE__ */ u({ ifft_: Qs });
232
- function Ls(t) {
231
+ const P = /* @__PURE__ */ u({ ifft_: Ls });
232
+ function Qs(t) {
233
233
  const o = t.shape[t.shape.length - 1], s = t.size / o;
234
234
  let n;
235
235
  if (o <= 2) {
236
236
  const e = l(t, [s, o]);
237
237
  n = P(e);
238
238
  } else {
239
- const e = [s, 2 * (o - 1)], i = l(K(t), [s, o]), p = l(L(t), [s, o]), a = E(T(i, [0, 1], [s, o - 2]), 1), f = M(E(T(p, [0, 1], [s, o - 2]), 1), _t(-1)), y = _([i, a], 1), c = _([p, f], 1), m = l(q(y, c), [e[0], e[1]]);
239
+ const e = [s, 2 * (o - 1)], i = l(K(t), [s, o]), p = l(Q(t), [s, o]), a = E(T(i, [0, 1], [s, o - 2]), 1), f = M(E(T(p, [0, 1], [s, o - 2]), 1), _t(-1)), y = _([i, a], 1), c = _([p, f], 1), m = l(q(y, c), [e[0], e[1]]);
240
240
  n = P(m);
241
241
  }
242
242
  if (n = K(n), t.rank === 3 && t.shape[0] !== 0) {
@@ -245,7 +245,7 @@ function Ls(t) {
245
245
  }
246
246
  return n;
247
247
  }
248
- const tr = /* @__PURE__ */ u({ irfft_: Ls });
248
+ const tr = /* @__PURE__ */ u({ irfft_: Qs });
249
249
  function or(t, o) {
250
250
  D(t.dtype === "float32", () => `The dtype for rfft() must be real value but got ${t.dtype}`);
251
251
  let s = t.shape[t.shape.length - 1];
@@ -259,7 +259,7 @@ function or(t, o) {
259
259
  x[t.shape.length - 1] = o - s, e = _([t, Ro(x)], t.shape.length - 1), s = o;
260
260
  } else
261
261
  e = t;
262
- const i = C(e), p = l(q(e, i), [n, s]), a = ot(p), f = Math.floor(s / 2) + 1, y = K(a), c = L(a), m = z(y, [f, s - f], y.shape.length - 1), I = z(c, [f, s - f], c.shape.length - 1), w = e.shape.slice();
262
+ const i = C(e), p = l(q(e, i), [n, s]), a = ot(p), f = Math.floor(s / 2) + 1, y = K(a), c = Q(a), m = z(y, [f, s - f], y.shape.length - 1), I = z(c, [f, s - f], c.shape.length - 1), w = e.shape.slice();
263
263
  return w[e.shape.length - 1] = f, l(q(m[0], I[0]), w);
264
264
  }
265
265
  const sr = /* @__PURE__ */ u({ rfft_: or });
@@ -306,10 +306,10 @@ r().prototype.abs = function() {
306
306
  return this.throwIfDisposed(), Kt(this);
307
307
  };
308
308
  r().prototype.acos = function() {
309
- return this.throwIfDisposed(), Yo(this);
309
+ return this.throwIfDisposed(), Jo(this);
310
310
  };
311
311
  r().prototype.acosh = function() {
312
- return this.throwIfDisposed(), Lo(this);
312
+ return this.throwIfDisposed(), Qo(this);
313
313
  };
314
314
  r().prototype.add = function(t) {
315
315
  return this.throwIfDisposed(), zt(this, t);
@@ -402,16 +402,16 @@ r().prototype.cosh = function() {
402
402
  return this.throwIfDisposed(), Zt(this);
403
403
  };
404
404
  r().prototype.cumprod = function(t, o, s) {
405
- return this.throwIfDisposed(), Jt(this, t, o, s);
405
+ return this.throwIfDisposed(), Ut(this, t, o, s);
406
406
  };
407
407
  r().prototype.cumsum = function(t, o, s) {
408
- return this.throwIfDisposed(), Ut(this, t, o, s);
408
+ return this.throwIfDisposed(), Yt(this, t, o, s);
409
409
  };
410
410
  r().prototype.depthToSpace = function(t, o) {
411
411
  return this.throwIfDisposed(), ms(this, t, o);
412
412
  };
413
413
  r().prototype.depthwiseConv2d = function(t, o, s, n, e, i) {
414
- return this.throwIfDisposed(), Yt(this, t, o, s, n, e, i);
414
+ return this.throwIfDisposed(), Jt(this, t, o, s, n, e, i);
415
415
  };
416
416
  r().prototype.dilation2d = function(t, o, s, n, e) {
417
417
  return this.throwIfDisposed(), ys(this, t, o, s, n, e);
@@ -432,7 +432,7 @@ r().prototype.equal = function(t) {
432
432
  return this.throwIfDisposed(), j(this, t);
433
433
  };
434
434
  r().prototype.erf = function() {
435
- return this.throwIfDisposed(), Qt(this);
435
+ return this.throwIfDisposed(), Lt(this);
436
436
  };
437
437
  r().prototype.euclideanNorm = function(t, o) {
438
438
  return this.throwIfDisposed(), bs(this, t, o);
@@ -444,7 +444,7 @@ r().prototype.expandDims = function(t) {
444
444
  return this.throwIfDisposed(), Ao(this, t);
445
445
  };
446
446
  r().prototype.expm1 = function() {
447
- return this.throwIfDisposed(), ks(this);
447
+ return this.throwIfDisposed(), vs(this);
448
448
  };
449
449
  r().prototype.fft = function() {
450
450
  return this.throwIfDisposed(), ot(this);
@@ -498,7 +498,7 @@ r().prototype.logSigmoid = function() {
498
498
  return this.throwIfDisposed(), Cs(this);
499
499
  };
500
500
  r().prototype.logSoftmax = function(t) {
501
- return this.throwIfDisposed(), Lt(this, t);
501
+ return this.throwIfDisposed(), Qt(this, t);
502
502
  };
503
503
  r().prototype.logSumExp = function(t, o) {
504
504
  return this.throwIfDisposed(), lo(this, t, o);
@@ -522,10 +522,10 @@ r().prototype.logicalXor = function(t) {
522
522
  return this.throwIfDisposed(), As(this, t);
523
523
  };
524
524
  r().prototype.matMul = function(t, o, s) {
525
- return this.throwIfDisposed(), k(this, t, o, s);
525
+ return this.throwIfDisposed(), v(this, t, o, s);
526
526
  };
527
527
  r().prototype.maxPool = function(t, o, s, n) {
528
- return this.throwIfDisposed(), J(this, t, o, s, n);
528
+ return this.throwIfDisposed(), U(this, t, o, s, n);
529
529
  };
530
530
  r().prototype.max = function(t, o) {
531
531
  return this.throwIfDisposed(), Do(this, t, o);
@@ -555,7 +555,7 @@ r().prototype.neg = function() {
555
555
  return this.throwIfDisposed(), N(this);
556
556
  };
557
557
  r().prototype.norm = function(t, o, s) {
558
- return this.throwIfDisposed(), Q(this, t, o, s);
558
+ return this.throwIfDisposed(), L(this, t, o, s);
559
559
  };
560
560
  r().prototype.notEqual = function(t) {
561
561
  return this.throwIfDisposed(), Io(this, t);
@@ -588,7 +588,7 @@ r().prototype.relu = function() {
588
588
  return this.throwIfDisposed(), jo(this);
589
589
  };
590
590
  r().prototype.relu6 = function() {
591
- return this.throwIfDisposed(), vo(this);
591
+ return this.throwIfDisposed(), ko(this);
592
592
  };
593
593
  r().prototype.reshapeAs = function(t) {
594
594
  return this.throwIfDisposed(), l(this, t.shape);
@@ -621,10 +621,10 @@ r().prototype.separableConv2d = function(t, o, s, n, e, i) {
621
621
  return this.throwIfDisposed(), eo(this, t, o, s, n, e, i);
622
622
  };
623
623
  r().prototype.sigmoid = function() {
624
- return this.throwIfDisposed(), Y(this);
624
+ return this.throwIfDisposed(), J(this);
625
625
  };
626
626
  r().prototype.sign = function() {
627
- return this.throwIfDisposed(), Us(this);
627
+ return this.throwIfDisposed(), Ys(this);
628
628
  };
629
629
  r().prototype.sin = function() {
630
630
  return this.throwIfDisposed(), io(this);
@@ -665,7 +665,7 @@ r().prototype.stack = function(t, o) {
665
665
  return Vo(s, o);
666
666
  };
667
667
  r().prototype.step = function(t) {
668
- return this.throwIfDisposed(), ko(this, t);
668
+ return this.throwIfDisposed(), vo(this, t);
669
669
  };
670
670
  r().prototype.stridedSlice = function(t, o, s, n, e, i, p, a) {
671
671
  return this.throwIfDisposed(), nr(this, t, o, s, n, e, i, p, a);
@@ -683,7 +683,7 @@ r().prototype.tanh = function() {
683
683
  return this.throwIfDisposed(), ao(this);
684
684
  };
685
685
  r().prototype.tile = function(t) {
686
- return this.throwIfDisposed(), Jo(this, t);
686
+ return this.throwIfDisposed(), Uo(this, t);
687
687
  };
688
688
  r().prototype.toBool = function() {
689
689
  return this.throwIfDisposed(), $(this, "bool");
@@ -710,7 +710,7 @@ r().prototype.unstack = function(t) {
710
710
  return this.throwIfDisposed(), Oo(this, t);
711
711
  };
712
712
  r().prototype.where = function(t, o) {
713
- return this.throwIfDisposed(), U(t, this, o);
713
+ return this.throwIfDisposed(), Y(t, this, o);
714
714
  };
715
715
  r().prototype.zerosLike = function() {
716
716
  return this.throwIfDisposed(), C(this);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genai-fi/nanogpt",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",
@@ -1,11 +0,0 @@
1
- import { o as t, n as s, a6 as c, E as m, a7 as r } from "./index-DSGwv2Yx.js";
2
- function l(o, n) {
3
- const a = s(o, "real", "complex"), e = s(n, "imag", "complex");
4
- c(a.shape, e.shape, `real and imag shapes, ${a.shape} and ${e.shape}, must match in call to tf.complex().`);
5
- const p = { real: a, imag: e };
6
- return m.runKernel(r, p);
7
- }
8
- const i = /* @__PURE__ */ t({ complex_: l });
9
- export {
10
- i as c
11
- };
@@ -1,11 +0,0 @@
1
- import { o as m, n as s, z as c, E as M, B as p } from "./index-DSGwv2Yx.js";
2
- function f(e, n, o = !1, l = !1) {
3
- let a = s(e, "a", "matMul"), t = s(n, "b", "matMul");
4
- [a, t] = c(a, t);
5
- const r = { a, b: t }, u = { transposeA: o, transposeB: l };
6
- return M.runKernel(p, r, u);
7
- }
8
- const i = /* @__PURE__ */ m({ matMul_: f });
9
- export {
10
- i as m
11
- };
@@ -1,11 +0,0 @@
1
- import { o as r, n, z as m, E as c, M as d } from "./index-DSGwv2Yx.js";
2
- function p(s, t) {
3
- let o = n(s, "a", "mod"), a = n(t, "b", "mod");
4
- [o, a] = m(o, a);
5
- const e = { a: o, b: a };
6
- return c.runKernel(d, e);
7
- }
8
- const b = /* @__PURE__ */ r({ mod_: p });
9
- export {
10
- b as m
11
- };
@@ -1,12 +0,0 @@
1
- import { d as o, i as n } from "./dataset-DlqAN81i.js";
2
- import "./index-DSGwv2Yx.js";
3
- import "./index-Cp39cXWe.js";
4
- function m(t) {
5
- return o(async () => {
6
- const r = await t();
7
- return n(() => r.next());
8
- });
9
- }
10
- export {
11
- m as g
12
- };
@@ -1,9 +0,0 @@
1
- import { o, n as e, E as s, A as t } from "./index-DSGwv2Yx.js";
2
- function u(r) {
3
- const n = { x: e(r, "x", "relu") };
4
- return s.runKernel(t, n);
5
- }
6
- const l = /* @__PURE__ */ o({ relu_: u });
7
- export {
8
- l as r
9
- };
@@ -1,12 +0,0 @@
1
- import { o as c, n as e, E as a, S as l } from "./index-DSGwv2Yx.js";
2
- function p(n, r, o) {
3
- const s = e(n, "x", "slice", "string_or_numeric");
4
- if (s.rank === 0)
5
- throw new Error("Slicing scalar is not possible");
6
- const t = { x: s }, i = { begin: r, size: o };
7
- return a.runKernel(l, t, i);
8
- }
9
- const x = /* @__PURE__ */ c({ slice_: p });
10
- export {
11
- x as s
12
- };
@@ -1,9 +0,0 @@
1
- import { o as p, n as i, E as a, H as c } from "./index-DSGwv2Yx.js";
2
- function e(t, s, n = 0) {
3
- const o = { x: i(t, "x", "split") }, r = { numOrSizeSplits: s, axis: n };
4
- return a.runKernel(c, o, r);
5
- }
6
- const u = /* @__PURE__ */ p({ split_: e });
7
- export {
8
- u as s
9
- };
@@ -1,23 +0,0 @@
1
- import { Tensor } from '@tensorflow/tfjs-core';
2
- import { Conversation, ITokeniser } from '../tokeniser/type';
3
- import { Dataset } from '@tensorflow/tfjs-data';
4
- import { Task } from './tasks/Task';
5
- export declare function buildSFTExample(conversation: Conversation[], ignoreIndex: number, tokenizer: ITokeniser, blockSize: number): {
6
- xs: Int32Array;
7
- ys: Int32Array;
8
- } | null;
9
- export declare class SFTDatasetBuilder {
10
- tokenizer: ITokeniser;
11
- blockSize: number;
12
- constructor(tokenizer: ITokeniser, blockSize?: number);
13
- /**
14
- * Create SFT dataset from structured conversations.
15
- * - Always starts from the beginning of each conversation.
16
- * - Pads with eosToken and masks padding.
17
- * - Masks non-assistant tokens in labels with ignoreIndex (default -100).
18
- */
19
- createSFTDataset(conversations: Task[], batchSize?: number, ignoreIndex?: number): Promise<Dataset<{
20
- xs: Tensor;
21
- ys: Tensor;
22
- }>>;
23
- }