Browse Source

!5125 add create_dict_iterator parameter num_epochs api

Merge pull request !5125 from anzhengqi/add-num_epochs-api
tags/v1.0.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
c7c5835800
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      mindspore/dataset/engine/datasets.py

+ 6
- 0
mindspore/dataset/engine/datasets.py View File

@@ -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.



Loading…
Cancel
Save