moveforever commented on a change in pull request #18411:
URL: https://github.com/apache/incubator-mxnet/pull/18411#discussion_r432843569



##########
File path: src/c_api/c_api.cc
##########
@@ -2254,9 +2255,11 @@ int MXDataIterGetIndex(DataIterHandle handle, uint64_t 
**out_index, uint64_t *ou
 int MXDataIterGetData(DataIterHandle handle, NDArrayHandle *out) {
   API_BEGIN();
   const DataBatch& db = static_cast<IIterator<DataBatch>* >(handle)->Value();
-  NDArray* pndarray = new NDArray();
-  *pndarray = db.data[0];
-  *out = pndarray;
+  for (size_t i = 0 ; i < db.data.size() - 1; ++i) {

Review comment:
       db.data.size() should be at least greater than or equal to 1.
   i add a line:
   CHECK_GE(db.data.size(), 1) << "The size of data in db should be greater 
than or equal to 1.";




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


Reply via email to