cinn/hlir/framework/graph_compiler.cc
// get the most complex op's index in the fused groups according to the OpPattern. If the OpPattern is same, we will
// take the latter.
get the most complex op's index in the fused groups according to the OpPattern. If the OpPattern is same, we will
take the latter.
get the most complex op ' s index in the fused groups according to the OpPattern . If the OpPattern is same we will take the latter .
int GetMasterRefNode(const std::vector<Node*>& nodes) {
  auto& op_pattern_dict = Operator::GetAttrs<OpPatternKind>("OpPattern");
  int master_index      = 0;
  int master_pattern    = op_pattern_dict[nodes[0]->op()];
  for (int i = 1; i < nodes.size(); i++) {
    int pattern    = op_pattern_dict[nodes[i]->op()];
    master_index   = pattern >= master_pattern ? i : master_index;
    master_pattern = std::max(pattern, master_pattern);
  }
  VLOG(3) << "master_index: " << master_index << ", master op: " << nodes[master_index]->op()->name;
  return master_index;
}
int GetMasterRefNode ( const std :: vector < Node * > & nodes ) { auto & op_pattern_dict = Operator :: GetAttrs < OpPatternKind > ( " " ) ; int master_index = 0 ; int master_pattern = op_pattern_dict [ nodes [ 0 ] -> op ( ) ] ; for ( int i = 1 ; i < nodes . size ( ) ; i ++ ) { int pattern = op_pattern_dict [ nodes [ i ] -> op ( ) ] ; master_index = pattern >= master_pattern ? i : master_index ; master_pattern = std :: max ( pattern , master_pattern ) ; } VLOG ( 3 ) << " " << master_index << " " << nodes [ master_index ] -> op ( ) -> name ; return master_index ; }
get the most complex op's index in the fused groups according to the OpPattern.
get the most complex op ' s index in the fused groups according to the OpPattern .