From 305434786af599b964b23038eeab520e4cd67e90 Mon Sep 17 00:00:00 2001 From: anzhengqi Date: Tue, 25 Aug 2020 15:35:06 +0800 Subject: [PATCH] add num_epochs api --- mindspore/dataset/engine/datasets.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mindspore/dataset/engine/datasets.py b/mindspore/dataset/engine/datasets.py index 2f6c967a92..97133e6e6e 100644 --- a/mindspore/dataset/engine/datasets.py +++ b/mindspore/dataset/engine/datasets.py @@ -1130,6 +1130,8 @@ class Dataset: Args: columns (list[str], optional): List of columns to be used to specify the order of columns (default=None, means all columns). + num_epochs (int, optional): max epochs that iterator can be iteratered, + if num_epochs = -1, iterator can be iteratered infinit epochs (default=-1) Returns: Iterator, list of ndarray. @@ -1155,6 +1157,10 @@ class Dataset: The data retrieved will be a dictionary. The order of the columns in the dictionary may not be the same as the original order. + Args: + num_epochs (int, optional): max epochs that iterator can be iteratered, + if num_epochs = -1, iterator can be iteratered infinit epochs (default=-1) + Returns: Iterator, dictionary of column_name-ndarray pair.