@genai-fi/nanogpt 1.5.0 → 1.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 (319) hide show
  1. package/dist/{DatasetBuilder-DU1G1OKX.js → DatasetBuilder-DRDW8tcM.js} +85 -86
  2. package/dist/Generator-8IK28IWR.js +316 -0
  3. package/dist/{RealDiv-CSnvtN2E.js → RealDiv-Cl8k3YTx.js} +54 -62
  4. package/dist/{Reshape-BlylqwWy.js → Reshape-CKxKPKqi.js} +9 -12
  5. package/dist/Reshape-H5zZRgr9.js +16 -0
  6. package/dist/RoPECache-dYscFINl.js +722 -0
  7. package/dist/TeachableLLM.js +29 -34
  8. package/dist/api/beamer.js +5 -6
  9. package/dist/api/responses.js +11 -12
  10. package/dist/api/training.js +12 -14
  11. package/dist/axis_util-rF9RnwKE.js +37 -0
  12. package/dist/backend.js +5 -6
  13. package/dist/{backend_util-DAV0I34P.js → backend_util-Cpp0Gwlp.js} +180 -185
  14. package/dist/{binary_op_util-CrYk9LXL.js → binary_op_util-WY9YIl0q.js} +3 -7
  15. package/dist/broadcast_to-CGvLNiQ0.js +20 -0
  16. package/dist/checks/appendCache.js +7 -7
  17. package/dist/checks/attentionMask.js +9 -8
  18. package/dist/checks/check.js +1 -2
  19. package/dist/checks/gelu.js +6 -6
  20. package/dist/checks/index.js +24 -25
  21. package/dist/checks/matMulGelu.js +7 -7
  22. package/dist/checks/normRMS.js +14 -12
  23. package/dist/checks/normRMSGrad.js +9 -8
  24. package/dist/checks/packUnpack.js +7 -7
  25. package/dist/checks/qkv.js +1 -34
  26. package/dist/checks/rope.js +6 -6
  27. package/dist/checks/weights.js +1 -2
  28. package/dist/clip_by_value-D-UX9am5.js +13 -0
  29. package/dist/complex-Cl904TqN.js +13 -0
  30. package/dist/{complex_util-CkazZsaH.js → complex_util-BBlPAm-s.js} +1 -2
  31. package/dist/concat-Oip5acVY.js +14 -0
  32. package/dist/{concat_util-CWzvQQlK.js → concat_util-CY45Hf4F.js} +2 -3
  33. package/dist/data/docx.js +3 -4
  34. package/dist/data/pdf.js +11 -14
  35. package/dist/data/stream.js +1 -2
  36. package/dist/data/textLoader.js +16 -15
  37. package/dist/data-CV_i_H6B.js +11 -0
  38. package/dist/data.js +5 -12
  39. package/dist/dist-CMMLi-qO.js +2675 -0
  40. package/dist/{dist-BGVm64AY.js → dist-DeVH1nGn.js} +1465 -1573
  41. package/dist/{dist-CwK5S7Ls.js → dist-DyL7qSLJ.js} +2664 -2400
  42. package/dist/dropout16-CA31Ud5a.js +20 -0
  43. package/dist/dropout_util-SiFMbFXz.js +22 -0
  44. package/dist/{eventemitter3-D_qV3Lof.js → eventemitter3-wmfmOP_f.js} +2 -3
  45. package/dist/expand_dims-Dh3Fulyn.js +10 -0
  46. package/dist/floor-BwjmUb7X.js +8 -0
  47. package/dist/gather-B5Z1RFt5.js +14 -0
  48. package/dist/gatherSub-CRUfUzBa.js +22 -0
  49. package/dist/gelu-Xx9-ohH9.js +25 -0
  50. package/dist/{gpgpu_math-20tPK8LM.js → gpgpu_math-48m8q3jI.js} +265 -286
  51. package/dist/inference/Beamer.js +34 -27
  52. package/dist/inference/Generator.js +1 -273
  53. package/dist/inference/tokenisePrompt.js +5 -4
  54. package/dist/inference/types.d.ts +6 -0
  55. package/dist/inference/utilities.js +1 -2
  56. package/dist/{jszip.min-DKa1Rjyn.js → jszip.min-Btv48m44.js} +68 -64
  57. package/dist/{kernel_funcs_utils-ql8Y8qPn.js → kernel_funcs_utils-BYRpSfV_.js} +39 -42
  58. package/dist/layers/BaseLayer.js +9 -10
  59. package/dist/layers/GQA.js +45 -44
  60. package/dist/layers/HeadLayer.js +13 -13
  61. package/dist/layers/LoRA.js +17 -20
  62. package/dist/layers/MHA.d.ts +2 -2
  63. package/dist/layers/MHA.js +46 -45
  64. package/dist/layers/MLP.js +22 -21
  65. package/dist/layers/PositionEmbedding.js +14 -13
  66. package/dist/layers/RMSNorm.js +14 -13
  67. package/dist/layers/RoPECache.js +1 -338
  68. package/dist/layers/TiedEmbedding.js +15 -14
  69. package/dist/layers/TransformerBlock.d.ts +3 -9
  70. package/dist/layers/TransformerBlock.js +29 -30
  71. package/dist/layers/WeightStore.js +4 -5
  72. package/dist/layers-CFqEip3s.js +13 -0
  73. package/dist/layers.js +3 -11
  74. package/dist/loader/load.js +27 -24
  75. package/dist/loader/loadHF.js +3 -3
  76. package/dist/loader/loadTransformers.js +5 -6
  77. package/dist/loader/loadZipMeta.js +1 -2
  78. package/dist/loader/newZipLoad.js +1 -2
  79. package/dist/loader/oldZipLoad.js +8 -9
  80. package/dist/loader/save.js +15 -16
  81. package/dist/main.js +3281 -3463
  82. package/dist/{matMul16-CO1QhsRt.js → matMul16-tE26fnhf.js} +29 -27
  83. package/dist/{matMulGelu-CBoqTZM7.js → matMulGelu-ASUWlKqu.js} +33 -33
  84. package/dist/mat_mul-R9_DWmIT.js +16 -0
  85. package/dist/models/Llama.js +48 -49
  86. package/dist/models/NanoGPTV1.js +53 -54
  87. package/dist/models/NanoGPTV2.js +48 -49
  88. package/dist/models/Qwen3.js +48 -49
  89. package/dist/models/config.js +3 -8
  90. package/dist/models/factory.js +7 -8
  91. package/dist/models/model.d.ts +5 -7
  92. package/dist/models/model.js +1 -2
  93. package/dist/models-DyBpJJwM.js +13 -0
  94. package/dist/models.js +6 -14
  95. package/dist/mul16-C7sqgqik.js +41 -0
  96. package/dist/non_max_suppression_impl-B0H318rb.js +72 -0
  97. package/dist/not_equal-Bu3O8rh_.js +67 -0
  98. package/dist/one_hot-TEMPumJj.js +14 -0
  99. package/dist/ones-DpPXWa6A.js +13 -0
  100. package/dist/ops/adamAdjust.js +2 -3
  101. package/dist/ops/adamMoments.js +2 -3
  102. package/dist/ops/add16.js +2 -3
  103. package/dist/ops/appendCache.js +9 -8
  104. package/dist/ops/attentionMask.d.ts +1 -1
  105. package/dist/ops/attentionMask.js +8 -5
  106. package/dist/ops/concat16.js +5 -5
  107. package/dist/ops/cpu/adamAdjust.js +7 -8
  108. package/dist/ops/cpu/adamMoments.js +5 -5
  109. package/dist/ops/cpu/appendCache.js +3 -3
  110. package/dist/ops/cpu/attentionMask.js +12 -8
  111. package/dist/ops/cpu/fusedSoftmax.js +3 -3
  112. package/dist/ops/cpu/gatherSub.js +1 -12
  113. package/dist/ops/cpu/gelu.js +12 -13
  114. package/dist/ops/cpu/matMul16.js +7 -7
  115. package/dist/ops/cpu/matMulGelu.js +21 -18
  116. package/dist/ops/cpu/matMulMul.js +8 -9
  117. package/dist/ops/cpu/mulDropout.js +8 -9
  118. package/dist/ops/cpu/normRMS.js +12 -13
  119. package/dist/ops/cpu/qkv.js +14 -13
  120. package/dist/ops/cpu/rope.js +11 -8
  121. package/dist/ops/cpu/scatterSub.js +1 -12
  122. package/dist/ops/dot16.js +16 -17
  123. package/dist/ops/dropout.js +9 -8
  124. package/dist/ops/dropout16.js +1 -22
  125. package/dist/ops/gatherSub.js +3 -4
  126. package/dist/ops/gelu.js +1 -2
  127. package/dist/ops/globalNorm.js +10 -10
  128. package/dist/ops/grads/add16.js +16 -17
  129. package/dist/ops/grads/attentionMask.js +6 -7
  130. package/dist/ops/grads/dropout16.js +1 -1
  131. package/dist/ops/grads/gelu.js +1 -2
  132. package/dist/ops/grads/matMul16.js +1 -2
  133. package/dist/ops/grads/matMulGelu.js +6 -7
  134. package/dist/ops/grads/mul16.js +1 -1
  135. package/dist/ops/grads/normRMS.js +8 -9
  136. package/dist/ops/grads/pack16.js +1 -2
  137. package/dist/ops/grads/qkv.js +10 -10
  138. package/dist/ops/grads/rope.js +1 -2
  139. package/dist/ops/grads/silu.js +1 -2
  140. package/dist/ops/grads/softmax16.js +6 -7
  141. package/dist/ops/grads/unpack16.js +1 -2
  142. package/dist/ops/grads/utils.js +1 -2
  143. package/dist/ops/matMul16.d.ts +1 -1
  144. package/dist/ops/matMul16.js +1 -2
  145. package/dist/ops/matMulGelu.js +3 -4
  146. package/dist/ops/matMulMul.js +2 -3
  147. package/dist/ops/mul16.js +1 -43
  148. package/dist/ops/mulDrop.js +2 -3
  149. package/dist/ops/normRMS.js +2 -3
  150. package/dist/ops/pack16.js +1 -2
  151. package/dist/ops/qkv.js +2 -3
  152. package/dist/ops/reshape16.js +11 -11
  153. package/dist/ops/rope.js +1 -2
  154. package/dist/ops/scatterSub.js +3 -4
  155. package/dist/ops/silu.js +1 -2
  156. package/dist/ops/slice16.js +5 -5
  157. package/dist/ops/softmax16.js +3 -4
  158. package/dist/ops/sub16.js +3 -4
  159. package/dist/ops/sum16.js +3 -3
  160. package/dist/ops/transpose16.js +16 -15
  161. package/dist/ops/unpack16.js +1 -2
  162. package/dist/ops/webgl/adamAdjust.js +8 -9
  163. package/dist/ops/webgl/adamMoments.js +2 -3
  164. package/dist/ops/webgl/appendCache.js +2 -3
  165. package/dist/ops/webgl/attentionMask.js +2 -3
  166. package/dist/ops/webgl/dropout16.js +2 -3
  167. package/dist/ops/webgl/fusedSoftmax.js +13 -13
  168. package/dist/ops/webgl/gatherSub.js +2 -3
  169. package/dist/ops/webgl/gelu.js +11 -12
  170. package/dist/ops/webgl/log.js +10 -10
  171. package/dist/ops/webgl/matMul16.js +31 -24
  172. package/dist/ops/webgl/matMulGelu.js +1 -2
  173. package/dist/ops/webgl/matMulMul.js +3 -4
  174. package/dist/ops/webgl/mulDropout.js +2 -3
  175. package/dist/ops/webgl/normRMS.js +11 -10
  176. package/dist/ops/webgl/qkv.js +2 -3
  177. package/dist/ops/webgl/rope.js +4 -5
  178. package/dist/ops/webgl/scatterSub.js +2 -3
  179. package/dist/ops/webgpu/adamAdjust.js +13 -14
  180. package/dist/ops/webgpu/adamMoments.js +13 -14
  181. package/dist/ops/webgpu/add16.js +3 -4
  182. package/dist/ops/webgpu/appendCache.js +20 -21
  183. package/dist/ops/webgpu/attentionMask.js +18 -19
  184. package/dist/ops/webgpu/attentionMask32_program.js +7 -8
  185. package/dist/ops/webgpu/clipScale.js +11 -12
  186. package/dist/ops/webgpu/concat16.js +17 -18
  187. package/dist/ops/webgpu/dropout16.js +6 -7
  188. package/dist/ops/webgpu/gatherSub.js +11 -12
  189. package/dist/ops/webgpu/gelu.js +10 -11
  190. package/dist/ops/webgpu/index.js +17 -17
  191. package/dist/ops/webgpu/matMul16.js +74 -63
  192. package/dist/ops/webgpu/matMul16_program.d.ts +2 -1
  193. package/dist/ops/webgpu/matMul16_program.js +29 -21
  194. package/dist/ops/webgpu/mul16.js +3 -4
  195. package/dist/ops/webgpu/norm2.js +9 -10
  196. package/dist/ops/webgpu/normRMS.js +9 -10
  197. package/dist/ops/webgpu/normRMS16_program.js +1 -2
  198. package/dist/ops/webgpu/normRMS32_program.js +1 -2
  199. package/dist/ops/webgpu/normRMSGrad.js +30 -30
  200. package/dist/ops/webgpu/pack16.js +2 -3
  201. package/dist/ops/webgpu/pack16_program.js +3 -4
  202. package/dist/ops/webgpu/qkv.js +10 -11
  203. package/dist/ops/webgpu/rope.js +26 -27
  204. package/dist/ops/webgpu/scatterSub.js +12 -13
  205. package/dist/ops/webgpu/silu.js +10 -11
  206. package/dist/ops/webgpu/slice16.js +17 -18
  207. package/dist/ops/webgpu/softmax16.js +9 -9
  208. package/dist/ops/webgpu/softmax16_program.js +9 -10
  209. package/dist/ops/webgpu/softmax16_subgroup_program.js +11 -12
  210. package/dist/ops/webgpu/softmax16grad.js +8 -9
  211. package/dist/ops/webgpu/sub16.js +3 -4
  212. package/dist/ops/webgpu/sum16.js +16 -15
  213. package/dist/ops/webgpu/transpose16.js +13 -12
  214. package/dist/ops/webgpu/transpose16_program.js +3 -4
  215. package/dist/ops/webgpu/transpose16_shared_program.js +17 -18
  216. package/dist/ops/webgpu/unpack16.js +8 -9
  217. package/dist/ops/webgpu/utils/binary_op.js +20 -21
  218. package/dist/ops/webgpu/utils/deviceInfo.js +1 -2
  219. package/dist/ops/webgpu/utils/reductions.js +21 -20
  220. package/dist/ops-Be5ACU5R.js +13 -0
  221. package/dist/ops-C1UpdEYM.js +509 -0
  222. package/dist/{pack16-BhuXNUS7.js → pack16-BHO4t1-M.js} +14 -17
  223. package/dist/pad-Dy-1IP3A.js +13 -0
  224. package/dist/patches/webgpu_backend.js +18 -19
  225. package/dist/patches/webgpu_base.js +2 -3
  226. package/dist/patches/webgpu_program.js +21 -22
  227. package/dist/{pdf-Bzuk68Vy.js → pdf-CbnQ75VG.js} +380 -701
  228. package/dist/{picomatch-BO4HbNfo.js → picomatch--TW6gyBJ.js} +229 -291
  229. package/dist/qkv-BQfNPucX.js +42 -0
  230. package/dist/rand_util-_vCY93Uw.js +44 -0
  231. package/dist/random_normal-DUIT8kyC.js +11 -0
  232. package/dist/range-CYvQC3fW.js +13 -0
  233. package/dist/relu-C4XULT8A.js +8 -0
  234. package/dist/reshape-DJb1jgMt.js +8 -0
  235. package/dist/resize_nearest_neighbor-DAqcTYUe.js +188 -0
  236. package/dist/{chunk-CWhphoD1.js → rolldown-runtime-CwxnZyOB.js} +4 -5
  237. package/dist/{rope-BPu_uooz.js → rope-JjBVufF_.js} +6 -8
  238. package/dist/scatterSub-BOnqk-uY.js +27 -0
  239. package/dist/scatter_nd_util-BepMCpLY.js +34 -0
  240. package/dist/seedrandom-SHEGFK6H.js +282 -0
  241. package/dist/selu_util-DeOTf-sc.js +27 -0
  242. package/dist/shared-BIDMUBCs.js +1864 -0
  243. package/dist/{shared-CfTzpULd.js → shared-CX_iPI5K.js} +2 -3
  244. package/dist/silu-DsAE2cJ5.js +23 -0
  245. package/dist/slice-Dlb1FlzG.js +13 -0
  246. package/dist/{slice_util-Dve4TkDn.js → slice_util-BVgPRoij.js} +3 -4
  247. package/dist/softmax-Dpav_dWw.js +10 -0
  248. package/dist/split-DYnT8chz.js +11 -0
  249. package/dist/squeeze-B3XYGAlg.js +9 -0
  250. package/dist/stack-Dbbt9mIk.js +10 -0
  251. package/dist/step-DA-5DNu9.js +348 -0
  252. package/dist/{stream-BpAwcvHz.js → stream-BBe2apn4.js} +68 -88
  253. package/dist/sum-C8qNbFNp.js +13 -0
  254. package/dist/tensor-ALxWZfmz.js +7 -0
  255. package/dist/tensor1d-BHgkkhTE.js +9 -0
  256. package/dist/tensor2d-ARItvqVn.js +10 -0
  257. package/dist/tensor4d-D1zRBipJ.js +10 -0
  258. package/dist/tfjs_backend-CsXOum0h.js +685 -0
  259. package/dist/tile-DfyQ0KX-.js +10 -0
  260. package/dist/tokenise-DbS2Ea-T.js +14 -0
  261. package/dist/tokenise.js +6 -15
  262. package/dist/tokeniser/BaseTokeniser.js +5 -9
  263. package/dist/tokeniser/CharTokeniser.js +1 -2
  264. package/dist/tokeniser/bpe.js +19 -20
  265. package/dist/topk-BrU2pkrR.js +19 -0
  266. package/dist/training/AdamW.js +35 -31
  267. package/dist/training/BasicTrainer.js +56 -56
  268. package/dist/training/DatasetBuilder.js +1 -2
  269. package/dist/training/Evaluator.js +4 -4
  270. package/dist/training/LRScheduler.js +1 -2
  271. package/dist/training/PreTrainer.js +7 -8
  272. package/dist/training/SFTTrainer.js +7 -8
  273. package/dist/training/configure.js +16 -15
  274. package/dist/training/factory.js +1 -2
  275. package/dist/training/loss.js +1 -2
  276. package/dist/training/orthoGrad.js +2 -3
  277. package/dist/training/prepareData.js +18 -17
  278. package/dist/training/sparseCrossEntropy.js +38 -32
  279. package/dist/training/tasks/TokenStore.js +21 -22
  280. package/dist/training/tasks/tokenStream.js +1 -2
  281. package/dist/training/validateOptions.js +1 -2
  282. package/dist/training/validation.js +1 -2
  283. package/dist/transpose-BC-M_OoT.js +34 -0
  284. package/dist/unsorted_segment_sum-BelC7R-q.js +408 -0
  285. package/dist/utilities/arrayClose.js +5 -4
  286. package/dist/utilities/arrayShape.js +1 -2
  287. package/dist/utilities/datasetID.js +1 -2
  288. package/dist/utilities/dummy.js +15 -15
  289. package/dist/utilities/float16.js +10 -10
  290. package/dist/utilities/maxHeap.js +1 -2
  291. package/dist/utilities/multinomialCPU.d.ts +1 -2
  292. package/dist/utilities/multinomialCPU.js +6 -8
  293. package/dist/utilities/packed.js +2 -3
  294. package/dist/utilities/parameters.js +3 -4
  295. package/dist/utilities/performance.js +2 -3
  296. package/dist/utilities/profile.js +3 -4
  297. package/dist/utilities/random.js +1 -2
  298. package/dist/utilities/safetensors.js +14 -14
  299. package/dist/utilities/sentences.js +16 -13
  300. package/dist/utilities/tokenParse.js +1 -2
  301. package/dist/utilities/tokens.js +5 -6
  302. package/dist/utilities/topP.d.ts +1 -0
  303. package/dist/utilities/topP.js +20 -13
  304. package/dist/utilities/waitForModel.js +1 -2
  305. package/dist/utilities/weights.js +4 -4
  306. package/dist/utilities/yielder.js +1 -2
  307. package/dist/{v4-BK7K-jy_.js → v4-YCkfo8OR.js} +4 -7
  308. package/dist/{webgpu-IAn9VotJ.js → webgpu-BHX-uBym.js} +156 -163
  309. package/dist/{webgpu_program-B0PokuRJ.js → webgpu_program-DvkFqRlR.js} +28 -29
  310. package/dist/{webgpu_util-DfODg6XI.js → webgpu_util-5QTyovaf.js} +2 -3
  311. package/dist/zeros-hxKGkRfl.js +12 -0
  312. package/package.json +3 -3
  313. package/dist/Reshape-CwxdaU8n.js +0 -17
  314. package/dist/dist-Da20xy8E.js +0 -6375
  315. package/dist/gelu-B6637MKa.js +0 -27
  316. package/dist/selu_util-B_AFEfoz.js +0 -24
  317. package/dist/shared-24EoeHJl.js +0 -1314
  318. package/dist/silu-B6bvCgJ7.js +0 -25
  319. package/dist/tfjs_backend-h5weiy1O.js +0 -614
