Struct SymDim
pub struct SymDim(/* private fields */);Expand description
A symbolic tensor dimension expression used to build shape-agnostic graphs.
SymDim values can be combined with basic arithmetic and later resolved
against op-local [DimExpr] expressions when shape metadata is propagated.
§Examples
use tenferro_ops::sym_dim::SymDim;
let rows = SymDim::from(3usize);
let cols = SymDim::from(4usize);
let area = rows * cols;Implementations§
§impl SymDim
impl SymDim
pub fn min(self, other: impl Into<SymDim>) -> SymDim
pub fn min(self, other: impl Into<SymDim>) -> SymDim
Return the smaller of two symbolic dimensions.
§Examples
use tenferro_ops::sym_dim::SymDim;
let clipped = SymDim::from(5usize).min(8usize);pub fn max(self, other: impl Into<SymDim>) -> SymDim
pub fn max(self, other: impl Into<SymDim>) -> SymDim
Return the larger of two symbolic dimensions.
§Examples
use tenferro_ops::sym_dim::SymDim;
let batch = SymDim::from(2usize).max(1usize);pub fn referenced_tensor_ids(&self) -> Vec<u64>
pub fn referenced_tensor_ids(&self) -> Vec<u64>
Collect the unique traced tensor IDs referenced by TensorAxis
variants inside this expression, in traversal order (first
occurrence wins).
Used by traced composition wrappers that build multi-input ops
from SymDim-valued target shapes — e.g.
TracedTensor::broadcast_in_dim_sym.
§Examples
use tenferro_ops::sym_dim::SymDim;
let lhs = SymDim::tensor_axis(7, 0);
let rhs = SymDim::tensor_axis(9, 1);
let sum = lhs + rhs;
assert_eq!(sum.referenced_tensor_ids(), vec![7, 9]);Trait Implementations§
impl Eq for SymDim
impl StructuralPartialEq for SymDim
Auto Trait Implementations§
impl Freeze for SymDim
impl RefUnwindSafe for SymDim
impl Send for SymDim
impl Sync for SymDim
impl Unpin for SymDim
impl UnsafeUnpin for SymDim
impl UnwindSafe for SymDim
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
Compare self to
key and return true if they are equal.