import { t as d } from "../index-DSGwv2Yx.js";
function l(m, t, s) {
  return d(() => {
    const r = m.reshape([-1]), o = t.reshape([-1]), e = r.mul(r).sum().add(s), c = r.mul(o).sum().div(e), n = o.sub(r.mul(c)), a = o.norm(), u = n.norm().add(s);
    return n.mul(a.div(u)).reshape(t.shape);
  });
}
export {
  l as orthogonalizeGradient
};
