Struct caffe2_opt::GraphMatcher
source · pub struct GraphMatcher { /* private fields */ }
Expand description
| \brief Main graph matcher interface. | | This class solves a problem of finding | a matching subgraph, which is specified in | a text form.
Implementations§
source§impl GraphMatcher
impl GraphMatcher
sourcepub fn init_from_string(&mut self, str: *const u8)
pub fn init_from_string(&mut self, str: *const u8)
| @brief | | Initialize subgraph pattern from \p | | STR. |
sourcepub fn init_from_file(&mut self, fname: *const u8)
pub fn init_from_file(&mut self, fname: *const u8)
| ———– | @brief | | Initialize subgraph patter from IR | stored in file \p fname. |
sourcepub fn find_subgraph(&mut self, df: &mut NNGraph) -> bool
pub fn find_subgraph(&mut self, df: &mut NNGraph) -> bool
| @brief | | Try to find the pattern in the given graph | \p DF and return true if it was found. |
sourcepub fn replace_subgraph_with(&mut self)
pub fn replace_subgraph_with(&mut self)
| ———– | @brief | | Replace the found subgraph with another | one. |
sourcepub fn get_matcher_graph(&mut self) -> *mut TestMatchGraph
pub fn get_matcher_graph(&mut self) -> *mut TestMatchGraph
\brief Return the matcher graph.
sourcepub fn get_matcher(&mut self) -> TestMatchGraph_NodeRef
pub fn get_matcher(&mut self) -> TestMatchGraph_NodeRef
| TODO: Do we need this, or can we get it | from getMatcherGraph? |
sourcepub fn get_match_map(&self) -> HashMap<String, NNGraph_NodeRef>
pub fn get_match_map(&self) -> HashMap<String, NNGraph_NodeRef>
| @brief | | Return a mapping from IR variable name | (std::string) to Node in the matched | graph. |
pub fn does_match(&mut self, df: &mut NNGraph) -> bool
pub fn gen_matcher_from_astexpr( &mut self, expr: *mut ASTExpr, insert_temp: Option<bool> ) -> TestMatchGraph_NodeRef
pub fn gen_matcher_from_aststmt( &mut self, stmt: *mut ASTStmt ) -> TestMatchGraph_NodeRef
pub fn gen_matcher_from_astgraph( &mut self, ast: *mut ASTGraph ) -> TestMatchGraph_NodeRef
pub fn gen_matcher_from_irfile( &mut self, fname: *const u8 ) -> TestMatchGraph_NodeRef
pub fn gen_matcher_from_irstr( &mut self, str: *const u8 ) -> TestMatchGraph_NodeRef
sourcepub fn get_matches<T, U>(&self, df: &mut NNGraph) -> Vec<MatchedSubgraph<T, U>>
pub fn get_matches<T, U>(&self, df: &mut NNGraph) -> Vec<MatchedSubgraph<T, U>>
\brief Returns a vector of matches.
Auto Trait Implementations§
impl RefUnwindSafe for GraphMatcher
impl !Send for GraphMatcher
impl !Sync for GraphMatcher
impl Unpin for GraphMatcher
impl UnwindSafe for GraphMatcher
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.