Struct burn_tensor::container::TensorContainer
source · pub struct TensorContainer<B: Backend, ID> { /* private fields */ }Expand description
Contains tensor of arbitrary dimension.
Implementations§
source§impl<B, ID> TensorContainer<B, ID>where
B: Backend,
ID: Hash + PartialEq + Eq,
impl<B, ID> TensorContainer<B, ID>where B: Backend, ID: Hash + PartialEq + Eq,
sourcepub fn get<const D: usize>(&self, id: &ID) -> Option<Tensor<B, D>>
pub fn get<const D: usize>(&self, id: &ID) -> Option<Tensor<B, D>>
Get a tensor with the given ID.
sourcepub fn register<const D: usize>(&mut self, id: ID, value: Tensor<B, D>)
pub fn register<const D: usize>(&mut self, id: ID, value: Tensor<B, D>)
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§
Auto Trait Implementations§
impl<B, ID> !RefUnwindSafe for TensorContainer<B, ID>
impl<B, ID> Send for TensorContainer<B, ID>where ID: Send,
impl<B, ID> Sync for TensorContainer<B, ID>where ID: Sync,
impl<B, ID> Unpin for TensorContainer<B, ID>where B: Unpin, ID: Unpin,
impl<B, ID> !UnwindSafe for TensorContainer<B, ID>
Blanket Implementations§
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.