Browse Source

Changin Sampler in Python to SamplerObj

tags/v1.2.0-rc1
Mahdi 5 years ago
parent
commit
c622e9cb12
2 changed files with 3 additions and 1 deletions
  1. +2
    -0
      mindspore/ccsrc/minddata/dataset/engine/consumers/tree_consumer.cc
  2. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/source/minddata_node.cc

+ 2
- 0
mindspore/ccsrc/minddata/dataset/engine/consumers/tree_consumer.cc View File

@@ -593,6 +593,8 @@ Status DatasetSizeGetter::GetRow(const std::shared_ptr<TreeAdapter> &tree_adapte
} }
Status DatasetSizeGetter::Terminate() { Status DatasetSizeGetter::Terminate() {
for (const auto &tree : tree_adapters_) { for (const auto &tree : tree_adapters_) {
RETURN_UNEXPECTED_IF_NULL(tree);
RETURN_UNEXPECTED_IF_NULL(tree->AllTasks());
RETURN_IF_NOT_OK(tree->AllTasks()->ServiceStop()); RETURN_IF_NOT_OK(tree->AllTasks()->ServiceStop());
} }
return Status::OK(); return Status::OK();


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/source/minddata_node.cc View File

@@ -187,7 +187,7 @@ Status MindDataNode::GetDatasetSize(const std::shared_ptr<DatasetSizeGetter> &si
*dataset_size = dataset_size_; *dataset_size = dataset_size_;
return Status::OK(); return Status::OK();
} }
int64_t num_rows;
int64_t num_rows = -1;
std::vector<std::shared_ptr<ShardOperator>> operators; std::vector<std::shared_ptr<ShardOperator>> operators;
RETURN_IF_NOT_OK(BuildMindDatasetSamplerChain(sampler_, &operators, num_padded_)); RETURN_IF_NOT_OK(BuildMindDatasetSamplerChain(sampler_, &operators, num_padded_));




Loading…
Cancel
Save