Class Iterator
Defined in File iterator.h
Nested Relationships
Nested Types
Inheritance Relationships
Derived Type
public mindspore::dataset::PullIterator
(Class PullIterator)
Class Documentation
-
class Iterator
Subclassed by mindspore::dataset::PullIterator
Public Functions
-
Iterator()
Constructor.
-
virtual ~Iterator()
Destructor.
Method for building and launching the pipeline.
- Parameters
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).
- Returns
Status error code, returns OK if no error encountered.
-
inline Status GetNextRow(MSTensorMap *row)
Function to get the next row from the data pipeline.
Note
Type of return data is a unordered_map(with column name).
- Parameters
row – [out] The output tensor row.
- Returns
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.
Note
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.
Note
Type of return data is a vector(without column name).
- Parameters
row – [out] The output tensor row.
- Returns
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.
-
class _Iterator
Inter class as iterator of Iterator.
-
Iterator()