Initializes the model.
(self, *args, model_mode: str = MODEL_MODE_TRAIN, **kwargs)
| 268 | """Transformer model as a linen module.""" |
| 269 | |
| 270 | def init(self, *args, model_mode: str = MODEL_MODE_TRAIN, **kwargs): |
| 271 | """Initializes the model.""" |
| 272 | model_kwargs = self.kwargs.copy({"model_mode": model_mode}) # type: ignore[wrong-arg-types] |
| 273 | module = self.clone(kwargs=model_kwargs) |
| 274 | kwargs["model_mode"] = model_mode |
| 275 | return nnx_wrappers.ToLinen.init(module, *args, **kwargs) |
| 276 | |
| 277 | def apply(self, *args, model_mode: str = MODEL_MODE_TRAIN, **kwargs): |
| 278 | """Applies the model.""" |
no test coverage detected