You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/08/03 20:44:17 UTC

[GitHub] reminisce commented on a change in pull request #12008: [WIP] Enable graph partitioning in executor with types/shape awareness

reminisce commented on a change in pull request #12008: [WIP] Enable graph partitioning in executor with types/shape awareness 
URL: https://github.com/apache/incubator-mxnet/pull/12008#discussion_r207636899
 
 

 ##########
 File path: src/executor/graph_executor.cc
 ##########
 @@ -505,6 +506,62 @@ static void HandleInferStorageTypeError(const size_t num_forward_inputs,
              << oss.str();
 }
 
+/*!
+ * \brief Infer and add to graph attr using given info.
+ * given values are moved to graph attr
+ */
+void Infer(nnvm::Graph &g, size_t num_forward_inputs, nnvm::ShapeVector &arg_shapes,
+             nnvm::DTypeVector &arg_dtypes, StorageTypeVector &arg_stypes) {
+  g = InferShape(std::move(g), std::move(arg_shapes), "__shape__");
+  if (g.GetAttr<size_t>("shape_num_unknown_nodes") != 0U) {
+    HandleInferShapeError(num_forward_inputs, g.indexed_graph(),
+                          g.GetAttr<nnvm::ShapeVector>("shape"));
+  }
+
+  g = InferType(std::move(g), std::move(arg_dtypes), "__dtype__");
+  if (g.GetAttr<size_t>("dtype_num_unknown_nodes") != 0U) {
+    HandleInferTypeError(num_forward_inputs, g.indexed_graph(),
+                         g.GetAttr<nnvm::DTypeVector>("dtype"));
+  }
+
+  g = InferStorageType(std::move(g), std::move(arg_stypes), "__storage_type__");
+  if (g.GetAttr<size_t>("storage_type_num_unknown_nodes") != 0U) {
+    HandleInferStorageTypeError(num_forward_inputs, g.indexed_graph(),
+                                g.GetAttr<StorageTypeVector>("storage_type"));
+  }
+}
+
+void GetTypes(nnvm::Symbol &symbol,
+                         const std::vector<NDArray>& in_args,
 
 Review comment:
   alignment

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services