Struct hotg_runecoral::Tensor
source · [−]pub struct Tensor<'a> {
pub element_type: ElementType,
pub buffer: &'a [u8],
pub shape: Cow<'a, [c_int]>,
}
Expand description
An immutable reference to a tensor’s backing buffer.
Fields
element_type: ElementType
buffer: &'a [u8]
shape: Cow<'a, [c_int]>
Implementations
sourceimpl<'a> Tensor<'a>
impl<'a> Tensor<'a>
sourcepub fn from_slice<E: TensorElement>(
slice: &'a [E],
dimensions: &[usize]
) -> Self
pub fn from_slice<E: TensorElement>(
slice: &'a [E],
dimensions: &[usize]
) -> Self
Create a new Tensor
backed by a slice.
sourcepub fn descriptor(&self) -> TensorDescriptor<'_>
pub fn descriptor(&self) -> TensorDescriptor<'_>
Get a TensorDescriptor
that describes this tensor.
Trait Implementations
impl<'a> StructuralPartialEq for Tensor<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for Tensor<'a>
impl<'a> Send for Tensor<'a>
impl<'a> Sync for Tensor<'a>
impl<'a> Unpin for Tensor<'a>
impl<'a> UnwindSafe for Tensor<'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