@genai-fi/nanogpt 0.10.2 → 0.10.3
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.
- package/dist/Generator.js +11761 -171
- package/dist/{RealDiv-zz7FpkKX.js → RealDiv-KAPDe8zB.js} +23 -25
- package/dist/Reshape-BYkmUnAv.js +14 -0
- package/dist/{Reshape-CHdUjC72.js → Reshape-Zt6eb7yh.js} +18 -20
- package/dist/TeachableLLM.js +10 -11
- package/dist/{axis_util-BsIr9ZNu.js → axis_util-BaG7mf5A.js} +3 -3
- package/dist/backend.js +2 -2
- package/dist/{backend_util-B1XRLuq9.js → backend_util-RCe-rHaj.js} +72 -73
- package/dist/{backend_webgpu-CqpfEImu.js → backend_webgpu-DE3ACOLx.js} +45 -47
- package/dist/broadcast_to-B3eYlZm7.js +28 -0
- package/dist/checks/appendCache.js +2 -2
- package/dist/checks/attentionMask.js +3 -3
- package/dist/checks/gelu.js +2 -2
- package/dist/checks/matMulGelu.js +7 -11
- package/dist/checks/normRMS.js +9 -9
- package/dist/checks/normRMSGrad.js +3 -3
- package/dist/checks/packUnpack.js +2 -2
- package/dist/checks/qkv.js +12 -13
- package/dist/checks/rope.js +2 -2
- package/dist/clip_by_value-BnO7-a88.js +12 -0
- package/dist/complex-DjxcVmoX.js +11 -0
- package/dist/concat-BV8bt5H-.js +17 -0
- package/dist/{concat_util-iBYIyuQe.js → concat_util-DpW8mL_l.js} +1 -1
- package/dist/{dataset-D2P7rHAw.js → dataset-BcwmTGYc.js} +137 -139
- package/dist/dropout-BcvN9JYi.js +92 -0
- package/dist/expand_dims-DT4tEPwA.js +11 -0
- package/dist/{exports_initializers-CZSUJoVE.js → exports_initializers-Hta_rEnm.js} +1 -1
- package/dist/floor-D5QdR_le.js +9 -0
- package/dist/gather-D3JcZUaI.js +9 -0
- package/dist/{gelu-Bmhopi0J.js → gelu-CjNPL4OH.js} +10 -11
- package/dist/{gpgpu_math-DsCcikas.js → gpgpu_math-DAOmgtXR.js} +841 -1015
- package/dist/{index-DRyE072i.js → index-BwexR4lA.js} +262 -263
- package/dist/index-DOvlwCh-.js +3520 -0
- package/dist/{kernel_funcs_utils-CWfOAPGO.js → kernel_funcs_utils-CCzYdUZg.js} +130 -132
- package/dist/layers/BaseLayer.js +15 -16
- package/dist/layers/CausalSelfAttention.js +6 -6
- package/dist/layers/MLP.js +4 -4
- package/dist/layers/PositionEmbedding.js +7 -7
- package/dist/layers/RMSNorm.js +3 -3
- package/dist/layers/RoPECache.js +9 -9
- package/dist/layers/TiedEmbedding.js +6 -6
- package/dist/layers/TransformerBlock.js +1 -1
- package/dist/loader/loadTransformers.js +1 -1
- package/dist/loader/oldZipLoad.js +13 -14
- package/dist/log_sum_exp-ngO0-4pK.js +39 -0
- package/dist/main.js +49 -50
- package/dist/{matMul16-fEAJ4smh.js → matMul16-BWRSOCWB.js} +14 -15
- package/dist/matMulGelu-CzfgT6Wq.js +163 -0
- package/dist/mat_mul-SjpJRLyL.js +11 -0
- package/dist/mod-AnXEvvpo.js +11 -0
- package/dist/models/NanoGPTV1.js +2 -2
- package/dist/models/model.js +13 -14
- package/dist/ones-D2rT0xk2.js +14 -0
- package/dist/ops/adamAdjust.js +1 -1
- package/dist/ops/adamMoments.js +1 -1
- package/dist/ops/add16.js +1 -1
- package/dist/ops/appendCache.js +3 -3
- package/dist/ops/attentionMask.js +1 -1
- package/dist/ops/concat16.js +2 -2
- package/dist/ops/cpu/adamAdjust.js +13 -14
- package/dist/ops/cpu/adamMoments.js +6 -7
- package/dist/ops/cpu/appendCache.js +7 -8
- package/dist/ops/cpu/attentionMask.js +7 -7
- package/dist/ops/cpu/fusedSoftmax.js +10 -11
- package/dist/ops/cpu/gatherSub.js +9 -10
- package/dist/ops/cpu/gelu.js +9 -10
- package/dist/ops/cpu/matMul16.js +6 -7
- package/dist/ops/cpu/matMulGelu.js +5 -6
- package/dist/ops/cpu/matMulMul.js +3 -4
- package/dist/ops/cpu/mulDropout.js +3 -4
- package/dist/ops/cpu/normRMS.js +10 -11
- package/dist/ops/cpu/qkv.js +8 -9
- package/dist/ops/cpu/rope.js +5 -6
- package/dist/ops/cpu/scatterSub.js +17 -19
- package/dist/ops/dot16.js +2 -2
- package/dist/ops/gatherSub.js +1 -1
- package/dist/ops/gelu.js +2 -2
- package/dist/ops/grads/add16.js +11 -12
- package/dist/ops/grads/attentionMask.js +5 -6
- package/dist/ops/grads/gelu.js +3 -4
- package/dist/ops/grads/matMul16.js +4 -5
- package/dist/ops/grads/matMulGelu.js +9 -10
- package/dist/ops/grads/normRMS.js +7 -8
- package/dist/ops/grads/pack16.js +4 -5
- package/dist/ops/grads/qkv.js +17 -19
- package/dist/ops/grads/rope.js +3 -5
- package/dist/ops/grads/softmax16.js +3 -4
- package/dist/ops/grads/unpack16.js +3 -4
- package/dist/ops/grads/utils.d.ts +1 -0
- package/dist/ops/grads/utils.js +8 -4
- package/dist/ops/matMul16.js +3 -3
- package/dist/ops/matMulGelu.js +2 -2
- package/dist/ops/matMulMul.js +1 -1
- package/dist/ops/mul16.js +1 -1
- package/dist/ops/mulDrop.js +1 -1
- package/dist/ops/normRMS.js +1 -1
- package/dist/ops/pack16.js +3 -4
- package/dist/ops/qkv.js +4 -8
- package/dist/ops/reshape16.js +14 -16
- package/dist/ops/rope.d.ts +1 -1
- package/dist/ops/rope.js +3 -8
- package/dist/ops/scatterSub.js +1 -1
- package/dist/ops/slice16.js +2 -2
- package/dist/ops/softmax16.js +5 -8
- package/dist/ops/sub16.js +1 -1
- package/dist/ops/sum16.js +2 -2
- package/dist/ops/transpose16.js +23 -24
- package/dist/ops/unpack16.js +2 -2
- package/dist/ops/webgl/adamAdjust.js +2 -3
- package/dist/ops/webgl/adamMoments.js +1 -2
- package/dist/ops/webgl/appendCache.js +1 -2
- package/dist/ops/webgl/attentionMask.js +4 -5
- package/dist/ops/webgl/fusedSoftmax.js +4 -6
- package/dist/ops/webgl/gatherSub.js +6 -7
- package/dist/ops/webgl/gelu.js +2 -3
- package/dist/ops/webgl/log.js +11 -12
- package/dist/ops/webgl/matMul16.js +10 -11
- package/dist/ops/webgl/matMulGelu.js +7 -111
- package/dist/ops/webgl/matMulMul.js +9 -10
- package/dist/ops/webgl/mulDropout.js +8 -9
- package/dist/ops/webgl/normRMS.js +2 -3
- package/dist/ops/webgl/qkv.js +5 -6
- package/dist/ops/webgl/rope.js +7 -8
- package/dist/ops/webgl/scatterSub.js +5 -6
- package/dist/ops/webgpu/adamAdjust.js +10 -12
- package/dist/ops/webgpu/adamMoments.js +8 -10
- package/dist/ops/webgpu/add16.js +8 -9
- package/dist/ops/webgpu/appendCache.js +23 -25
- package/dist/ops/webgpu/attentionMask.js +8 -10
- package/dist/ops/webgpu/attentionMask32_program.js +2 -2
- package/dist/ops/webgpu/concat16.js +12 -14
- package/dist/ops/webgpu/gatherSub.js +11 -13
- package/dist/ops/webgpu/gelu.js +28 -29
- package/dist/ops/webgpu/matMul16.js +26 -28
- package/dist/ops/webgpu/matMul16_program.js +4 -5
- package/dist/ops/webgpu/mul16.js +9 -10
- package/dist/ops/webgpu/normRMS.js +15 -17
- package/dist/ops/webgpu/normRMSGrad.js +21 -28
- package/dist/ops/webgpu/pack16.js +12 -13
- package/dist/ops/webgpu/pack16_program.js +2 -2
- package/dist/ops/webgpu/qkv.js +16 -18
- package/dist/ops/webgpu/rope.js +25 -27
- package/dist/ops/webgpu/scatterSub.js +7 -9
- package/dist/ops/webgpu/slice16.js +21 -23
- package/dist/ops/webgpu/softmax16.js +17 -19
- package/dist/ops/webgpu/softmax16_program.js +2 -2
- package/dist/ops/webgpu/softmax16_subgroup_program.js +2 -2
- package/dist/ops/webgpu/softmax16grad.js +7 -8
- package/dist/ops/webgpu/sub16.js +7 -8
- package/dist/ops/webgpu/sum16.js +18 -20
- package/dist/ops/webgpu/transpose16.js +19 -20
- package/dist/ops/webgpu/transpose16_program.js +2 -2
- package/dist/ops/webgpu/transpose16_shared_program.js +11 -12
- package/dist/ops/webgpu/unpack16.js +3 -4
- package/dist/ops/webgpu/utils/binary_op.js +7 -8
- package/dist/ops/webgpu/utils/reductions.js +14 -22
- package/dist/ops-B5yanEdW.js +476 -0
- package/dist/pack16-nQ6JaLo-.js +39 -0
- package/dist/patches/webgpu_backend.js +19 -20
- package/dist/patches/webgpu_base.js +1 -1
- package/dist/patches/webgpu_program.js +21 -22
- package/dist/{random_width-BVV9HveY.js → random_width-or-CEftb.js} +2506 -2761
- package/dist/range-BklejeeW.js +10 -0
- package/dist/relu-CP0ZcxWO.js +9 -0
- package/dist/reshape-ByE68wS9.js +9 -0
- package/dist/resize_nearest_neighbor-B19mCEg2.js +175 -0
- package/dist/rope-Ir4mTyD1.js +24 -0
- package/dist/{scatter_nd_util-C7zXRT_h.js → scatter_nd_util-lvSiX8q4.js} +1 -1
- package/dist/selu_util-kbhpTdYD.js +44 -0
- package/dist/{shared-CHhxz-O5.js → shared-DT1TkE6w.js} +1 -1
- package/dist/{shared-D2NP_CpY.js → shared-dntlHIDQ.js} +343 -345
- package/dist/slice-BfEGSH82.js +12 -0
- package/dist/{slice_util-DyjSAD0u.js → slice_util-uTKwiEpW.js} +1 -1
- package/dist/{softmax-C9JQEtnO.js → softmax-CA5jFsLR.js} +4 -5
- package/dist/split-CVLc0w--.js +9 -0
- package/dist/squeeze-C7Z2srUo.js +10 -0
- package/dist/stack-Cf4n9h0N.js +11 -0
- package/dist/step-CINUs5QB.js +261 -0
- package/dist/sum-DWAtNGez.js +11 -0
- package/dist/tensor-DJoc7gJU.js +8 -0
- package/dist/tensor1d-D11P_7Dp.js +11 -0
- package/dist/{tensor2d-CSB4KOb0.js → tensor2d-Bs9wZRc7.js} +6 -7
- package/dist/{tensor4d-D7bLqGqz.js → tensor4d-BARPdTaS.js} +6 -7
- package/dist/{tfjs_backend-CNkSTL0c.js → tfjs_backend-y1cvNhLA.js} +255 -264
- package/dist/tile-mbfagpsB.js +11 -0
- package/dist/training/Adam.js +2 -2
- package/dist/training/AdamExt.js +1 -1
- package/dist/training/DatasetBuilder.js +2 -2
- package/dist/training/FullTrainer.js +1 -1
- package/dist/training/Trainer.js +2 -2
- package/dist/training/sparseCrossEntropy.js +5 -5
- package/dist/transpose-ClWiBS_b.js +36 -0
- package/dist/unsorted_segment_sum-BDDhB_E6.js +277 -0
- package/dist/utilities/dummy.js +3 -3
- package/dist/utilities/multinomialCPU.js +2 -2
- package/dist/utilities/packed.d.ts +1 -4
- package/dist/utilities/packed.js +10 -745
- package/dist/utilities/performance.js +1 -1
- package/dist/utilities/profile.js +1 -1
- package/dist/utilities/safetensors.js +2 -2
- package/dist/utilities/sentences.js +5 -5
- package/dist/utilities/weights.js +2 -2
- package/dist/{variable-DzfrwYuP.js → variable-WawDEaAb.js} +1 -1
- package/dist/{webgpu_program-DzaQiqel.js → webgpu_program-DuOXPQol.js} +178 -172
- package/dist/{webgpu_util-0_ubCEHJ.js → webgpu_util-RxEF33Rj.js} +34 -35
- package/dist/zeros-KnWaWf-X.js +13 -0
- package/dist/zeros_like-DvE73F4e.js +721 -0
- package/package.json +4 -2
- package/dist/Reshape-CDVLyVfz.js +0 -16
- package/dist/broadcast_to-B0ChcDaz.js +0 -30
- package/dist/complex-BBiRlsVq.js +0 -13
- package/dist/concat-DmBLPVGC.js +0 -19
- package/dist/dropout-B1x1kYMa.js +0 -99
- package/dist/expand_dims-ouvfxQ1n.js +0 -13
- package/dist/gather-CH9sdacz.js +0 -10
- package/dist/index-D6Q1lPZO.js +0 -2157
- package/dist/log_sum_exp-D3ftBNY5.js +0 -41
- package/dist/mat_mul-C59XWcJd.js +0 -12
- package/dist/mod-DESSvHIU.js +0 -12
- package/dist/mulmat_packed_gpu-Coh6qbJk.js +0 -55
- package/dist/ones-jU9jlQvM.js +0 -15
- package/dist/ops-BFDtP6th.js +0 -645
- package/dist/pack16-CmVZs6af.js +0 -41
- package/dist/patches/PackedTensor.d.ts +0 -12
- package/dist/patches/PackedTensor.js +0 -11
- package/dist/patches/engine.d.ts +0 -261
- package/dist/patches/engine.js +0 -12
- package/dist/patches/tape.d.ts +0 -12
- package/dist/patches/tape.js +0 -5
- package/dist/range-ZZZD60Fx.js +0 -11
- package/dist/reciprocal-CrYlsAGD.js +0 -10
- package/dist/register_all_kernels-nvj2k7OC.js +0 -12307
- package/dist/relu-BYDneVPn.js +0 -10
- package/dist/reshape-CaPQzFvz.js +0 -10
- package/dist/rope-s4W2XO9B.js +0 -32
- package/dist/selu_util-BGPXmd4B.js +0 -303
- package/dist/sin-Djs4aQiu.js +0 -16
- package/dist/slice-DvovR5wq.js +0 -13
- package/dist/split-DBck65sX.js +0 -10
- package/dist/squeeze-C00Ipm_7.js +0 -11
- package/dist/stack-ChnHwRpX.js +0 -13
- package/dist/sum-ywRJj3Zr.js +0 -12
- package/dist/tensor-0r5yOo2R.js +0 -8
- package/dist/tensor-CzmOBsdf.js +0 -909
- package/dist/tensor1d-BlUT89BP.js +0 -12
- package/dist/tensor_util-DfwaWayG.js +0 -523
- package/dist/tile-CR074jmp.js +0 -13
- package/dist/transpose-DH4gmHvu.js +0 -38
- package/dist/zeros-DBFVbpv5.js +0 -14
|
@@ -0,0 +1,721 @@
|
|
|
1
|
+
import { A as u, B as h, E as d, c9 as st, ca as rt, cb as nt, cc as et, cd as it, ce as pt, L as B, cf as at, cg as ht, b_ as ut, l as D, ch as ct, ci as ft, w as H, a7 as C, b$ as lt, cj as dt, ck as mt, cl as Dt, aG as yt, cm as It, a6 as wt, m as A, a3 as F, cn as xt, co as gt, X 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 zt, x as Kt, a8 as W, cy as Pt, cz as Ct, z as At, y as Mt, b0 as Ot, c as Bt } from "./index-DOvlwCh-.js";
|
|
2
|
+
import { e as j, a as R, l as X, b as G, 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 Xt, o as Gt, c as Vt, p as Zt, q as Ut, t as Jt, u as Lt, v as Qt, w as Yt, 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-BDDhB_E6.js";
|
|
3
|
+
import { r as l } from "./reshape-ByE68wS9.js";
|
|
4
|
+
import { b as uo } from "./broadcast_to-B3eYlZm7.js";
|
|
5
|
+
import { c as co } from "./clip_by_value-BnO7-a88.js";
|
|
6
|
+
import { c as _ } from "./concat-BV8bt5H-.js";
|
|
7
|
+
import { w as J, n as L, 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-B19mCEg2.js";
|
|
8
|
+
import { m as v } from "./mat_mul-SjpJRLyL.js";
|
|
9
|
+
import { s as Q, k as _o, h as To, e as Eo, l as So, p as qo, r as zo, a as Ko } from "./step-CINUs5QB.js";
|
|
10
|
+
import { e as Po, l as Co, a as Ao, m as Mo } from "./log_sum_exp-ngO0-4pK.js";
|
|
11
|
+
import { e as Oo } from "./expand_dims-DT4tEPwA.js";
|
|
12
|
+
import { f as Bo } from "./floor-D5QdR_le.js";
|
|
13
|
+
import { g as Ho } from "./gather-D3JcZUaI.js";
|
|
14
|
+
import { c as q } from "./complex-DjxcVmoX.js";
|
|
15
|
+
import { n as N, r as z, i as Y, t as Fo } from "./transpose-ClWiBS_b.js";
|
|
16
|
+
import { s as T } from "./slice-BfEGSH82.js";
|
|
17
|
+
import { m as Wo } from "./mod-AnXEvvpo.js";
|
|
18
|
+
import { r as jo } from "./relu-CP0ZcxWO.js";
|
|
19
|
+
import { s as K } from "./split-CVLc0w--.js";
|
|
20
|
+
import { z as Ro } from "./zeros-KnWaWf-X.js";
|
|
21
|
+
import { s as Xo } from "./softmax-CA5jFsLR.js";
|
|
22
|
+
import { s as Go } from "./squeeze-C7Z2srUo.js";
|
|
23
|
+
import { s as Vo } from "./stack-Cf4n9h0N.js";
|
|
24
|
+
import { s as Zo } from "./sum-DWAtNGez.js";
|
|
25
|
+
import { t as Uo } from "./tile-mbfagpsB.js";
|
|
26
|
+
function Jo(t) {
|
|
27
|
+
const s = { x: h(t, "x", "acos") };
|
|
28
|
+
return d.runKernel(st, s);
|
|
29
|
+
}
|
|
30
|
+
const Lo = /* @__PURE__ */ u({ acos_: Jo });
|
|
31
|
+
function Qo(t) {
|
|
32
|
+
const s = { x: h(t, "x", "acosh") };
|
|
33
|
+
return d.runKernel(rt, s);
|
|
34
|
+
}
|
|
35
|
+
const Yo = /* @__PURE__ */ u({ acosh_: Qo });
|
|
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 L(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 zs(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 Ks = /* @__PURE__ */ u({ localResponseNormalization_: zs });
|
|
153
|
+
function Ps(t) {
|
|
154
|
+
const o = h(t, "x", "logSigmoid");
|
|
155
|
+
return wt((n) => ({ value: N(R(N(n))), gradFunc: (p) => A(p, Q(N(n))) }))(o);
|
|
156
|
+
}
|
|
157
|
+
const Cs = /* @__PURE__ */ u({ logSigmoid_: Ps });
|
|
158
|
+
function As(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_: As });
|
|
165
|
+
function Ms(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), X(S(t, o)));
|
|
168
|
+
}
|
|
169
|
+
const Os = /* @__PURE__ */ u({ logicalXor_: Ms });
|
|
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", M = w ? f : G(f, m, x), O = (s === "avg" ? () => V(M, o, i, b, p) : () => Z(M, o, i, b, p))(), k = w ? O : U(O, 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 Xs(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 Gs = /* @__PURE__ */ u({ prod_: Xs });
|
|
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 Ls(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_: Ls });
|
|
226
|
+
function Qs(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_: Qs });
|
|
232
|
+
function Ys(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(z(t), [s, o]), p = l(Y(t), [s, o]), a = E(T(i, [0, 1], [s, o - 2]), 1), f = A(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 = z(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_: Ys });
|
|
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 = z(a), c = Y(a), m = K(y, [f, s - f], y.shape.length - 1), I = K(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(), zt(this);
|
|
307
|
+
};
|
|
308
|
+
r().prototype.acos = function() {
|
|
309
|
+
return this.throwIfDisposed(), Lo(this);
|
|
310
|
+
};
|
|
311
|
+
r().prototype.acosh = function() {
|
|
312
|
+
return this.throwIfDisposed(), Yo(this);
|
|
313
|
+
};
|
|
314
|
+
r().prototype.add = function(t) {
|
|
315
|
+
return this.throwIfDisposed(), Kt(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(), Xt(this, t, o, s, n, e);
|
|
394
|
+
};
|
|
395
|
+
r().prototype.conv2d = function(t, o, s, n, e, i) {
|
|
396
|
+
return this.throwIfDisposed(), Gt(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(), Lt(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(), Qt(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(), Oo(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(), Ks(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(), Yt(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(), Ao(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(), X(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(), Os(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(), Mo(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(), A(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(), L(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(), At(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(), Gs(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(), zo(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(), Q(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(), Xo(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(), G(this, t, o);
|
|
646
|
+
};
|
|
647
|
+
r().prototype.split = function(t, o) {
|
|
648
|
+
return this.throwIfDisposed(), K(this, t, o);
|
|
649
|
+
};
|
|
650
|
+
r().prototype.sqrt = function() {
|
|
651
|
+
return this.throwIfDisposed(), Mt(this);
|
|
652
|
+
};
|
|
653
|
+
r().prototype.square = function() {
|
|
654
|
+
return this.throwIfDisposed(), Ot(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(), Go(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(), Ko(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
|
+
};
|