import { a as i } from "../../index-DSGwv2Yx.js";
class u {
  variableNames = ["labels", "softmaxProbs", "dy"];
  outputShape;
  userCode;
  constructor(e, t) {
    this.outputShape = [e, t], this.userCode = `
            void main() {
                ivec2 coords = getOutputCoords();
                int index = int(getLabels(coords.x));
                float prob = getSoftmaxProbsAtOutCoords();
                float dy = getDy(coords.x);
                setOutput((index == coords.y ? prob - 1.0 : prob) * dy);
            }
            `;
  }
}
function d(o) {
  const { logits: e, labels: t, dy: r } = o.inputs, s = o.backend, a = t.shape[0], n = e.shape[1], c = new u(a, n);
  return s.runWebGLProgram(c, [t, e, r], "float32");
}
const b = {
  kernelName: "EfficientScatterSub",
  backendName: "webgl",
  kernelFunc: d
};
i(b);
