import { a as e, t as m } from "../../index-DSGwv2Yx.js";
import { g as M, d as i } from "../../gelu-DpTCC3eB.js";
import { m as k } from "../../mat_mul-DP86qZtZ.js";
function c(t) {
  const { inputs: a } = t, { x: n, kernel: r } = a, u = n, l = r;
  return m(() => {
    const o = k(u, l);
    return M(o);
  });
}
const G = {
  kernelName: "MatMulGelu",
  backendName: "cpu",
  kernelFunc: c
};
e(G);
const f = {
  kernelName: "MatMulGelu",
  backendName: "tensorflow",
  kernelFunc: c
};
e(f);
const p = {
  kernelName: "MatMulGelu",
  backendName: "webgpu",
  kernelFunc: c
};
e(p);
function s(t) {
  const { dy: a, x: n, kernel: r } = t.inputs;
  return m(() => {
    const u = k(n, r), l = i(a, u), o = l.matMul(r.transpose()), d = n.transpose().matMul(l);
    return [o, d];
  });
}
const g = {
  kernelName: "MatMulGeluGrad",
  backendName: "cpu",
  kernelFunc: s
};
e(g);
const N = {
  kernelName: "MatMulGeluGrad",
  backendName: "tensorflow",
  kernelFunc: s
};
e(N);
const b = {
  kernelName: "MatMulGeluGrad",
  backendName: "webgpu",
  kernelFunc: s
};
e(b);
