import { c as m } from "../../index-DSGwv2Yx.js";
import { m as o } from "../../matMul16-BIT70Vya.js";
import { transpose16 as c } from "../transpose16.js";
const l = {
  kernelName: "AttentionMask",
  inputsToSave: ["q", "k"],
  outputsToSave: [],
  gradFunc: (r, s, n) => {
    if (Array.isArray(r))
      throw new Error("Expected dy to be a single Tensor");
    const [a, i] = s, { divisor: e } = n;
    return {
      q: () => o(r, i, e),
      k: () => {
        const t = o(a, r, e, !0, !1), u = c(t, [0, 1, 3, 2]);
        return t.dispose(), u;
      }
    };
  }
};
m(l);
