Class Iterator

Nested Relationships

Nested Types

Inheritance Relationships

Derived Type

Class Documentation

class Iterator

Subclassed by mindspore::dataset::PullIterator

Public Functions

Iterator()

Constructor.

virtual ~Iterator()

Destructor.

Status BuildAndLaunchTree(const std::shared_ptr<Dataset> &ds, int32_t num_epochs)

Method for building and launching the pipeline.

参数
  • ds[in] The last DatasetOp in the dataset pipeline.

  • num_epochs[in] Number of epochs passed down to EpochCtrlNode (default=-1, which means infinite epochs).

返回

Status error code, returns OK if no error encountered.

inline Status GetNextRow(MSTensorMap *row)

Function to get the next row from the data pipeline.

说明

Type of return data is a unordered_map(with column name).

参数

row[out] The output tensor row.

返回

Status error code, returns OK if no error encountered.

样例
/* dataset is an instance of Dataset object */
std::shared_ptr<Iterator> = dataset->CreateIterator();
std::unordered_map<std::string, mindspore::MSTensor> row;
iter->GetNextRow(&row);
Status GetNextRowCharIF(MSTensorMapChar *row)

Char interface(CharIF) of GetNextRow.

说明

The reason for using this API is that std::string will be constrained by the compiler option ‘_GLIBCXX_USE_CXX11_ABI’ while char is free of this restriction.

virtual Status GetNextRow(MSTensorVec *row)

Function to get the next row from the data pipeline.

说明

Type of return data is a vector(without column name).

参数

row[out] The output tensor row.

返回

Status error code, returns OK if no error encountered.

样例
/* dataset is an instance of Dataset object */
std::shared_ptr<Iterator> = dataset->CreateIterator();
std::vector<mindspore::MSTensor> row;
iter->GetNextRow(&row);
void Stop()

Function to shut down the data pipeline.

inline _Iterator begin()

Function to return the iterator points to the begin of Iterator.

inline _Iterator end()

Function to return the iterator points to the end of Iterator.

class _Iterator

Inter class as iterator of Iterator.

Public Functions

explicit _Iterator(Iterator *lt)

Constructor.

inline ~_Iterator()

Destructor.