Browse Source

!7876 Validate the DatasetNode before building it in TreeAdapter

Merge pull request !7876 from ZiruiWu/validate_in_tree_adatper
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
75609c8612
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      mindspore/ccsrc/minddata/dataset/engine/tree_adapter.cc

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

@@ -66,6 +66,8 @@ Status TreeAdapter::GetNext(TensorRow *row) {
}

Status TreeAdapter::DFSBuildTree(std::shared_ptr<api::Dataset> ir, std::shared_ptr<DatasetOp> *op) {
// validate the op can be built first before building the DatasetOp
RETURN_IF_NOT_OK(ir->ValidateParams());
std::vector<std::shared_ptr<DatasetOp>> ops = ir->Build();
CHECK_FAIL_RETURN_UNEXPECTED(!ops.empty(), "Unable to build node.");



Loading…
Cancel
Save