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

 ##########
 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:
   @eric-haibin-lin do you have suggestions on where to put this?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to