import { o as c, n as e, _ as d, E as u, aL as b, aM as E, aN as _, aO as g, ah as S, a1 as w, h as K, aP as q, z as M, aQ as T } from "./index-DSGwv2Yx.js";
import { b as h } from "./broadcast_to-C_EJTVTZ.js";
import { e as N } from "./axis_util-QWWgLjut.js";
import { r as f } from "./reshape-BIN71H3p.js";
import { s as A } from "./sum-D39FeU5h.js";
function B(s, o, n) {
  const a = e(o, "a", "where"), t = e(n, "b", "where"), r = e(s, "condition", "where", "bool"), p = d(d(r.shape, a.shape), t.shape), l = h(r, p), m = h(a, p), x = h(t, p), i = {
    condition: l,
    t: m,
    e: x
  };
  return u.runKernel(b, i);
}
const H = /* @__PURE__ */ c({ where_: B });
function G(s, o = null, n = !1) {
  const t = { x: e(s, "x", "max") }, r = { reductionIndices: o, keepDims: n };
  return u.runKernel(E, t, r);
}
const I = /* @__PURE__ */ c({ max_: G });
function L(s) {
  const n = { x: e(s, "x", "exp") };
  return u.runKernel(_, n);
}
const P = /* @__PURE__ */ c({ exp_: L });
function k(s) {
  const n = { x: e(s, "x", "log", "float32") };
  return u.runKernel(g, n);
}
const v = /* @__PURE__ */ c({ log_: k });
function y(s, o = null, n = !1) {
  const a = e(s, "x", "logSumExp"), t = S(o, a.shape), r = I(
    a,
    t,
    !0
    /* keepDims */
  ), p = w(a, r), l = P(p), m = A(l, t), x = v(m), i = K(f(r, x.shape), x);
  if (n) {
    const $ = N(i.shape, t);
    return f(i, $);
  }
  return i;
}
const J = /* @__PURE__ */ c({ logSumExp_: y });
function z(s, o = null, n = !1) {
  const t = { x: e(s, "x", "mean") }, r = { axis: o, keepDims: n };
  return u.runKernel(q, t, r);
}
const R = /* @__PURE__ */ c({ mean_: z });
function C(s, o) {
  let n = e(s, "a", "notEqual", "string_or_numeric"), a = e(o, "b", "notEqual", "string_or_numeric");
  [n, a] = M(n, a), d(n.shape, a.shape);
  const t = { a: n, b: a };
  return u.runKernel(T, t);
}
const U = /* @__PURE__ */ c({ notEqual_: C });
export {
  R as a,
  v as b,
  P as e,
  J as l,
  I as m,
  U as n,
  H as w
};
