pub enum MetadataPrimsDescriptor {
Generate {
op: MetadataGenerateOp,
output_dtype: MetadataDType,
},
Binary {
op: MetadataBinaryOp,
lhs_dtype: MetadataDType,
rhs_dtype: MetadataDType,
output_dtype: MetadataDType,
},
Ternary {
op: MetadataTernaryOp,
cond_dtype: MetadataDType,
lhs_dtype: MetadataDType,
rhs_dtype: MetadataDType,
output_dtype: MetadataDType,
},
Reduction {
modes_a: Vec<u32>,
modes_c: Vec<u32>,
input_dtype: MetadataDType,
output_dtype: MetadataDType,
op: MetadataReductionOp,
},
}Expand description
Descriptor for metadata tensor planning.
§Examples
use tenferro_prims::{
MetadataConstantValue, MetadataDType, MetadataGenerateOp, MetadataPrimsDescriptor,
};
let desc = MetadataPrimsDescriptor::Generate {
op: MetadataGenerateOp::Constant(MetadataConstantValue::I32(3)),
output_dtype: MetadataDType::I32,
};
assert!(matches!(desc, MetadataPrimsDescriptor::Generate { .. }));Variants§
Generate
Generate a metadata tensor without consuming an input tensor.
Fields
op: MetadataGenerateOpGeneration operation to apply.
output_dtype: MetadataDTypeLogical dtype of the generated tensor.
Binary
Apply a metadata binary operation to two input tensors.
Fields
op: MetadataBinaryOpBinary operation to apply.
lhs_dtype: MetadataDTypeLogical dtype of the left-hand side operand.
rhs_dtype: MetadataDTypeLogical dtype of the right-hand side operand.
output_dtype: MetadataDTypeLogical dtype of the output tensor.
Ternary
Apply a metadata ternary operation to three input tensors.
Fields
op: MetadataTernaryOpTernary operation to apply.
cond_dtype: MetadataDTypeLogical dtype of the condition/mask input.
lhs_dtype: MetadataDTypeLogical dtype of the first data input.
rhs_dtype: MetadataDTypeLogical dtype of the second data input.
output_dtype: MetadataDTypeLogical dtype of the output tensor.
Reduction
Reduce one tensor into an output tensor over the dropped modes.
Fields
input_dtype: MetadataDTypeLogical dtype of the input tensor.
output_dtype: MetadataDTypeLogical dtype of the output tensor.
op: MetadataReductionOpReduction operator to use.
Trait Implementations§
Source§impl Clone for MetadataPrimsDescriptor
impl Clone for MetadataPrimsDescriptor
Source§fn clone(&self) -> MetadataPrimsDescriptor
fn clone(&self) -> MetadataPrimsDescriptor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MetadataPrimsDescriptor
impl Debug for MetadataPrimsDescriptor
Source§impl Hash for MetadataPrimsDescriptor
impl Hash for MetadataPrimsDescriptor
Source§impl PartialEq for MetadataPrimsDescriptor
impl PartialEq for MetadataPrimsDescriptor
impl Eq for MetadataPrimsDescriptor
impl StructuralPartialEq for MetadataPrimsDescriptor
Auto Trait Implementations§
impl Freeze for MetadataPrimsDescriptor
impl RefUnwindSafe for MetadataPrimsDescriptor
impl Send for MetadataPrimsDescriptor
impl Sync for MetadataPrimsDescriptor
impl Unpin for MetadataPrimsDescriptor
impl UnwindSafe for MetadataPrimsDescriptor
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
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>
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>
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