ThomasDelteil commented on a change in pull request #10528: Remove empty 
buckets causing index errors
URL: https://github.com/apache/incubator-mxnet/pull/10528#discussion_r181152743
 
 

 ##########
 File path: python/mxnet/rnn/io.py
 ##########
 @@ -120,7 +120,7 @@ def __init__(self, sentences, batch_size, buckets=None, 
invalid_label=-1,
             buff[:len(sent)] = sent
             self.data[buck].append(buff)
 
-        self.data = [np.asarray(i, dtype=dtype) for i in self.data]
+        self.data = [np.asarray(i, dtype=dtype) for i in self.data if i]
 
 Review comment:
   please add a test validating your changes

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


With regards,
Apache Git Services

Reply via email to