bry-biometric-collector
Version:
BRy web-collector component for biometric capture.
912 lines • 1.65 MB
JavaScript
import { cI as F, cJ as T, bn as Bl, cK as W, cL as Wl, b as _o, c as Lo, h as Ul, l as Gl, m as vi, n as ki, o as Po, q as Mo, r as zo, cM as Nt, u as Vo, v as Bo, E as k, b6 as Ct, cN as D, cO as Ot, w as Si, cP as se, y as Ni, cQ as Sd, cR as Fs, a0 as Ti, F as Ri, S as Hl, cp as Wo, M as Di, aD as Ei, V as Xl, cS as qs, cr as Uo, Z as Go, cT as Kl, $ as Ho, cU as Ms, a5 as Ai, a8 as Fi, a9 as Oi, ac as jl, ad as Xo, ae as Ko, ag as ql, ai as _i, aj as Yl, ak as Zl, al as Li, an as Pi, a as xe, at as Mi, bK as zi, cV as fe, cW as We, cX as Ql, au as jo, a$ as Vi, b8 as Bi, p as Ce, k as nt, cY as wt, cZ as le, c_ as sn, c$ as qo, d0 as ze, d1 as rt, av as Yo, aw as Wi, ax as Zo, d2 as $e, aB as Qo, aI as Ui, aK as Gi, aL as Jo, d3 as Jl, aM as er, aN as tr, aO as nr, aQ as Hi, aR as Xi, d4 as ec, aZ as Ki, aT as sr, aU as or, bf as ji, bQ as rr, d5 as zs, d6 as A, d7 as ir, d8 as pe, d9 as oe, aV as qi, aW as Yi, aX as Zi, b1 as Qi, b2 as Ji, b7 as ea, da as zt, s as X, db as Nd, b9 as ar, ba as ta, bd as lr, bj as na, bk as sa, bl as oa, bo as ra, bR as ia, x as cn, br as aa, cA as Lb, bs as tc, dc as nc, bv as cr, bC as la, bF as ur, bG as hr, bL as dr, bN as pr, bO as fr, bP as mr, bb as ca, dd as sc, de as oc, c7 as ua, cb as gr, df as Zn, bm as ha, cd as rc, co as xr, dg as Td, dh as Rd, di as Dd, cs as ic, cu as ac, dj as da, cw as pa, dk as M, T as Os, dl as De, dm as An, dn as lc, dp as Ed, dq as Ad, a7 as Rt, aE as Jr, dr as Fd, ds as fa, dt as Od, du as cc, dv as uc, _ as ei, af as hc, aA as dc, bD as pc, bg as fc, bi as mc, bh as gc, by as ma, bA as ga, t as _d, ct as xc, dw as Pe, dx as Pb, dy as Mb, dz as zb, dA as Vb, dB as Bb, dC as Wb, dD as Ub, A as bc, dE as ie, J as ue, dF as dt, dG as Io, dH as Ys, dI as gn, I as yc, Y as Cc, dJ as Ld, dK as xa, dL as Vs, dM as Hn, d as ba, W as $c, dN as xt, aC as ya, b0 as Ca, be as $a, dO as Qn, g as Xe, f as Ze, j as ut, dP as on, dQ as Gb, dR as Hb, dS as Xb, dT as Kb, dU as jb, dV as kt, bM as wa, bV as qb, bU as Yb, bT as Zb, b_ as Qb, bZ as Jb, b$ as e0, bY as t0, bX as n0, c0 as ih, c3 as s0, c2 as o0, c1 as r0, c9 as Ia, dW as wc, cm as va, dX as po, a3 as Pd, bt as Md, L as i0, ch as zd, cj as Vd, cl as Bd, cv as Wd, dY as ka, dZ as ct, e as Ic, B as vc, C as kc, d_ as a0, d$ as Sc, ab as Nc, aq as bl, ap as yl, ar as Sa, as as Tc, ah as bs, aP as Rc, e0 as l0, a_ as Dc, b3 as Ec, b4 as Ac, bp as Na, bq as Fc, bu as Ta, bx as Ra, bw as Da, R as Oc, bz as _c, bB as Lc, e1 as Pc, e2 as Mc, G as Ud, ca as zc, cc as Ea, cn as Vc, e3 as ys, cx as Bc, e4 as c0, e5 as B, e6 as Wc, e7 as u0, e8 as Gd, e9 as Hd, ea as Zs, eb as h0, cE as Jt, ec as d0, ed as K, ee as br, ef as yr, eg as Cl, cz as G, eh as Rn, ei as ah, ej as p0, ek as f0, el as m0, em as lh, en as g0, cB as Xd, cC as Kd, cD as hn, eo as Cr, ep as jd, eq as qd, er as x0, es as $r, cH as Yd, D as Zd, i as pt, z as Jn, N as Aa, O as Fa, P as Oa, Q as Qd, U as Jd, et as Bs, X as ep, a1 as tp, a2 as Dn, a6 as Cs, aa as Qs, am as np, ao as _a, eu as _s, ev as sp, ew as b0, ex as op, ey as rp, ez as ip, eA as ap, eB as lp, eC as cp, eD as up, eE as hp, eF as dp, eG as pp, eH as fp, eI as mp, eJ as y0, eK as C0, eL as $0, eM as w0, eN as I0, eO as v0, ay as gp, az as xp, aF as bp, aG as yp, aH as Cp, aJ as $p, aS as wp, b5 as Ip, bc as vp, eP as kp, eQ as Sp, eR as Np, bE as Tp, bH as Rp, bI as Js, bJ as Dp, bS as Ep, bW as Ap, c4 as Fp, c5 as Op, c6 as _p, c8 as Lp, ce as Pp, cf as Mp, cg as zp, ci as Vp, ck as Bp, cq as Wp, eS as Uc, cy as Up, eT as k0, eU as $l, eV as ch, eW as Gc, eX as Gp, eY as S0, eZ as uh, e_ as hh, e$ as N0, cF as T0, f0 as R0, f1 as Hc, f2 as Xc, f3 as D0, H as E0, K as A0, f4 as F0, f5 as O0, f6 as _0 } from "./Unique_impl_cbb0d216_3.3.6.js";
import { fc as VW, fb as BW, aY as WW, fe as UW, f9 as GW, f8 as HW, fi as XW, fh as KW, fj as jW, fd as qW, fg as YW, ff as ZW, f7 as QW, fa as JW } from "./Unique_impl_cbb0d216_3.3.6.js";
import { bz as $s } from "./main_8f1a8854_3.3.6.js";
import "./face_api_d3d25326_3.3.6.js";
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function L0(n, e) {
const t = T(n, "real", "complex"), s = T(e, "imag", "complex");
Bl(t.shape, s.shape, `real and imag shapes, ${t.shape} and ${s.shape}, must match in call to tf.complex().`);
const o = { real: t, imag: s };
return W.runKernel(Wl, o);
}
const Ws = /* @__PURE__ */ F({ complex_: L0 });
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function P0(n) {
const t = { x: T(n, "x", "acos") };
return W.runKernel(_o, t);
}
const M0 = /* @__PURE__ */ F({ acos_: P0 });
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function z0(n) {
const t = { x: T(n, "x", "acosh") };
return W.runKernel(Lo, t);
}
const V0 = /* @__PURE__ */ F({ acosh_: z0 });
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function B0(n, e = null, t = !1) {
const o = { x: T(n, "x", "all", "bool") }, r = { axis: e, keepDims: t };
return W.runKernel(Ul, o, r);
}
const Hp = /* @__PURE__ */ F({ all_: B0 });
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function W0(n, e = null, t = !1) {
const o = { x: T(n, "x", "any", "bool") }, r = { axis: e, keepDims: t };
return W.runKernel(Gl, o, r);
}
const wl = /* @__PURE__ */ F({ any_: W0 });
/**
* @license
* Copyright 2020 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function U0(n, e = 0) {
const s = { x: T(n, "x", "argMax") }, o = { axis: e };
return W.runKernel(vi, s, o);
}
const vo = /* @__PURE__ */ F({ argMax_: U0 });
/**
* @license
* Copyright 2020 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function G0(n, e = 0) {
const s = { x: T(n, "x", "argMin") }, o = { axis: e };
return W.runKernel(ki, s, o);
}
const H0 = /* @__PURE__ */ F({ argMin_: G0 });
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function X0(n) {
const t = { x: T(n, "x", "asin") };
return W.runKernel(Po, t);
}
const K0 = /* @__PURE__ */ F({ asin_: X0 });
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function j0(n) {
const t = { x: T(n, "x", "asinh") };
return W.runKernel(Mo, t);
}
const q0 = /* @__PURE__ */ F({ asinh_: j0 });
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Y0(n) {
const t = { x: T(n, "x", "atan") };
return W.runKernel(zo, t);
}
const Z0 = /* @__PURE__ */ F({ atan_: Y0 });
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Q0(n, e) {
let t = T(n, "a", "atan2"), s = T(e, "b", "atan2");
[t, s] = Nt(t, s);
const o = { a: t, b: s };
return W.runKernel(Vo, o);
}
const J0 = /* @__PURE__ */ F({ atan2_: Q0 });
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function e1(n) {
const t = { x: T(n, "x", "atanh") };
return W.runKernel(Bo, t);
}
const t1 = /* @__PURE__ */ F({ atanh_: e1 });
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function n1(n, e, t, s, o) {
const r = T(n, "x", "avgPool", "float32"), i = 1;
k(Ct(t, i), () => `Error in avgPool: Either strides or dilations must be 1. Got strides ${t} and dilations '${i}'`);
let a = r, l = !1;
r.rank === 3 && (l = !0, a = D(r, [1, r.shape[0], r.shape[1], r.shape[2]])), k(a.rank === 4, () => `Error in avgPool: x must be rank 4 but got rank ${a.rank}.`), Ot("avgPool", s, o);
const c = { x: a }, u = { filterSize: e, strides: t, pad: s, dimRoundingMode: o };
let h = W.runKernel(Si, c, u);
return h = se(h, r.dtype), l ? D(h, [h.shape[1], h.shape[2], h.shape[3]]) : h;
}
const Kc = /* @__PURE__ */ F({ avgPool_: n1 });
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function s1(n, e, t, s, o, r = "NDHWC") {
const i = T(n, "x", "avgPool3d", "float32");
let a = i, l = !1;
i.rank === 4 && (l = !0, a = D(i, [1, i.shape[0], i.shape[1], i.shape[2], i.shape[3]])), k(a.rank === 5, () => `Error in avgPool3d: x must be rank 5 but got rank ${a.rank}.`), k(r === "NDHWC", () => `Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${r}`), k(typeof t == "number" && t > 0 || Array.isArray(t) && t[0] > 0 && t[1] > 0 && t[2] > 0, () => `Error in avgPool3d: Stride must be > 0, but got '${t}'`), Ot("avgPool3d", s, o);
const c = { x: a }, u = { filterSize: e, strides: t, pad: s, dimRoundingMode: o, dataFormat: r };
let h = W.runKernel(Ni, c, u);
return h = se(h, a.dtype), l ? D(h, [h.shape[1], h.shape[2], h.shape[3], h.shape[4]]) : h;
}
const o1 = /* @__PURE__ */ F({ avgPool3d_: s1 });
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function r1(n, e = 0) {
k(n.length >= 1, () => "Pass at least one tensor to concat");
const t = Sd(n, "tensors", "concat", "string_or_numeric");
if (t[0].dtype === "complex64" && t.forEach((r) => {
if (r.dtype !== "complex64")
throw new Error(`Cannot concatenate complex64 tensors with a tensor
with dtype ${r.dtype}. `);
}), t.length === 1)
return Fs(t[0]);
const s = t, o = { axis: e };
return W.runKernel(Ti, s, o);
}
const St = /* @__PURE__ */ F({ concat_: r1 });
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function i1(n, e, t = !1, s = !1) {
let o = T(n, "a", "matMul"), r = T(e, "b", "matMul");
[o, r] = Nt(o, r);
const i = { a: o, b: r }, a = { transposeA: t, transposeB: s };
return W.runKernel(Ri, i, a);
}
const ke = /* @__PURE__ */ F({ matMul_: i1 });
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function a1(n, e, t) {
const s = T(n, "x", "slice", "string_or_numeric");
if (s.rank === 0)
throw new Error("Slicing scalar is not possible");
const o = { x: s }, r = { begin: e, size: t };
return W.runKernel(Hl, o, r);
}
const _e = /* @__PURE__ */ F({ slice_: a1 });
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function l1(n) {
const t = { x: T(n, "x", "tanh", "float32") };
return W.runKernel(Wo, t);
}
const La = /* @__PURE__ */ F({ tanh_: l1 });
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function c1(n, e, t) {
const s = T(n, "x", "batchToSpaceND"), o = e.reduce((a, l) => a * l);
k(s.rank >= 1 + e.length, () => `input rank is ${s.rank} but should be > than blockShape.length ${e.length}`), k(t.length === e.length, () => `crops.length is ${t.length} but should be equal to blockShape.length ${e.length}`), k(s.shape[0] % o === 0, () => `input tensor batch is ${s.shape[0]} but is not divisible by the product of the elements of blockShape ${e.join(" * ")} === ${o}`);
const r = { x: s }, i = { blockShape: e, crops: t };
return W.runKernel(Di, r, i);
}
const jc = /* @__PURE__ */ F({ batchToSpaceND_: c1 });
function u1(n) {
let e;
return n.rank === 0 || n.rank === 1 ? e = D(n, [1, 1, 1, n.size]) : n.rank === 2 ? e = D(n, [1, 1, n.shape[0], n.shape[1]]) : n.rank === 3 ? e = D(n, [1, n.shape[0], n.shape[1], n.shape[2]]) : e = n, e;
}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function h1(n, e, t, s, o, r) {
r == null && (r = 1e-3);
const i = T(n, "x", "batchNorm"), a = T(e, "mean", "batchNorm"), l = T(t, "variance", "batchNorm");
let c;
o != null && (c = T(o, "scale", "batchNorm"));
let u;
s != null && (u = T(s, "offset", "batchNorm")), k(a.rank === l.rank, () => "Batch normalization gradient requires mean and variance to have equal ranks."), k(u == null || a.rank === u.rank, () => "Batch normalization gradient requires mean and offset to have equal ranks."), k(c == null || a.rank === c.rank, () => "Batch normalization gradient requires mean and scale to have equal ranks.");
const d = {
x: u1(i),
scale: c,
offset: u,
mean: a,
variance: l
}, p = { varianceEpsilon: r }, f = W.runKernel(Ei, d, p);
return D(f, i.shape);
}
const Pa = /* @__PURE__ */ F({ batchNorm_: h1 });
function d1(n, e, t, s, o, r) {
const i = T(n, "x", "batchNorm"), a = T(e, "mean", "batchNorm"), l = T(t, "variance", "batchNorm");
let c;
o != null && (c = T(o, "scale", "batchNorm"));
let u;
return s != null && (u = T(s, "offset", "batchNorm")), k(i.rank === 2, () => `Error in batchNorm2D: x must be rank 2 but got rank ${i.rank}.`), k(a.rank === 2 || a.rank === 1, () => `Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${a.rank}.`), k(l.rank === 2 || l.rank === 1, () => `Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${l.rank}.`), c != null && k(c.rank === 2 || c.rank === 1, () => `Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${c.rank}.`), u != null && k(u.rank === 2 || u.rank === 1, () => `Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${u.rank}.`), Pa(i, a, l, u, c, r);
}
const p1 = /* @__PURE__ */ F({ batchNorm2d_: d1 });
function f1(n, e, t, s, o, r) {
const i = T(n, "x", "batchNorm"), a = T(e, "mean", "batchNorm"), l = T(t, "variance", "batchNorm");
let c;
o != null && (c = T(o, "scale", "batchNorm"));
let u;
return s != null && (u = T(s, "offset", "batchNorm")), k(i.rank === 3, () => `Error in batchNorm3D: x must be rank 3 but got rank ${i.rank}.`), k(a.rank === 3 || a.rank === 1, () => `Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${a.rank}.`), k(l.rank === 3 || l.rank === 1, () => `Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${l.rank}.`), c != null && k(c.rank === 3 || c.rank === 1, () => `Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${c.rank}.`), u != null && k(u.rank === 3 || u.rank === 1, () => `Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${u.rank}.`), Pa(i, a, l, u, c, r);
}
const m1 = /* @__PURE__ */ F({ batchNorm3d_: f1 });
function g1(n, e, t, s, o, r) {
const i = T(n, "x", "batchNorm"), a = T(e, "mean", "batchNorm"), l = T(t, "variance", "batchNorm");
let c;
o != null && (c = T(o, "scale", "batchNorm"));
let u;
return s != null && (u = T(s, "offset", "batchNorm")), k(i.rank === 4, () => `Error in batchNorm4D: x must be rank 4 but got rank ${i.rank}.`), k(a.rank === 4 || a.rank === 1, () => `Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${a.rank}.`), k(l.rank === 4 || l.rank === 1, () => `Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${l.rank}.`), c != null && k(c.rank === 4 || c.rank === 1, () => `Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${c.rank}.`), u != null && k(u.rank === 4 || u.rank === 1, () => `Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${u.rank}.`), Pa(i, a, l, u, c, r);
}
const x1 = /* @__PURE__ */ F({ batchNorm4d_: g1 });
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function b1(n, e, t) {
const s = T(n, "x", "bincount"), o = T(e, "weights", "bincount");
k(s.dtype === "int32", () => `Error in bincount: input dtype must be int32, but got ${s.dtype}`), k(t >= 0, () => `size must be non-negative, but got ${t}.`), k(o.size === s.size || o.size === 0, () => `Error in bincount: weights must have the same size as input or0-length, but got input shape: ${s.shape}, weights shape: ${o.shape}.`);
const r = { x: s, weights: o }, i = { size: t };
return W.runKernel(Xl, r, i);
}
const y1 = /* @__PURE__ */ F({ bincount_: b1 });
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function C1(n, e) {
let t = T(n, "broadcastTo", "x");
const s = t.shape;
if (qs(e), e.length < t.rank)
throw new Error(`broadcastTo(): shape.length=${e.length} < input.rank=${t.rank}.`);
if (e.length > t.rank) {
const c = t.shape.slice();
for (; c.length < e.length; )
c.unshift(1);
t = D(t, c);
}
const o = t.shape, r = Array.from(e);
for (let c = e.length - 1; c >= 0; c--)
if (o[c] === e[c])
r[c] = 1;
else if (t.shape[c] !== 1)
throw new Error(`broadcastTo(): [${s}] cannot be broadcast to [${e}].`);
if (r.map((c, u) => c > 1 ? u : -1).filter((c) => c >= 0).length === 0)
return Fs(t);
const a = { x: t }, l = { reps: r };
return W.runKernel(Uo, a, l);
}
const $o = /* @__PURE__ */ F({ broadcastTo_: C1 });
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function $1(n) {
const t = { x: T(n, "x", "ceil", "float32") };
return W.runKernel(Go, t);
}
const w1 = /* @__PURE__ */ F({ ceil_: $1 });
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function I1(n, e, t) {
const s = T(n, "x", "clipByValue");
if (k(e <= t, () => `Error in clip: min (${e}) must be less than or equal to max (${t}).`), e === t)
return Kl(s.shape, e, s.dtype);
const o = { x: s }, r = { clipValueMin: e, clipValueMax: t };
return W.runKernel(Ho, o, r);
}
const Mt = /* @__PURE__ */ F({ clipByValue_: I1 });
function v1(n) {
return St(
n,
0
/* axis */
);
}
const k1 = /* @__PURE__ */ F({ concat1d_: v1 });
function S1(n, e) {
return St(n, e);
}
const N1 = /* @__PURE__ */ F({ concat2d_: S1 });
function T1(n, e) {
return St(n, e);
}
const R1 = /* @__PURE__ */ F({ concat3d_: T1 });
function D1(n, e) {
return St(n, e);
}
const E1 = /* @__PURE__ */ F({ concat4d_: D1 });
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function A1(n, e, t, s, o = "NHWC", r = [1, 1], i) {
const a = T(n, "x", "conv2d", "float32"), l = T(e, "filter", "conv2d", "float32");
let c = a, u = !1;
a.rank === 3 && (u = !0, c = D(a, [1, a.shape[0], a.shape[1], a.shape[2]])), k(c.rank === 4, () => `Error in conv2d: input must be rank 4, but got rank ${c.rank}.`), k(l.rank === 4, () => `Error in conv2d: filter must be rank 4, but got rank ${l.rank}.`), Ot("conv2d", s, i);
const h = o === "NHWC" ? c.shape[3] : c.shape[1];
k(h === l.shape[2], () => `Error in conv2d: depth of input (${h}) must match input depth for filter ${l.shape[2]}.`), k(Ct(t, r), () => `Error in conv2D: Either strides or dilations must be 1. Got strides ${t} and dilations '${r}'`), k(Ms(r), () => "Error in conv2D: Dilated rates should be larger than 0."), k(Ms(t), () => "Error in conv2D: Strides should be larger than 0.");
const d = { x: c, filter: l }, p = { strides: t, pad: s, dataFormat: o, dilations: r, dimRoundingMode: i }, f = W.runKernel(Ai, d, p);
return u ? D(f, [f.shape[1], f.shape[2], f.shape[3]]) : f;
}
const ds = /* @__PURE__ */ F({ conv2d_: A1 });
function F1(n, e, t, s, o = "NWC", r = 1, i) {
const a = T(n, "x", "conv1d"), l = T(e, "filter", "conv1d");
let c = a, u = !1;
a.rank === 2 && (u = !0, c = D(a, [1, a.shape[0], a.shape[1]])), k(c.rank === 3, () => `Error in conv1d: input must be rank 3, but got rank ${c.rank}.`), k(l.rank === 3, () => `Error in conv1d: filter must be rank 3, but got rank ${l.rank}.`), Ot("conv1d", s, i), k(c.shape[2] === l.shape[1], () => `Error in conv1d: depth of input (${c.shape[2]}) must match input depth for filter ${l.shape[1]}.`), k(Ct(t, r), () => `Error in conv1D: Either stride or dilation must be 1. Got stride ${t} and dilation '${r}'`), k(Ms(r), () => "Error in conv1D: Dilated rates should be larger than 0."), k(Ms(t), () => "Error in conv1D: Stride should be larger than 0."), k(o === "NWC", () => `Error in conv1d: got dataFormat of ${o} but only NWC is currently supported.`);
const h = D(l, [1, l.shape[0], l.shape[1], l.shape[2]]), d = D(c, [c.shape[0], 1, c.shape[1], c.shape[2]]), m = ds(d, h, [1, t], s, "NHWC", [1, r], i);
return u ? D(m, [m.shape[2], m.shape[3]]) : D(m, [m.shape[0], m.shape[2], m.shape[3]]);
}
const Xp = /* @__PURE__ */ F({ conv1d_: F1 });
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function O1(n, e, t, s, o, r = "NHWC", i) {
k(n.length === e.rank, () => `Length of inShape (${n.length}) and rank of dy (${e.rank}) must match`);
let a = n, l = e, c = !1;
e.rank === 3 && (c = !0, l = D(e, [1, e.shape[0], e.shape[1], e.shape[2]]), a = [1, n[0], n[1], n[2]]), k(a.length === 4, () => `Error in conv2dDerInput: inShape must be length 4, but got length ${a.length}.`), k(l.rank === 4, () => `Error in conv2dDerInput: dy must be rank 4, but got rank ${l.rank}`), k(t.rank === 4, () => `Error in conv2dDerInput: filter must be rank 4, but got rank ${t.rank}`);
const u = r === "NHWC" ? a[3] : a[1], h = r === "NHWC" ? l.shape[3] : l.shape[1];
k(u === t.shape[2], () => `Error in conv2dDerInput: depth of input (${u}) must match input depth for filter ${t.shape[2]}.`), k(h === t.shape[3], () => `Error in conv2dDerInput: depth of output (${h}) must match output depth for filter ${t.shape[3]}.`), Ot("conv2dDerInput", o, i);
const d = { dy: l, filter: t }, p = { strides: s, pad: o, dataFormat: r, dimRoundingMode: i, inputShape: a }, f = W.runKernel(Fi, d, p);
return c ? D(f, [f.shape[1], f.shape[2], f.shape[3]]) : f;
}
const qc = /* @__PURE__ */ F({ conv2DBackpropInput_: O1 });
function _1(n, e, t, s, o, r) {
const i = T(n, "x", "conv2dTranspose"), a = T(e, "filter", "conv2dTranspose");
return qc(t, i, a, s, o, "NHWC", r);
}
const Kp = /* @__PURE__ */ F({ conv2dTranspose_: _1 });
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function L1(n, e, t, s, o = "NDHWC", r = [1, 1, 1]) {
const i = T(n, "x", "conv3d"), a = T(e, "filter", "conv3d");
let l = i, c = !1;
i.rank === 4 && (c = !0, l = D(i, [1, i.shape[0], i.shape[1], i.shape[2], i.shape[3]])), k(l.rank === 5, () => `Error in conv3d: input must be rank 5, but got rank ${l.rank}.`), k(a.rank === 5, () => `Error in conv3d: filter must be rank 5, but got rank ${a.rank}.`), k(l.shape[4] === a.shape[3], () => `Error in conv3d: depth of input (${l.shape[4]}) must match input depth for filter ${a.shape[3]}.`), k(Ct(t, r), () => `Error in conv3D: Either strides or dilations must be 1. Got strides ${t} and dilations '${r}'`), k(o === "NDHWC", () => `Error in conv3d: got dataFormat of ${o} but only NDHWC is currently supported.`), k(Ms(r), () => "Error in conv3D: Dilated rates should be larger than 0."), k(Ms(t), () => "Error in conv3D: Strides should be larger than 0.");
const u = { x: l, filter: a }, h = { strides: t, pad: s, dataFormat: o, dilations: r }, d = W.runKernel(Oi, u, h);
return c ? D(d, [d.shape[1], d.shape[2], d.shape[3], d.shape[4]]) : d;
}
const P1 = /* @__PURE__ */ F({ conv3d_: L1 });
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function M1(n, e, t, s, o) {
k(n.length === e.rank, () => `Length of inShape (${n.length}) and rank of dy (${e.rank}) must match`);
let r = n, i = e, a = !1;
e.rank === 4 && (a = !0, i = D(e, [1, e.shape[0], e.shape[1], e.shape[2], e.shape[3]]), r = [1, n[0], n[1], n[2], n[3]]);
const l = r[4], c = i.shape[4];
k(r.length === 5, () => `Error in conv3dDerInput: inShape must be length 5, but got length ${r.length}.`), k(i.rank === 5, () => `Error in conv3dDerInput: dy must be rank 5, but got rank ${i.rank}`), k(t.rank === 5, () => `Error in conv3dDerInput: filter must be rank 5, but got rank ${t.rank}`), k(l === t.shape[3], () => `Error in conv3dDerInput: depth of input (${l}) must match input depth for filter ${t.shape[3]}.`), k(c === t.shape[4], () => `Error in conv3dDerInput: depth of output (${c}) must match output depth for filter ${t.shape[4]}.`);
const u = { dy: i, filter: t }, h = { pad: o, strides: s, inputShape: r }, d = W.runKernel(jl, u, h);
return a ? D(d, [d.shape[1], d.shape[2], d.shape[3], d.shape[4]]) : d;
}
const jp = /* @__PURE__ */ F({ conv3DBackpropInput_: M1 });
function z1(n, e, t, s, o) {
const r = T(n, "x", "conv3dTranspose"), i = T(e, "filter", "conv3dTranspose");
return jp(t, r, i, s, o);
}
const V1 = /* @__PURE__ */ F({ conv3dTranspose_: z1 });
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function B1(n) {
const t = { x: T(n, "x", "cos", "float32") };
return W.runKernel(Xo, t);
}
const Yc = /* @__PURE__ */ F({ cos_: B1 });
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function W1(n) {
const t = { x: T(n, "x", "cosh", "float32") };
return W.runKernel(Ko, t);
}
const qp = /* @__PURE__ */ F({ cosh_: W1 });
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function U1(n, e = 0, t = !1, s = !1) {
const r = { x: T(n, "x", "cumprod") }, i = { axis: e, exclusive: t, reverse: s };
return W.runKernel(ql, r, i);
}
const Il = /* @__PURE__ */ F({ cumprod_: U1 });
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function G1(n, e = 0, t = !1, s = !1) {
const r = { x: T(n, "x", "cumsum") }, i = { axis: e, exclusive: t, reverse: s };
return W.runKernel(_i, r, i);
}
const Yp = /* @__PURE__ */ F({ cumsum_: G1 });
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function H1(n, e, t, s = !1) {
const o = T(n, "x", "denseBincount"), r = T(e, "weights", "denseBincount");
k(o.dtype === "int32", () => `Error in denseBincount: input dtype must be int32, but got ${o.dtype}`), k(o.rank <= 2, () => `Error in denseBincount: input must be at most rank 2, but got rank ${o.rank}.`), k(t >= 0, () => `size must be non-negative, but got ${t}.`), k(r.size === o.size || r.size === 0, () => `Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${o.shape}, weights shape: ${r.shape}.`);
const i = { x: o, weights: r }, a = { size: t, binaryOutput: s };
return W.runKernel(Yl, i, a);
}
const dh = /* @__PURE__ */ F({ denseBincount_: H1 });
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function X1(n, e, t = "NHWC") {
const s = T(n, "x", "depthToSpace", "float32"), o = t === "NHWC" ? s.shape[1] : s.shape[2], r = t === "NHWC" ? s.shape[2] : s.shape[3], i = t === "NHWC" ? s.shape[3] : s.shape[1];
k(e > 1, () => `blockSize should be > 1 for depthToSpace, but was: ${e}`), k(o * e >= 0, () => `Negative dimension size caused by overflow when multiplying
${o} and ${e} for depthToSpace with input shape
${s.shape}`), k(r * e >= 0, () => `Negative dimension size caused by overflow when multiplying
${r} and ${e} for depthToSpace with input shape
${s.shape}`), k(i % (e * e) === 0, () => `Dimension size must be evenly divisible by ${e * e} but is ${i} for depthToSpace with input shape ${s.shape}`);
const a = { x: s }, l = { blockSize: e, dataFormat: t };
return W.runKernel(Zl, a, l);
}
const K1 = /* @__PURE__ */ F({ depthToSpace_: X1 });
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function j1(n, e, t, s, o = "NHWC", r = [1, 1], i) {
const a = T(n, "x", "depthwiseConv2d", "float32"), l = T(e, "filter", "depthwiseConv2d", "float32");
let c = a, u = !1;
a.rank === 3 && (u = !0, c = D(a, [1, a.shape[0], a.shape[1], a.shape[2]])), k(c.rank === 4, () => `Error in depthwiseConv2d: input must be rank 4, but got rank ${c.rank}.`), k(l.rank === 4, () => `Error in depthwiseConv2d: filter must be rank 4, but got rank ${l.rank}.`);
const h = o === "NHWC" ? c.shape[3] : c.shape[1];
k(h === l.shape[2], () => `Error in depthwiseConv2d: number of input channels (${h}) must match the inChannels dimension in filter ${l.shape[2]}.`), Ot("depthwiseConv2d", s, i);
const d = { x: c, filter: l }, p = { strides: t, pad: s, dataFormat: o, dilations: r, dimRoundingMode: i }, f = W.runKernel(Li, d, p);
return u ? D(f, [f.shape[1], f.shape[2], f.shape[3]]) : f;
}
const Zc = /* @__PURE__ */ F({ depthwiseConv2d_: j1 });
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the speci