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

Fix shape index bug in iterator #14630

Merged
merged 1 commit into from
Apr 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/c_api/c_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ int MXDataIterGetLabel(DataIterHandle handle, NDArrayHandle *out) {
// temp hack to make label 1D
// TODO(tianjun) make label 1D when label_width=0
mxnet::TShape shape = db.data[1].shape();
if (shape[1] == 1) {
if (shape.ndim() > 1 && shape[1] == 1) {
*pndarray = db.data[1].Reshape(mshadow::Shape1(shape[0]));
} else {
*pndarray = db.data[1];
Expand Down