pub struct ExpressionNode {
pub id: NodeId,
pub operation: OperationType,
pub inputs: Vec<NodeId>,
pub output_shape: Option<Vec<usize>>,
pub device: DeviceType,
pub memory_usage: Option<usize>,
pub compute_cost: Option<f32>,
pub can_compute_inplace: bool,
pub metadata: HashMap<String, String>,
}Expand description
Node in the expression graph representing a tensor operation
Fields§
§id: NodeIdUnique identifier for this node
operation: OperationTypeType of operation this node represents
inputs: Vec<NodeId>Input node IDs (operands)
output_shape: Option<Vec<usize>>Output shape (if known)
device: DeviceTypeDevice where this operation should be executed
memory_usage: Option<usize>Estimated memory usage in bytes
compute_cost: Option<f32>Estimated computation cost (relative units)
can_compute_inplace: boolWhether this node can be computed in-place
metadata: HashMap<String, String>Metadata for optimization decisions
Implementations§
Source§impl ExpressionNode
impl ExpressionNode
Sourcepub fn new(id: NodeId, operation: OperationType) -> Self
pub fn new(id: NodeId, operation: OperationType) -> Self
Create a new expression node
Sourcepub fn set_output_shape(&mut self, shape: Vec<usize>)
pub fn set_output_shape(&mut self, shape: Vec<usize>)
Set the output shape for this node
Sourcepub fn is_fusable_with(&self, other: &ExpressionNode) -> bool
pub fn is_fusable_with(&self, other: &ExpressionNode) -> bool
Check if this node is fusable with another operation
Trait Implementations§
Source§impl Clone for ExpressionNode
impl Clone for ExpressionNode
Source§fn clone(&self) -> ExpressionNode
fn clone(&self) -> ExpressionNode
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 moreAuto Trait Implementations§
impl Freeze for ExpressionNode
impl RefUnwindSafe for ExpressionNode
impl Send for ExpressionNode
impl Sync for ExpressionNode
impl Unpin for ExpressionNode
impl UnwindSafe for ExpressionNode
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,
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