Struct caffe2_imports::ArgumentHelper
source · pub struct ArgumentHelper { /* private fields */ }
Expand description
| ———– | @brief | | A helper class to index into arguments. | | This helper helps us to more easily index | into a set of arguments that are present | in the operator. | | To save memory, the argument helper | does not copy the operator def, so one | would need to make sure that the lifetime | of the OperatorDef object outlives | that of the ArgumentHelper. |
Implementations§
source§impl ArgumentHelper
impl ArgumentHelper
pub fn new(def: &OperatorDef) -> ArgumentHelper
pub fn new_from_netdef(netdef: &NetDef) -> ArgumentHelper
pub fn has_argument(&self, name: &String) -> bool
pub fn has_argument_with_def<Def>(def: &Def, name: &String) -> bool
pub fn get_single_argument<Def, T>(def: &Def, name: &str, default_value: T) -> T
pub fn has_single_argument_of_type<Def, T>(def: &Def, name: &String) -> bool
pub fn get_repeated_argument<Def, T>( def: &Def, name: &String, default_value: &Vec<T, Global> ) -> Vec<T, Global>
pub fn get_message_argument_with_def<Def, MessageType>( def: &Def, name: &String ) -> MessageType
pub fn get_repeated_message_argument_with_def<Def, MessageType>( def: &Def, name: &String ) -> Vec<MessageType, Global>
pub fn remove_argument<Def>(def: &mut Def, index: i32) -> bool
pub fn get_message_argument<MessageType>(&self, name: &String) -> MessageType
pub fn get_repeated_message_argument<MessageType>( &self, name: &String ) -> Vec<MessageType, Global>
Auto Trait Implementations§
impl RefUnwindSafe for ArgumentHelper
impl Send for ArgumentHelper
impl Sync for ArgumentHelper
impl Unpin for ArgumentHelper
impl UnwindSafe for ArgumentHelper
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.