import { t as i } from "../index-DSGwv2Yx.js";
import e from "./BaseLayer.js";
import { normRMS as m } from "../ops/normRMS.js";
import { v as a } from "../variable-SSATClyt.js";
import { o as M } from "../ones-DbVB5N58.js";
class l extends e {
  GAMMA;
  rmsConfig;
  constructor(r, t, s = "", o) {
    super(r, o), this.GAMMA = s, this.rmsConfig = t, (this.rmsConfig.useGamma ?? !0) && this.addVariable(this.GAMMA, a(M([r.nEmbed]), !0, this.GAMMA, "float32"));
  }
  forward(r, t) {
    return i(() => {
      this.startMemory();
      const s = m(t, this.rmsConfig.useGamma ?? !0 ? this.getVariable(this.GAMMA) : void 0);
      return this.endMemory("RMSNorm"), s;
    });
  }
}
export {
  l as default
};
