samskalicky commented on a change in pull request #15886: [WIP] Graph Partition
API
URL: https://github.com/apache/incubator-mxnet/pull/15886#discussion_r314928296
##########
File path: src/common/exec_utils.h
##########
@@ -621,6 +621,42 @@ inline nnvm::Graph AssignContext(nnvm::Graph g,
return g;
}
+/*!
+ * \brief infers shapes, dtypes, stypes, contexts for the forward graph
+ */
+inline nnvm::Graph InferForwardAttrs(nnvm::Graph g,
+ mxnet::ShapeVector arg_shapes,
+ nnvm::DTypeVector arg_dtypes,
+ StorageTypeVector arg_stypes,
+ const Context& default_ctx,
+ const std::map<std::string, Context>&
ctx_map,
+ const std::vector<Context>& in_arg_ctxes,
+ const std::vector<Context>&
aux_state_ctxes,
+ bool partial_shape = false) {
+ const auto& indexed_graph = g.indexed_graph();
+ const auto num_forward_inputs = indexed_graph.input_nodes().size();
+ g = AssignContext(g, default_ctx, ctx_map, in_arg_ctxes, {},
+ aux_state_ctxes, {}, num_forward_inputs, g.outputs.size());
Review comment:
this is the only consumer of default_ctx, is it really necessary to just do
the shape/type prop that we're looking for pre-partitioning?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services