Struct hotg_rune_core::Shape
source · [−]pub struct Shape<'a> { /* private fields */ }
Expand description
A tensor’s shape.
Implementations
sourceimpl<'a> Shape<'a>
impl<'a> Shape<'a>
pub fn new(
element_type: ElementType,
dimensions: impl Into<Cow<'a, [usize]>>
) -> Self
pub fn element_type(&self) -> ElementType
pub fn dimensions(&self) -> &[usize]
sourcepub fn size(&self) -> Option<usize>
pub fn size(&self) -> Option<usize>
The number of bytes this tensor would take up, if it has a fized size.
pub fn to_owned(&self) -> Shape<'static>
Trait Implementations
sourceimpl<'de, 'a> Deserialize<'de> for Shape<'a>
impl<'de, 'a> Deserialize<'de> for Shape<'a>
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<'a> StructuralPartialEq for Shape<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for Shape<'a>
impl<'a> Send for Shape<'a>
impl<'a> Sync for Shape<'a>
impl<'a> Unpin for Shape<'a>
impl<'a> UnwindSafe for Shape<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more