@genai-fi/nanogpt 0.10.2 → 0.11.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 (262) hide show
  1. package/dist/Generator.d.ts +10 -5
  2. package/dist/Generator.js +11760 -146
  3. package/dist/{RealDiv-zz7FpkKX.js → RealDiv-Ds-jvL09.js} +28 -30
  4. package/dist/Reshape-Cd6e-Otn.js +14 -0
  5. package/dist/{Reshape-CHdUjC72.js → Reshape-Ct266DEk.js} +21 -23
  6. package/dist/TeachableLLM.d.ts +4 -3
  7. package/dist/TeachableLLM.js +15 -16
  8. package/dist/Trainer.d.ts +2 -2
  9. package/dist/Trainer.js +6 -6
  10. package/dist/{axis_util-BsIr9ZNu.js → axis_util-DofAuy0p.js} +1 -1
  11. package/dist/backend.js +2 -2
  12. package/dist/{backend_util-B1XRLuq9.js → backend_util-C7NWHpv7.js} +72 -73
  13. package/dist/{backend_webgpu-CqpfEImu.js → backend_webgpu-B0Vls736.js} +52 -54
  14. package/dist/broadcast_to-DDaNMbX7.js +28 -0
  15. package/dist/checks/appendCache.js +2 -2
  16. package/dist/checks/attentionMask.js +3 -3
  17. package/dist/checks/gelu.js +2 -2
  18. package/dist/checks/matMulGelu.js +7 -11
  19. package/dist/checks/normRMS.js +9 -9
  20. package/dist/checks/normRMSGrad.js +3 -3
  21. package/dist/checks/packUnpack.js +2 -2
  22. package/dist/checks/qkv.js +11 -12
  23. package/dist/checks/rope.js +2 -2
  24. package/dist/clip_by_value-Dn5tzexi.js +12 -0
  25. package/dist/complex-DClmWqJt.js +11 -0
  26. package/dist/concat-C6X3AAlQ.js +17 -0
  27. package/dist/{concat_util-iBYIyuQe.js → concat_util-CHsJFZJJ.js} +1 -1
  28. package/dist/{dataset-D2P7rHAw.js → dataset-DcjWqUVQ.js} +135 -137
  29. package/dist/dropout-OxuaJz6z.js +92 -0
  30. package/dist/expand_dims-BzfJK2uc.js +11 -0
  31. package/dist/{exports_initializers-CZSUJoVE.js → exports_initializers-eS9QJ6ut.js} +1 -1
  32. package/dist/floor-DIb-lN_u.js +9 -0
  33. package/dist/gather-BcO5UQNJ.js +9 -0
  34. package/dist/{gelu-Bmhopi0J.js → gelu-DqTbCx5x.js} +10 -11
  35. package/dist/{gpgpu_math-DsCcikas.js → gpgpu_math-CJcbnKPC.js} +841 -1015
  36. package/dist/index-D0RBWjq8.js +3520 -0
  37. package/dist/{index-DRyE072i.js → index-Dj5TkmPY.js} +330 -331
  38. package/dist/{kernel_funcs_utils-CWfOAPGO.js → kernel_funcs_utils-CSaumNDs.js} +132 -134
  39. package/dist/layers/BaseLayer.js +15 -16
  40. package/dist/layers/CausalSelfAttention.js +6 -6
  41. package/dist/layers/MLP.js +4 -4
  42. package/dist/layers/PositionEmbedding.js +7 -7
  43. package/dist/layers/RMSNorm.js +3 -3
  44. package/dist/layers/RoPECache.js +9 -9
  45. package/dist/layers/TiedEmbedding.js +6 -6
  46. package/dist/layers/TransformerBlock.js +1 -1
  47. package/dist/loader/loadTransformers.js +1 -1
  48. package/dist/loader/oldZipLoad.js +21 -22
  49. package/dist/log_sum_exp-VLZgbFAH.js +39 -0
  50. package/dist/main.d.ts +1 -1
  51. package/dist/main.js +49 -50
  52. package/dist/{matMul16-fEAJ4smh.js → matMul16-cDxwemKj.js} +14 -15
  53. package/dist/matMulGelu-B2s_80-H.js +163 -0
  54. package/dist/mat_mul-DxpNTCRz.js +11 -0
  55. package/dist/mod-PrOKlFxH.js +11 -0
  56. package/dist/models/NanoGPTV1.js +2 -2
  57. package/dist/models/model.js +13 -14
  58. package/dist/ones-BX_wEgzB.js +14 -0
  59. package/dist/ops/adamAdjust.js +1 -1
  60. package/dist/ops/adamMoments.js +1 -1
  61. package/dist/ops/add16.js +1 -1
  62. package/dist/ops/appendCache.js +3 -3
  63. package/dist/ops/attentionMask.js +1 -1
  64. package/dist/ops/concat16.js +2 -2
  65. package/dist/ops/cpu/adamAdjust.js +12 -13
  66. package/dist/ops/cpu/adamMoments.js +6 -7
  67. package/dist/ops/cpu/appendCache.js +7 -8
  68. package/dist/ops/cpu/attentionMask.js +11 -11
  69. package/dist/ops/cpu/fusedSoftmax.js +10 -11
  70. package/dist/ops/cpu/gatherSub.js +10 -11
  71. package/dist/ops/cpu/gelu.js +14 -15
  72. package/dist/ops/cpu/matMul16.js +6 -7
  73. package/dist/ops/cpu/matMulGelu.js +5 -6
  74. package/dist/ops/cpu/matMulMul.js +3 -4
  75. package/dist/ops/cpu/mulDropout.js +3 -4
  76. package/dist/ops/cpu/normRMS.js +11 -12
  77. package/dist/ops/cpu/qkv.js +8 -9
  78. package/dist/ops/cpu/rope.js +9 -10
  79. package/dist/ops/cpu/scatterSub.js +14 -16
  80. package/dist/ops/dot16.js +2 -2
  81. package/dist/ops/gatherSub.js +1 -1
  82. package/dist/ops/gelu.js +2 -2
  83. package/dist/ops/grads/add16.js +10 -11
  84. package/dist/ops/grads/attentionMask.js +5 -6
  85. package/dist/ops/grads/gelu.js +3 -4
  86. package/dist/ops/grads/matMul16.js +4 -5
  87. package/dist/ops/grads/matMulGelu.js +8 -9
  88. package/dist/ops/grads/normRMS.js +9 -10
  89. package/dist/ops/grads/pack16.js +4 -5
  90. package/dist/ops/grads/qkv.js +17 -19
  91. package/dist/ops/grads/rope.js +3 -5
  92. package/dist/ops/grads/softmax16.js +3 -4
  93. package/dist/ops/grads/unpack16.js +3 -4
  94. package/dist/ops/grads/utils.d.ts +1 -0
  95. package/dist/ops/grads/utils.js +8 -4
  96. package/dist/ops/matMul16.js +3 -3
  97. package/dist/ops/matMulGelu.js +2 -2
  98. package/dist/ops/matMulMul.js +1 -1
  99. package/dist/ops/mul16.js +1 -1
  100. package/dist/ops/mulDrop.js +1 -1
  101. package/dist/ops/normRMS.js +1 -1
  102. package/dist/ops/pack16.js +3 -4
  103. package/dist/ops/qkv.js +4 -8
  104. package/dist/ops/reshape16.js +16 -18
  105. package/dist/ops/rope.d.ts +1 -1
  106. package/dist/ops/rope.js +3 -8
  107. package/dist/ops/scatterSub.js +1 -1
  108. package/dist/ops/slice16.js +2 -2
  109. package/dist/ops/softmax16.js +5 -8
  110. package/dist/ops/sub16.js +1 -1
  111. package/dist/ops/sum16.js +2 -2
  112. package/dist/ops/transpose16.js +23 -24
  113. package/dist/ops/unpack16.js +2 -2
  114. package/dist/ops/webgl/adamAdjust.js +2 -3
  115. package/dist/ops/webgl/adamMoments.js +1 -2
  116. package/dist/ops/webgl/appendCache.js +1 -2
  117. package/dist/ops/webgl/attentionMask.js +5 -6
  118. package/dist/ops/webgl/fusedSoftmax.js +6 -8
  119. package/dist/ops/webgl/gatherSub.js +6 -7
  120. package/dist/ops/webgl/gelu.js +2 -3
  121. package/dist/ops/webgl/log.js +11 -12
  122. package/dist/ops/webgl/matMul16.js +15 -16
  123. package/dist/ops/webgl/matMulGelu.js +7 -111
  124. package/dist/ops/webgl/matMulMul.js +14 -15
  125. package/dist/ops/webgl/mulDropout.js +8 -9
  126. package/dist/ops/webgl/normRMS.js +7 -8
  127. package/dist/ops/webgl/qkv.js +5 -6
  128. package/dist/ops/webgl/rope.js +7 -8
  129. package/dist/ops/webgl/scatterSub.js +5 -6
  130. package/dist/ops/webgpu/adamAdjust.js +10 -12
  131. package/dist/ops/webgpu/adamMoments.js +8 -10
  132. package/dist/ops/webgpu/add16.js +8 -9
  133. package/dist/ops/webgpu/appendCache.js +23 -25
  134. package/dist/ops/webgpu/attentionMask.js +10 -12
  135. package/dist/ops/webgpu/attentionMask32_program.js +2 -2
  136. package/dist/ops/webgpu/concat16.js +12 -14
  137. package/dist/ops/webgpu/gatherSub.js +9 -11
  138. package/dist/ops/webgpu/gelu.js +28 -29
  139. package/dist/ops/webgpu/matMul16.js +26 -28
  140. package/dist/ops/webgpu/matMul16_program.js +4 -5
  141. package/dist/ops/webgpu/mul16.js +7 -8
  142. package/dist/ops/webgpu/normRMS.js +17 -19
  143. package/dist/ops/webgpu/normRMSGrad.js +21 -28
  144. package/dist/ops/webgpu/pack16.js +12 -13
  145. package/dist/ops/webgpu/pack16_program.js +2 -2
  146. package/dist/ops/webgpu/qkv.js +13 -15
  147. package/dist/ops/webgpu/rope.js +25 -27
  148. package/dist/ops/webgpu/scatterSub.js +7 -9
  149. package/dist/ops/webgpu/slice16.js +21 -23
  150. package/dist/ops/webgpu/softmax16.js +17 -19
  151. package/dist/ops/webgpu/softmax16_program.js +2 -2
  152. package/dist/ops/webgpu/softmax16_subgroup_program.js +2 -2
  153. package/dist/ops/webgpu/softmax16grad.js +7 -8
  154. package/dist/ops/webgpu/sub16.js +8 -9
  155. package/dist/ops/webgpu/sum16.js +19 -21
  156. package/dist/ops/webgpu/transpose16.js +19 -20
  157. package/dist/ops/webgpu/transpose16_program.js +2 -2
  158. package/dist/ops/webgpu/transpose16_shared_program.js +11 -12
  159. package/dist/ops/webgpu/unpack16.js +3 -4
  160. package/dist/ops/webgpu/utils/binary_op.js +7 -8
  161. package/dist/ops/webgpu/utils/reductions.js +14 -22
  162. package/dist/ops-FJapAPfm.js +476 -0
  163. package/dist/pack16-k4jq6aMX.js +39 -0
  164. package/dist/patches/webgpu_backend.js +19 -20
  165. package/dist/patches/webgpu_base.js +1 -1
  166. package/dist/patches/webgpu_program.js +15 -16
  167. package/dist/{random_width-BVV9HveY.js → random_width-UGQn4OWb.js} +2506 -2761
  168. package/dist/range-CuGvVN2c.js +10 -0
  169. package/dist/relu-Cf80uA2p.js +9 -0
  170. package/dist/reshape-CkjKPPqB.js +9 -0
  171. package/dist/resize_nearest_neighbor-DB8k9KN_.js +175 -0
  172. package/dist/rope-BmZmp9uP.js +24 -0
  173. package/dist/{scatter_nd_util-C7zXRT_h.js → scatter_nd_util-BY22Cc-C.js} +1 -1
  174. package/dist/selu_util-BuLbmbrl.js +44 -0
  175. package/dist/{shared-CHhxz-O5.js → shared-B7USJZgw.js} +1 -1
  176. package/dist/{shared-D2NP_CpY.js → shared-BQboIImQ.js} +379 -381
  177. package/dist/slice-Aqy7KbJh.js +12 -0
  178. package/dist/{slice_util-DyjSAD0u.js → slice_util-D8CQRenR.js} +7 -7
  179. package/dist/{softmax-C9JQEtnO.js → softmax-faLoUZVT.js} +4 -5
  180. package/dist/split-BNz5jcGc.js +9 -0
  181. package/dist/squeeze--YMgaAAf.js +10 -0
  182. package/dist/stack-WJK22CFn.js +11 -0
  183. package/dist/step-dXR33iOg.js +261 -0
  184. package/dist/sum-BdplSvq_.js +11 -0
  185. package/dist/{tensor-0r5yOo2R.js → tensor-BQqrDvpx.js} +1 -1
  186. package/dist/tensor1d-LxP9asMm.js +11 -0
  187. package/dist/{tensor2d-CSB4KOb0.js → tensor2d-BN1sSfQO.js} +6 -7
  188. package/dist/{tensor4d-D7bLqGqz.js → tensor4d-DVwr7pLF.js} +6 -7
  189. package/dist/{tfjs_backend-CNkSTL0c.js → tfjs_backend-Vi4JfLzT.js} +256 -265
  190. package/dist/tile-CvN_LyVr.js +11 -0
  191. package/dist/tokeniser/BaseTokeniser.d.ts +27 -0
  192. package/dist/tokeniser/BaseTokeniser.js +94 -0
  193. package/dist/tokeniser/CharTokeniser.d.ts +4 -3
  194. package/dist/tokeniser/CharTokeniser.js +46 -32
  195. package/dist/tokeniser/bpe.d.ts +4 -3
  196. package/dist/tokeniser/bpe.js +60 -45
  197. package/dist/tokeniser/type.d.ts +11 -0
  198. package/dist/training/Adam.js +2 -2
  199. package/dist/training/AdamExt.js +1 -1
  200. package/dist/training/DatasetBuilder.d.ts +2 -2
  201. package/dist/training/DatasetBuilder.js +32 -36
  202. package/dist/training/FullTrainer.js +1 -1
  203. package/dist/training/Trainer.d.ts +3 -3
  204. package/dist/training/Trainer.js +2 -2
  205. package/dist/training/sparseCrossEntropy.js +5 -5
  206. package/dist/transpose-JawVKyZy.js +36 -0
  207. package/dist/unsorted_segment_sum-LAbmE9G4.js +277 -0
  208. package/dist/utilities/dummy.js +3 -3
  209. package/dist/utilities/multinomialCPU.js +2 -2
  210. package/dist/utilities/packed.d.ts +1 -4
  211. package/dist/utilities/packed.js +10 -745
  212. package/dist/utilities/performance.js +1 -1
  213. package/dist/utilities/profile.js +1 -1
  214. package/dist/utilities/safetensors.js +2 -2
  215. package/dist/utilities/sentences.js +5 -5
  216. package/dist/utilities/weights.js +2 -2
  217. package/dist/{variable-DzfrwYuP.js → variable-DQ9yYgEU.js} +1 -1
  218. package/dist/{webgpu_program-DzaQiqel.js → webgpu_program-CAE4RICo.js} +177 -171
  219. package/dist/{webgpu_util-0_ubCEHJ.js → webgpu_util-BdovYhXr.js} +34 -35
  220. package/dist/zeros-DeiE2zTa.js +13 -0
  221. package/dist/zeros_like-BAz3iKru.js +721 -0
  222. package/package.json +4 -2
  223. package/dist/Reshape-CDVLyVfz.js +0 -16
  224. package/dist/broadcast_to-B0ChcDaz.js +0 -30
  225. package/dist/complex-BBiRlsVq.js +0 -13
  226. package/dist/concat-DmBLPVGC.js +0 -19
  227. package/dist/dropout-B1x1kYMa.js +0 -99
  228. package/dist/expand_dims-ouvfxQ1n.js +0 -13
  229. package/dist/gather-CH9sdacz.js +0 -10
  230. package/dist/index-D6Q1lPZO.js +0 -2157
  231. package/dist/log_sum_exp-D3ftBNY5.js +0 -41
  232. package/dist/mat_mul-C59XWcJd.js +0 -12
  233. package/dist/mod-DESSvHIU.js +0 -12
  234. package/dist/mulmat_packed_gpu-Coh6qbJk.js +0 -55
  235. package/dist/ones-jU9jlQvM.js +0 -15
  236. package/dist/ops-BFDtP6th.js +0 -645
  237. package/dist/pack16-CmVZs6af.js +0 -41
  238. package/dist/patches/PackedTensor.d.ts +0 -12
  239. package/dist/patches/PackedTensor.js +0 -11
  240. package/dist/patches/engine.d.ts +0 -261
  241. package/dist/patches/engine.js +0 -12
  242. package/dist/patches/tape.d.ts +0 -12
  243. package/dist/patches/tape.js +0 -5
  244. package/dist/range-ZZZD60Fx.js +0 -11
  245. package/dist/reciprocal-CrYlsAGD.js +0 -10
  246. package/dist/register_all_kernels-nvj2k7OC.js +0 -12307
  247. package/dist/relu-BYDneVPn.js +0 -10
  248. package/dist/reshape-CaPQzFvz.js +0 -10
  249. package/dist/rope-s4W2XO9B.js +0 -32
  250. package/dist/selu_util-BGPXmd4B.js +0 -303
  251. package/dist/sin-Djs4aQiu.js +0 -16
  252. package/dist/slice-DvovR5wq.js +0 -13
  253. package/dist/split-DBck65sX.js +0 -10
  254. package/dist/squeeze-C00Ipm_7.js +0 -11
  255. package/dist/stack-ChnHwRpX.js +0 -13
  256. package/dist/sum-ywRJj3Zr.js +0 -12
  257. package/dist/tensor-CzmOBsdf.js +0 -909
  258. package/dist/tensor1d-BlUT89BP.js +0 -12
  259. package/dist/tensor_util-DfwaWayG.js +0 -523
  260. package/dist/tile-CR074jmp.js +0 -13
  261. package/dist/transpose-DH4gmHvu.js +0 -38
  262. package/dist/zeros-DBFVbpv5.js +0 -14
