import { v as Lt, bP as Ce, N as V, _ as Pt, a9 as H, af as et, ad as ht, bQ as dt, bR as at, a7 as De, L as st, aU as Ue, aq as We, bS as $e, bT as ze, bU as Be, bV as At, a5 as K, bW as qt, bX as U, bY as _t, bA as Vt, aN as Ct, bZ as Dt, F as Ut, b_ as Wt, a$ as $t, b0 as zt, b1 as Bt, b2 as jt, aO as Gt, b$ as Zt, b5 as Kt, c0 as Ht, ap as je, aV as Ge, aQ as Xt, ar as Ze, c1 as Ke, ah as Qt, am as He, t as Xe, bK as Yt, c2 as It, aF as Jt, S as Qe, c3 as te, b7 as ee, c4 as ne, az as pt, c5 as se, c6 as ot } from "./index-DSGwv2Yx.js";
import { f as it, g as Ye, a as Je, R as tn, v as en, d as nn, e as sn, h as on, i as rn, j as an, k as ln, l as cn, m as un, n as hn, o as fn, p as kt, q as dn, r as gn, s as mn } from "./backend_util-qwSFfxYx.js";
import { m as Nt } from "./complex_util-Yc1A_gV1.js";
import { a as pn, b as wn, e as In, c as bn } from "./axis_util-QWWgLjut.js";
import { b as xn } from "./broadcast_to-C_EJTVTZ.js";
import { r as En } from "./reshape-BIN71H3p.js";
import { p as Fn, a as yn, i as kn, c as Nn } from "./slice_util-DPY56GzQ.js";
import { g as vn } from "./_commonjsHelpers-ByX85dGu.js";
function Sn(e, t) {
  for (var n = 0; n < t.length; n++) {
    const s = t[n];
    if (typeof s != "string" && !Array.isArray(s)) {
      for (const o in s)
        if (o !== "default" && !(o in e)) {
          const a = Object.getOwnPropertyDescriptor(s, o);
          a && Object.defineProperty(e, o, a.get ? a : {
            enumerable: !0,
            get: () => s[o]
          });
        }
    }
  }
  return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }));
}
var wt, vt;
function Tn() {
  if (vt) return wt;
  vt = 1, wt = t;
  var e = null;
  try {
    e = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([
      0,
      97,
      115,
      109,
      1,
      0,
      0,
      0,
      1,
      13,
      2,
      96,
      0,
      1,
      127,
      96,
      4,
      127,
      127,
      127,
      127,
      1,
      127,
      3,
      7,
      6,
      0,
      1,
      1,
      1,
      1,
      1,
      6,
      6,
      1,
      127,
      1,
      65,
      0,
      11,
      7,
      50,
      6,
      3,
      109,
      117,
      108,
      0,
      1,
      5,
      100,
      105,
      118,
      95,
      115,
      0,
      2,
      5,
      100,
      105,
      118,
      95,
      117,
      0,
      3,
      5,
      114,
      101,
      109,
      95,
      115,
      0,
      4,
      5,
      114,
      101,
      109,
      95,
      117,
      0,
      5,
      8,
      103,
      101,
      116,
      95,
      104,
      105,
      103,
      104,
      0,
      0,
      10,
      191,
      1,
      6,
      4,
      0,
      35,
      0,
      11,
      36,
      1,
      1,
      126,
      32,
      0,
      173,
      32,
      1,
      173,
      66,
      32,
      134,
      132,
      32,
      2,
      173,
      32,
      3,
      173,
      66,
      32,
      134,
      132,
      126,
      34,
      4,
      66,
      32,
      135,
      167,
      36,
      0,
      32,
      4,
      167,
      11,
      36,
      1,
      1,
      126,
      32,
      0,
      173,
      32,
      1,
      173,
      66,
      32,
      134,
      132,
      32,
      2,
      173,
      32,
      3,
      173,
      66,
      32,
      134,
      132,
      127,
      34,
      4,
      66,
      32,
      135,
      167,
      36,
      0,
      32,
      4,
      167,
      11,
      36,
      1,
      1,
      126,
      32,
      0,
      173,
      32,
      1,
      173,
      66,
      32,
      134,
      132,
      32,
      2,
      173,
      32,
      3,
      173,
      66,
      32,
      134,
      132,
      128,
      34,
      4,
      66,
      32,
      135,
      167,
      36,
      0,
      32,
      4,
      167,
      11,
      36,
      1,
      1,
      126,
      32,
      0,
      173,
      32,
      1,
      173,
      66,
      32,
      134,
      132,
      32,
      2,
      173,
      32,
      3,
      173,
      66,
      32,
      134,
      132,
      129,
      34,
      4,
      66,
      32,
      135,
      167,
      36,
      0,
      32,
      4,
      167,
      11,
      36,
      1,
      1,
      126,
      32,
      0,
      173,
      32,
      1,
      173,
      66,
      32,
      134,
      132,
      32,
      2,
      173,
      32,
      3,
      173,
      66,
      32,
      134,
      132,
      130,
      34,
      4,
      66,
      32,
      135,
      167,
      36,
      0,
      32,
      4,
      167,
      11
    ])), {}).exports;
  } catch {
  }
  function t(I, c, E) {
    this.low = I | 0, this.high = c | 0, this.unsigned = !!E;
  }
  t.prototype.__isLong__, Object.defineProperty(t.prototype, "__isLong__", { value: !0 });
  function n(I) {
    return (I && I.__isLong__) === !0;
  }
  t.isLong = n;
  var s = {}, o = {};
  function a(I, c) {
    var E, N, L;
    return c ? (I >>>= 0, (L = 0 <= I && I < 256) && (N = o[I], N) ? N : (E = i(I, (I | 0) < 0 ? -1 : 0, !0), L && (o[I] = E), E)) : (I |= 0, (L = -128 <= I && I < 128) && (N = s[I], N) ? N : (E = i(I, I < 0 ? -1 : 0, !1), L && (s[I] = E), E));
  }
  t.fromInt = a;
  function r(I, c) {
    if (isNaN(I))
      return c ? b : g;
    if (c) {
      if (I < 0)
        return b;
      if (I >= m)
        return O;
    } else {
      if (I <= -F)
        return S;
      if (I + 1 >= F)
        return M;
    }
    return I < 0 ? r(-I, c).neg() : i(I % w | 0, I / w | 0, c);
  }
  t.fromNumber = r;
  function i(I, c, E) {
    return new t(I, c, E);
  }
  t.fromBits = i;
  var l = Math.pow;
  function u(I, c, E) {
    if (I.length === 0)
      throw Error("empty string");
    if (I === "NaN" || I === "Infinity" || I === "+Infinity" || I === "-Infinity")
      return g;
    if (typeof c == "number" ? (E = c, c = !1) : c = !!c, E = E || 10, E < 2 || 36 < E)
      throw RangeError("radix");
    var N;
    if ((N = I.indexOf("-")) > 0)
      throw Error("interior hyphen");
    if (N === 0)
      return u(I.substring(1), c, E).neg();
    for (var L = r(l(E, 8)), R = g, A = 0; A < I.length; A += 8) {
      var $ = Math.min(8, I.length - A), j = parseInt(I.substring(A, A + $), E);
      if ($ < 8) {
        var C = r(l(E, $));
        R = R.mul(C).add(r(j));
      } else
        R = R.mul(L), R = R.add(r(j));
    }
    return R.unsigned = c, R;
  }
  t.fromString = u;
  function h(I, c) {
    return typeof I == "number" ? r(I, c) : typeof I == "string" ? u(I, c) : i(I.low, I.high, typeof c == "boolean" ? c : I.unsigned);
  }
  t.fromValue = h;
  var f = 65536, p = 1 << 24, w = f * f, m = w * w, F = m / 2, d = a(p), g = a(0);
  t.ZERO = g;
  var b = a(0, !0);
  t.UZERO = b;
  var k = a(1);
  t.ONE = k;
  var y = a(1, !0);
  t.UONE = y;
  var v = a(-1);
  t.NEG_ONE = v;
  var M = i(-1, 2147483647, !1);
  t.MAX_VALUE = M;
  var O = i(-1, -1, !0);
  t.MAX_UNSIGNED_VALUE = O;
  var S = i(0, -2147483648, !1);
  t.MIN_VALUE = S;
  var x = t.prototype;
  return x.toInt = function() {
    return this.unsigned ? this.low >>> 0 : this.low;
  }, x.toNumber = function() {
    return this.unsigned ? (this.high >>> 0) * w + (this.low >>> 0) : this.high * w + (this.low >>> 0);
  }, x.toString = function(c) {
    if (c = c || 10, c < 2 || 36 < c)
      throw RangeError("radix");
    if (this.isZero())
      return "0";
    if (this.isNegative())
      if (this.eq(S)) {
        var E = r(c), N = this.div(E), L = N.mul(E).sub(this);
        return N.toString(c) + L.toInt().toString(c);
      } else
        return "-" + this.neg().toString(c);
    for (var R = r(l(c, 6), this.unsigned), A = this, $ = ""; ; ) {
      var j = A.div(R), C = A.sub(j.mul(R)).toInt() >>> 0, P = C.toString(c);
      if (A = j, A.isZero())
        return P + $;
      for (; P.length < 6; )
        P = "0" + P;
      $ = "" + P + $;
    }
  }, x.getHighBits = function() {
    return this.high;
  }, x.getHighBitsUnsigned = function() {
    return this.high >>> 0;
  }, x.getLowBits = function() {
    return this.low;
  }, x.getLowBitsUnsigned = function() {
    return this.low >>> 0;
  }, x.getNumBitsAbs = function() {
    if (this.isNegative())
      return this.eq(S) ? 64 : this.neg().getNumBitsAbs();
    for (var c = this.high != 0 ? this.high : this.low, E = 31; E > 0 && (c & 1 << E) == 0; E--)
      ;
    return this.high != 0 ? E + 33 : E + 1;
  }, x.isZero = function() {
    return this.high === 0 && this.low === 0;
  }, x.eqz = x.isZero, x.isNegative = function() {
    return !this.unsigned && this.high < 0;
  }, x.isPositive = function() {
    return this.unsigned || this.high >= 0;
  }, x.isOdd = function() {
    return (this.low & 1) === 1;
  }, x.isEven = function() {
    return (this.low & 1) === 0;
  }, x.equals = function(c) {
    return n(c) || (c = h(c)), this.unsigned !== c.unsigned && this.high >>> 31 === 1 && c.high >>> 31 === 1 ? !1 : this.high === c.high && this.low === c.low;
  }, x.eq = x.equals, x.notEquals = function(c) {
    return !this.eq(
      /* validates */
      c
    );
  }, x.neq = x.notEquals, x.ne = x.notEquals, x.lessThan = function(c) {
    return this.comp(
      /* validates */
      c
    ) < 0;
  }, x.lt = x.lessThan, x.lessThanOrEqual = function(c) {
    return this.comp(
      /* validates */
      c
    ) <= 0;
  }, x.lte = x.lessThanOrEqual, x.le = x.lessThanOrEqual, x.greaterThan = function(c) {
    return this.comp(
      /* validates */
      c
    ) > 0;
  }, x.gt = x.greaterThan, x.greaterThanOrEqual = function(c) {
    return this.comp(
      /* validates */
      c
    ) >= 0;
  }, x.gte = x.greaterThanOrEqual, x.ge = x.greaterThanOrEqual, x.compare = function(c) {
    if (n(c) || (c = h(c)), this.eq(c))
      return 0;
    var E = this.isNegative(), N = c.isNegative();
    return E && !N ? -1 : !E && N ? 1 : this.unsigned ? c.high >>> 0 > this.high >>> 0 || c.high === this.high && c.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(c).isNegative() ? -1 : 1;
  }, x.comp = x.compare, x.negate = function() {
    return !this.unsigned && this.eq(S) ? S : this.not().add(k);
  }, x.neg = x.negate, x.add = function(c) {
    n(c) || (c = h(c));
    var E = this.high >>> 16, N = this.high & 65535, L = this.low >>> 16, R = this.low & 65535, A = c.high >>> 16, $ = c.high & 65535, j = c.low >>> 16, C = c.low & 65535, P = 0, G = 0, _ = 0, B = 0;
    return B += R + C, _ += B >>> 16, B &= 65535, _ += L + j, G += _ >>> 16, _ &= 65535, G += N + $, P += G >>> 16, G &= 65535, P += E + A, P &= 65535, i(_ << 16 | B, P << 16 | G, this.unsigned);
  }, x.subtract = function(c) {
    return n(c) || (c = h(c)), this.add(c.neg());
  }, x.sub = x.subtract, x.multiply = function(c) {
    if (this.isZero())
      return g;
    if (n(c) || (c = h(c)), e) {
      var E = e.mul(
        this.low,
        this.high,
        c.low,
        c.high
      );
      return i(E, e.get_high(), this.unsigned);
    }
    if (c.isZero())
      return g;
    if (this.eq(S))
      return c.isOdd() ? S : g;
    if (c.eq(S))
      return this.isOdd() ? S : g;
    if (this.isNegative())
      return c.isNegative() ? this.neg().mul(c.neg()) : this.neg().mul(c).neg();
    if (c.isNegative())
      return this.mul(c.neg()).neg();
    if (this.lt(d) && c.lt(d))
      return r(this.toNumber() * c.toNumber(), this.unsigned);
    var N = this.high >>> 16, L = this.high & 65535, R = this.low >>> 16, A = this.low & 65535, $ = c.high >>> 16, j = c.high & 65535, C = c.low >>> 16, P = c.low & 65535, G = 0, _ = 0, B = 0, ct = 0;
    return ct += A * P, B += ct >>> 16, ct &= 65535, B += R * P, _ += B >>> 16, B &= 65535, B += A * C, _ += B >>> 16, B &= 65535, _ += L * P, G += _ >>> 16, _ &= 65535, _ += R * C, G += _ >>> 16, _ &= 65535, _ += A * j, G += _ >>> 16, _ &= 65535, G += N * P + L * C + R * j + A * $, G &= 65535, i(B << 16 | ct, G << 16 | _, this.unsigned);
  }, x.mul = x.multiply, x.divide = function(c) {
    if (n(c) || (c = h(c)), c.isZero())
      throw Error("division by zero");
    if (e) {
      if (!this.unsigned && this.high === -2147483648 && c.low === -1 && c.high === -1)
        return this;
      var E = (this.unsigned ? e.div_u : e.div_s)(
        this.low,
        this.high,
        c.low,
        c.high
      );
      return i(E, e.get_high(), this.unsigned);
    }
    if (this.isZero())
      return this.unsigned ? b : g;
    var N, L, R;
    if (this.unsigned) {
      if (c.unsigned || (c = c.toUnsigned()), c.gt(this))
        return b;
      if (c.gt(this.shru(1)))
        return y;
      R = b;
    } else {
      if (this.eq(S)) {
        if (c.eq(k) || c.eq(v))
          return S;
        if (c.eq(S))
          return k;
        var A = this.shr(1);
        return N = A.div(c).shl(1), N.eq(g) ? c.isNegative() ? k : v : (L = this.sub(c.mul(N)), R = N.add(L.div(c)), R);
      } else if (c.eq(S))
        return this.unsigned ? b : g;
      if (this.isNegative())
        return c.isNegative() ? this.neg().div(c.neg()) : this.neg().div(c).neg();
      if (c.isNegative())
        return this.div(c.neg()).neg();
      R = g;
    }
    for (L = this; L.gte(c); ) {
      N = Math.max(1, Math.floor(L.toNumber() / c.toNumber()));
      for (var $ = Math.ceil(Math.log(N) / Math.LN2), j = $ <= 48 ? 1 : l(2, $ - 48), C = r(N), P = C.mul(c); P.isNegative() || P.gt(L); )
        N -= j, C = r(N, this.unsigned), P = C.mul(c);
      C.isZero() && (C = k), R = R.add(C), L = L.sub(P);
    }
    return R;
  }, x.div = x.divide, x.modulo = function(c) {
    if (n(c) || (c = h(c)), e) {
      var E = (this.unsigned ? e.rem_u : e.rem_s)(
        this.low,
        this.high,
        c.low,
        c.high
      );
      return i(E, e.get_high(), this.unsigned);
    }
    return this.sub(this.div(c).mul(c));
  }, x.mod = x.modulo, x.rem = x.modulo, x.not = function() {
    return i(~this.low, ~this.high, this.unsigned);
  }, x.and = function(c) {
    return n(c) || (c = h(c)), i(this.low & c.low, this.high & c.high, this.unsigned);
  }, x.or = function(c) {
    return n(c) || (c = h(c)), i(this.low | c.low, this.high | c.high, this.unsigned);
  }, x.xor = function(c) {
    return n(c) || (c = h(c)), i(this.low ^ c.low, this.high ^ c.high, this.unsigned);
  }, x.shiftLeft = function(c) {
    return n(c) && (c = c.toInt()), (c &= 63) === 0 ? this : c < 32 ? i(this.low << c, this.high << c | this.low >>> 32 - c, this.unsigned) : i(0, this.low << c - 32, this.unsigned);
  }, x.shl = x.shiftLeft, x.shiftRight = function(c) {
    return n(c) && (c = c.toInt()), (c &= 63) === 0 ? this : c < 32 ? i(this.low >>> c | this.high << 32 - c, this.high >> c, this.unsigned) : i(this.high >> c - 32, this.high >= 0 ? 0 : -1, this.unsigned);
  }, x.shr = x.shiftRight, x.shiftRightUnsigned = function(c) {
    if (n(c) && (c = c.toInt()), c &= 63, c === 0)
      return this;
    var E = this.high;
    if (c < 32) {
      var N = this.low;
      return i(N >>> c | E << 32 - c, E >>> c, this.unsigned);
    } else return c === 32 ? i(E, 0, this.unsigned) : i(E >>> c - 32, 0, this.unsigned);
  }, x.shru = x.shiftRightUnsigned, x.shr_u = x.shiftRightUnsigned, x.toSigned = function() {
    return this.unsigned ? i(this.low, this.high, !1) : this;
  }, x.toUnsigned = function() {
    return this.unsigned ? this : i(this.low, this.high, !0);
  }, x.toBytes = function(c) {
    return c ? this.toBytesLE() : this.toBytesBE();
  }, x.toBytesLE = function() {
    var c = this.high, E = this.low;
    return [
      E & 255,
      E >>> 8 & 255,
      E >>> 16 & 255,
      E >>> 24,
      c & 255,
      c >>> 8 & 255,
      c >>> 16 & 255,
      c >>> 24
    ];
  }, x.toBytesBE = function() {
    var c = this.high, E = this.low;
    return [
      c >>> 24,
      c >>> 16 & 255,
      c >>> 8 & 255,
      c & 255,
      E >>> 24,
      E >>> 16 & 255,
      E >>> 8 & 255,
      E & 255
    ];
  }, t.fromBytes = function(c, E, N) {
    return N ? t.fromBytesLE(c, E) : t.fromBytesBE(c, E);
  }, t.fromBytesLE = function(c, E) {
    return new t(
      c[0] | c[1] << 8 | c[2] << 16 | c[3] << 24,
      c[4] | c[5] << 8 | c[6] << 16 | c[7] << 24,
      E
    );
  }, t.fromBytesBE = function(c, E) {
    return new t(
      c[4] << 24 | c[5] << 16 | c[6] << 8 | c[7],
      c[0] << 24 | c[1] << 16 | c[2] << 8 | c[3],
      E
    );
  }, wt;
}
var oe = Tn();
const re = /* @__PURE__ */ vn(oe), Rn = /* @__PURE__ */ Sn({
  __proto__: null,
  default: re
}, [oe]);
const tt = (
  // tslint:disable-next-line
  re || Rn
);
function gt(e) {
  return tt.fromString(e, !0, 16);
}
const ae = gt("c3a5c85c97cb3127"), J = gt("b492b66fbe98f273"), D = gt("9ae16a3b2f90404f");
function bt(e) {
  return e.xor(e.shru(47));
}
function ie(e, t, n) {
  const s = e.slice(t, t + n);
  return tt.fromBytes(Array.from(s), !0, !0);
}
function T(e, t) {
  return ie(e, t, 8);
}
function St(e, t) {
  return ie(e, t, 4);
}
function q(e, t) {
  return t === 0 ? e : e.shru(t).or(e.shl(64 - t));
}
function Q(e, t, n = gt("9ddfea08eb382d69")) {
  let s = e.xor(t).mul(n);
  s = s.xor(s.shru(47));
  let o = t.xor(s).mul(n);
  return o = o.xor(o.shru(47)), o = o.mul(n), o;
}
function Mn(e, t, n, s, o, a) {
  o = o.add(e), a = q(a.add(o).add(s), 21);
  const r = o;
  return o = o.add(t), o = o.add(n), a = a.add(q(o, 44)), [o.add(s), a.add(r)];
}
function ut(e, t, n, s) {
  return Mn(T(e, t), T(e, t + 8), T(e, t + 16), T(e, t + 24), n, s);
}
function On(e, t = e.length) {
  if (t >= 8) {
    const n = D.add(t * 2), s = T(e, 0).add(D), o = T(e, t - 8), a = q(o, 37).mul(n).add(s), r = q(s, 25).add(o).mul(n);
    return Q(a, r, n);
  }
  if (t >= 4) {
    const n = D.add(t * 2), s = St(e, 0);
    return Q(s.shl(3).add(t), St(e, t - 4), n);
  }
  if (t > 0) {
    const n = e[0], s = e[t >> 1], o = e[t - 1], a = n + (s << 8), r = t + (o << 2);
    return bt(D.mul(a).xor(ae.mul(r))).mul(D);
  }
  return D;
}
function Ln(e, t = e.length) {
  const n = D.add(t * 2), s = T(e, 0).mul(J), o = T(e, 8), a = T(e, t - 8).mul(n), r = T(e, t - 16).mul(D);
  return Q(q(s.add(o), 43).add(q(a, 30)).add(r), s.add(q(o.add(D), 18)).add(a), n);
}
function Pn(e, t = e.length) {
  const n = D.add(t * 2), s = T(e, 0).mul(D), o = T(e, 8), a = T(e, t - 8).mul(n), r = T(e, t - 16).mul(D), i = q(s.add(o), 43).add(q(a, 30)).add(r), l = Q(i, s.add(q(o.add(D), 18)).add(a), n), u = T(e, 16).mul(n), h = T(e, 24), f = i.add(T(e, t - 32)).mul(n), p = l.add(T(e, t - 24)).mul(n);
  return Q(q(u.add(h), 43).add(q(f, 30)).add(p), u.add(q(h.add(s), 18)).add(f), n);
}
function An(e, t = e.length) {
  const n = tt.fromNumber(81, !0);
  if (t <= 32)
    return t <= 16 ? On(e, t) : Ln(e, t);
  if (t <= 64)
    return Pn(e, t);
  let s = n, o = n.mul(J).add(113), a = bt(o.mul(D).add(113)).mul(D), r = [tt.UZERO, tt.UZERO], i = [tt.UZERO, tt.UZERO];
  s = s.mul(D).add(T(e, 0));
  let l = 0;
  const u = (t - 1 >> 6) * 64, h = u + (t - 1 & 63) - 63;
  do
    s = q(s.add(o).add(r[0]).add(T(e, l + 8)), 37).mul(J), o = q(o.add(r[1]).add(T(e, l + 48)), 42).mul(J), s = s.xor(i[1]), o = o.add(r[0]).add(T(e, l + 40)), a = q(a.add(i[0]), 33).mul(J), r = ut(e, l, r[1].mul(J), s.add(i[0])), i = ut(e, l + 32, a.add(i[1]), o.add(T(e, l + 16))), [a, s] = [s, a], l += 64;
  while (l !== u);
  const f = J.add(a.and(255).shl(1));
  return l = h, i[0] = i[0].add(t - 1 & 63), r[0] = r[0].add(i[0]), i[0] = i[0].add(r[0]), s = q(s.add(o).add(r[0]).add(T(e, l + 8)), 37).mul(f), o = q(o.add(r[1]).add(T(e, l + 48)), 42).mul(f), s = s.xor(i[1].mul(9)), o = o.add(r[0].mul(9).add(T(e, l + 40))), a = q(a.add(i[0]), 33).mul(f), r = ut(e, l, r[1].mul(f), s.add(i[0])), i = ut(e, l + 32, a.add(i[1]), o.add(T(e, l + 16))), [a, s] = [s, a], Q(Q(r[0], i[0], f).add(bt(o).mul(ae)).add(a), Q(r[1], i[1], f).add(s), f);
}
function nt(e, t) {
  Array.isArray(e) || (e = [e]), e.forEach((n) => {
    n != null && Lt(n.dtype !== "complex64", () => `${t} does not support complex64 tensors in the CPU backend.`);
  });
}
function le(e) {
  const t = new Float32Array(e.length);
  for (let n = 0; n < e.length; ++n)
    t[n] = Math.abs(e[n]);
  return t;
}
const qn = (e) => {
  const { x: t } = e.inputs, n = e.backend;
  nt(t, "abs");
  let s = new Float32Array(V(t.shape));
  const o = n.data.get(t.dataId).values;
  return s = le(o), n.makeOutput(s, t.shape, t.dtype);
}, Qs = {
  kernelName: Ce,
  backendName: "cpu",
  kernelFunc: qn
};
function W(e) {
  return (t, n, s, o, a) => {
    const r = Pt(t, n), i = r.length, l = H(r), u = V(r), h = et(a, u), f = t.length, p = n.length, w = H(t), m = H(n), F = ht(t, r), d = ht(n, r);
    if (F.length + d.length === 0)
      for (let g = 0; g < h.length; ++g)
        h[g] = e(s[g % s.length], o[g % o.length]);
    else
      for (let g = 0; g < h.length; ++g) {
        const b = dt(g, i, l), k = b.slice(-f);
        F.forEach((O) => k[O] = 0);
        const y = at(k, f, w), v = b.slice(-p);
        d.forEach((O) => v[O] = 0);
        const M = at(v, p, m);
        h[g] = e(s[y], o[M]);
      }
    return [h, r];
  };
}
function mt(e) {
  const { inputs: t, backend: n } = e, { real: s, imag: o } = t, a = n.data.get(s.dataId).values, r = n.data.get(o.dataId).values, i = n.makeTensorInfo(s.shape, "complex64"), l = n.data.get(i.dataId);
  return l.complexTensorInfos = {
    real: n.makeTensorInfo(s.shape, "float32", a),
    imag: n.makeTensorInfo(o.shape, "float32", r)
  }, i;
}
const Ys = {
  kernelName: De,
  backendName: "cpu",
  kernelFunc: mt
};
function xt(e, t, n = "float32") {
  if (n === "complex64") {
    const o = xt(e, t, "float32"), a = xt(e, t, "float32");
    return mt({ inputs: { real: o, imag: a }, backend: e });
  }
  const s = st(V(t), n);
  return e.makeTensorInfo(t, n, s);
}
function Et(e) {
  const { inputs: t, backend: n } = e, { x: s } = t;
  return n.incRef(s.dataId), { dataId: s.dataId, shape: s.shape, dtype: s.dtype };
}
const Js = {
  kernelName: Ue,
  backendName: "cpu",
  kernelFunc: Et
};
function ce(e) {
  const { inputs: t, backend: n } = e, { input: s } = t, o = n.data.get(s.dataId).complexTensorInfos.real, a = n.data.get(o.dataId).values;
  return n.makeTensorInfo(o.shape, o.dtype, a);
}
const to = {
  kernelName: We,
  backendName: "cpu",
  kernelFunc: ce
};
function ue(e, t, n, s) {
  if (s === "int32") {
    const o = Int32Array.from(e);
    return [t, "int32", o];
  }
  if (s === "bool") {
    const o = Be([0], n), [a, r] = W((i, l) => i !== l ? 1 : 0)(t, [], e, o, "bool");
    return [r, "bool", a];
  }
  throw new Error(`Error in Cast: failed to cast ${n} to ${s}`);
}
function lt(e) {
  const { inputs: t, backend: n, attrs: s } = e, { x: o } = t, { dtype: a } = s;
  if (a === "complex64") {
    if (o.dtype === "complex64")
      return Et({ inputs: { x: o }, backend: n });
    const h = xt(n, o.shape, o.dtype), f = lt({ inputs: { x: o }, backend: n, attrs: { dtype: "float32" } }), p = mt({ inputs: { real: f, imag: h }, backend: n });
    return n.disposeIntermediateTensorInfo(h), n.disposeIntermediateTensorInfo(f), p;
  }
  if (o.dtype === "complex64") {
    const h = ce({ inputs: { input: o }, backend: n }), f = lt({ inputs: { x: h }, backend: n, attrs: { dtype: a } });
    return n.disposeIntermediateTensorInfo(h), f;
  }
  if (!ze(o.dtype, a)) {
    const h = Et({ inputs: { x: o }, backend: n });
    return { dataId: h.dataId, shape: h.shape, dtype: a };
  }
  const r = n.data.get(o.dataId).values, [i, l, u] = ue(r, o.shape, o.dtype, a);
  return n.makeTensorInfo(i, l, u);
}
const eo = {
  kernelName: $e,
  backendName: "cpu",
  kernelFunc: lt
};
function z(e, t, n, s) {
  return n == null ? ({ inputs: o, backend: a }) => {
    const { a: r, b: i } = o, l = a;
    nt([r, i], e);
    const u = l.data.get(r.dataId).values, h = l.data.get(i.dataId).values, f = r.dtype === "string" ? (
      // tslint:disable-next-line: no-any
      it(u)
    ) : u, p = r.dtype === "string" ? (
      // tslint:disable-next-line: no-any
      it(h)
    ) : h, w = s || r.dtype, [m, F] = t(r.shape, i.shape, f, p, w);
    return l.makeTensorInfo(F, w, m);
  } : ({ inputs: o, backend: a }) => {
    const { a: r, b: i } = o, l = a;
    if (r.dtype === "complex64" || i.dtype === "complex64") {
      const u = lt({ inputs: { x: r }, backend: l, attrs: { dtype: "complex64" } }), h = l.data.get(u.dataId), f = h.complexTensorInfos.real, p = h.complexTensorInfos.imag, w = l.data.get(f.dataId).values, m = l.data.get(p.dataId).values, F = lt({ inputs: { x: i }, backend: l, attrs: { dtype: "complex64" } }), d = l.data.get(F.dataId), g = d.complexTensorInfos.real, b = d.complexTensorInfos.imag, k = l.data.get(g.dataId).values, y = l.data.get(b.dataId).values, [v, M, O] = n(r.shape, i.shape, w, m, k, y), S = l.makeTensorInfo(O, "float32", v), x = l.makeTensorInfo(O, "float32", M), I = mt({ inputs: { real: S, imag: x }, backend: l });
      return l.disposeIntermediateTensorInfo(u), l.disposeIntermediateTensorInfo(F), l.disposeIntermediateTensorInfo(S), l.disposeIntermediateTensorInfo(x), I;
    } else {
      const u = l.data.get(r.dataId).values, h = l.data.get(i.dataId).values, f = s || r.dtype, [p, w] = t(r.shape, i.shape, u, h, f);
      return l.makeTensorInfo(w, f, p);
    }
  };
}
function Ft(e) {
  return (t, n, s, o, a, r) => {
    const i = Pt(t, n), l = V(i), u = i.length, h = H(i), f = et("float32", l), p = et("float32", l), w = ht(t, i), m = ht(n, i), F = Nt(s, o), d = Nt(a, r), g = t.length, b = H(t), k = n.length, y = H(n);
    if (w.length + m.length === 0)
      for (let v = 0; v < f.length; v++) {
        const M = v % F.length, O = v % d.length, S = e(F[M * 2], F[M * 2 + 1], d[O * 2], d[O * 2 + 1]);
        f[v] = S.real, p[v] = S.imag;
      }
    else
      for (let v = 0; v < f.length; v++) {
        const M = dt(v, u, h), O = M.slice(-g);
        w.forEach((E) => O[E] = 0);
        const S = at(O, g, b), x = M.slice(-k);
        m.forEach((E) => x[E] = 0);
        const I = at(x, k, y), c = e(F[S * 2], F[S * 2 + 1], d[I * 2], d[I * 2 + 1]);
        f[v] = c.real, p[v] = c.imag;
      }
    return [f, p, i];
  };
}
const he = W(((e, t) => e + t)), _n = Ft(((e, t, n, s) => ({ real: e + n, imag: t + s }))), Vn = z(At, he, _n), no = {
  kernelName: At,
  backendName: "cpu",
  kernelFunc: Vn
};
function Cn(e, t, n, s, o) {
  const a = V(s), r = st(o, n);
  for (let i = 0; i < e.length; i++) {
    const l = e[i];
    if (l < 0)
      throw new Error("Input x must be non-negative!");
    l >= o || (a > 0 ? r[l] += t[i] : r[l] += 1);
  }
  return r;
}
function Dn(e, t, n, s = !1) {
  const o = e.shape[0], a = e.shape[1], r = K([o, n], t.dtype);
  for (let i = 0; i < o; i++)
    for (let l = 0; l < a; l++) {
      const u = e.get(i, l);
      if (u < 0)
        throw new Error("Input x must be non-negative!");
      u >= n || (s ? r.set(1, i, u) : t.size > 0 ? r.set(r.get(i, u) + t.get(i, l), i, u) : r.set(r.get(i, u) + 1, i, u));
    }
  return r;
}
const fe = W(((e, t) => e & t)), Un = z(qt, fe), so = {
  kernelName: qt,
  backendName: "cpu",
  kernelFunc: Un
};
function X(e) {
  return (t, n, s) => {
    const o = U(n, t.length);
    for (let a = 0; a < t.length; ++a)
      o[a] = e(t[a], s);
    return o;
  };
}
function de(e, t, n) {
  const s = X(t);
  return Y(e, s, n);
}
function Y(e, t, n) {
  return ({ inputs: s, attrs: o, backend: a }) => {
    const { x: r } = s;
    nt(r, e);
    const i = a, l = i.data.get(r.dataId).values;
    let u;
    if (r.dtype === "string") {
      if (!Array.isArray(l))
        throw new Error("String tensor's value was not an instance of Array");
      u = it(l);
    } else
      u = l;
    const h = n || r.dtype, f = t(u, h, o);
    return i.makeTensorInfo(r.shape, h, f);
  };
}
const ge = X((e) => Math.ceil(e)), Wn = Y(_t, ge), oo = {
  kernelName: _t,
  backendName: "cpu",
  kernelFunc: Wn
};
function $n(e, t, n, s) {
  const o = U(n, V(t));
  if (s && n !== "string") {
    let a = 0;
    e.forEach((r) => {
      const i = V(r.shape);
      o.set(r.vals, a), a += i;
    });
  } else {
    let a = 0;
    e.forEach((r) => {
      const i = n === "string" ? it(r.vals) : r.vals;
      let l = 0;
      for (let u = 0; u < r.shape[0]; ++u) {
        const h = u * t[1] + a;
        for (let f = 0; f < r.shape[1]; ++f)
          o[h + f] = i[l++];
      }
      a += r.shape[1];
    });
  }
  return o;
}
const me = W((e, t) => e === t ? 1 : 0), zn = z(Vt, me, null, "bool"), ro = {
  kernelName: Vt,
  backendName: "cpu",
  kernelFunc: zn
};
const pe = X((e) => Math.exp(e)), Bn = Y(Ct, pe, "float32"), ao = {
  kernelName: Ct,
  backendName: "cpu",
  kernelFunc: Bn
};
const we = X((e) => Math.expm1(e)), jn = Y(Dt, we), io = {
  kernelName: Dt,
  backendName: "cpu",
  kernelFunc: jn
};
const Ie = X((e) => Math.floor(e)), Gn = Y(Ut, Ie), lo = {
  kernelName: Ut,
  backendName: "cpu",
  kernelFunc: Gn
};
const be = W((e, t) => Math.floor(e / t)), Zn = z(Wt, be, null, "int32"), co = {
  kernelName: Wt,
  backendName: "cpu",
  kernelFunc: Zn
};
function Kn(e, t, n, s, o, a, r, i, l) {
  const u = K([s, a], n);
  for (let h = 0; h < s; h++) {
    const f = [];
    let p = 0;
    for (let w = 0; w < o; w++) {
      const m = e[h * o + w];
      p += m * r[w], f.push(m);
    }
    if (p < 0 || p >= l / a)
      throw new Error(`Invalid indices: ${f} does not index into ${i}`);
    for (let w = 0; w < a; w++)
      u.values[h * a + w] = t.get(...t.indexToLoc(p * a + w));
  }
  return u;
}
function Hn(e, t, n) {
  const s = K(n, e.dtype);
  for (let o = 0; o < s.size; ++o) {
    const r = s.indexToLoc(o).slice(), i = r[0], l = r[2], u = t.locToIndex([i, l]);
    r[2] = t.values[u];
    const h = e.locToIndex(r);
    0 <= h && h < e.values.length && (s.values[o] = e.values[h]);
  }
  return s;
}
const xe = W((e, t) => e > t ? 1 : 0), Xn = z($t, xe, null, "bool"), uo = {
  kernelName: $t,
  backendName: "cpu",
  kernelFunc: Xn
};
const Ee = W((e, t) => e >= t ? 1 : 0), Qn = z(zt, Ee, null, "bool"), ho = {
  kernelName: zt,
  backendName: "cpu",
  kernelFunc: Qn
};
const Fe = W((e, t) => e < t ? 1 : 0), Yn = z(Bt, Fe, null, "bool"), fo = {
  kernelName: Bt,
  backendName: "cpu",
  kernelFunc: Yn
};
const ye = W((e, t) => e <= t ? 1 : 0), Jn = z(jt, ye, null, "bool"), go = {
  kernelName: jt,
  backendName: "cpu",
  kernelFunc: Jn
};
function ts(e, t, n) {
  const s = (t - e) / (n - 1), o = st(n, "float32");
  o[0] = e;
  for (let a = 1; a < o.length; a++)
    o[a] = o[a - 1] + s;
  return o;
}
const ke = X((e) => Math.log(e)), es = Y(Gt, ke), mo = {
  kernelName: Gt,
  backendName: "cpu",
  kernelFunc: es
};
function ns(e, t, n, s) {
  const o = et(s, V(n));
  for (let a = 0; a < o.length; ++a) {
    const r = a * t;
    let i = e[r];
    for (let l = 0; l < t; ++l) {
      const u = e[r + l];
      (Number.isNaN(u) || u > i) && (i = u);
    }
    o[a] = i;
  }
  return o;
}
const Ne = W(((e, t) => Math.max(e, t))), ss = z(Zt, Ne), po = {
  kernelName: Zt,
  backendName: "cpu",
  kernelFunc: ss
};
const ve = W(((e, t) => Math.min(e, t))), os = z(Kt, ve), wo = {
  kernelName: Kt,
  backendName: "cpu",
  kernelFunc: os
};
const yt = W(((e, t) => e * t)), rs = Ft(((e, t, n, s) => ({
  real: e * n - t * s,
  imag: e * s + t * n
}))), as = z(Ht, yt, rs), Io = {
  kernelName: Ht,
  backendName: "cpu",
  kernelFunc: as
};
function Se(e, t, n) {
  const s = Ge(-1, n);
  return yt([], t, s, e, n);
}
function is(e) {
  const { inputs: t, backend: n } = e, { x: s } = t;
  nt(s, "neg");
  const o = n.data.get(s.dataId).values, [a, r] = Se(o, s.shape, s.dtype);
  return n.makeTensorInfo(r, s.dtype, a);
}
const bo = {
  kernelName: je,
  backendName: "cpu",
  kernelFunc: is
};
const Te = W(((e, t) => e !== t ? 1 : 0)), ls = z(Xt, Te, null, "bool"), xo = {
  kernelName: Xt,
  backendName: "cpu",
  kernelFunc: ls
};
function Re(e, t, n, s, o) {
  const a = t.length, r = V(t), i = H(t), l = H(o), u = et(n, V(o));
  for (let h = 0; h < r; ++h) {
    const f = dt(h, a, i), p = new Array(f.length);
    for (let m = 0; m < p.length; m++)
      p[m] = f[s[m]];
    const w = at(p, a, l);
    u[w] = e[h];
  }
  return u;
}
function Me(e) {
  const { inputs: t, attrs: n, backend: s } = e, { x: o } = t, { perm: a } = n;
  nt(o, "transpose");
  const r = o.shape.length, i = new Array(r);
  for (let f = 0; f < i.length; f++)
    i[f] = o.shape[a[f]];
  const l = s.data.get(o.dataId).values, u = Re(l, o.shape, o.dtype, a, i);
  return { dataId: s.write(u, i, o.dtype), shape: i, dtype: o.dtype };
}
const Eo = {
  kernelName: Ze,
  backendName: "cpu",
  kernelFunc: Me
};
function Oe(e, t, n, s) {
  const [o, a] = bn(e, s), r = He(t, "int32"), i = st(V(o), r), l = V(a);
  for (let u = 0; u < i.length; ++u) {
    const h = u * l;
    let f = 1;
    for (let p = 0; p < l; ++p)
      f *= n[h + p];
    i[u] = f;
  }
  return { outVals: i, outShape: o, outDtype: r };
}
function cs(e) {
  const { inputs: t, backend: n, attrs: s } = e, { x: o } = t, { axis: a, keepDims: r } = s;
  nt(o, "prod");
  const i = o.shape.length, l = Qt(a, o.shape), u = pn(l, i);
  let h = l, f = o;
  const p = [];
  u != null && (f = Me({ inputs: { x: o }, backend: n, attrs: { perm: u } }), p.push(f), h = wn(h.length, i));
  const w = n.data.get(f.dataId).values, { outVals: m, outShape: F, outDtype: d } = Oe(f.shape, f.dtype, w, h);
  let g = F;
  return r && (g = In(F, l)), p.forEach((b) => n.disposeIntermediateTensorInfo(b)), n.makeTensorInfo(g, d, m);
}
const Fo = {
  kernelName: Ke,
  backendName: "cpu",
  kernelFunc: cs
};
function us(e, t, n) {
  e.forEach((s, o) => {
    if (s < 0 || s >= n) {
      const a = dt(o, t.length, H(t)).join(",");
      throw new Error(`indices[${a}] = ${s} is not in [0, ${n})`);
    }
  });
}
function hs(e, t) {
  for (let n = 0; n < e.length; ++n) {
    const s = e[n], o = n === e.length - 1 ? t : e[n + 1].length;
    if (s.length === 0)
      throw new Error("Ragged splits may not be empty");
    if (s[0] < 0)
      throw new Error("Ragged splits must be non-negative");
    if (s[s.length - 1] > o)
      throw new Error("Ragged splits must not point past values");
    for (let a = 1; a < s.length; ++a)
      if (s[a - 1] > s[a])
        throw new Error("Ragged splits must be sorted in ascending order");
  }
}
function fs(e, t, n, s) {
  const o = [];
  let a = 0;
  const r = t.length - 1 + n.length, i = new Array(r).fill(null).map(() => [0]);
  hs(n, s);
  let l = 1;
  for (let u = 0; u < t.length - 1; ++u) {
    l *= t[u];
    const h = t[u + 1];
    for (let f = 1; f < l + 1; ++f)
      i[u].push(f * h);
  }
  for (let u = 0; u < e.length; ++u) {
    let h = e[u], f = e[u] + 1;
    for (let p = 0; p < n.length; ++p) {
      const w = n[p], m = p + t.length - 1;
      if (m >= 0) {
        const F = i[m], d = F[F.length - 1] - w[h];
        for (let g = h; g < f; ++g)
          i[m].push(w[g + 1] + d);
      }
      h = w[h], f = w[f];
    }
    f !== h && (o.push([h, f]), a += f - h);
  }
  return { outSplits: i, valueSlices: o, numValues: a };
}
function ds(e) {
  const t = [];
  for (let n = 0; n < e.length; ++n) {
    const s = e[n].length, o = U("int32", s);
    t.push(o), e[n].forEach((a, r) => o[r] = a);
  }
  return t;
}
function Tt(e, t) {
  const n = e.slice(0, t);
  for (; n.length < t; )
    n.push(1);
  for (let s = t; s < e.length; s++)
    n[t - 1] *= e[s];
  return n;
}
function gs(e, t, n, s, o, a) {
  const r = Tt(t, 2)[1], i = Tt(a, 2)[1];
  let l = 0;
  for (const u of n)
    for (let h = u[0]; h < u[1]; ++h) {
      for (let f = 0; f < s; ++f)
        o[l * i + f] = e[h * r + f];
      ++l;
    }
}
function ms(e, t, n, s, o) {
  const a = t.slice();
  a[0] = o;
  const r = U(n, V(a)), i = e.length, l = i === 0 ? 0 : i / t[0];
  return gs(e, t, s, l, r, a), [r, a];
}
function ps(e, t, n, s, o, a, r, i) {
  if (e.length === 0)
    throw new Error("paramsNestedSplits must be non empty");
  if (t[0].length === 0)
    throw new Error("Split tensors must not be scalars");
  const l = t[0][0] - 1;
  if (us(a, r, l), s.length === 0)
    throw new Error("params.rank must be nonzero");
  const u = s[0], { outSplits: h, valueSlices: f, numValues: p } = fs(a, r, e, u), w = ds(h), m = ms(n, s, o, f, p);
  return [w, m[0], m[1]];
}
const Rt = 2147483647;
function ws(e, t, n, s, o, a, r) {
  if (t.length > 1)
    throw new Error("starts must be a scalar or vector");
  if (o.length > 1)
    throw new Error("limits must be a scalar or vector");
  if (r.length > 1)
    throw new Error("deltas must be a scalar or vector");
  const i = t.length === 0, l = o.length === 0, u = r.length === 0, h = [];
  i || h.push(t[0]), l || h.push(o[0]), u || h.push(r[0]);
  for (let d = 1; d < h.length; ++d)
    if (h[d] !== h[d - 1])
      throw new Error("starts, limits, and deltas must have the same shape");
  const f = h.length === 0 ? 1 : h[0], p = U("int32", f + 1);
  p[0] = 0;
  for (let d = 0; d < f; ++d) {
    const g = i ? e[0] : e[d], b = l ? s[0] : s[d], k = u ? a[0] : a[d];
    if (k === 0)
      throw new Error("Requires delta != 0");
    let y;
    if (k > 0 && b < g || k < 0 && b > g)
      y = 0;
    else if (y = Math.ceil(Math.abs((b - g) / k)), y > Rt)
      throw new Error(`Requires ((limit - start) / delta) <= ${Rt}`);
    p[d + 1] = p[d] + y;
  }
  const w = p[f], m = U(n, w);
  let F = 0;
  for (let d = 0; d < f; ++d) {
    const g = p[d + 1] - p[d];
    let b = i ? e[0] : e[d];
    const k = u ? a[0] : a[d];
    for (let y = 0; y < g; ++y)
      m[F++] = b, b += k;
  }
  return [p, m];
}
var Z = tn;
class ft {
  constructor(t, n, s, o, a, r, i, l, u, h) {
    this.shape = t, this.shapeShape = n, this.values = s, this.valuesShape = o, this.valuesDType = a, this.defaultValue = r, this.defaultValueShape = i, this.rowPartitionValues = l, this.rowPartitionValuesShapes = u, this.rowPartitionTypes = Ye(h), this.raggedRank = Je(this.rowPartitionTypes);
  }
  getRowPartitionTypeByDimension(t) {
    return this.rowPartitionTypes[0] === Z.FIRST_DIM_SIZE ? this.rowPartitionTypes[t + 1] : this.rowPartitionTypes[t];
  }
  // Returns the relationship between dimension and dimension + 1.
  getRowPartitionTensor(t) {
    return this.rowPartitionTypes[0] === Z.FIRST_DIM_SIZE ? this.rowPartitionValues[t + 1] : this.rowPartitionValues[t];
  }
  getMaxWidth(t) {
    const n = this.getRowPartitionTensor(t - 1);
    switch (this.getRowPartitionTypeByDimension(t - 1)) {
      case Z.VALUE_ROWIDS:
        return ft.getMaxWidthValueRowID(n);
      case Z.ROW_SPLITS:
        return ft.getMaxWidthRowSplit(n);
      default:
        throw new Error(`Cannot handle partition type ${Z[this.getRowPartitionTypeByDimension(t - 1)]}`);
    }
  }
  static getMaxWidthRowSplit(t) {
    const n = t.length;
    if (n === 0 || n === 1)
      return 0;
    let s = 0;
    for (let o = 0; o < n - 1; ++o) {
      const a = t[o + 1] - t[o];
      a > s && (s = a);
    }
    return s;
  }
  static getMaxWidthValueRowID(t) {
    const n = t.length;
    if (n === 0)
      return 0;
    let s = 0, o = t[0], a = 0;
    for (let r = 1; r < n; ++r) {
      const i = t[r];
      i !== o && (o = i, a = Math.max(r - s, a), s = r);
    }
    return Math.max(n - s, a);
  }
  tensorShapeFromTensor(t, n, s = !0) {
    if (n.length === 0) {
      if (t[0] === -1)
        return [];
      throw new Error("The only valid scalar shape tensor is the fully unknown shape specified as -1.");
    }
    return Ot(t, s);
  }
  calculateOutputSize(t) {
    const n = this.valuesShape, s = this.defaultValueShape;
    en(s, n);
    const o = this.tensorShapeFromTensor(this.shape, this.shapeShape), r = nn(this.raggedRank, o, n);
    r[0] < 0 && (r[0] = t);
    for (let i = 1; i <= this.raggedRank; ++i)
      r[i] < 0 && (r[i] = this.getMaxWidth(i));
    return r;
  }
  /**
   * The outputIndex represents the index in the output tensor
   * where the first element of a particular dimension would be written.
   * If it is -1, it indicates that the index is out of scope.
   * Example, given firstDimension = 10, firstDimensionOutput = 6,
   * and outputIndexMultiplier = 100:
   * result = [0 100 200 300 400 500 -1 -1 -1 -1]
   * If firstDimensionOutput = 11 instead, then:
   * result = [0 100 200 300 400 500 600 700 800 900]
   */
  calculateFirstParentOutputIndex(t, n, s) {
    const o = Math.min(t, s), a = [];
    let r = 0;
    for (let i = 0; i < o; ++i, r += n)
      a.push(r);
    for (let i = o; i < t; ++i)
      a.push(-1);
    return Lt(a.length === t, () => "Final length of result must be equal to firstDimension."), a;
  }
  calculateOutputIndexRowSplit(t, n, s, o) {
    const a = t.length, r = [];
    for (let i = 0; i < a - 1; ++i) {
      const l = t[i + 1] - t[i];
      let u = Math.min(o, l), h = n[i];
      h === -1 && (u = 0);
      for (let f = 0; f < u; ++f)
        r.push(h), h += s;
      for (let f = 0; f < l - u; ++f)
        r.push(-1);
    }
    if (a > 0 && r.length !== t[a - 1])
      throw new Error("Invalid row split size.");
    return r;
  }
  // Calculate the output index of the first element of a list.
  // The parentOutputIndex is the same computation for the previous list.
  // -1 indicates an element or list that is out of range.
  // The outputIndexMultiplier is the number of output indices one moves
  // forward for each column.
  // E.g., given:
  // valueRowIds:[0 1 2 2 2 3 5 5 6]
  // parentOutputIndex:[1000 1100 2000 2100 -1 3000 4000]
  // outputIndexMultiplier: 10
  // outputSize: 2
  // You get:
  // result = [1000 1100 2000 2010 -1 2100 -1 -1 3000]
  // result[0] = parentOutputIndex[valueRowIds[0]]
  // result[1] = parentOutputIndex[valueRowIds[1]]
  // result[2] = parentOutputIndex[valueRowIds[2]]
  // result[3] = parentOutputIndex[valueRowIds[2] + 10]
  // result[4] = -1 because it is the third element the size is 2.
  // result[5] = parentOutputIndex[valueRowIds[3]]
  // result[6] = -1 because parentOutputIndex[valueRowIds[6]] == -1
  // result[7] = -1 because parentOutputIndex[valueRowIds[6]] == -1
  // result[8] = parentOutputIndex[valueRowIds[7]]
  calculateOutputIndexValueRowID(t, n, s, o) {
    const a = t.length, r = [];
    if (a === 0)
      return [];
    let i = 0, l = t[0];
    if (l >= n.length)
      throw new Error(`Got currentValueRowId=${l}, which is not less than ${n.length}`);
    let u = n[l];
    r.push(u);
    for (let h = 1; h < a; ++h) {
      const f = t[h];
      if (f === l)
        u >= 0 && (++i, i < o ? u += s : u = -1);
      else {
        if (i = 0, l = f, f >= n.length)
          throw new Error(`Got nextValueRowId=${f} which is not less than ${n.length}`);
        u = n[f];
      }
      r.push(u);
    }
    if (r.length !== t.length)
      throw new Error("Invalid row ids.");
    return r;
  }
  calculateOutputIndex(t, n, s, o) {
    const a = this.getRowPartitionTensor(t), r = this.getRowPartitionTypeByDimension(t);
    switch (r) {
      case Z.VALUE_ROWIDS:
        return this.calculateOutputIndexValueRowID(a, n, s, o);
      case Z.ROW_SPLITS:
        if (a.length - 1 > n.length)
          throw new Error(`Row partition size is greater than output size: ${a.length - 1} > ${n.length}`);
        return this.calculateOutputIndexRowSplit(a, n, s, o);
      default:
        throw new Error(`Unsupported partition type: ${Z[r]}`);
    }
  }
  getFirstDimensionSize() {
    const t = this.rowPartitionValues[0];
    if (this.rowPartitionTypes.length === 0)
      throw new Error("No row_partition_types given.");
    const n = this.rowPartitionTypes[0];
    switch (n) {
      case Z.FIRST_DIM_SIZE:
        return t[0];
      case Z.VALUE_ROWIDS:
        throw new Error("Cannot handle VALUE_ROWIDS in first dimension.");
      case Z.ROW_SPLITS:
        return this.rowPartitionValuesShapes[0][0] - 1;
      default:
        throw new Error(`Cannot handle type ${Z[n]}`);
    }
  }
  compute() {
    if (this.rowPartitionValues[0].length <= 0)
      throw new Error("Invalid first partition input. Tensor requires at least one element.");
    const n = this.getFirstDimensionSize(), s = this.calculateOutputSize(n), o = new Array(this.raggedRank + 1);
    o[o.length - 1] = 1;
    for (let l = o.length - 2; l >= 0; --l)
      o[l] = o[l + 1] * s[l + 1];
    const a = Ot(s, !1), r = U(this.valuesDType, V(a));
    if (o[0] * s[0] > 0) {
      let l = this.calculateFirstParentOutputIndex(n, o[0], s[0]);
      for (let u = 1; u <= this.raggedRank; ++u)
        l = this.calculateOutputIndex(u - 1, l, o[u], s[u]);
      this.setOutput(this.raggedRank, l, r, a);
    }
    return [a, r];
  }
  setOutput(t, n, s, o) {
    if (s.length === 0)
      return;
    const a = this.values, r = s;
    let i = o.slice();
    i = i.slice(t + 1);
    const l = V(i), u = n.length;
    let h = this.defaultValue;
    if (h.length !== l && h.length !== 1) {
      const m = this.defaultValueShape;
      Xe(() => {
        const F = En(h, m);
        h = xn(F, i).dataSync();
      });
    }
    let f = 0, p = 0, w = 0;
    for (let m = 0; m <= u; ++m) {
      let F = m < u ? n[m] : -1;
      if (F === w) {
        ++w;
        continue;
      }
      if (p < w) {
        const d = a.subarray(f * l), g = r.subarray(p * l), b = (w - p) * l;
        Mt(g, d, b);
      }
      if (m >= u) {
        const d = s.length;
        F = Math.floor(d / l);
      }
      if (F > w)
        if (this.defaultValue.length === 1)
          r.subarray(w * l, F * l).fill(this.defaultValue[0]), w = F;
        else
          for (; F > w; ) {
            const d = r.slice(w * l);
            Mt(d, h, l), ++w;
          }
      F < 0 ? (f = m + 1, p = w) : (f = m, p = w, w = p + 1);
    }
  }
}
function Mt(e, t, n) {
  for (let s = 0; s < n; s++)
    e[s] = t[s];
}
function Ot(e, t) {
  const n = [];
  for (let s of e) {
    if (s < 0) {
      if (!t)
        throw new Error(`Dimension ${s} must be >= 0`);
      if (s < -1)
        throw new Error(`Dimension ${s} must be >= -1`);
      s = -1;
    }
    n.push(s);
  }
  return n;
}
function Is(e, t, n, s, o, a, r, i, l, u) {
  return new ft(e, t, n, s, o, a, r, i, l, u).compute();
}
function bs(e, t, n, s) {
  const o = e === t, a = e < t && n < 0, r = t < e && n > 1;
  if (o || a || r)
    return st(0, s);
  const i = Math.abs(Math.ceil((t - e) / n)), l = st(i, s);
  t < e && n === 1 && (n = -1), l[0] = e;
  for (let u = 1; u < l.length; u++)
    l[u] = l[u - 1] + n;
  return l;
}
const Le = X((e) => 1 / Math.sqrt(e)), xs = Y(Yt, Le), yo = {
  kernelName: Yt,
  backendName: "cpu",
  kernelFunc: xs
};
function Es(e, t, n, s, o, a, r, i, l, u) {
  const h = [s / o, o], f = e.values, p = t.values;
  if (s === 0)
    return K(n, t.dtype);
  const w = l instanceof It ? l : K(h, t.dtype);
  typeof l == "string" || typeof l == "number" ? w.values.fill(l) : typeof l == "boolean" && w.values.fill(+l);
  for (let m = 0; m < a; m++) {
    const F = [];
    let d = 0;
    for (let g = 0; g < r; g++) {
      const b = f[m * r + g];
      F.push(b), d += b * i[g];
    }
    if (d < 0 || d >= s / o)
      throw new Error(`Invalid indices: ${F} does not index into ${n}`);
    for (let g = 0; g < o; g++)
      u ? w.values[d * o + g] += p[m * o + g] : w.values[d * o + g] = t.rank === 0 ? p[0] : p[m * o + g];
  }
  return w;
}
const Fs = X((e) => 1 / (1 + Math.exp(-e))), ys = de(Jt, (e) => 1 / (1 + Math.exp(-e))), ko = {
  kernelName: Jt,
  backendName: "cpu",
  kernelFunc: ys
};
function Pe(e, t, n, s, o) {
  const a = kn(s, t, n), r = V(n), i = H(s);
  if (a) {
    const f = Nn(t, i);
    return o === "string" ? e.slice(f, f + r) : e.subarray(f, f + r);
  }
  const l = o === "string" ? it(e) : e, u = K(s, o, l), h = K(n, o);
  for (let f = 0; f < h.size; ++f) {
    const p = h.indexToLoc(f), w = p.map((m, F) => m + t[F]);
    h.set(u.get(...w), ...p);
  }
  return o === "string" ? sn(h.values) : h.values;
}
function ks(e) {
  const { inputs: t, backend: n, attrs: s } = e, { x: o } = t, { begin: a, size: r } = s;
  nt(o, "slice");
  const [i, l] = Fn(o, a, r);
  yn(o, i, l);
  const u = n.data.get(o.dataId).values, h = Pe(u, i, l, o.shape, o.dtype);
  return n.makeTensorInfo(l, o.dtype, h);
}
const No = {
  kernelName: Qe,
  backendName: "cpu",
  kernelFunc: ks
};
function Ns(e, t, n, s, o, a, r) {
  const i = t[0], l = a[0], u = new Array(l), h = new Array(i), f = t[1];
  if (l === 0) {
    if (i !== 0)
      throw new Error(on(i));
    const d = U(n, 0), g = U(o, 0);
    return [
      d,
      [0, f],
      g,
      u,
      h
    ];
  }
  let p = !0, w = 0;
  const m = new Array(l).fill(0);
  for (let d = 0; d < i; ++d) {
    const g = e[d * f];
    if (g < 0)
      throw new Error(rn(d, g));
    if (g >= l)
      throw new Error(an(d, g, l));
    ++m[g], p = p && g >= w, w = g;
  }
  let F = !0;
  for (let d = 0; d < l; ++d) {
    const g = m[d] === 0;
    u[d] = g, F = F && !g, m[d] = Math.max(m[d], 1), d > 0 && (m[d] += m[d - 1]);
  }
  if (F && p) {
    const d = e, g = s;
    for (let b = 0; b < i; ++b)
      h[b] = b;
    return [
      d,
      [i, f],
      g,
      u,
      h
    ];
  } else {
    const d = m[l - 1], g = U(n, d * f), b = U(o, d), k = new Array(l).fill(0);
    for (let y = 0; y < i; ++y) {
      const v = e[y * f], M = k[v], O = (v === 0 ? 0 : m[v - 1]) + M;
      k[v]++;
      for (let S = 0; S < f; ++S)
        g[O * f + S] = e[y * f + S];
      b[O] = s[y], h[y] = O;
    }
    for (let y = 0; y < l; ++y)
      if (k[y] === 0) {
        const M = y === 0 ? 0 : m[y - 1];
        g[M * f + 0] = y;
        for (let O = 1; O < f; ++O)
          g[M * f + O] = 0;
        b[M] = r;
      }
    return [
      g,
      [d, f],
      b,
      u,
      h
    ];
  }
}
function vs(e, t, n, s, o) {
  const a = V(s), r = t[0], i = o.length, l = [];
  let u = 1, h = -1;
  for (let d = 0; d < i; ++d) {
    const g = o[d];
    if (g === -1) {
      if (h !== -1)
        throw new Error(ln(h, d));
      h = d, l.push(1);
    } else {
      if (g < 0)
        throw new Error(cn(d, g));
      u *= g, l.push(g);
    }
  }
  if (h !== -1) {
    if (u <= 0)
      throw new Error(un());
    const d = Math.trunc(a / u);
    if (u * d !== a)
      throw new Error(hn(s, l));
    l[h] = d;
  }
  if (V(l) !== a)
    throw new Error(fn(s, l));
  const p = s.length, w = [];
  if (p > 0) {
    w[p - 1] = 1;
    for (let d = p - 2; d >= 0; --d)
      w[d] = w[d + 1] * s[d + 1];
  }
  const m = [];
  if (i > 0) {
    m[i - 1] = 1;
    for (let d = i - 2; d >= 0; --d)
      m[d] = m[d + 1] * l[d + 1];
  }
  const F = U(n, r * i);
  for (let d = 0; d < r; ++d) {
    let g = 0;
    for (let b = 0; b < p; ++b)
      g += e[d * p + b] * w[b];
    for (let b = 0; b < i; ++b)
      F[d * i + b] = Math.trunc(g / m[b]), g %= m[b];
  }
  return [F, [r, i], l];
}
function Ss(e, t, n, s, o, a = !1, r = 0) {
  const i = s.length, l = [t[0], e.length / t[0]], u = l[1], f = i > 0 ? o[i - 1] + 1 : 0;
  if (f < 0)
    throw new Error(kt());
  const p = t.slice();
  p[0] = f;
  const w = p.reduce((k, y) => k * y, 1), m = U(n, w);
  if (i === 0)
    return f > 0 && m.fill(r), [m, p];
  if (f <= 0)
    throw new Error(kt());
  let F = 0, d = 1, g = 0, b = o[F];
  for (; ; ) {
    let k = 0;
    if (d < i) {
      if (k = o[d], b === k) {
        ++d;
        continue;
      }
      if (b >= k)
        throw new Error(dn());
    }
    if (b < 0 || b >= f)
      throw new Error(gn(b, f));
    b > g && m.fill(r, g * u, b * u);
    for (let y = F; y < d; ++y) {
      const v = s[y];
      if (v < 0 || v >= l[0])
        throw new Error(mn(y, s[y], l[0]));
      for (let M = 0; M < u; M++)
        m[b * u + M] += e[v * u + M];
    }
    if (a)
      for (let y = 0; y < u; y++)
        m[b * u + y] /= d - F;
    if (F = d, ++d, g = b + 1, b = k, d > i)
      break;
  }
  return g < f && m.fill(r, g * u, f * u), [m, p];
}
const Ts = X((e) => Math.sqrt(e)), Rs = de(te, (e) => Math.sqrt(e)), vo = {
  kernelName: te,
  backendName: "cpu",
  kernelFunc: Rs
};
const Ae = W(((e, t) => {
  const n = e - t;
  return n * n;
})), Ms = z(ee, Ae), So = {
  kernelName: ee,
  backendName: "cpu",
  kernelFunc: Ms
};
const qe = X((e, t) => {
  const { pattern: n, replaceGlobal: s, rewrite: o } = t;
  return e.replace(new RegExp(n, s ? "g" : ""), o);
}), Os = Y(ne, qe), To = {
  kernelName: ne,
  backendName: "cpu",
  kernelFunc: Os
};
function Ls(e, t, n, s) {
  const o = K(e, t.dtype);
  for (let a = 0; a < o.size; a++) {
    const r = o.indexToLoc(a), i = new Array(r.length);
    for (let l = 0; l < i.length; l++)
      i[l] = r[l] * n[l] + s[l];
    o.set(t.get(...i), ...r);
  }
  return o;
}
class Ps {
  constructor(t, n, s, o, a, r) {
    this.separator = pt(t), this.nGramWidths = n, this.leftPad = pt(s), this.rightPad = pt(o), this.padWidth = a, this.preserveShort = r;
  }
  getPadWidth(t) {
    return Math.min(this.padWidth < 0 ? t - 1 : this.padWidth, t - 1);
  }
  getNumNGrams(t, n) {
    const s = this.getPadWidth(n);
    return Math.max(0, t + 2 * s - n + 1);
  }
  createNGrams(t, n, s, o, a, r) {
    for (let i = 0; i < a; ++i) {
      const l = this.getPadWidth(r), u = Math.max(0, l - i), h = Math.max(0, l - (a - (i + 1))), f = r - (u + h), p = n + (u > 0 ? 0 : i - l);
      let w = 0;
      w += u * this.leftPad.length;
      for (let b = 0; b < f; ++b)
        w += t[p + b].length;
      w += h * this.rightPad.length;
      const m = u + h + f - 1;
      w += m * this.separator.length, s[o + i] = new Uint8Array(w);
      const F = s[o + i];
      let d = 0;
      const g = (b) => b.forEach((k) => F[d++] = k);
      for (let b = 0; b < u; ++b)
        g(this.leftPad), g(this.separator);
      for (let b = 0; b < f - 1; ++b)
        g(t[p + b]), g(this.separator);
      if (f > 0) {
        g(t[p + f - 1]);
        for (let b = 0; b < h; ++b)
          g(this.separator), g(this.rightPad);
      } else {
        for (let b = 0; b < h - 1; ++b)
          g(this.rightPad), g(this.separator);
        g(this.rightPad);
      }
    }
  }
  // Data and splits together form the definition of the ragged tensor,
  // where data is 1 dimensional and contains the values of the tensor
  // and splits denotes the indices at which each row starts.
  compute(t, n) {
    const s = t.length, o = n.length;
    if (o > 0) {
      let l = n[0];
      if (l !== 0)
        throw new Error(`First split value must be 0, got ${l}`);
      for (let u = 1; u < o; ++u) {
        let h = n[u] >= l;
        if (h = h && n[u] <= s, !h)
          throw new Error(`Invalid split value ${n[u]}, must be in [${l}, ${s}]`);
        l = n[u];
      }
      if (l !== s)
        throw new Error(`Last split value must be data size. Expected ${s}, got ${l}`);
    }
    const a = o - 1, r = U("int32", o);
    if (s === 0 || o === 0) {
      const l = new Array(s);
      for (let u = 0; u <= a; ++u)
        r[u] = 0;
      return [l, r];
    }
    r[0] = 0;
    for (let l = 1; l <= a; ++l) {
      const u = n[l] - n[l - 1];
      let h = 0;
      this.nGramWidths.forEach((f) => {
        h += this.getNumNGrams(u, f);
      }), this.preserveShort && u > 0 && h === 0 && (h = 1), r[l] = r[l - 1] + h;
    }
    const i = new Array(r[a]);
    for (let l = 0; l < a; ++l) {
      const u = n[l];
      let h = r[l];
      if (this.nGramWidths.forEach((f) => {
        const p = n[l + 1] - n[l], w = this.getNumNGrams(p, f);
        this.createNGrams(t, u, i, h, w, f), h += w;
      }), this.preserveShort && h === r[l]) {
        const f = n[l + 1] - n[l];
        if (f === 0)
          continue;
        const p = f + 2 * this.padWidth;
        this.createNGrams(t, u, i, h, 1, p);
      }
    }
    return [i, r];
  }
}
function As(e, t, n, s, o, a, r, i) {
  return new Ps(n, s, o, a, r, i).compute(e, t);
}
function qs(e, t, n, s) {
  if (!e.length)
    return;
  if (t.length === 0) {
    for (let a = 0; a < e.length; ++a)
      s.push(e.subarray(a, a + 1));
    return;
  }
  if (t.length === 1) {
    const a = t[0];
    let r = e.indexOf(a);
    for (; r !== -1; ) {
      const i = e.subarray(0, r);
      (!n || i.length !== 0) && s.push(i), e = e.subarray(r + 1), r = e.indexOf(a);
    }
    (!n || e.length !== 0) && s.push(e);
    return;
  }
  let o = 0;
  for (let a = 0; a < e.length + 1; a++)
    if (a === e.length || t.indexOf(e[a]) !== -1) {
      const r = e.subarray(o, a);
      (!n || r.length !== 0) && s.push(r), o = a + 1;
    }
}
function _s(e, t, n) {
  const s = e.length, o = [];
  let a = 0, r = 0;
  const i = new Array(s);
  for (let p = 0; p < s; ++p) {
    const w = o.length;
    qs(e[p], t, n, o);
    const m = o.length - w;
    i[p] = m, a += m, r = Math.max(r, m);
  }
  const l = U("int32", a * 2), u = new Array(a), h = [s, r];
  let f = 0;
  for (let p = 0; p < s; ++p)
    for (let w = 0; w < i[p]; ++w)
      l[f * 2] = p, l[f * 2 + 1] = w, u[f] = o[f], ++f;
  return [l, u, h];
}
function Vs(e, t) {
  const n = U("int32", e.length);
  for (let s = 0; s < e.length; ++s)
    n[s] = An(e[s]).modulo(t).getLowBitsUnsigned();
  return n;
}
const _e = W(((e, t) => e - t)), Cs = Ft(((e, t, n, s) => ({ real: e - n, imag: t - s }))), Ds = z(se, _e, Cs), Ro = {
  kernelName: se,
  backendName: "cpu",
  kernelFunc: Ds
};
function Us(e, t) {
  const n = new Array(e.rank);
  for (let o = 0; o < n.length; o++)
    n[o] = e.shape[o] * t[o];
  const s = K(n, e.dtype);
  for (let o = 0; o < s.values.length; ++o) {
    const a = s.indexToLoc(o), r = new Array(e.rank);
    for (let l = 0; l < r.length; l++)
      r[l] = a[l] % e.shape[l];
    const i = e.locToIndex(r);
    s.values[o] = e.values[i];
  }
  return s;
}
const rt = (e, t) => {
  const n = t.value - e.value;
  return n === 0 ? e.index - t.index : n;
};
function Ve(e, t, n = 0, s = e.length - 1) {
  for (; s > n; ) {
    if (s - n > 600) {
      const i = s - n + 1, l = t - n + 1, u = Math.log(i), h = 0.5 * Math.exp(2 * u / 3), f = 0.5 * Math.sqrt(u * h * (i - h) / i) * Math.sign(l - i / 2), p = Math.max(n, Math.floor(t - l * h / i + f)), w = Math.min(s, Math.floor(t + (i - l) * h / i + f));
      Ve(e, t, p, w);
    }
    const o = e[t];
    let a = n, r = s;
    for (ot(e, n, t), rt(e[s], o) > 0 && ot(e, n, s); a < r; ) {
      for (ot(e, a, r), a++, r--; rt(e[a], o) < 0; )
        a = a + 1;
      for (; rt(e[r], o) > 0; )
        r = r - 1;
    }
    rt(e[n], o) === 0 ? ot(e, n, r) : (r = r + 1, ot(e, r, s)), r <= t && (n = r + 1), t <= r && (s = r - 1);
  }
}
function Ws(e, t, n, s, o) {
  const a = t[t.length - 1], [r, i] = [e.length / a, a], l = et(n, r * s), u = et("int32", r * s);
  for (let f = 0; f < r; f++) {
    const p = f * i, w = e.subarray(p, p + i);
    let m = new Array(w.length);
    w.forEach((b, k) => m[k] = { value: b, index: k }), s < m.length && (Ve(m, s), m = m.slice(0, s)), o && m.sort(rt);
    const F = f * s, d = l.subarray(F, F + s), g = u.subarray(F, F + s);
    for (let b = 0; b < s; b++)
      d[b] = m[b].value, g[b] = m[b].index;
  }
  const h = t.slice();
  return h[h.length - 1] = s, [
    K(h, n, l),
    K(h, "int32", u)
  ];
}
function $s(e, t, n, s) {
  const o = Qt(t, n)[0], a = [1, n[0], 1];
  for (let m = 0; m < o; m++)
    a[0] *= n[m];
  a[1] = n[o];
  for (let m = o + 1; m < n.length; m++)
    a[2] *= n[m];
  const r = /* @__PURE__ */ new Map(), i = new Int32Array(n[o]), l = new It(a, s, e), u = [], h = a[0] === 1 && a[2] === 1;
  for (let m = 0; m < n[o]; m++) {
    let F;
    if (h)
      F = e[m].toString();
    else {
      const g = [];
      for (let b = 0; b < a[0]; b++)
        for (let k = 0; k < a[2]; k++)
          g.push(l.get(b, m, k));
      F = g.join(",");
    }
    const d = r.get(F);
    if (d != null)
      i[m] = d;
    else {
      const g = r.size;
      r.set(F, g), i[m] = g, u.push(m);
    }
  }
  const f = a.slice();
  f[1] = r.size;
  const p = new It(f, s);
  u.forEach((m, F) => {
    for (let d = 0; d < a[0]; d++)
      for (let g = 0; g < a[2]; g++)
        p.set(l.get(d, m, g), d, F, g);
  });
  const w = n.slice();
  return w[o] = f[1], {
    outputValues: p.values,
    outputShape: w,
    indices: i
  };
}
const Mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  addImpl: he,
  bincountImpl: Cn,
  bincountReduceImpl: Dn,
  bitwiseAndImpl: fe,
  castImpl: ue,
  ceilImpl: ge,
  concatImpl: $n,
  equalImpl: me,
  expImpl: pe,
  expm1Impl: we,
  floorDivImpl: be,
  floorImpl: Ie,
  gatherNdImpl: Kn,
  gatherV2Impl: Hn,
  greaterEqualImpl: Ee,
  greaterImpl: xe,
  lessEqualImpl: ye,
  lessImpl: Fe,
  linSpaceImpl: ts,
  logImpl: ke,
  maxImpl: ns,
  maximumImpl: Ne,
  minimumImpl: ve,
  multiplyImpl: yt,
  negImpl: Se,
  notEqualImpl: Te,
  prodImpl: Oe,
  raggedGatherImpl: ps,
  raggedRangeImpl: ws,
  raggedTensorToTensorImpl: Is,
  rangeImpl: bs,
  rsqrtImpl: Le,
  scatterImpl: Es,
  sigmoidImpl: Fs,
  simpleAbsImpl: le,
  sliceImpl: Pe,
  sparseFillEmptyRowsImpl: Ns,
  sparseReshapeImpl: vs,
  sparseSegmentReductionImpl: Ss,
  sqrtImpl: Ts,
  squaredDifferenceImpl: Ae,
  staticRegexReplaceImpl: qe,
  stridedSliceImpl: Ls,
  stringNGramsImpl: As,
  stringSplitImpl: _s,
  stringToHashBucketFastImpl: Vs,
  subImpl: _e,
  tileImpl: Us,
  topKImpl: Ws,
  transposeImpl: Re,
  uniqueImpl: $s
}, Symbol.toStringTag, { value: "Module" }));
export {
  ho as $,
  ws as A,
  Is as B,
  bs as C,
  Es as D,
  Ns as E,
  vs as F,
  Ss as G,
  Ls as H,
  As as I,
  _s as J,
  Vs as K,
  Us as L,
  Ws as M,
  $s as N,
  zn as O,
  Qs as P,
  no as Q,
  so as R,
  eo as S,
  oo as T,
  Ys as U,
  ro as V,
  ao as W,
  io as X,
  lo as Y,
  co as Z,
  uo as _,
  nt as a,
  Js as a0,
  fo as a1,
  go as a2,
  mo as a3,
  po as a4,
  wo as a5,
  Io as a6,
  bo as a7,
  xo as a8,
  Fo as a9,
  to as aa,
  yo as ab,
  ko as ac,
  No as ad,
  vo as ae,
  So as af,
  To as ag,
  Ro as ah,
  Eo as ai,
  ys as b,
  W as c,
  Vn as d,
  z as e,
  ks as f,
  Cn as g,
  mt as h,
  Et as i,
  $n as j,
  Dn as k,
  lt as l,
  as as m,
  Ds as n,
  Kn as o,
  Hn as p,
  ts as q,
  ce as r,
  Mo as s,
  Me as t,
  de as u,
  Re as v,
  ns as w,
  Bn as x,
  ps as y,
  xt as z
};
