import { t as i, e as n } from "../index-DSGwv2Yx.js";
import { z as l } from "../zeros-Bw0puq_w.js";
function c(e, r, o = 1) {
  return i(() => {
    const t = l([e.length], "int32");
    return e.map(
      (p, u) => n().runKernel("Norm2", { x: p, output: t }, { invLossScaling: r, index: u })
    ), n().runKernel("ClipScale", { x: t }, { invLossScaling: r, clipNorm: o });
  });
}
export {
  c as clipScale
};
