Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
set context for newly created aux handle
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxihu committed Mar 12, 2019
1 parent 1f4626b commit 2248647
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/mxnet/ndarray.h
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,8 @@ class NDArray {
<< "storage type cannot be kDefaultStorage in CheckAndAllocAuxData";
if (aux_handles.size() <= i) {
aux_handles.resize(i + 1);
// set context for the newly created handle.
aux_handles[i].ctx = ctx;
}
size_t aux_bytes = shape.Size() * mshadow::mshadow_sizeof(aux_types[i]);
if (aux_handles[i].size < aux_bytes) {
Expand Down

0 comments on commit 2248647

Please sign in to comment.