import { a as p } from "../../index-DSGwv2Yx.js";
import { s as b } from "../../stack-z6QE7kmP.js";
function f(t) {
  const { moments: n, gradient: c } = t.inputs, { beta1: o, beta2: a } = t.attrs, e = n.shape.length, m = new Array(e).fill(0), s = n.shape.slice();
  s[e - 1] = 1;
  const i = m.slice();
  i[e - 1] = 1;
  const r = s.slice(), l = n.slice(m, s).squeeze([e - 1]), u = n.slice(i, r).squeeze([e - 1]), M = l.mul(o).add(c.mul(1 - o)), d = u.mul(a).add(c.square().mul(1 - a));
  return b([M, d], -1);
}
const g = {
  kernelName: "AdamMoments",
  backendName: "cpu",
  kernelFunc: f
};
p(g);
