pub struct TensorMetadata {
pub name: String,
pub shape: Vec<usize>,
pub dtype: Option<DType>,
pub numel: usize,
pub size_bytes: usize,
pub is_contiguous: bool,
pub values: Option<Vec<f64>>,
}Expand description
Input/output metadata for traced operations
Fields§
§name: StringTensor name/identifier
shape: Vec<usize>Tensor shape
dtype: Option<DType>Data type
numel: usizeTotal number of elements
size_bytes: usizeSize in bytes
is_contiguous: boolWhether the tensor is contiguous
values: Option<Vec<f64>>Captured values (if enabled)
Implementations§
Source§impl TensorMetadata
impl TensorMetadata
Sourcepub fn with_dtype(self, dtype: DType) -> Self
pub fn with_dtype(self, dtype: DType) -> Self
Set data type
Sourcepub fn with_contiguous(self, is_contiguous: bool) -> Self
pub fn with_contiguous(self, is_contiguous: bool) -> Self
Set contiguity
Sourcepub fn with_values(self, values: Vec<f64>) -> Self
pub fn with_values(self, values: Vec<f64>) -> Self
Set captured values
Trait Implementations§
Source§impl Clone for TensorMetadata
impl Clone for TensorMetadata
Source§fn clone(&self) -> TensorMetadata
fn clone(&self) -> TensorMetadata
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 moreAuto Trait Implementations§
impl Freeze for TensorMetadata
impl RefUnwindSafe for TensorMetadata
impl Send for TensorMetadata
impl Sync for TensorMetadata
impl Unpin for TensorMetadata
impl UnsafeUnpin for TensorMetadata
impl UnwindSafe for TensorMetadata
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,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more