mlx_rs::module

Trait Parameter

Source
pub trait Parameter {
    // Required methods
    fn freeze(&mut self, recursive: bool);
    fn unfreeze(&mut self, recursive: bool);
    fn is_frozen(&self) -> Option<bool>;
    fn as_nested_value(&self) -> NestedValue<Rc<str>, &Array>;
    fn as_nested_value_mut(&mut self) -> NestedValue<Rc<str>, &mut Array>;
    fn as_trainable_nested_value(&self) -> Option<NestedValue<Rc<str>, &Array>>;
}
Expand description

Trait for a module parameter.

Required Methods§

Source

fn freeze(&mut self, recursive: bool)

Freeze the parameter.

Source

fn unfreeze(&mut self, recursive: bool)

Unfreeze the parameter.

Source

fn is_frozen(&self) -> Option<bool>

Check if the parameter is frozen. Returns None if the parameter is a module that has no parameters.

Source

fn as_nested_value(&self) -> NestedValue<Rc<str>, &Array>

Get the parameter as a nested value.

Source

fn as_nested_value_mut(&mut self) -> NestedValue<Rc<str>, &mut Array>

Get the parameter as a mutable nested value.

Source

fn as_trainable_nested_value(&self) -> Option<NestedValue<Rc<str>, &Array>>

Get the parameter as a nested value if it is trainable.

Implementors§