pub struct TensorSpec {
pub uid: i64,
pub dtype: DtypeTag,
pub dims: Vec<i64>,
pub strides: Vec<i64>,
pub alignment: i64,
pub is_virtual: bool,
}Expand description
One tensor in a backend graph: unique id, dtype, dims, strides, alignment.
Fields§
§uid: i64§dtype: DtypeTag§dims: Vec<i64>§strides: Vec<i64>§alignment: i64Byte alignment of the data pointer. cuDNN requires ≥ 4.
is_virtual: boolWhether the tensor is virtual (intermediate result, no device-pointer binding required).
Implementations§
Source§impl TensorSpec
impl TensorSpec
Sourcepub fn new(
uid: i64,
dtype: DtypeTag,
dims: Vec<i64>,
layout: TensorLayout,
) -> Self
pub fn new( uid: i64, dtype: DtypeTag, dims: Vec<i64>, layout: TensorLayout, ) -> Self
Build a TensorSpec for dims under layout. For Strided
the caller must call with_strides afterwards.
pub fn with_strides(self, strides: Vec<i64>) -> Self
pub fn with_alignment(self, alignment: i64) -> Self
pub fn virtualized(self) -> Self
pub fn rank(&self) -> usize
Trait Implementations§
Source§impl Clone for TensorSpec
impl Clone for TensorSpec
Source§fn clone(&self) -> TensorSpec
fn clone(&self) -> TensorSpec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TensorSpec
impl Debug for TensorSpec
Source§impl Hash for TensorSpec
impl Hash for TensorSpec
Source§impl PartialEq for TensorSpec
impl PartialEq for TensorSpec
impl Eq for TensorSpec
impl StructuralPartialEq for TensorSpec
Auto Trait Implementations§
impl Freeze for TensorSpec
impl RefUnwindSafe for TensorSpec
impl Send for TensorSpec
impl Sync for TensorSpec
impl Unpin for TensorSpec
impl UnsafeUnpin for TensorSpec
impl UnwindSafe for TensorSpec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more