Trait caffe2_transform::SingleOpTransform
source · pub trait SingleOpTransform: Transform {
// Required methods
fn match_operator(&mut self, op: &OperatorDef);
fn replace_operator(&mut self, op: *mut OperatorDef);
// Provided methods
fn pattern_rule(&mut self, g: &Graph, subgraph: &Vec<i32>, idx: i32) -> bool { ... }
fn validator_rule(&mut self, g: &Graph, subgraph: &Vec<i32>) -> bool { ... }
fn replace_rule(&mut self, subgraph: &Vec<i32>, g_ptr: *mut Graph) -> bool { ... }
}
Expand description
| Single Op Transform Base class | | A transform which is applied to a single | node, in place. | | Transforms which derive from SingleOpTransform | need to override: | | ReplaceOperator and MatchOperator. |
Required Methods§
sourcefn match_operator(&mut self, op: &OperatorDef)
fn match_operator(&mut self, op: &OperatorDef)
| Specify what the op needs to be to match | the pattern. |
sourcefn replace_operator(&mut self, op: *mut OperatorDef)
fn replace_operator(&mut self, op: *mut OperatorDef)
| Specify how the operator should be replaced. |