pub struct ProgramValueMetadata { /* private fields */ }Expand description
Dtype and ordered symbolic extents of one semantic SSA value.
Implementations§
Source§impl ProgramValueMetadata
impl ProgramValueMetadata
Sourcepub fn new(dtype: DType, shape: impl IntoIterator<Item = DimExpr>) -> Self
pub fn new(dtype: DType, shape: impl IntoIterator<Item = DimExpr>) -> Self
Construct value metadata from a dtype and symbolic shape.
Sourcepub fn from_extents(
dtype: DType,
shape: impl IntoIterator<Item = ShapeExtent<DimExpr>>,
) -> Self
pub fn from_extents( dtype: DType, shape: impl IntoIterator<Item = ShapeExtent<DimExpr>>, ) -> Self
Construct metadata with explicit exact, bounded, or unknown extents.
Sourcepub fn with_scalar_identity(self, identity: &'static str) -> Self
pub fn with_scalar_identity(self, identity: &'static str) -> Self
Declare the canonical identity of an externally defined scalar.
A semantic program’s identity must be reproducible across processes, and an
externally defined tag is a process-local TypeId, so a program that carries
one has to declare the stable name. The name belongs to the contribution that
owns the scalar, and two scalars must not share one.
§Examples
use tenferro_ops::dim_expr::DimExpr;
use tenferro_runtime::program::ProgramValueMetadata;
use tenferro_tensor::DType;
let dtype = DType::External(std::any::TypeId::of::<f64>());
let declared = ProgramValueMetadata::new(dtype, [DimExpr::Const(3)])
.with_scalar_identity("example.scalar.v1");
assert_eq!(declared.scalar_identity(), Some("example.scalar.v1"));Sourcepub const fn scalar_identity(&self) -> Option<&'static str>
pub const fn scalar_identity(&self) -> Option<&'static str>
Return the declared identity of an externally defined scalar, if any.
Sourcepub fn shape(&self) -> &[ShapeExtent<DimExpr>]
pub fn shape(&self) -> &[ShapeExtent<DimExpr>]
Borrow the ordered symbolic extents without allocation.
Trait Implementations§
Source§impl Clone for ProgramValueMetadata
impl Clone for ProgramValueMetadata
Source§fn clone(&self) -> ProgramValueMetadata
fn clone(&self) -> ProgramValueMetadata
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ProgramValueMetadata
impl Debug for ProgramValueMetadata
impl Eq for ProgramValueMetadata
Source§impl Hash for ProgramValueMetadata
impl Hash for ProgramValueMetadata
Source§impl PartialEq for ProgramValueMetadata
impl PartialEq for ProgramValueMetadata
impl StructuralPartialEq for ProgramValueMetadata
Auto Trait Implementations§
impl Freeze for ProgramValueMetadata
impl RefUnwindSafe for ProgramValueMetadata
impl Send for ProgramValueMetadata
impl Sync for ProgramValueMetadata
impl Unpin for ProgramValueMetadata
impl UnsafeUnpin for ProgramValueMetadata
impl UnwindSafe for ProgramValueMetadata
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