pub enum OperationIr {
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),
}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.
Implementations§
Source§impl OperationIr
impl OperationIr
Sourcepub fn inputs(&self) -> impl Iterator<Item = &TensorIr>
pub fn inputs(&self) -> impl Iterator<Item = &TensorIr>
Get all input tensors involved with the current operation.
Sourcepub fn outputs(&self) -> impl Iterator<Item = &TensorIr>
pub fn outputs(&self) -> impl Iterator<Item = &TensorIr>
Get all output tensors involved with the current operation.
Sourcepub 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.
Trait Implementations§
Source§impl Clone for OperationIr
impl Clone for OperationIr
Source§fn clone(&self) -> OperationIr
fn clone(&self) -> OperationIr
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 OperationIr
impl Debug for OperationIr
Source§impl<'de> Deserialize<'de> for OperationIr
impl<'de> Deserialize<'de> for OperationIr
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for OperationIr
impl Hash for OperationIr
Source§impl PartialEq for OperationIr
impl PartialEq for OperationIr
Source§impl Serialize for OperationIr
impl Serialize for OperationIr
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 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
Mutably borrows from an owned value. Read more