MCPcopy Create free account
hub / github.com/OpenSparseLLMs/Linear-MoE / forward

Method forward

linear_moe/model/common_modules/l2norm.py:175–185  ·  view source on GitHub ↗
(
        ctx,
        x,
        eps=1e-6,
    )

Source from the content-addressed store, hash-verified

173
174 @staticmethod
175 def forward(
176 ctx,
177 x,
178 eps=1e-6,
179 ):
180 # reshape input data into 2D tensor
181 y = _l2_norm_fwd(x, eps)
182 ctx.eps = eps
183 ctx.x_dtype = x.dtype
184 ctx.save_for_backward(x)
185 return y
186
187 @staticmethod
188 def backward(ctx, dy, *args):

Callers

nothing calls this directly

Calls 1

_l2_norm_fwdFunction · 0.85

Tested by

no test coverage detected