leezu commented on a change in pull request #17841:
URL: https://github.com/apache/incubator-mxnet/pull/17841#discussion_r420331986



##########
File path: src/io/dataloader.cc
##########
@@ -170,8 +164,7 @@ class ThreadedDataLoader : public IIterator<TBlobBatch> {
   /*! \brief batched buffer */
   std::vector<NDArray> batched_buffer_;
   /*! \brief pointer to dataset */
-  // std::shared_ptr<Dataset> dataset_;
-  std::vector<std::shared_ptr<Dataset>> datasets_;
+  std::shared_ptr<Dataset> dataset_;

Review comment:
       Nevermind, the MXDatasetCreate actually creates a shared pointer on the 
heap. So we're just reusing that and there is no double free here. `*out = new 
std::shared_ptr<Dataset>(dataset); `




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


Reply via email to