cjolivier01 commented on a change in pull request #9464: refactor logging in
infer storage pass
URL: https://github.com/apache/incubator-mxnet/pull/9464#discussion_r161963306
##########
File path: src/common/utils.h
##########
@@ -364,6 +364,48 @@ inline std::string dev_type_string(const int dev_type) {
return "unknown";
}
+/*! \brief get string representation of the operator stypes */
+inline std::string operator_stype_string(const nnvm::NodeAttrs& attrs,
+ const int dev_mask,
+ const std::vector<int>& in_attrs,
+ const std::vector<int>& out_attrs) {
+ std::string result = "";
+ result += "operator = " + attrs.op->name + "\n";
+ result += "input storage types = [";
+ for (const auto attr : in_attrs) {
+ result += stype_string(attr) + ", ";
+ }
+ result += "]\n";
+ result += "output storage types = [";
+ for (const auto attr : out_attrs) {
+ result += stype_string(attr) + ", ";
+ }
+ result += "]\n";
+ result += "params = {";
+ for (auto kv : attrs.dict) {
+ result += "\"" + kv.first + "\" : " + kv.second + ", ";
+ }
+ result += "}\n";
+ result += "context.dev_mask = " + dev_type_string(dev_mask);
+ return result;
+}
+
+/*! \brief get string representation of the operator */
+inline std::string operator_string(const nnvm::NodeAttrs& attrs,
+ const OpContext& ctx,
+ const std::vector<NDArray>& inputs,
+ const std::vector<OpReqType>& req,
+ const std::vector<NDArray>& outputs) {
+ std::string result = "";
+ std::vector<int> in_stypes;
Review comment:
Can you call reserve on these first?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services