pub struct Node {
pub name: String,
pub op_type: String,
pub inputs: Vec<String>,
pub outputs: Vec<String>,
pub attributes: HashMap<String, String>,
}Expand description
A node in the computational graph
Fields§
§name: StringUnique identifier for the node
op_type: StringType of operation this node performs
inputs: Vec<String>Input tensor names
outputs: Vec<String>Output tensor names
attributes: HashMap<String, String>Node attributes (parameters)
Implementations§
Source§impl Node
impl Node
Sourcepub fn new(
name: String,
op_type: String,
inputs: Vec<String>,
outputs: Vec<String>,
) -> Self
pub fn new( name: String, op_type: String, inputs: Vec<String>, outputs: Vec<String>, ) -> Self
Create a new node
Sourcepub fn add_attribute<K: Into<String>, V: Into<String>>(
&mut self,
key: K,
value: V,
)
pub fn add_attribute<K: Into<String>, V: Into<String>>( &mut self, key: K, value: V, )
Add an attribute to the node
Sourcepub fn get_operator_type(&self) -> Result<OperatorType>
pub fn get_operator_type(&self) -> Result<OperatorType>
Get the operator type as enum
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Node
impl<'de> Deserialize<'de> for Node
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
Auto Trait Implementations§
impl Freeze for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnwindSafe for Node
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