eric-haibin-lin commented on a change in pull request #17376: [MXNET-1404] 
Implement storage tagging, the first half of the memory profiler
URL: https://github.com/apache/incubator-mxnet/pull/17376#discussion_r373243452
 
 

 ##########
 File path: include/mxnet/ndarray.h
 ##########
 @@ -1057,6 +1119,41 @@ class NDArray {
     bool IsDefault() const;
 #endif
 
+    /// \brief Cast storage type and auxiliary index to string,
+    ///        used for recording storage allocations.
+    inline std::string STypeToString() const {
+      if (storage_type == kUndefinedStorage) {
+        return "undef";
+      } else if (storage_type == kRowSparseStorage) {
+        return "row_sparse";
+      } else if (storage_type == kCSRStorage) {
+        return "csr";
+      } else {
+        return "unknown";
+      }
+    }
 
 Review comment:
   it exists in 
https://github.com/apache/incubator-mxnet/blob/master/src/common/utils.h#L386-L397
  . can we reuse it? 

----------------------------------------------------------------
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

Reply via email to