Struct metatensor::TensorBlockRefMut
source · pub struct TensorBlockRefMut<'a> { /* private fields */ }
Expand description
Mutable reference to a TensorBlock
Implementations§
source§impl<'a> TensorBlockRefMut<'a>
impl<'a> TensorBlockRefMut<'a>
sourcepub fn as_ref(&self) -> TensorBlockRef<'_>
pub fn as_ref(&self) -> TensorBlockRef<'_>
Get a non mutable reference to this block
sourcepub fn data_mut(&mut self) -> TensorBlockDataMut<'_>
pub fn data_mut(&mut self) -> TensorBlockDataMut<'_>
Get all the data and metadata inside this TensorBlockRefMut
as a
struct with separate fields, to allow borrowing them separately.
sourcepub fn values_mut(&mut self) -> ArrayRefMut<'_>
pub fn values_mut(&mut self) -> ArrayRefMut<'_>
Get a mutable reference to the values in this block
sourcepub fn components(&self) -> Vec<Labels>
pub fn components(&self) -> Vec<Labels>
Get the components for this block
sourcepub fn properties(&self) -> Labels
pub fn properties(&self) -> Labels
Get the properties for this block
sourcepub fn gradient_mut(&mut self, parameter: &str) -> Option<TensorBlockRefMut<'_>>
pub fn gradient_mut(&mut self, parameter: &str) -> Option<TensorBlockRefMut<'_>>
Get a mutable reference to the data and metadata for the gradient with respect to the given parameter in this block, if it exists.
sourcepub fn gradients_mut(&mut self) -> GradientsMutIter<'_> ⓘ
pub fn gradients_mut(&mut self) -> GradientsMutIter<'_> ⓘ
Get an iterator over parameter/TensorBlockRefMut
pairs for all gradients
in this block
Trait Implementations§
source§impl<'a> Debug for TensorBlockRefMut<'a>
impl<'a> Debug for TensorBlockRefMut<'a>
impl<'a> Send for TensorBlockRefMut<'a>
impl<'a> Sync for TensorBlockRefMut<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for TensorBlockRefMut<'a>
impl<'a> Unpin for TensorBlockRefMut<'a>
impl<'a> !UnwindSafe for TensorBlockRefMut<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more