MCPcopy Create free account
hub / github.com/LargeWorldModel/LWM / setup

Method setup

lwm/llama.py:326–332  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

324 param_dtype: jnp.dtype=jnp.float32
325
326 def setup(self) -> None:
327 self.weight = self.param(
328 'kernel',
329 nn.initializers.ones,
330 (self.dim,),
331 self.param_dtype,
332 )
333
334 def _norm(self, x: jnp.ndarray) -> jnp.ndarray:
335 return x * jax.lax.rsqrt(jnp.square(x).mean(-1, keepdims=True) + self.eps)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected