MCPcopy Create free account
hub / github.com/AI-Hypercomputer/maxtext / init

Method init

src/MaxText/layers/models.py:270–275  ·  view source on GitHub ↗

Initializes the model.

(self, *args, model_mode: str = MODEL_MODE_TRAIN, **kwargs)

Source from the content-addressed store, hash-verified

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."""

Callers 2

initMethod · 0.45
get_weight_shardingMethod · 0.45

Calls 1

copyMethod · 0.80

Tested by

no test coverage detected