pub struct TensorDescriptor { /* private fields */ }Expand description
Extents and element strides, relative to the start of a tensor’s buffer view.
Implementations§
Source§impl TensorDescriptor
impl TensorDescriptor
pub fn new(extents: &[usize], strides: &[usize], dtype: DType) -> Result<Self>
Sourcepub fn contiguous(extents: &[usize], dtype: DType) -> Result<Self>
pub fn contiguous(extents: &[usize], dtype: DType) -> Result<Self>
Packed row-major layout; an empty extent list denotes a scalar.
pub fn from_tensor<R: Runtime>(tensor: &RudaTensor<R>) -> Result<Self>
pub fn extents(&self) -> &[usize]
pub fn strides(&self) -> &[usize]
pub fn dtype(&self) -> DType
pub fn rank(&self) -> usize
pub fn num_elements(&self) -> usize
pub fn storage_bytes(&self) -> usize
Sourcepub fn is_nonoverlapping(&self) -> bool
pub fn is_nonoverlapping(&self) -> bool
Whether the axes form a writable, non-overlapping strided layout.
Trait Implementations§
Source§impl Clone for TensorDescriptor
impl Clone for TensorDescriptor
Source§impl Debug for TensorDescriptor
impl Debug for TensorDescriptor
impl Eq for TensorDescriptor
Source§impl PartialEq for TensorDescriptor
impl PartialEq for TensorDescriptor
impl StructuralPartialEq for TensorDescriptor
Auto Trait Implementations§
impl Freeze for TensorDescriptor
impl RefUnwindSafe for TensorDescriptor
impl Send for TensorDescriptor
impl Sync for TensorDescriptor
impl Unpin for TensorDescriptor
impl UnsafeUnpin for TensorDescriptor
impl UnwindSafe for TensorDescriptor
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<C> CloneExpand for Cwhere
C: Clone,
impl<C> CloneExpand for Cwhere
C: Clone,
fn __expand_clone_method(&self, _scope: &mut Scope) -> C
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.