pub enum MetadataConstantValue {
I32(i32),
Bool(bool),
}Expand description
Constant payload for metadata tensor generation.
§Examples
use tenferro_prims::{MetadataConstantValue, MetadataDType};
let int_value = MetadataConstantValue::I32(7);
let bool_value = MetadataConstantValue::Bool(true);
assert_eq!(int_value.dtype(), MetadataDType::I32);
assert_eq!(bool_value.dtype(), MetadataDType::Bool);Variants§
Implementations§
Source§impl MetadataConstantValue
impl MetadataConstantValue
Sourcepub const fn dtype(self) -> MetadataDType
pub const fn dtype(self) -> MetadataDType
Return the logical dtype carried by this constant payload.
§Examples
use tenferro_prims::{MetadataConstantValue, MetadataDType};
assert_eq!(MetadataConstantValue::I32(-3).dtype(), MetadataDType::I32);
assert_eq!(MetadataConstantValue::Bool(false).dtype(), MetadataDType::Bool);Trait Implementations§
Source§impl Clone for MetadataConstantValue
impl Clone for MetadataConstantValue
Source§fn clone(&self) -> MetadataConstantValue
fn clone(&self) -> MetadataConstantValue
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 moreSource§impl Debug for MetadataConstantValue
impl Debug for MetadataConstantValue
Source§impl Hash for MetadataConstantValue
impl Hash for MetadataConstantValue
Source§impl PartialEq for MetadataConstantValue
impl PartialEq for MetadataConstantValue
impl Copy for MetadataConstantValue
impl Eq for MetadataConstantValue
impl StructuralPartialEq for MetadataConstantValue
Auto Trait Implementations§
impl Freeze for MetadataConstantValue
impl RefUnwindSafe for MetadataConstantValue
impl Send for MetadataConstantValue
impl Sync for MetadataConstantValue
impl Unpin for MetadataConstantValue
impl UnwindSafe for MetadataConstantValue
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<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
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