leezu commented on a change in pull request #16955: [Dataset] add flatten API
to dataset
URL: https://github.com/apache/incubator-mxnet/pull/16955#discussion_r352411756
##########
File path: python/mxnet/gluon/data/dataset.py
##########
@@ -185,6 +185,20 @@ def transform_first(self, fn, lazy=True):
"""
return self.transform(_TransformFirstClosure(fn), lazy)
+ def flatten(self):
+ """Returns a new dataset with samples flattened.
+
+ It is usefull to call after transform() when your transformer function
'fn' transform
+ each sample into multipul samples.
+ Note that the items in dataset should be iterable, e.g., list.
Review comment:
The items in the dataset must be iterable.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services