mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-16 01:49:05 +08:00
Compile with capture (#629)
* Simple kernel generation * Remove the generate kernel from graph_utils * fix multi-output with compile * fuse with stopgrad * v1 input, output capture in compile * cleanup tree update with visitor update * nit * remove todo * state for model, optional explicit init and more pure optimizer steps * move learning rate to state * add lr to opt state, some fixes in capture * fix optim * update tuple of containers as well * fix stream for compiled output * rng state for compile * nit * updates and comments --------- Co-authored-by: Angelos Katharopoulos <a_katharopoulos@apple.com>
This commit is contained in:
@@ -66,6 +66,19 @@ class Module(dict):
|
||||
"""Boolean indicating if the model is in training mode."""
|
||||
return self._training
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
"""The module's state dictionary
|
||||
|
||||
The module's state dictionary contains any attribute set on the
|
||||
module including parameters in :meth:`Module.parameters`
|
||||
|
||||
Unlike :meth:`Module.parameters`, the :attr:`Module.state` property is
|
||||
a reference to the module's state. Updates to it will be reflected in
|
||||
the original module.
|
||||
"""
|
||||
return self
|
||||
|
||||
def _extra_repr(self):
|
||||
return ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user