masahi commented on code in PR #15137:
URL: https://github.com/apache/tvm/pull/15137#discussion_r1268853059
##########
src/relay/analysis/graph_partitioner.cc:
##########
@@ -220,7 +225,113 @@ size_t
GraphPartitioner::CountFusedNodesWithNewChild(IndexedForwardGraph::Node*
return target->FindRoot()->num_nodes + CountNodesUptoSink_(child,
dom_parent);
}
+size_t GraphPartitioner::CountAdditionalArgs_(const TensorTypeNode* ttype,
bool with_strides) {
+ size_t any_dims = 0;
+ for (const auto& dim : ttype->shape) {
+ if (dim.as<AnyNode>()) {
+ any_dims++;
+ }
+ }
+ if (with_strides && any_dims > 0) any_dims += ttype->shape.size();
+ return any_dims;
+}
+
+size_t GraphPartitioner::CountArgs_(IndexedForwardGraph::Node* src,
+ const IndexedForwardGraph& graph, bool
update_postpone) {
+ std::unordered_set<Group*> visited_groups;
+ Group* gnode = groups_[src->index];
+ ICHECK(gnode != nullptr);
+ auto sum = gnode->args_num;
+ visited_groups.insert(gnode->FindRoot());
+ auto calcArgs = [this, src, &graph, &visited_groups,
Review Comment:
code style
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]