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§
Source§impl SymDim
impl SymDim
Sourcepub fn min(self, other: impl Into<SymDim>) -> Self
pub fn min(self, other: impl Into<SymDim>) -> Self
Return the smaller of two symbolic dimensions.
§Examples
use tenferro_ops::sym_dim::SymDim;
let clipped = SymDim::from(5usize).min(8usize);Sourcepub fn max(self, other: impl Into<SymDim>) -> Self
pub fn max(self, other: impl Into<SymDim>) -> Self
Return the larger of two symbolic dimensions.
§Examples
use tenferro_ops::sym_dim::SymDim;
let batch = SymDim::from(2usize).max(1usize);Sourcepub 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