pub struct NodeProto {
pub input: Vec<String>,
pub output: Vec<String>,
pub name: String,
pub op_type: String,
pub domain: String,
pub attribute: Vec<AttributeProto>,
pub doc_string: String,
}
Expand description
Nodes
Computation graphs are made up of a DAG of nodes, which represent what is commonly called a “layer” or “pipeline stage” in machine learning frameworks.
For example, it can be a node of type “Conv” that takes in an image, a filter tensor and a bias tensor, and produces the convolved output.
Fields§
§input: Vec<String>
namespace Value
output: Vec<String>
namespace Value
name: String
An optional identifier for this node in a graph. This field MAY be absent in ths version of the IR.
namespace Node
op_type: String
The symbolic identifier of the Operator to execute.
namespace Operator
domain: String
The domain of the OperatorSet that specifies the operator named by op_type.
namespace Domain
attribute: Vec<AttributeProto>
Additional named attributes.
doc_string: String
A human-readable documentation for this node. Markdown is allowed.
Implementations§
Source§impl NodeProto
impl NodeProto
pub fn bail<T>(&self, msg: &str) -> TractResult<T>
pub fn bail_attr<T>(&self, attr: &str, msg: &str) -> TractResult<T>
pub fn expect<R: Reason>(&self, cond: bool, what: R) -> TractResult<()>
pub fn expect_attr<R: Reason>( &self, attr: &str, cond: bool, what: R, ) -> TractResult<()>
pub fn expect_ok_or_else<T, R: Reason>( &self, result: Option<T>, what: R, ) -> TractResult<T>
pub fn get_attr_opt<'a, T>(&'a self, name: &str) -> TractResult<Option<T>>where
T: AttrScalarType<'a>,
pub fn get_attr<'a, T>(&'a self, name: &str) -> TractResult<T>where
T: AttrScalarType<'a>,
pub fn check_value<T, V: Debug>( &self, attr: &str, value: Result<T, V>, ) -> TractResult<T>
pub fn get_attr_opt_slice<'a, T>(
&'a self,
name: &str,
) -> TractResult<Option<&'a [T]>>where
T: AttrSliceType<'a>,
pub fn get_attr_slice<'a, T>(&'a self, name: &str) -> TractResult<&'a [T]>where
T: AttrSliceType<'a>,
pub fn get_attr_opt_tvec<'a, T>(
&'a self,
name: &str,
) -> TractResult<Option<TVec<T>>>where
T: AttrTVecType<'a>,
pub fn get_attr_tvec<'a, T>(&'a self, name: &str) -> TractResult<TVec<T>>where
T: AttrTVecType<'a>,
pub fn get_attr_opt_vec<'a, T>(
&'a self,
name: &str,
) -> TractResult<Option<Vec<T>>>where
T: AttrTVecType<'a>,
pub fn get_attr_vec<'a, T>(&'a self, name: &str) -> TractResult<Vec<T>>where
T: AttrTVecType<'a>,
Trait Implementations§
Source§impl Message for NodeProto
impl Message for NodeProto
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
Decodes an instance of the message from a buffer, and merges it into
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
Decodes a length-delimited instance of the message from buffer, and
merges it into
self
.impl StructuralPartialEq for NodeProto
Auto Trait Implementations§
impl Freeze for NodeProto
impl RefUnwindSafe for NodeProto
impl Send for NodeProto
impl Sync for NodeProto
impl Unpin for NodeProto
impl UnwindSafe for NodeProto
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for 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> ⓘ
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