Browse Source

!8056 C++ API: Delete More ValidateParams in dataset APIs

Merge pull request !8056 from cathwong/ckw_cppapi_more_dataset_del_valparms
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
ae6d85f02e
1 changed files with 1 additions and 10 deletions
  1. +1
    -10
      mindspore/ccsrc/minddata/dataset/api/datasets.cc

+ 1
- 10
mindspore/ccsrc/minddata/dataset/api/datasets.cc View File

@@ -540,11 +540,6 @@ std::shared_ptr<SentencePieceVocab> Dataset::BuildSentencePieceVocab(
auto ds = std::make_shared<BuildSentenceVocabNode>(shared_from_this(), vocab, col_names, vocab_size, auto ds = std::make_shared<BuildSentenceVocabNode>(shared_from_this(), vocab, col_names, vocab_size,
character_coverage, model_type, params); character_coverage, model_type, params);


// Validate input params
if (!ds->ValidateParams()) {
return nullptr;
}

// Run tree here to start building vocab // Run tree here to start building vocab
std::shared_ptr<Iterator> iter = ds->CreateIterator(); std::shared_ptr<Iterator> iter = ds->CreateIterator();
if (iter == nullptr) { if (iter == nullptr) {
@@ -569,10 +564,6 @@ std::shared_ptr<Vocab> Dataset::BuildVocab(const std::vector<std::string> &colum
auto ds = std::make_shared<BuildVocabNode>(shared_from_this(), vocab, columns, freq_range, top_k, special_tokens, auto ds = std::make_shared<BuildVocabNode>(shared_from_this(), vocab, columns, freq_range, top_k, special_tokens,
special_first); special_first);


if (!ds->ValidateParams()) {
return nullptr;
}

// Run tree here to starting building vocab // Run tree here to starting building vocab
std::shared_ptr<Iterator> iter = ds->CreateIterator(); std::shared_ptr<Iterator> iter = ds->CreateIterator();
if (iter == nullptr) { if (iter == nullptr) {
@@ -1051,7 +1042,7 @@ std::shared_ptr<DatasetCache> CreateDatasetCache(session_id_type id, uint64_t me
std::optional<int32_t> num_connections, std::optional<int32_t> num_connections,
std::optional<int32_t> prefetch_sz) { std::optional<int32_t> prefetch_sz) {
auto cache = std::make_shared<DatasetCacheImpl>(id, mem_sz, spill, hostname, port, num_connections, prefetch_sz); auto cache = std::make_shared<DatasetCacheImpl>(id, mem_sz, spill, hostname, port, num_connections, prefetch_sz);
return cache->ValidateParams() ? cache : nullptr;
return cache;
} }
#endif #endif




Loading…
Cancel
Save