banhxeo.model.llm.layers.layer_norm module
- class banhxeo.model.llm.layers.layer_norm.LayerNorm(cfg: GPT2Config)[source]
Bases:
Module
- __init__(cfg: GPT2Config)[source]
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- forward(residual: Float[Tensor, 'batch seq_len d_model']) Float[Tensor, 'batch seq_len d_model'] [source]
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.