You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/01/25 01:46:25 UTC

[GitHub] yuxihu commented on a change in pull request #13980: Use CPUPinned context in ImageRecordIOParser2

yuxihu commented on a change in pull request #13980: Use CPUPinned context in ImageRecordIOParser2
URL: https://github.com/apache/incubator-mxnet/pull/13980#discussion_r250842362
 
 

 ##########
 File path: src/io/iter_image_recordio_2.cc
 ##########
 @@ -285,9 +285,10 @@ inline bool ImageRecordIOParser2<DType>::ParseNext(DataBatch *out) {
     shape_vec.push_back(param_.label_width);
     TShape label_shape(shape_vec.begin(), shape_vec.end());
 
-    out->data.at(0) = NDArray(data_shape, Context::CPU(0), false,
+    auto dev_id = param_.device_id;
+    out->data.at(0) = NDArray(data_shape, Context::CPUPinned(dev_id), false,
       mshadow::DataType<DType>::kFlag);
-    out->data.at(1) = NDArray(label_shape, Context::CPU(0), false,
+    out->data.at(1) = NDArray(label_shape, Context::CPUPinned(dev_id), false,
 
 Review comment:
   yes, that can be done. but I think default should be CPUPinned(0).

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


With regards,
Apache Git Services