@@ -1,38 +1,40 @@
1
- import { n as e } from "./chunk-CWhphoD1.js";
2
- import { Ar as t, Ci as n, Cn as r, Cr as i, Dn as a, Dr as o, En as s, Er as c, In as l, Li as u, Ln as d, M as ee, N as te, Oi as ne, On as re, Or as ie, Ps as f, Ri as ae, Rn as oe, Rs as se, Sn as ce, Sr as le, Tn as ue, Tr as de, ec as p, j as fe, jr as pe, ki as me, kr as he, oc as m, wn as ge, wr as _e, xn as ve, xr as ye } from "./dist-Da20xy8E.js";
3
- import { a as be, i as xe, n as Se, o as Ce, r as we, t as Te } from "./selu_util-B_AFEfoz.js";
4
- import { s as Ee } from "./slice_util-Dve4TkDn.js";
5
- import { n as De, t as Oe } from "./concat_util-CWzvQQlK.js";
6
- import { a as ke, c as Ae, i as je, n as Me, o as Ne, r as Pe, s as Fe, t as Ie } from "./complex_util-CkazZsaH.js";
7
- //#region node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd_util.js
8
- function h(e, t) {
1
+ import { n as e } from "./rolldown-runtime-CwxnZyOB.js";
2
+ import { C as t, Ct as n, St as r, T as i, Ti as a, Vi as o, ht as s, lt as c, mt as l, qi as u, w as d, yi as f } from "./dist-CMMLi-qO.js";
3
+ import { a as ee, c as te, i as ne, n as re, o as ie, r as ae, s as oe, t as se } from "./axis_util-rF9RnwKE.js";
4
+ import { n as ce, t as le } from "./concat_util-CY45Hf4F.js";
5
+ import { _ as ue, c as de, d as fe, f as pe, g as me, h as he, l as ge, m as _e, p as ve, s as ye, u as be } from "./step-DA-5DNu9.js";
6
+ import { a as xe, i as Se, n as Ce, o as we, r as Te, t as Ee } from "./selu_util-DeOTf-sc.js";
7
+ import { s as De } from "./slice_util-BVgPRoij.js";
8
+ import { n as Oe, r as ke, t as Ae } from "./scatter_nd_util-BepMCpLY.js";
9
+ import { a as je, c as Me, i as Ne, n as Pe, o as Fe, r as Ie, s as Le, t as Re } from "./complex_util-BBlPAm-s.js";
10
+ // node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd_util.js
11
+ function p(e, t) {
9
12
  let n = e.shape.length, r = t.shape.length;
10
13
  if (n < 1) throw Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${n}.`);
11
14
  if (r < 1) throw Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${r}.`);
12
15
  if (t.dtype !== "int32") throw Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${t.dtype}.`);
13
16
  if (t.shape[r - 1] > n) throw Error(`index innermost dimension length must be <= tensor rank; saw: ${t.shape[r - 1]} vs. ${n}`);
14
- if (m(e.shape) === 0) throw Error(`Requested more than 0 entries, but input is empty. Input shape: ${e.shape}.`);
15
- let i = t.shape, a = i[i.length - 1], o = 1;
16
- for (let e = 0; e < i.length - 1; ++e) o *= i[e];
17
- let s = e.shape, c = i.slice();
18
- c.pop();
19
- let l = 1;
20
- for (let e = a; e < n; ++e) l *= s[e], c.push(s[e]);
21
- let u = [...se(e.shape).map((e) => e / l), 1].slice(0, a);
17
+ if (u(e.shape) === 0) throw Error(`Requested more than 0 entries, but input is empty. Input shape: ${e.shape}.`);
18
+ let i = t.shape, o = i[i.length - 1], s = 1;
19
+ for (let e = 0; e < i.length - 1; ++e) s *= i[e];
20
+ let c = e.shape, l = i.slice();
21
+ l.pop();
22
+ let d = 1;
23
+ for (let e = o; e < n; ++e) d *= c[e], l.push(c[e]);
24
+ let f = [...a(e.shape).map((e) => e / d), 1].slice(0, o);
22
25
  return [
23
- c,
24
- o,
25
26
  l,
26
- u
27
+ s,
28
+ d,
29
+ f
27
30
  ];
28
31
  }
29
- //#endregion
30
- //#region node_modules/@tensorflow/tfjs-core/dist/ops/ragged_to_dense_util.js
31
- var g;
32
+ // node_modules/@tensorflow/tfjs-core/dist/ops/ragged_to_dense_util.js
33
+ var m;
32
34
  (function(e) {
33
35
  e[e.FIRST_DIM_SIZE = 0] = "FIRST_DIM_SIZE", e[e.VALUE_ROWIDS = 1] = "VALUE_ROWIDS", e[e.ROW_LENGTHS = 2] = "ROW_LENGTHS", e[e.ROW_SPLITS = 3] = "ROW_SPLITS", e[e.ROW_LIMITS = 4] = "ROW_LIMITS", e[e.ROW_STARTS = 5] = "ROW_STARTS";
34
- })(g ||= {});
35
- function _(e, t, n) {
36
+ })(m ||= {});
37
+ function h(e, t, n) {
36
38
  let r = [];
37
39
  if (n == null && t == null) return r;
38
40
  if (t == null) for (; r.length < e + n.length;) r.push(-1);
@@ -41,29 +43,31 @@ function _(e, t, n) {
41
43
  if (e + n.length !== r.length) throw Error(`rt input.shape and shape=${t} are incompatible: rt input.rank = ${e + n.length}, but shape.rank = ${r.length}`);
42
44
  for (let i = 1; i < n.length; ++i) {
43
45
  let a = n[i], o = r[r.length - n.length + i], s = r[o];
44
- if (a >= 0) if (s >= 0) {
45
- if (s !== a) throw Error(`rt input.shape and shape=${t} are incompatible: rt input.shape[${i + e}] = ${a} but shape[${i + e}] = ${s}`);
46
- } else r[o] = a;
46
+ if (a >= 0) {
47
+ if (s >= 0) {
48
+ if (s !== a) throw Error(`rt input.shape and shape=${t} are incompatible: rt input.shape[${i + e}] = ${a} but shape[${i + e}] = ${s}`);
49
+ } else r[o] = a;
50
+ }
47
51
  }
48
52
  return r;
49
53
  }
50
- function v(e) {
54
+ function g(e) {
51
55
  let t = {
52
- FIRST_DIM_SIZE: g.FIRST_DIM_SIZE,
53
- VALUE_ROWIDS: g.VALUE_ROWIDS,
54
- ROW_LENGTHS: g.ROW_LENGTHS,
55
- ROW_SPLITS: g.ROW_SPLITS,
56
- ROW_LIMITS: g.ROW_LIMITS,
57
- ROW_STARTS: g.ROW_STARTS
56
+ FIRST_DIM_SIZE: m.FIRST_DIM_SIZE,
57
+ VALUE_ROWIDS: m.VALUE_ROWIDS,
58
+ ROW_LENGTHS: m.ROW_LENGTHS,
59
+ ROW_SPLITS: m.ROW_SPLITS,
60
+ ROW_LIMITS: m.ROW_LIMITS,
61
+ ROW_STARTS: m.ROW_STARTS
58
62
  }, n = [];
59
63
  for (let r of e) if (r in t) n.push(t[r]);
60
64
  else break;
61
65
  return n;
62
66
  }
63
- function y(e) {
64
- return e.length === 0 ? 0 : e[0] === g.FIRST_DIM_SIZE ? e.length - 1 : e.length;
67
+ function _(e) {
68
+ return e.length === 0 ? 0 : e[0] === m.FIRST_DIM_SIZE ? e.length - 1 : e.length;
65
69
  }
66
- function b(e, t) {
70
+ function v(e, t) {
67
71
  if (e == null || t == null) return;
68
72
  let n = e.length, r = t.length;
69
73
  if (n >= r) throw Error(`defaultValue.shape=${e} and ragged tensor flatValues.shape=${t}, are incompatible: defaultValue.rank = ${n} must be less than ragged tensor input flatValues.rank = ${r})`);
@@ -72,17 +76,15 @@ function b(e, t) {
72
76
  if (n >= 0 && r >= 0 && n !== 1 && n !== r) throw Error(`defaultValue.shape=${e}, and ragged tensor input flatValues.shape=${t} are incompatible: defaultValue.shape[${i - e.length}] = ${n} but ragged tensor input.flatValues.shape[${i - e.length}] = ${r}`);
73
77
  }
74
78
  }
75
- function x(e) {
76
- return e <= 30 ? e : p(e, Math.floor(Math.sqrt(e)));
79
+ function y(e) {
80
+ return e <= 30 ? e : o(e, Math.floor(Math.sqrt(e)));
77
81
  }
78
- //#endregion
79
- //#region node_modules/@tensorflow/tfjs-core/dist/ops/rotate_util.js
80
- function S(e, t, n) {
82
+ // node_modules/@tensorflow/tfjs-core/dist/ops/rotate_util.js
83
+ function ze(e, t, n) {
81
84
  return [n * (typeof e == "number" ? e : e[0]), t * (typeof e == "number" ? e : e[1])];
82
85
  }
83
- //#endregion
84
- //#region node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_util.js
85
- function C(e, t, n, r = !0) {
86
+ // node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_util.js
87
+ function b(e, t, n, r = !0) {
86
88
  let i = [];
87
89
  if (r) i = i.concat(t.slice(0)), i.push(e[0] / n), i = i.concat(e.slice(1));
88
90
  else {
@@ -93,7 +95,7 @@ function C(e, t, n, r = !0) {
93
95
  }
94
96
  return i;
95
97
  }
96
- function Le(e, t, n = !0) {
98
+ function x(e, t, n = !0) {
97
99
  let r = [];
98
100
  if (n) {
99
101
  r.push(t);
@@ -105,33 +107,32 @@ function Le(e, t, n = !0) {
105
107
  }
106
108
  return r;
107
109
  }
108
- function w(e, t, n, r = !0) {
110
+ function S(e, t, n, r = !0) {
109
111
  let i = [];
110
112
  r ? i.push(e[0] / n) : i.push(e[0] * n);
111
113
  for (let n = 1; n < e.length; ++n) n <= t.length ? r ? i.push(t[n - 1] * e[n]) : i.push(e[n] / t[n - 1]) : i.push(e[n]);
112
114
  return i;
113
115
  }
114
- function T(e, t) {
116
+ function C(e, t) {
115
117
  let n = [0];
116
118
  for (let r = 0; r < t; ++r) n.push(e[r][0]);
117
119
  return n;
118
120
  }
119
- function E(e, t, n) {
121
+ function w(e, t, n) {
120
122
  let r = e.slice(0, 1);
121
123
  for (let i = 0; i < n; ++i) r.push(e[i + 1] - t[i][0] - t[i][1]);
122
124
  return r;
123
125
  }
124
- //#endregion
125
- //#region node_modules/@tensorflow/tfjs-core/dist/ops/erf_util.js
126
- var D = .3275911, O = .254829592, k = -.284496736, A = 1.421413741, j = -1.453152027, M = 1.061405429, N = "->", Re = /->/g, P = ",", F = "...";
127
- function I(e, t) {
126
+ // node_modules/@tensorflow/tfjs-core/dist/ops/erf_util.js
127
+ var T = .3275911, E = .254829592, D = -.284496736, O = 1.421413741, k = -1.453152027, A = 1.061405429, j = "->", Be = /->/g, M = ",", N = "...";
128
+ function P(e, t) {
128
129
  e = e.replace(/\s/g, "");
129
- let n = (e.length - e.replace(Re, "").length) / 2;
130
+ let n = (e.length - e.replace(Be, "").length) / 2;
130
131
  if (n < 1) throw Error("Equations without an arrow are not supported.");
131
- if (n > 1) throw Error(`Equation must contain exactly one arrow ("${N}").`);
132
- let [r, i] = e.split(N);
133
- f(r.indexOf(F) === -1, () => `The ellipsis notation ("${F}") is not supported yet.`);
134
- let a = r.split(P), o = a.length;
132
+ if (n > 1) throw Error(`Equation must contain exactly one arrow ("${j}").`);
133
+ let [r, i] = e.split(j);
134
+ f(r.indexOf(N) === -1, () => `The ellipsis notation ("${N}") is not supported yet.`);
135
+ let a = r.split(M), o = a.length;
135
136
  if (t !== o) throw Error(`Expected ${o} input tensors, received ${t}`);
136
137
  if (o > 2) throw Error("Support for more than 2 input tensors is not implemented yet.");
137
138
  let s = [];
@@ -142,7 +143,7 @@ function I(e, t) {
142
143
  }
143
144
  for (let e = 0; e < r.length; ++e) {
144
145
  let t = r[e];
145
- s.indexOf(t) === -1 && t !== P && s.push(t);
146
+ s.indexOf(t) === -1 && t !== M && s.push(t);
146
147
  }
147
148
  let c = Array(a.length);
148
149
  for (let e = 0; e < o; ++e) {
@@ -158,7 +159,7 @@ function I(e, t) {
158
159
  idDims: c
159
160
  };
160
161
  }
161
- function L(e, t) {
162
+ function F(e, t) {
162
163
  let n = Array(e);
163
164
  n.fill(-1);
164
165
  for (let e = 0; e < t.length; ++e) n[t[e]] = e;
@@ -169,20 +170,20 @@ function L(e, t) {
169
170
  expandDims: r
170
171
  };
171
172
  }
172
- function R(e, t, n) {
173
+ function I(e, t, n) {
173
174
  let r = Array(e);
174
175
  for (let e = 0; e < n.length; ++e) {
175
176
  let i = n[e].shape;
176
177
  for (let n = 0; n < t[e].length; ++n) r[t[e][n]] === void 0 ? r[t[e][n]] = i[n] : f(r[t[e][n]] === i[n], () => `Expected dimension ${r[t[e][n]]} at axis ${n} of input shaped ${JSON.stringify(i)}, but got dimension ${i[n]}`);
177
178
  }
178
179
  }
179
- function z(e, t) {
180
+ function L(e, t) {
180
181
  let n = e, r = [], i = 0;
181
182
  e.length === 0 && n.push(-1), i = e.length + 1;
182
183
  for (let e = 0; e < i; ++e) r.push([]);
183
184
  let a = [];
184
185
  for (let e = 0; e < n.length; ++e) {
185
- let i = n[e], o = ze(t, i);
186
+ let i = n[e], o = Ve(t, i);
186
187
  for (let t of o) a.indexOf(t) === -1 && (r[e].push(t), a.push(t));
187
188
  }
188
189
  return {
@@ -190,84 +191,80 @@ function z(e, t) {
190
191
  steps: r
191
192
  };
192
193
  }
193
- function B(e) {
194
+ function R(e) {
194
195
  return e.every((e, t) => e === t);
195
196
  }
196
- function ze(e, t) {
197
+ function Ve(e, t) {
197
198
  let n = [];
198
199
  for (let r = 0; r < e.length; ++r) (e[r].length === 0 || e[r].indexOf(t) !== -1 || t === -1) && n.push(r);
199
200
  return n;
200
201
  }
201
- //#endregion
202
- //#region node_modules/@tensorflow/tfjs-core/dist/ops/split_util.js
203
- function V(e, t, n = 0) {
202
+ // node_modules/@tensorflow/tfjs-core/dist/ops/split_util.js
203
+ function z(e, t, n = 0) {
204
204
  let r = [];
205
205
  if (typeof t == "number") f(e.shape[n] % t === 0, () => "Number of splits must evenly divide the axis."), r = Array(t).fill(e.shape[n] / t);
206
206
  else {
207
- f(t.reduce((e, t) => (t === -1 && (e += 1), e), 0) <= 1, () => "There should be only one negative value in split array.");
208
- let i = t.indexOf(-1);
209
- if (i !== -1) {
207
+ let i = t.reduce((e, t) => (t === -1 && (e += 1), e), 0);
208
+ f(i <= 1, () => "There should be only one negative value in split array.");
209
+ let a = t.indexOf(-1);
210
+ if (a !== -1) {
210
211
  let r = t.reduce((e, t) => t > 0 ? e + t : e);
211
- t[i] = e.shape[n] - r;
212
+ t[a] = e.shape[n] - r;
212
213
  }
213
214
  f(e.shape[n] === t.reduce((e, t) => e + t), () => "The sum of sizes must match the size of the axis dimension."), r = t;
214
215
  }
215
216
  return r;
216
217
  }
217
- //#endregion
218
- //#region node_modules/@tensorflow/tfjs-core/dist/ops/sparse/sparse_fill_empty_rows_util.js
219
- function H(e) {
218
+ // node_modules/@tensorflow/tfjs-core/dist/ops/sparse/sparse_fill_empty_rows_util.js
219
+ function B(e) {
220
220
  return `Received SparseTensor with denseShape[0] = 0 but
