Class PullIterator

Inheritance Relationships

Base Type

  • public mindspore::dataset::Iterator

Class Documentation

class PullIterator : public mindspore::dataset::Iterator

Public Functions

PullIterator()

Constructor.

virtual ~PullIterator()

Destructor.

Status GetNextRow(MSTensorVec *const row) override

Function to get 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 else false.

样例
/* dataset is an instance of Dataset object */
std::shared_ptr<Iterator> = dataset->CreatePullBasedIterator();
std::vector<mindspore::MSTensor> row;
iter->GetNextRow(&row);
Status GetRows(int32_t num_rows, std::vector<MSTensorVec> *const row)

Function to get specified rows from the data pipeline.

Note

Type of return data is a vector(without column name). This behavior is subject to change.

Parameters
  • num_rows[in] The number of rows to fetch.

  • row[out] The output tensor row.

Returns

Status error code, returns OK if no error encountered else false.

样例
/* dataset is an instance of Dataset object */
std::shared_ptr<Iterator> = dataset->CreatePullBasedIterator();
std::vector<std::vector<mindspore::MSTensor>> rows;
iter->GetNextRow(5, &rows);
Status BuildAndLaunchTree(const std::shared_ptr<Dataset> &ds, int32_t num_epochs)

Method for building and launching the pipeline.

Note

Consider making this function protected.

Parameters
  • ds[in] The root node that calls the function.

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