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§
Sourcefn is_frozen(&self) -> Option<bool>
fn is_frozen(&self) -> Option<bool>
Check if the parameter is frozen. Returns None
if the parameter is a module that has no
parameters.
Sourcefn as_nested_value(&self) -> NestedValue<Rc<str>, &Array>
fn as_nested_value(&self) -> NestedValue<Rc<str>, &Array>
Get the parameter as a nested value.
Sourcefn as_nested_value_mut(&mut self) -> NestedValue<Rc<str>, &mut Array>
fn as_nested_value_mut(&mut self) -> NestedValue<Rc<str>, &mut Array>
Get the parameter as a mutable nested value.
Sourcefn as_trainable_nested_value(&self) -> Option<NestedValue<Rc<str>, &Array>>
fn as_trainable_nested_value(&self) -> Option<NestedValue<Rc<str>, &Array>>
Get the parameter as a nested value if it is trainable.