Struct burn_tensor::container::TensorContainer
source · pub struct TensorContainer<ID> { /* private fields */ }Expand description
Contains tensor of arbitrary dimension.
Implementations§
source§impl<ID> TensorContainer<ID>where
ID: Hash + PartialEq + Eq + Debug,
impl<ID> TensorContainer<ID>where ID: Hash + PartialEq + Eq + Debug,
sourcepub fn get<B, const D: usize>(&self, id: &ID) -> Option<Tensor<B, D>>where
B: Backend,
pub fn get<B, const D: usize>(&self, id: &ID) -> Option<Tensor<B, D>>where B: Backend,
Get a tensor with the given ID.
sourcepub fn register<B, const D: usize>(&mut self, id: ID, value: Tensor<B, D>)where
B: Backend,
pub fn register<B, const D: usize>(&mut self, id: ID, value: Tensor<B, D>)where B: Backend,
Register a new tensor for the given ID.
Notes
If a tensor is already registered for the given ID, it will be replaced.
Trait Implementations§
source§impl<ID: Debug> Debug for TensorContainer<ID>
impl<ID: Debug> Debug for TensorContainer<ID>
Auto Trait Implementations§
impl<ID> !RefUnwindSafe for TensorContainer<ID>
impl<ID> Send for TensorContainer<ID>where ID: Send,
impl<ID> Sync for TensorContainer<ID>where ID: Sync,
impl<ID> Unpin for TensorContainer<ID>where ID: Unpin,
impl<ID> !UnwindSafe for TensorContainer<ID>
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