Enum OperationIr
pub enum OperationIr {
Show 14 variants
BaseFloat(BaseOperationIr),
BaseInt(BaseOperationIr),
BaseBool(BaseOperationIr),
NumericFloat(DType, NumericOperationIr),
NumericInt(DType, NumericOperationIr),
Bool(BoolOperationIr),
Int(IntOperationIr),
Float(DType, FloatOperationIr),
Module(ModuleOperationIr),
Init(InitOperationIr),
Custom(CustomOpIr),
Drop(TensorIr),
Distributed(DistributedOperationIr),
Activation(ActivationOperationIr),
}Expand description
Describe all tensor operations possible.
Variants§
BaseFloat(BaseOperationIr)
Basic operation on a float tensor.
BaseInt(BaseOperationIr)
Basic operation on an int tensor.
BaseBool(BaseOperationIr)
Basic operation on a bool tensor.
NumericFloat(DType, NumericOperationIr)
Numeric operation on a float tensor.
NumericInt(DType, NumericOperationIr)
Numeric operation on an int tensor.
Bool(BoolOperationIr)
Operation specific to a bool tensor.
Int(IntOperationIr)
Operation specific to an int tensor.
Float(DType, FloatOperationIr)
Operation specific to a float tensor.
Module(ModuleOperationIr)
Module operation.
Init(InitOperationIr)
Initialize operation.
Custom(CustomOpIr)
A custom operation.
Drop(TensorIr)
A tensor is dropped.
Distributed(DistributedOperationIr)
Operation specific to a distributed tensor.
Activation(ActivationOperationIr)
Activation function operation (relu, gelu, sigmoid, softmax, …).
Implementations§
§impl OperationIr
impl OperationIr
pub fn inputs(&self) -> impl Iterator<Item = &TensorIr>
pub fn inputs(&self) -> impl Iterator<Item = &TensorIr>
Get all input tensors involved with the current operation.
pub fn outputs(&self) -> impl Iterator<Item = &TensorIr>
pub fn outputs(&self) -> impl Iterator<Item = &TensorIr>
Get all output tensors involved with the current operation.
pub fn mark_read_only(&mut self, nodes: &[TensorId]) -> Vec<TensorIr>
pub fn mark_read_only(&mut self, nodes: &[TensorId]) -> Vec<TensorIr>
Set the given nodes that are read write to read only in the current operation.
Returns the tensor that were updated with their original representation.
pub fn visit_mut(&mut self, v: &mut impl IrVisitorMut)
pub fn visit_mut(&mut self, v: &mut impl IrVisitorMut)
Trait Implementations§
§impl Clone for OperationIr
impl Clone for OperationIr
§fn clone(&self) -> OperationIr
fn clone(&self) -> OperationIr
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for OperationIr
impl Debug for OperationIr
§impl<'de> Deserialize<'de> for OperationIr
impl<'de> Deserialize<'de> for OperationIr
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<OperationIr, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<OperationIr, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Hash for OperationIr
impl Hash for OperationIr
§impl PartialEq for OperationIr
impl PartialEq for OperationIr
§impl Serialize for OperationIr
impl Serialize for OperationIr
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for OperationIr
Auto Trait Implementations§
impl Freeze for OperationIr
impl RefUnwindSafe for OperationIr
impl Send for OperationIr
impl Sync for OperationIr
impl Unpin for OperationIr
impl UnsafeUnpin for OperationIr
impl UnwindSafe for OperationIr
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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