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

Commit

Permalink
Fix check against nonexistent variable (#9082)
Browse files Browse the repository at this point in the history
Array length checks hit undefined name when AssertionError is raised. Also clarified message.
  • Loading branch information
fmailhot authored and piiswrong committed Dec 15, 2017
1 parent 48f62cf commit 5540ee9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/mxnet/gluon/data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def __init__(self, *args):
self._data = []
for i, data in enumerate(args):
assert len(data) == self._length, \
"All arrays must have the same length. But the first has %s " \
"while the %d-th has %d."%(length, i+1, len(data))
"All arrays must have the same length; array[0] has length %d " \
"while array[%d] has %d." % (self._length, i+1, len(data))
if isinstance(data, ndarray.NDArray) and len(data.shape) == 1:
data = data.asnumpy()
self._data.append(data)
Expand Down

0 comments on commit 5540ee9

Please sign in to comment.