@@ -0,0 +1,721 @@
1
+ import { q as u, u as h, E as d, c9 as st, ca as rt, cb as nt, cc as et, cd as it, ce as pt, D as B, cf as at, cg as ht, b_ as ut, y as D, ch as ct, ci as ft, l as H, a3 as C, b$ as lt, cj as dt, ck as mt, cl as Dt, aG as yt, cm as It, a2 as wt, m as M, $ as F, cn as xt, co as gt, N as $, c3 as $t, cp as bt, cq as kt, cr as vt, cs as Nt, b as _t, ct as Tt, cu as Et, cv as St, cw as qt, cx as r, aZ as Kt, n as zt, a4 as W, cy as Pt, cz as Ct, p as Mt, o as Ot, b0 as At, c as Bt } from "./index-D0RBWjq8.js";
2
+ import { e as j, a as R, l as G, b as X, d as V, m as Z, f as U, r as E, g as Ht, h as Ft, i as Wt, j as jt, k as Rt, n as Gt, o as Xt, c as Vt, p as Zt, q as Ut, t as Jt, u as Qt, v as Yt, 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-LAbmE9G4.js";
3
+ import { r as l } from "./reshape-CkjKPPqB.js";
4
+ import { b as uo } from "./broadcast_to-DDaNMbX7.js";
5
+ import { c as co } from "./clip_by_value-Dn5tzexi.js";
6
+ import { c as _ } from "./concat-C6X3AAlQ.js";
7
+ import { w as J, n as Q, b as S, c as fo, g as lo, l as mo, a as Do, f as yo, d as Io, j as wo, m as xo, e as go, i as $o, h as bo, r as ko, s as vo, u as No } from "./resize_nearest_neighbor-DB8k9KN_.js";
8
+ import { m as v } from "./mat_mul-DxpNTCRz.js";
9
+ import { s as Y, k as _o, h as To, e as Eo, l as So, p as qo, r as Ko, a as zo } from "./step-dXR33iOg.js";
10
+ import { e as Po, l as Co, a as Mo, m as Oo } from "./log_sum_exp-VLZgbFAH.js";
11
+ import { e as Ao } from "./expand_dims-BzfJK2uc.js";
12
+ import { f as Bo } from "./floor-DIb-lN_u.js";
13
+ import { g as Ho } from "./gather-BcO5UQNJ.js";
14
+ import { c as q } from "./complex-DClmWqJt.js";
15
+ import { n as N, r as K, i as L, t as Fo } from "./transpose-JawVKyZy.js";
16
+ import { s as T } from "./slice-Aqy7KbJh.js";
17
+ import { m as Wo } from "./mod-PrOKlFxH.js";
18
+ import { r as jo } from "./relu-Cf80uA2p.js";
19
+ import { s as z } from "./split-BNz5jcGc.js";
20
+ import { z as Ro } from "./zeros-DeiE2zTa.js";
21
+ import { s as Go } from "./softmax-faLoUZVT.js";
22
+ import { s as Xo } from "./squeeze--YMgaAAf.js";
23
+ import { s as Vo } from "./stack-WJK22CFn.js";
24
+ import { s as Zo } from "./sum-BdplSvq_.js";
25
+ import { t as Uo } from "./tile-CvN_LyVr.js";
26
+ function Jo(t) {
27
+ const s = { x: h(t, "x", "acos") };
28
+ return d.runKernel(st, s);
29
+ }
30
+ const Qo = /* @__PURE__ */ u({ acos_: Jo });
31
+ function Yo(t) {
32
+ const s = { x: h(t, "x", "acosh") };
33
+ return d.runKernel(rt, s);
34
+ }
35
+ const Lo = /* @__PURE__ */ u({ acosh_: Yo });
36
+ function ts(t, o = 0) {
37
+ const n = { x: h(t, "x", "argMin") }, e = { axis: o };
38
+ return d.runKernel(nt, n, e);
39
+ }
40
+ const os = /* @__PURE__ */ u({ argMin_: ts });
41
+ function ss(t) {
42
+ const s = { x: h(t, "x", "asin") };
43
+ return d.runKernel(et, s);
44
+ }
45
+ const rs = /* @__PURE__ */ u({ asin_: ss });
46
+ function ns(t) {
47
+ const s = { x: h(t, "x", "asinh") };
48
+ return d.runKernel(it, s);
49
+ }
50
+ const es = /* @__PURE__ */ u({ asinh_: ns });
51
+ function is(t) {
52
+ const s = { x: h(t, "x", "atan") };
53
+ return d.runKernel(pt, s);
54
+ }
55
+ const ps = /* @__PURE__ */ u({ atan_: is });
56
+ function as(t, o) {
57
+ let s = h(t, "a", "atan2"), n = h(o, "b", "atan2");
58
+ [s, n] = B(s, n);
59
+ const e = { a: s, b: n };
60
+ return d.runKernel(at, e);
61
+ }
62
+ const hs = /* @__PURE__ */ u({ atan2_: as });
63
+ function us(t) {
64
+ const s = { x: h(t, "x", "atanh") };
65
+ return d.runKernel(ht, s);
66
+ }
67
+ const cs = /* @__PURE__ */ u({ atanh_: us });
68
+ function fs(t) {
69
+ const s = { x: h(t, "x", "ceil", "float32") };
70
+ return d.runKernel(ut, s);
71
+ }
72
+ const ls = /* @__PURE__ */ u({ ceil_: fs });
73
+ function ds(t, o, s = "NHWC") {
74
+ const n = h(t, "x", "depthToSpace", "float32"), e = s === "NHWC" ? n.shape[1] : n.shape[2], i = s === "NHWC" ? n.shape[2] : n.shape[3], p = s === "NHWC" ? n.shape[3] : n.shape[1];
75
+ D(o > 1, () => `blockSize should be > 1 for depthToSpace, but was: ${o}`), D(e * o >= 0, () => `Negative dimension size caused by overflow when multiplying
76
+ ${e} and ${o} for depthToSpace with input shape
77
+ ${n.shape}`), D(i * o >= 0, () => `Negative dimension size caused by overflow when multiplying
78
+ ${i} and ${o} for depthToSpace with input shape
79
+ ${n.shape}`), D(p % (o * o) === 0, () => `Dimension size must be evenly divisible by ${o * o} but is ${p} for depthToSpace with input shape ${n.shape}`);
80
+ const a = { x: n }, f = { blockSize: o, dataFormat: s };
81
+ return d.runKernel(ct, a, f);
82
+ }
83
+ const ms = /* @__PURE__ */ u({ depthToSpace_: ds });
84
+ function Ds(t, o, s, n, e = [1, 1], i = "NHWC") {
85
+ const p = h(t, "x", "dilation2d"), a = h(o, "filter", "dilation2d");
86
+ D(p.rank === 3 || p.rank === 4, () => `Error in dilation2d: input must be rank 3 or 4, but got rank ${p.rank}.`), D(a.rank === 3, () => `Error in dilation2d: filter must be rank 3, but got rank ${a.rank}.`), D(i === "NHWC", () => `Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${i}`);
87
+ let f = p, y = !1;
88
+ p.rank === 3 && (f = l(p, [1, p.shape[0], p.shape[1], p.shape[2]]), y = !0), D(f.shape[3] === a.shape[2], () => `Error in dilation2d: input and filter must have the same depth: ${f.shape[3]} vs ${a.shape[2]}`);
89
+ const c = { x: f, filter: a }, m = { strides: s, pad: n, dilations: e }, I = d.runKernel(ft, c, m);
90
+ return y ? l(I, [I.shape[1], I.shape[2], I.shape[3]]) : I;
91
+ }
92
+ const ys = /* @__PURE__ */ u({ dilation2d_: Ds });
93
+ function Is(t, o) {
94
+ let s = h(t, "a", "div"), n = h(o, "b", "div");
95
+ [s, n] = B(s, n);
96
+ const e = H(s, n), i = C(e), p = j(n, i);
97
+ return J(p, i, e);
98
+ }
99
+ const ws = /* @__PURE__ */ u({ divNoNan_: Is });
100
+ function xs(t, o) {
101
+ const s = h(t, "t1", "dot"), n = h(o, "t2", "dot");
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
+ const e = s.rank === 1 ? s.size : s.shape[1], i = n.rank === 1 ? n.size : n.shape[0];
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 = v(p, a);
106
+ return l(f, []);
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 = v(p, a);
109
+ return l(f, [f.size]);
110
+ } else if (s.rank === 2 && n.rank === 1) {
111
+ const p = l(n, [-1, 1]), a = v(s, p);
112
+ return l(a, [a.size]);
113
+ } else {
114
+ const p = l(n, [n.shape[0], n.shape[1]]);
115
+ return v(s, p);
116
+ }
117
+ }
118
+ const gs = /* @__PURE__ */ u({ dot_: xs });
119
+ function $s(t, o = null, s = !1) {
120
+ return Q(t, "euclidean", o, s);
121
+ }
122
+ const bs = /* @__PURE__ */ u({ euclideanNorm_: $s });
123
+ function ks(t) {
124
+ const s = { x: h(t, "x", "expm1") };
125
+ return d.runKernel(lt, s);
126
+ }
127
+ const vs = /* @__PURE__ */ u({ expm1_: ks });
128
+ function Ns(t) {
129
+ const s = { x: h(t, "x", "isFinite") };
130
+ return d.runKernel(dt, s);
131
+ }
132
+ const _s = /* @__PURE__ */ u({ isFinite_: Ns });
133
+ function Ts(t) {
134
+ const s = { x: h(t, "x", "isInf") };
135
+ return d.runKernel(mt, s);
136
+ }
137
+ const Es = /* @__PURE__ */ u({ isInf_: Ts });
138
+ function Ss(t) {
139
+ const s = { x: h(t, "x", "isNaN") };
140
+ return d.runKernel(Dt, s);
141
+ }
142
+ const qs = /* @__PURE__ */ u({ isNaN_: Ss });
143
+ function Ks(t, o = 5, s = 1, n = 1, e = 0.5) {
144
+ const i = h(t, "x", "localResponseNormalization");
145
+ D(i.rank === 4 || i.rank === 3, () => `Error in localResponseNormalization: x must be rank 3 or 4 but got
146
+ rank ${i.rank}.`), D(yt(o), () => `Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${o}.`);
147
+ let p = i, a = !1;
148
+ i.rank === 3 && (a = !0, p = l(i, [1, i.shape[0], i.shape[1], i.shape[2]]));
149
+ const f = { x: p }, y = { depthRadius: o, bias: s, alpha: n, beta: e }, c = d.runKernel(It, f, y);
150
+ return a ? l(c, [c.shape[1], c.shape[2], c.shape[3]]) : c;
151
+ }
152
+ const zs = /* @__PURE__ */ u({ localResponseNormalization_: Ks });
153
+ function Ps(t) {
154
+ const o = h(t, "x", "logSigmoid");
155
+ return wt((n) => ({ value: N(R(N(n))), gradFunc: (p) => M(p, Y(N(n))) }))(o);
156
+ }
157
+ const Cs = /* @__PURE__ */ u({ logSigmoid_: Ps });
158
+ function Ms(t, o) {
159
+ const s = h(t, "a", "logicalOr", "bool"), n = h(o, "b", "logicalOr", "bool");
160
+ F(s.shape, n.shape);
161
+ const e = { a: s, b: n };
162
+ return d.runKernel(xt, e);
163
+ }
164
+ const tt = /* @__PURE__ */ u({ logicalOr_: Ms });
165
+ function Os(t, o) {
166
+ const s = h(t, "a", "logicalXor", "bool"), n = h(o, "b", "logicalXor", "bool");
167
+ return F(s.shape, n.shape), S(tt(t, o), G(S(t, o)));
168
+ }
169
+ const As = /* @__PURE__ */ u({ logicalXor_: Os });
170
+ function Bs(t, o, s) {
171
+ D(s === "reflect" || s === "symmetric", () => `Invalid mode. Mode must be either reflect or symmetric. Got ${s}.`);
172
+ const n = h(t, "x", "mirrorPad");
173
+ if (n.rank === 0)
174
+ throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");
175
+ D(o.length === n.rank, () => `Padding doesn't match input. Must be ${n.rank}. Got ${o.length}.`);
176
+ const e = s === "reflect" ? 1 : 0;
177
+ for (let a = 0; a < n.rank; a++)
178
+ D(o[a].length === 2, () => "Invalid number of paddings. Must be length of 2 each."), D(o[a][0] >= 0 && o[a][0] <= n.shape[a] - e && o[a][1] >= 0 && o[a][1] <= n.shape[a] - e, () => `Padding in dimension ${a} cannot be greater than or equal to ${n.shape[a] - e} or less than 0 for input of shape ${n.shape}`);
179
+ const i = { paddings: o, mode: s }, p = { x: n };
180
+ return d.runKernel(gt, p, i);
181
+ }
182
+ const Hs = /* @__PURE__ */ u({ mirrorPad_: Bs });
183
+ function Fs(t, o, s, n, e, i, p) {
184
+ e == null && (e = [1, 1]), i == null && (i = 1), n === 0 && (n = "valid");
185
+ const a = h(t, "x", "maxPool");
186
+ let f = a, y = !1;
187
+ a.rank === 3 && (y = !0, f = l(a, [1, a.shape[0], a.shape[1], a.shape[2]])), D(_o(i, e), () => `Error in pool: Either strides or dilations must be 1. Got strides ${i} and dilations '${e}'`);
188
+ const c = To(f.shape, o, i, e, n), m = [c.dilationHeight, c.dilationWidth];
189
+ let I;
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 : X(f, m, x), A = (s === "avg" ? () => V(O, o, i, b, p) : () => Z(O, o, i, b, p))(), k = w ? A : U(A, m, g);
192
+ return y ? l(k, [k.shape[1], k.shape[2], k.shape[3]]) : k;
193
+ }
194
+ function Ws(t, o, s) {
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]]);
196
+ return [f, y];
197
+ }
198
+ function js(t, o) {
199
+ const n = t.map((p, a) => p + (p - 1) * (o[a] - 1)).map((p) => p - 1), e = n.map((p) => Math.floor(p / 2)), i = n.map((p, a) => p - e[a]);
200
+ return n.map((p, a) => [e[a], i[a]]);
201
+ }
202
+ const Rs = /* @__PURE__ */ u({ pool_: Fs });
203
+ function Gs(t, o = null, s = !1) {
204
+ let n = h(t, "x", "prod");
205
+ n.dtype === "bool" && (n = $(n, "int32"));
206
+ const e = { x: n }, i = { axis: o, keepDims: s };
207
+ return d.runKernel($t, e, i);
208
+ }
209
+ const Xs = /* @__PURE__ */ u({ prod_: Gs });
210
+ function Vs(t) {
211
+ const s = { x: h(t, "x", "reciprocal") };
212
+ return d.runKernel(bt, s);
213
+ }
214
+ const Zs = /* @__PURE__ */ u({ reciprocal_: Vs });
215
+ function Us(t) {
216
+ const s = { x: h(t, "x", "sign") };
217
+ return d.runKernel(kt, s);
218
+ }
219
+ const Js = /* @__PURE__ */ u({ sign_: Us });
220
+ function Qs(t) {
221
+ D(t.dtype === "complex64", () => `The dtype for tf.spectral.fft() must be complex64 but got ${t.dtype}.`);
222
+ const o = { input: t };
223
+ return d.runKernel(vt, o);
224
+ }
225
+ const ot = /* @__PURE__ */ u({ fft_: Qs });
226
+ function Ys(t) {
227
+ D(t.dtype === "complex64", () => `The dtype for tf.spectral.ifft() must be complex64 but got ${t.dtype}.`);
228
+ const o = { input: t };
229
+ return d.runKernel(Nt, o);
230
+ }
231
+ const P = /* @__PURE__ */ u({ ifft_: Ys });
232
+ function Ls(t) {
233
+ const o = t.shape[t.shape.length - 1], s = t.size / o;
234
+ let n;
235
+ if (o <= 2) {
236
+ const e = l(t, [s, o]);
237
+ n = P(e);
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]]);
240
+ n = P(m);
241
+ }
242
+ if (n = K(n), t.rank === 3 && t.shape[0] !== 0) {
243
+ const e = n, i = t.shape[0];
244
+ n = l(n, [i, n.shape[0] / i, n.shape[1]]), e.dispose();
245
+ }
246
+ return n;
247
+ }
248
+ const tr = /* @__PURE__ */ u({ irfft_: Ls });
249
+ function or(t, o) {
250
+ D(t.dtype === "float32", () => `The dtype for rfft() must be real value but got ${t.dtype}`);
251
+ let s = t.shape[t.shape.length - 1];
252
+ const n = t.size / s;
253
+ let e;
254
+ if (o != null && o < s) {
255
+ const x = t.shape.map((b) => 0), g = t.shape.map((b) => b);
256
+ g[t.shape.length - 1] = o, e = T(t, x, g), s = o;
257
+ } else if (o != null && o > s) {
258
+ const x = t.shape.map((g) => g);
259
+ x[t.shape.length - 1] = o - s, e = _([t, Ro(x)], t.shape.length - 1), s = o;
260
+ } else
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();
263
+ return w[e.shape.length - 1] = f, l(q(m[0], I[0]), w);
264
+ }
265
+ const sr = /* @__PURE__ */ u({ rfft_: or });
266
+ function rr(t, o, s, n, e = 0, i = 0, p = 0, a = 0, f = 0) {
267
+ const c = { x: h(t, "x", "stridedSlice", "string_or_numeric") }, m = {
268
+ begin: o,
269
+ end: s,
270
+ strides: n,
271
+ beginMask: e,
272
+ endMask: i,
273
+ ellipsisMask: p,
274
+ newAxisMask: a,
275
+ shrinkAxisMask: f
276
+ };
277
+ return d.runKernel(Tt, c, m);
278
+ }
279
+ const nr = /* @__PURE__ */ u({ stridedSlice_: rr });
280
+ function er(t) {
281
+ const s = { x: h(t, "x", "tan", "float32") };
282
+ return d.runKernel(Et, s);
283
+ }
284
+ const ir = /* @__PURE__ */ u({ tan_: er });
285
+ function pr(t, o = 1, s = !0) {
286
+ const n = h(t, "x", "topk");
287
+ if (n.rank === 0)
288
+ throw new Error("topk() expects the input to be of rank 1 or higher");
289
+ const e = n.shape[n.shape.length - 1];
290
+ if (o < 0)
291
+ throw new Error(`'k' passed to topk() must be >= 0 but got ${o}`);
292
+ if (o > e)
293
+ throw new Error(`'k' passed to topk() must be <= the last dimension (${e}) but got ${o}`);
294
+ const i = { x: n }, p = { k: o, sorted: s }, [a, f] = d.runKernel(St, i, p);
295
+ return { values: a, indices: f };
296
+ }
297
+ const ar = /* @__PURE__ */ u({ topk_: pr });
298
+ function hr(t, o = 0) {
299
+ const s = h(t, "x", "unique", "string_or_numeric");
300
+ D(s.rank > 0, () => "The input tensor must be at least 1D");
301
+ const n = { x: s }, e = { axis: o }, [i, p] = d.runKernel(qt, n, e);
302
+ return { values: i, indices: p };
303
+ }
304
+ const ur = /* @__PURE__ */ u({ unique_: hr });
305
+ r().prototype.abs = function() {
306
+ return this.throwIfDisposed(), Kt(this);
307
+ };
308
+ r().prototype.acos = function() {
309
+ return this.throwIfDisposed(), Qo(this);
310
+ };
311
+ r().prototype.acosh = function() {
312
+ return this.throwIfDisposed(), Lo(this);
313
+ };
314
+ r().prototype.add = function(t) {
315
+ return this.throwIfDisposed(), zt(this, t);
316
+ };
317
+ r().prototype.all = function(t, o) {
318
+ return this.throwIfDisposed(), Ht(this, t, o);
319
+ };
320
+ r().prototype.any = function(t, o) {
321
+ return this.throwIfDisposed(), Ft(this, t, o);
322
+ };
323
+ r().prototype.argMax = function(t) {
324
+ return this.throwIfDisposed(), Wt(this, t);
325
+ };
326
+ r().prototype.argMin = function(t) {
327
+ return this.throwIfDisposed(), os(this, t);
328
+ };
329
+ r().prototype.asScalar = function() {
330
+ return this.throwIfDisposed(), D(this.size === 1, () => "The array must have only 1 element."), l(this, []);
331
+ };
332
+ r().prototype.asType = function(t) {
333
+ return this.throwIfDisposed(), $(this, t);
334
+ };
335
+ r().prototype.as1D = function() {
336
+ return this.throwIfDisposed(), l(this, [this.size]);
337
+ };
338
+ r().prototype.as2D = function(t, o) {
339
+ return this.throwIfDisposed(), l(this, [t, o]);
340
+ };
341
+ r().prototype.as3D = function(t, o, s) {
342
+ return this.throwIfDisposed(), l(this, [t, o, s]);
343
+ };
344
+ r().prototype.as4D = function(t, o, s, n) {
345
+ return this.throwIfDisposed(), l(this, [t, o, s, n]);
346
+ };
347
+ r().prototype.as5D = function(t, o, s, n, e) {
348
+ return this.throwIfDisposed(), l(this, [t, o, s, n, e]);
349
+ };
350
+ r().prototype.asin = function() {
351
+ return this.throwIfDisposed(), rs(this);
352
+ };
353
+ r().prototype.asinh = function() {
354
+ return this.throwIfDisposed(), es(this);
355
+ };
356
+ r().prototype.atan = function() {
357
+ return this.throwIfDisposed(), ps(this);
358
+ };
359
+ r().prototype.atan2 = function(t) {
360
+ return this.throwIfDisposed(), hs(this, t);
361
+ };
362
+ r().prototype.atanh = function() {
363
+ return this.throwIfDisposed(), cs(this);
364
+ };
365
+ r().prototype.avgPool = function(t, o, s, n) {
366
+ return this.throwIfDisposed(), V(this, t, o, s, n);
367
+ };
368
+ r().prototype.batchToSpaceND = function(t, o) {
369
+ return this.throwIfDisposed(), U(this, t, o);
370
+ };
371
+ r().prototype.batchNorm = function(t, o, s, n, e) {
372
+ return this.throwIfDisposed(), jt(this, t, o, s, n, e);
373
+ };
374
+ r().prototype.broadcastTo = function(t) {
375
+ return this.throwIfDisposed(), uo(this, t);
376
+ };
377
+ r().prototype.cast = function(t) {
378
+ return this.throwIfDisposed(), $(this, t);
379
+ };
380
+ r().prototype.ceil = function() {
381
+ return this.throwIfDisposed(), ls(this);
382
+ };
383
+ r().prototype.clipByValue = function(t, o) {
384
+ return this.throwIfDisposed(), co(this, t, o);
385
+ };
386
+ r().prototype.concat = function(t, o) {
387
+ return this.throwIfDisposed(), t instanceof W && (t = [t]), _([this, ...t], o);
388
+ };
389
+ r().prototype.conv1d = function(t, o, s, n, e, i) {
390
+ return this.throwIfDisposed(), Rt(this, t, o, s, n, e, i);
391
+ };
392
+ r().prototype.conv2dTranspose = function(t, o, s, n, e) {
393
+ return this.throwIfDisposed(), Gt(this, t, o, s, n, e);
394
+ };
395
+ r().prototype.conv2d = function(t, o, s, n, e, i) {
396
+ return this.throwIfDisposed(), Xt(this, t, o, s, n, e, i);
397
+ };
398
+ r().prototype.cos = function() {
399
+ return this.throwIfDisposed(), Vt(this);
400
+ };
401
+ r().prototype.cosh = function() {
402
+ return this.throwIfDisposed(), Zt(this);
403
+ };
404
+ r().prototype.cumprod = function(t, o, s) {
405
+ return this.throwIfDisposed(), Ut(this, t, o, s);
406
+ };
407
+ r().prototype.cumsum = function(t, o, s) {
408
+ return this.throwIfDisposed(), Jt(this, t, o, s);
409
+ };
410
+ r().prototype.depthToSpace = function(t, o) {
411
+ return this.throwIfDisposed(), ms(this, t, o);
412
+ };
413
+ r().prototype.depthwiseConv2d = function(t, o, s, n, e, i) {
414
+ return this.throwIfDisposed(), Qt(this, t, o, s, n, e, i);
415
+ };
416
+ r().prototype.dilation2d = function(t, o, s, n, e) {
417
+ return this.throwIfDisposed(), ys(this, t, o, s, n, e);
418
+ };
419
+ r().prototype.divNoNan = function(t) {
420
+ return this.throwIfDisposed(), ws(this, t);
421
+ };
422
+ r().prototype.div = function(t) {
423
+ return this.throwIfDisposed(), H(this, t);
424
+ };
425
+ r().prototype.dot = function(t) {
426
+ return this.throwIfDisposed(), gs(this, t);
427
+ };
428
+ r().prototype.elu = function() {
429
+ return this.throwIfDisposed(), Eo(this);
430
+ };
431
+ r().prototype.equal = function(t) {
432
+ return this.throwIfDisposed(), j(this, t);
433
+ };
434
+ r().prototype.erf = function() {
435
+ return this.throwIfDisposed(), Yt(this);
436
+ };
437
+ r().prototype.euclideanNorm = function(t, o) {
438
+ return this.throwIfDisposed(), bs(this, t, o);
439
+ };
440
+ r().prototype.exp = function() {
441
+ return this.throwIfDisposed(), Po(this);
442
+ };
443
+ r().prototype.expandDims = function(t) {
444
+ return this.throwIfDisposed(), Ao(this, t);
445
+ };
446
+ r().prototype.expm1 = function() {
447
+ return this.throwIfDisposed(), vs(this);
448
+ };
449
+ r().prototype.fft = function() {
450
+ return this.throwIfDisposed(), ot(this);
451
+ };
452
+ r().prototype.flatten = function() {
453
+ return this.throwIfDisposed(), l(this, [this.size]);
454
+ };
455
+ r().prototype.floor = function() {
456
+ return this.throwIfDisposed(), Bo(this);
457
+ };
458
+ r().prototype.floorDiv = function(t) {
459
+ return this.throwIfDisposed(), Pt(this, t);
460
+ };
461
+ r().prototype.gather = function(t, o, s) {
462
+ return this.throwIfDisposed(), Ho(this, t, o, s);
463
+ };
464
+ r().prototype.greaterEqual = function(t) {
465
+ return this.throwIfDisposed(), fo(this, t);
466
+ };
467
+ r().prototype.greater = function(t) {
468
+ return this.throwIfDisposed(), lo(this, t);
469
+ };
470
+ r().prototype.ifft = function() {
471
+ return this.throwIfDisposed(), P(this);
472
+ };
473
+ r().prototype.irfft = function() {
474
+ return this.throwIfDisposed(), tr(this);
475
+ };
476
+ r().prototype.isFinite = function() {
477
+ return this.throwIfDisposed(), _s(this);
478
+ };
479
+ r().prototype.isInf = function() {
480
+ return this.throwIfDisposed(), Es(this);
481
+ };
482
+ r().prototype.isNaN = function() {
483
+ return this.throwIfDisposed(), qs(this);
484
+ };
485
+ r().prototype.leakyRelu = function(t) {
486
+ return this.throwIfDisposed(), So(this, t);
487
+ };
488
+ r().prototype.lessEqual = function(t) {
489
+ return this.throwIfDisposed(), mo(this, t);
490
+ };
491
+ r().prototype.less = function(t) {
492
+ return this.throwIfDisposed(), Do(this, t);
493
+ };
494
+ r().prototype.localResponseNormalization = function(t, o, s, n) {
495
+ return this.throwIfDisposed(), zs(this, t, o, s, n);
496
+ };
497
+ r().prototype.logSigmoid = function() {
498
+ return this.throwIfDisposed(), Cs(this);
499
+ };
500
+ r().prototype.logSoftmax = function(t) {
501
+ return this.throwIfDisposed(), Lt(this, t);
502
+ };
503
+ r().prototype.logSumExp = function(t, o) {
504
+ return this.throwIfDisposed(), Co(this, t, o);
505
+ };
506
+ r().prototype.log = function() {
507
+ return this.throwIfDisposed(), Mo(this);
508
+ };
509
+ r().prototype.log1p = function() {
510
+ return this.throwIfDisposed(), yo(this);
511
+ };
512
+ r().prototype.logicalAnd = function(t) {
513
+ return this.throwIfDisposed(), S(this, t);
514
+ };
515
+ r().prototype.logicalNot = function() {
516
+ return this.throwIfDisposed(), G(this);
517
+ };
518
+ r().prototype.logicalOr = function(t) {
519
+ return this.throwIfDisposed(), tt(this, t);
520
+ };
521
+ r().prototype.logicalXor = function(t) {
522
+ return this.throwIfDisposed(), As(this, t);
523
+ };
524
+ r().prototype.matMul = function(t, o, s) {
525
+ return this.throwIfDisposed(), v(this, t, o, s);
526
+ };
527
+ r().prototype.maxPool = function(t, o, s, n) {
528
+ return this.throwIfDisposed(), Z(this, t, o, s, n);
529
+ };
530
+ r().prototype.max = function(t, o) {
531
+ return this.throwIfDisposed(), Oo(this, t, o);
532
+ };
533
+ r().prototype.maximum = function(t) {
534
+ return this.throwIfDisposed(), Ct(this, t);
535
+ };
536
+ r().prototype.mean = function(t, o) {
537
+ return this.throwIfDisposed(), Io(this, t, o);
538
+ };
539
+ r().prototype.min = function(t, o) {
540
+ return this.throwIfDisposed(), wo(this, t, o);
541
+ };
542
+ r().prototype.minimum = function(t) {
543
+ return this.throwIfDisposed(), xo(this, t);
544
+ };
545
+ r().prototype.mirrorPad = function(t, o) {
546
+ return this.throwIfDisposed(), Hs(this, t, o);
547
+ };
548
+ r().prototype.mod = function(t) {
549
+ return this.throwIfDisposed(), Wo(this, t);
550
+ };
551
+ r().prototype.mul = function(t) {
552
+ return this.throwIfDisposed(), M(this, t);
553
+ };
554
+ r().prototype.neg = function() {
555
+ return this.throwIfDisposed(), N(this);
556
+ };
557
+ r().prototype.norm = function(t, o, s) {
558
+ return this.throwIfDisposed(), Q(this, t, o, s);
559
+ };
560
+ r().prototype.notEqual = function(t) {
561
+ return this.throwIfDisposed(), go(this, t);
562
+ };
563
+ r().prototype.oneHot = function(t, o = 1, s = 0) {
564
+ return this.throwIfDisposed(), to(this, t, o, s);
565
+ };
566
+ r().prototype.onesLike = function() {
567
+ return this.throwIfDisposed(), oo(this);
568
+ };
569
+ r().prototype.pad = function(t, o) {
570
+ return this.throwIfDisposed(), so(this, t, o);
571
+ };
572
+ r().prototype.pool = function(t, o, s, n, e, i) {
573
+ return this.throwIfDisposed(), Rs(this, t, o, s, n, e, i);
574
+ };
575
+ r().prototype.pow = function(t) {
576
+ return this.throwIfDisposed(), Mt(this, t);
577
+ };
578
+ r().prototype.prelu = function(t) {
579
+ return this.throwIfDisposed(), qo(this, t);
580
+ };
581
+ r().prototype.prod = function(t, o) {
582
+ return this.throwIfDisposed(), Xs(this, t, o);
583
+ };
584
+ r().prototype.reciprocal = function() {
585
+ return this.throwIfDisposed(), Zs(this);
586
+ };
587
+ r().prototype.relu = function() {
588
+ return this.throwIfDisposed(), jo(this);
589
+ };
590
+ r().prototype.relu6 = function() {
591
+ return this.throwIfDisposed(), Ko(this);
592
+ };
593
+ r().prototype.reshapeAs = function(t) {
594
+ return this.throwIfDisposed(), l(this, t.shape);
595
+ };
596
+ r().prototype.reshape = function(t) {
597
+ return this.throwIfDisposed(), l(this, t);
598
+ };
599
+ r().prototype.resizeBilinear = function(t, o, s) {
600
+ return this.throwIfDisposed(), $o(this, t, o, s);
601
+ };
602
+ r().prototype.resizeNearestNeighbor = function(t, o, s) {
603
+ return this.throwIfDisposed(), bo(this, t, o, s);
604
+ };
605
+ r().prototype.reverse = function(t) {
606
+ return this.throwIfDisposed(), E(this, t);
607
+ };
608
+ r().prototype.rfft = function() {
609
+ return this.throwIfDisposed(), sr(this);
610
+ };
611
+ r().prototype.round = function() {
612
+ return this.throwIfDisposed(), ko(this);
613
+ };
614
+ r().prototype.rsqrt = function() {
615
+ return this.throwIfDisposed(), ro(this);
616
+ };
617
+ r().prototype.selu = function() {
618
+ return this.throwIfDisposed(), no(this);
619
+ };
620
+ r().prototype.separableConv2d = function(t, o, s, n, e, i) {
621
+ return this.throwIfDisposed(), eo(this, t, o, s, n, e, i);
622
+ };
623
+ r().prototype.sigmoid = function() {
624
+ return this.throwIfDisposed(), Y(this);
625
+ };
626
+ r().prototype.sign = function() {
627
+ return this.throwIfDisposed(), Js(this);
628
+ };
629
+ r().prototype.sin = function() {
630
+ return this.throwIfDisposed(), io(this);
631
+ };
632
+ r().prototype.sinh = function() {
633
+ return this.throwIfDisposed(), po(this);
634
+ };
635
+ r().prototype.slice = function(t, o) {
636
+ return this.throwIfDisposed(), T(this, t, o);
637
+ };
638
+ r().prototype.softmax = function(t) {
639
+ return this.throwIfDisposed(), Go(this, t);
640
+ };
641
+ r().prototype.softplus = function() {
642
+ return this.throwIfDisposed(), R(this);
643
+ };
644
+ r().prototype.spaceToBatchND = function(t, o) {
645
+ return this.throwIfDisposed(), X(this, t, o);
646
+ };
647
+ r().prototype.split = function(t, o) {
648
+ return this.throwIfDisposed(), z(this, t, o);
649
+ };
650
+ r().prototype.sqrt = function() {
651
+ return this.throwIfDisposed(), Ot(this);
652
+ };
653
+ r().prototype.square = function() {
654
+ return this.throwIfDisposed(), At(this);
655
+ };
656
+ r().prototype.squaredDifference = function(t) {
657
+ return this.throwIfDisposed(), vo(this, t);
658
+ };
659
+ r().prototype.squeeze = function(t) {
660
+ return this.throwIfDisposed(), Xo(this, t);
661
+ };
662
+ r().prototype.stack = function(t, o) {
663
+ this.throwIfDisposed();
664
+ const s = t instanceof W ? [this, t] : [this, ...t];
665
+ return Vo(s, o);
666
+ };
667
+ r().prototype.step = function(t) {
668
+ return this.throwIfDisposed(), zo(this, t);
669
+ };
670
+ r().prototype.stridedSlice = function(t, o, s, n, e, i, p, a) {
671
+ return this.throwIfDisposed(), nr(this, t, o, s, n, e, i, p, a);
672
+ };
673
+ r().prototype.sub = function(t) {
674
+ return this.throwIfDisposed(), Bt(this, t);
675
+ };
676
+ r().prototype.sum = function(t, o) {
677
+ return this.throwIfDisposed(), Zo(this, t, o);
678
+ };
679
+ r().prototype.tan = function() {
680
+ return this.throwIfDisposed(), ir(this);
681
+ };
682
+ r().prototype.tanh = function() {
683
+ return this.throwIfDisposed(), ao(this);
684
+ };
685
+ r().prototype.tile = function(t) {
686
+ return this.throwIfDisposed(), Uo(this, t);
687
+ };
688
+ r().prototype.toBool = function() {
689
+ return this.throwIfDisposed(), $(this, "bool");
690
+ };
691
+ r().prototype.toFloat = function() {
692
+ return this.throwIfDisposed(), $(this, "float32");
693
+ };
694
+ r().prototype.toInt = function() {
695
+ return this.throwIfDisposed(), $(this, "int32");
696
+ };
697
+ r().prototype.topk = function(t, o) {
698
+ return this.throwIfDisposed(), ar(this, t, o);
699
+ };
700
+ r().prototype.transpose = function(t) {
701
+ return this.throwIfDisposed(), Fo(this, t);
702
+ };
703
+ r().prototype.unique = function(t) {
704
+ return this.throwIfDisposed(), ur(this, t);
705
+ };
706
+ r().prototype.unsortedSegmentSum = function(t, o) {
707
+ return this.throwIfDisposed(), ho(this, t, o);
708
+ };
709
+ r().prototype.unstack = function(t) {
710
+ return this.throwIfDisposed(), No(this, t);
711
+ };
712
+ r().prototype.where = function(t, o) {
713
+ return this.throwIfDisposed(), J(t, this, o);
714
+ };
715
+ r().prototype.zerosLike = function() {
716
+ return this.throwIfDisposed(), C(this);
717
+ };
718
+ export {
719
+ Zs as r,
720
+ ar as t
721
+ };