import { o as f, q as g, n as r, E as l, ak as N, a as b, a1 as S, m as h } from "../../index-DSGwv2Yx.js";
import { v as k } from "../../scatter_nd_util-C-x73Cj6.js";
import { r as D } from "../../range-BDxO73mk.js";
import { s as v } from "../../stack-z6QE7kmP.js";
import { o as E } from "../../ones-DbVB5N58.js";
function I(a, e, s) {
  g(s);
  const n = r(a, "indices", "scatterND", "int32"), t = r(e, "updates", "scatterND");
  k(t, n, s);
  const c = { indices: n, updates: t }, o = { shape: s };
  return l.runKernel(N, c, o);
}
const K = /* @__PURE__ */ f({ scatterND_: I });
function L(a) {
  const { logits: e, labels: s, dy: n } = a.inputs, t = s.shape[0], c = e.shape[1], o = D(0, t, 1, "int32"), i = v([o, s], 1), d = E([t]), u = K(i, d, [t, c]), p = S(e, u), m = n.reshape([t, 1]);
  return h(p, m);
}
const T = {
  kernelName: "EfficientScatterSub",
  backendName: "cpu",
  kernelFunc: L
};
b(T);
