pub struct TensorSpec {
pub name: String,
pub dtype: DType,
pub shape: Option<Vec<Option<usize>>>,
}Expand description
Dense, contiguous, row-major tensor metadata.
Fields§
§name: StringInput or output name from the ONNX graph.
dtype: DTypeRequired element type.
shape: Option<Vec<Option<usize>>>None means unknown rank; Some(vec![]) is a scalar.
Within a known rank, None is a dynamic dimension and zero is an empty dimension.
Implementations§
Source§impl TensorSpec
impl TensorSpec
Sourcepub fn fixed_shape(&self) -> Option<Vec<usize>>
pub fn fixed_shape(&self) -> Option<Vec<usize>>
Concrete dimensions, or None if any dimension is dynamic.
Sourcepub fn validate(&self, tensor: &TensorView<'_>) -> Result<()>
pub fn validate(&self, tensor: &TensorView<'_>) -> Result<()>
Check a tensor’s name, element type, dimensions, and storage length.
Trait Implementations§
Source§impl Clone for TensorSpec
impl Clone for TensorSpec
Source§impl Debug for TensorSpec
impl Debug for TensorSpec
impl Eq for TensorSpec
Source§impl PartialEq for TensorSpec
impl PartialEq 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