@@ -243,33 +243,33 @@ size_t GraphPartitioner::CountArgs_(IndexedForwardGraph::Node* src,
243243 ICHECK (gnode != nullptr );
244244 auto sum = gnode->args_num ;
245245 visited_groups.insert (gnode->FindRoot ());
246- auto calcArgs = [this , src, &graph, &visited_groups,
247- update_postpone](const relay::Expr& arg) -> size_t {
246+ auto calc_args_number = [this , src, &graph, &visited_groups,
247+ update_postpone](const relay::Expr& arg) -> size_t {
248248 if (arg.as <VarNode>()) return 0 ;
249249 auto * node = graph.node_map .at (arg.get ());
250250 Group* prev_group = groups_[node->index ]->FindRoot ();
251251 if (visited_groups.count (prev_group) == 0 ) {
252252 visited_groups.insert (prev_group);
253253 if (prev_group->args_num > 0 ) {
254- // Get number of arguments from group
254+ // Get the number of arguments from the group
255255 return prev_group->args_num ;
256256 } else if (update_postpone) {
257- // Update pointer to node which should be postponed for deferred fusing
257+ // Update pointer to the node which should be postponed for deferred fusing
258258 postpone_node_ = src;
259259 } else {
260- // Calculate number of arguments for the node which wasn't processed before
260+ // Calculate the number of arguments for the node which wasn't processed before
261261 return CountArgs_ (node, graph, update_postpone);
262262 }
263263 }
264264 return 0 ;
265265 };
266266 if (auto call_node = GetRef<ObjectRef>(src->ref ).as <CallNode>()) {
267267 for (auto & it : call_node->args ) {
268- sum += calcArgs (it);
268+ sum += calc_args_number (it);
269269 }
270270 } else if (auto tuple_node = GetRef<ObjectRef>(src->ref ).as <TupleNode>()) {
271271 for (auto & it : tuple_node->fields ) {
272- sum += calcArgs (it);
272+ sum += calc_args_number (it);
273273 }
274274 }
275275 return sum;
@@ -357,11 +357,11 @@ void GraphPartitioner::RunFuse(const IndexedForwardGraph& graph, //
357357 Group* group_node = groups_[nid];
358358 ICHECK (group_node != nullptr );
359359 postpone_node_ = nullptr ;
360- // Check if fusing of some inputs was postponed
360+ // Check if the fusing of some inputs was postponed
361361 if (postponed_fusing_map_.count (graph_node)) {
362362 auto range = postponed_fusing_map_.equal_range (graph_node);
363363 for (auto it = range.first ; it != range.second ; ++it) {
364- // If number of arguments is less than limit then the input can be fused
364+ // If the number of arguments is less than the limit then the input can be fused
365365 if (CountArgs_ (graph_node, graph, false ) <= CountArgsLimit_ (graph_node)) {
366366 auto * src = it->second ;
367367 auto * snode = post_dom_tree.nodes [src->index ]->parent ->gnode ;
@@ -381,7 +381,7 @@ void GraphPartitioner::RunFuse(const IndexedForwardGraph& graph, //
381381 // refuse the fusion if too many ops are going to be fused together
382382 if (CountFusedNodesWithNewChild (graph_node, dom_node->parent ->gnode ) > max_fuse_depth_)
383383 continue ;
384- // refuse the fusion if too many arguments are going to be in fused function
384+ // Refuse the fusion if too many arguments are going to be in the fused function
385385 if (max_function_args_ > 0 ) {
386386 auto limit = CountArgsLimit_ (graph_node);
387387 if (limit > 0 ) {
0 commit comments