anirudh2290 commented on a change in pull request #10374: Sparse support for Custom Op URL: https://github.com/apache/incubator-mxnet/pull/10374#discussion_r178925301
########## File path: include/mxnet/ndarray.h ########## @@ -507,6 +507,35 @@ class NDArray { ret.reuse_ = true; return ret; } + + inline void SparseUpdateChunk(const NDArray &arr) const { + auto stype = arr.storage_type(); + CHECK(stype == kCSRStorage || stype == kRowSparseStorage) + << "Only to be used with CSR and RSP storage types"; + ptr_->shandle.dptr = arr.ptr_->shandle.dptr; Review comment: this doesn't work because the Handle struct also stores a pointer to data. doing `ptr_->shandle = arr.ptr_->shandle` would make copies of dptr which point to same data. But then sparse updates the dptr at runtime and this wont reflect in the copied shandle. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services