MCPcopy Create free account
hub / github.com/pytorch/examples / __init__

Method __init__

distributed/tensor_parallelism/llama2_model.py:129–132  ·  view source on GitHub ↗
(self, dim: int, eps: float = 1e-6)

Source from the content-addressed store, hash-verified

127 """
128
129 def __init__(self, dim: int, eps: float = 1e-6):
130 super().__init__()
131 self.eps = eps
132 self.weight = nn.Parameter(torch.ones(dim))
133
134 def _norm(self, x: torch.Tensor):
135 return x * torch.rsqrt(x.pow(2).mean(-1, keepdim=True) + self.eps)

Callers 4

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected