(self)
| 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) |
nothing calls this directly
no outgoing calls
no test coverage detected