221
221
  indices.shape[0] = ${e}`;
222
222
  }
223
- function U(e, t) {
223
+ function V(e, t) {
224
224
  return `indices(${e}, 0) is invalid: ${t} < 0`;
225
225
  }
226
- function W(e, t, n) {
226
+ function H(e, t, n) {
227
227
  return `indices(${e}, 0) is invalid: ${t} >= ${n}`;
228
228
  }
229
- //#endregion
230
- //#region node_modules/@tensorflow/tfjs-core/dist/ops/sparse/sparse_reshape_util.js
231
- function G(e, t) {
229
+ // node_modules/@tensorflow/tfjs-core/dist/ops/sparse/sparse_reshape_util.js
230
+ function U(e, t) {
232
231
  return `only one output dimension may be -1, not both ${e} and ${t}`;
233
232
  }
234
- function K(e, t) {
233
+ function W(e, t) {
235
234
  return `size ${e} must be non-negative, not ${t}`;
236
235
  }
237
- function q() {
236
+ function G() {
238
237
  return "reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero";
239
238
  }
240
- function J(e, t) {
241
- return `Input to reshape is a SparseTensor with ${m(e)}
242
- dense values, but the requested shape requires a multiple of ${m(t)}. inputShape=${e} outputShape= ${t}`;
239
+ function K(e, t) {
240
+ return `Input to reshape is a SparseTensor with ${u(e)}
241
+ dense values, but the requested shape requires a multiple of ${u(t)}. inputShape=${e} outputShape= ${t}`;
243
242
  }
244
- function Y(e, t) {
245
- return `Input to reshape is a tensor with ${m(e)} dense values, but the requested shape has ${m(t)}. inputShape=${e} outputShape=${t}`;
243
+ function q(e, t) {
244
+ return `Input to reshape is a tensor with ${u(e)} dense values, but the requested shape has ${u(t)}. inputShape=${e} outputShape=${t}`;
246
245
  }
247
- //#endregion
248
- //#region node_modules/@tensorflow/tfjs-core/dist/ops/sparse/sparse_segment_reduction_util.js
249
- function X() {
246
+ // node_modules/@tensorflow/tfjs-core/dist/ops/sparse/sparse_segment_reduction_util.js
247
+ function J() {
250
248
  return "segment ids must be >= 0";
251
249
  }
252
- function Z() {
250
+ function Y() {
253
251
  return "segment ids are not increasing";
254
252
  }
255
- function Q(e, t) {
253
+ function X(e, t) {
256
254
  return `Segment id ${e} out of range [0, ${t}), possibly because segmentIds input is not sorted.`;
257
255
  }
258
- function Be(e, t, n) {
256
+ function Z(e, t, n) {
259
257
  return `Bad: indices[${e}] == ${t} out of range [0, ${n})`;
260
258
  }
261
- //#endregion
262
- //#region node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.js
263
- var Ve = /* @__PURE__ */ e({
259
+ // node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.js
260
+ var He = /* @__PURE__ */ e({
264
261
  collectGatherOpShapeInfo: () => We,
265
262
  computeOutShape: () => Ue,
266
- segOpComputeOptimalWindowSize: () => He
263
+ segOpComputeOptimalWindowSize: () => Q
267
264
  });
268
- function He(e, t) {
265
+ function Q(e, t) {
269
266
  let n = !1, r;
270
- for (e <= 30 ? (r = e, n = !0) : r = p(e, Math.floor(Math.sqrt(e))); !n;) r > t || r === e ? n = !0 : r = p(e, r + 1);
267
+ for (e <= 30 ? (r = e, n = !0) : r = o(e, Math.floor(Math.sqrt(e))); !n;) r > t || r === e ? n = !0 : r = o(e, r + 1);
271
268
  return r;
272
269
  }
273
270
  function Ue(e, t, n) {
@@ -295,105 +292,103 @@ function We(e, t, n, r) {
295
292
  outputShape: s
296
293
  };
297
294
  }
298
- //#endregion
299
- //#region node_modules/@tensorflow/tfjs-core/dist/backends/backend_util.js
295
+ // node_modules/@tensorflow/tfjs-core/dist/backends/backend_util.js
300
296
  var Ge = /* @__PURE__ */ e({
301
- ERF_A1: () => O,
302
- ERF_A2: () => k,
303
- ERF_A3: () => A,
304
- ERF_A4: () => j,
305
- ERF_A5: () => M,
306
- ERF_P: () => D,
297
+ ERF_A1: () => E,
298
+ ERF_A2: () => D,
299
+ ERF_A3: () => O,
300
+ ERF_A4: () => k,
301
+ ERF_A5: () => A,
302
+ ERF_P: () => T,
307
303
  PARALLELIZE_THRESHOLD: () => 30,
308
- RowPartitionType: () => g,
309
- SELU_SCALE: () => Te,
310
- SELU_SCALEALPHA: () => Se,
311
- applyActivation: () => we,
312
- assertAndGetBroadcastShape: () => l,
313
- assertAxesAreInnerMostDims: () => ve,
314
- assertParamsConsistent: () => Oe,
315
- assignToTypedArray: () => Ie,
316
- axesAreInnerMostDims: () => ce,
317
- calculateShapes: () => fe,
318
- checkEinsumDimSizes: () => R,
304
+ RowPartitionType: () => m,
305
+ SELU_SCALE: () => Ee,
306
+ SELU_SCALEALPHA: () => Ce,
307
+ applyActivation: () => Te,
308
+ assertAndGetBroadcastShape: () => t,
309
+ assertAxesAreInnerMostDims: () => se,
310
+ assertParamsConsistent: () => le,
311
+ assignToTypedArray: () => Re,
312
+ axesAreInnerMostDims: () => re,
313
+ calculateShapes: () => Ae,
314
+ checkEinsumDimSizes: () => I,
319
315
  checkPadOnDimRoundingMode: () => ye,
320
- combineLocations: () => r,
321
- combineRaggedTensorToTensorShapes: () => _,
322
- complexWithEvenIndex: () => Me,
323
- complexWithOddIndex: () => Pe,
324
- computeConv2DInfo: () => le,
325
- computeConv3DInfo: () => i,
326
- computeDefaultPad: () => _e,
327
- computeDilation2DInfo: () => de,
328
- computeOptimalWindowSize: () => x,
329
- computeOutAndReduceShapes: () => ge,
330
- computeOutShape: () => De,
331
- computePool2DInfo: () => c,
332
- computePool3DInfo: () => o,
333
- convertConv2DDataFormat: () => ie,
334
- decodeEinsumEquation: () => I,
316
+ combineLocations: () => ae,
317
+ combineRaggedTensorToTensorShapes: () => h,
318
+ complexWithEvenIndex: () => Pe,
319
+ complexWithOddIndex: () => Ie,
320
+ computeConv2DInfo: () => de,
321
+ computeConv3DInfo: () => ge,
322
+ computeDefaultPad: () => be,
323
+ computeDilation2DInfo: () => fe,
324
+ computeOptimalWindowSize: () => y,
325
+ computeOutAndReduceShapes: () => ne,
326
+ computeOutShape: () => ce,
327
+ computePool2DInfo: () => pe,
328
+ computePool3DInfo: () => ve,
329
+ convertConv2DDataFormat: () => _e,
330
+ decodeEinsumEquation: () => P,
335
331
  eitherStridesOrDilationsAreOne: () => he,
336
- expandShapeToKeepDim: () => ue,
337
- exponent: () => je,
338
- exponents: () => ke,
332
+ expandShapeToKeepDim: () => ee,
333
+ exponent: () => Ne,
334
+ exponents: () => je,
339
335
  fromStringArrayToUint8: () => $,
340
336
  fromUint8ToStringArray: () => Ke,
341
- getAxesPermutation: () => s,
337
+ getAxesPermutation: () => ie,
342
338
  getBroadcastDims: () => d,
343
- getComplexWithIndex: () => Ne,
344
- getEinsumComputePath: () => z,
345
- getEinsumPermutation: () => L,
346
- getFusedBiasGradient: () => xe,
347
- getFusedDyActivation: () => be,
348
- getImageCenter: () => S,
349
- getInnerMostAxes: () => a,
350
- getPermuted: () => Le,
351
- getRaggedRank: () => y,
352
- getReductionAxes: () => oe,
353
- getReshaped: () => C,
354
- getReshapedPermuted: () => w,
355
- getRowPartitionTypesHelper: () => v,
356
- getSliceBeginCoords: () => T,
357
- getSliceSize: () => E,
358
- getSparseFillEmptyRowsIndicesDenseShapeMismatch: () => H,
359
- getSparseFillEmptyRowsNegativeIndexErrorMessage: () => U,
360
- getSparseFillEmptyRowsOutOfRangeIndexErrorMessage: () => W,
361
- getSparseReshapeEmptyTensorZeroOutputDimErrorMessage: () => q,
362
- getSparseReshapeInputOutputMismatchErrorMessage: () => Y,
363
- getSparseReshapeInputOutputMultipleErrorMessage: () => J,
364
- getSparseReshapeMultipleNegativeOneOutputDimErrorMessage: () => G,
365
- getSparseReshapeNegativeOutputDimErrorMessage: () => K,
366
- getSparseSegmentReductionIndicesOutOfRangeErrorMessage: () => Be,
367
- getSparseSegmentReductionNegativeSegmentIdsErrorMessage: () => X,
368
- getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage: () => Z,
369
- getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage: () => Q,
370
- getUndoAxesPermutation: () => re,
371
- isIdentityPermutation: () => B,
372
- log: () => u,
373
- mergeRealAndImagArrays: () => Fe,
374
- prepareAndValidate: () => h,
375
- prepareSplitSize: () => V,
376
- segment_util: () => Ve,
377
- shouldFuse: () => Ce,
378
- slice_util: () => Ee,
379
- splitRealAndImagArrays: () => Ae,
380
- stridesOrDilationsArePositive: () => t,
381
- tupleValuesAreOne: () => pe,
382
- upcastType: () => n,
383
- validateDefaultValueShape: () => b,
384
- validateInput: () => ee,
385
- validateUpdateShape: () => te,
386
- warn: () => ae
339
+ getComplexWithIndex: () => Fe,
340
+ getEinsumComputePath: () => L,
341
+ getEinsumPermutation: () => F,
342
+ getFusedBiasGradient: () => Se,
343
+ getFusedDyActivation: () => xe,
344
+ getImageCenter: () => ze,
345
+ getInnerMostAxes: () => oe,
346
+ getPermuted: () => x,
347
+ getRaggedRank: () => _,
348
+ getReductionAxes: () => i,
349
+ getReshaped: () => b,
350
+ getReshapedPermuted: () => S,
351
+ getRowPartitionTypesHelper: () => g,
352
+ getSliceBeginCoords: () => C,
353
+ getSliceSize: () => w,
354
+ getSparseFillEmptyRowsIndicesDenseShapeMismatch: () => B,
355
+ getSparseFillEmptyRowsNegativeIndexErrorMessage: () => V,
356
+ getSparseFillEmptyRowsOutOfRangeIndexErrorMessage: () => H,
357
+ getSparseReshapeEmptyTensorZeroOutputDimErrorMessage: () => G,
358
+ getSparseReshapeInputOutputMismatchErrorMessage: () => q,
359
+ getSparseReshapeInputOutputMultipleErrorMessage: () => K,
360
+ getSparseReshapeMultipleNegativeOneOutputDimErrorMessage: () => U,
361
+ getSparseReshapeNegativeOutputDimErrorMessage: () => W,
362
+ getSparseSegmentReductionIndicesOutOfRangeErrorMessage: () => Z,
363
+ getSparseSegmentReductionNegativeSegmentIdsErrorMessage: () => J,
364
+ getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage: () => Y,
365
+ getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage: () => X,
366
+ getUndoAxesPermutation: () => te,
367
+ isIdentityPermutation: () => R,
368
+ log: () => r,
369
+ mergeRealAndImagArrays: () => Le,
370
+ prepareAndValidate: () => p,
371
+ prepareSplitSize: () => z,
372
+ segment_util: () => He,
373
+ shouldFuse: () => we,
374
+ slice_util: () => De,
375
+ splitRealAndImagArrays: () => Me,
376
+ stridesOrDilationsArePositive: () => me,
377
+ tupleValuesAreOne: () => ue,
378
+ upcastType: () => c,
379
+ validateDefaultValueShape: () => v,
380
+ validateInput: () => Oe,
381
+ validateUpdateShape: () => ke,
382
+ warn: () => n
387
383
  });
388
384
  function Ke(e) {
389
385
  try {
390
- return e.map((e) => ne(e));
386
+ return e.map((e) => l(e));
391
387
  } catch (e) {
392
388
  throw Error(`Failed to decode encoded string bytes into utf-8, error: ${e}`);
393
389
  }
394
390
  }
395
391
  function $(e) {
396
- return e.map((e) => me(e));
392
+ return e.map((e) => s(e));
397
393
  }
398
- //#endregion
399
- export { D as A, y as B, L as C, A as D, k as E, E as F, b as H, S as I, x as L, C as M, w as N, j as O, T as P, g as R, z as S, O as T, h as U, v as V, U as _, Ue as a, R as b, X as c, q as d, Y as f, H as g, K as h, We as i, Le as j, M as k, Z as l, G as m, $ as n, He as o, J as p, Ke as r, Be as s, Ge as t, Q as u, W as v, B as w, I as x, V as y, _ as z };
394
+ export { T as A, _ as B, F as C, O as D, D as E, w as F, v as H, ze as I, y as L, b as M, S as N, k as O, C as P, m as R, L as S, E as T, p as U, g as V, V as _, Ue as a, I as b, J as c, G as d, q as f, B as g, W as h, We as i, x as j, A as k, Y as l, U as m, $ as n, Q as o, K as p, Ke as r, Z as s, Ge as t, X as u, H as v, R as w, P as x, z as y, h as z };
@@ -1,4 +1,4 @@
1
- //#region node_modules/@tensorflow/tfjs-backend-webgpu/dist/binary_op_util.js
1
+ // node_modules/@tensorflow/tfjs-backend-webgpu/dist/binary_op_util.js
2
2
  var e;
3
3
  (function(e) {
4
4
  e[e.ADD = 0] = "ADD", e[e.ATAN2 = 1] = "ATAN2", e[e.COMPLEX_MULTIPLY_IMAG = 2] = "COMPLEX_MULTIPLY_IMAG", e[e.COMPLEX_MULTIPLY_REAL = 3] = "COMPLEX_MULTIPLY_REAL", e[e.DIV = 4] = "DIV", e[e.ELU_DER = 5] = "ELU_DER", e[e.EQUAL = 6] = "EQUAL", e[e.FLOOR_DIV = 7] = "FLOOR_DIV", e[e.GREATER = 8] = "GREATER", e[e.GREATER_EQUAL = 9] = "GREATER_EQUAL", e[e.LESS = 10] = "LESS", e[e.LESS_EQUAL = 11] = "LESS_EQUAL", e[e.LOGICAL_AND = 12] = "LOGICAL_AND", e[e.LOGICAL_OR = 13] = "LOGICAL_OR", e[e.MAX = 14] = "MAX", e[e.MIN = 15] = "MIN", e[e.MOD = 16] = "MOD", e[e.MUL = 17] = "MUL", e[e.NOT_EQUAL = 18] = "NOT_EQUAL", e[e.POW = 19] = "POW", e[e.PRELU = 20] = "PRELU", e[e.SQUARED_DIFFERENCE = 21] = "SQUARED_DIFFERENCE", e[e.SUB = 22] = "SUB";
@@ -45,7 +45,7 @@ function A(A, j) {
45
45
  ${i}(isNaN) | aIsNaN | bIsNaN);
46
46
  }
47
47
  `;
48
- } while (!1);
48
+ } while (0);
49
49
  switch (A) {
50
50
  case e.ADD:
51
51
  M = t;
@@ -89,15 +89,11 @@ function A(A, j) {
89
89
  case e.SQUARED_DIFFERENCE:
90
90
  M = O;
91
91
  break;
92
- case e.SUB:
93
- M = k;
94
- break;
95
- default:
92
+ case e.SUB: M = k;
96
93
  }
97
94
  return `
98
95
  ${M}
99
96
  return resultTemp;
100
97
  `;
101
98
  }
102
- //#endregion
103
99
  export { A as n, e as t };
@@ -0,0 +1,20 @@
1
+ import { M as e, Q as t, Z as n, bi as r, ci as i, rt as a } from "./dist-CMMLi-qO.js";
2
+ import { t as o } from "./reshape-DJb1jgMt.js";
3
+ // node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_to.js
4
+ function s(n, s) {
5
+ let c = t(n, "broadcastTo", "x"), l = c.shape;
6
+ if (r(s), s.length < c.rank) throw Error(`broadcastTo(): shape.length=${s.length} < input.rank=${c.rank}.`);
7
+ if (s.length > c.rank) {
8
+ let e = c.shape.slice();
9
+ for (; e.length < s.length;) e.unshift(1);
10
+ c = o(c, e);
11
+ }
12
+ let u = c.shape, d = Array.from(s);
13
+ for (let e = s.length - 1; e >= 0; e--) if (u[e] === s[e]) d[e] = 1;
14
+ else if (c.shape[e] !== 1) throw Error(`broadcastTo(): [${l}] cannot be broadcast to [${s}].`);
15
+ if (d.map((e, t) => e > 1 ? t : -1).filter((e) => e >= 0).length === 0) return e(c);
16
+ let f = { x: c }, p = { reps: d };
17
+ return a.runKernel(i, f, p);
18
+ }
19
+ var c = /* @__PURE__ */ n({ broadcastTo_: s });
20
+ export { c as t };
@@ -1,8 +1,9 @@
1
- import { P as e, ii as t, ui as n } from "../dist-Da20xy8E.js";
2
- //#region lib/checks/appendCache.ts
1
+ import { H as e, J as t } from "../dist-CMMLi-qO.js";
2
+ import { t as n } from "../tensor4d-D1zRBipJ.js";
3
+ // lib/checks/appendCache.ts
3
4
  async function r(r) {
4
- await n(r);
5
- let i = e([[[
5
+ await t(r);
6
+ let i = n([[[
6
7
  [
7
8
  .1,
8
9
  .2,
@@ -32,7 +33,7 @@ async function r(r) {
32
33
  1,
33
34
  4,
34
35
  4
35
- ]), a = e([[[[
36
+ ]), a = n([[[[
36
37
  .1,
37
38
  .2,
38
39
  .3,
@@ -43,7 +44,7 @@ async function r(r) {
43
44
  1,
44
45
  4
45
46
  ]);
46
- return await t().runKernel("AppendCache", {
47
+ return await e().runKernel("AppendCache", {
47
48
  cache: i,
48
49
  item: a
49
50
  }, {
@@ -51,5 +52,4 @@ async function r(r) {
51
52
  pastLen: 2
52
53
  }).array();
53
54
  }
54
- //#endregion
55
55
  export { r as execute };