JulianSlzr commented on a change in pull request #9877: Better even_split=False support in gluon.split_data() URL: https://github.com/apache/incubator-mxnet/pull/9877#discussion_r170796056
########## File path: python/mxnet/gluon/utils.py ########## @@ -56,13 +56,10 @@ def split_data(data, num_slice, batch_axis=0, even_split=True): Returns ------- list of NDArray - Return value is a list even if `num_slice` is 1. + Return value is a list even if `num_slice` is 1. When `even_split` + is `False` this may be shorter than `num_slice`. Review comment: See comment above: A user training using `zip(context, slices)` then doing`L.backward()` inside the loop won't have problems. Also, suppose a user doesn't use this idiom and is unlucky (has `N` samples where `N % batch_size < num_slice`). At worst, MXNet warns them about the stale gradient; plus, it would occur on the very last batch. This is still preferable to doing training/inference just to error on the last batch with a `size < num_slice` message, requiring an ad-hoc workaround. ---------------------------------------------------------------- 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