Browse Source

fix same colum name check in buildSentenceVocabNode

tags/v1.1.0
xulei2020 5 years ago
parent
commit
8a7c85bcfe
3 changed files with 7 additions and 5 deletions
  1. +4
    -0
      mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/build_sentence_piece_vocab_node.cc
  2. +2
    -4
      mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv/lite_mat.cc
  3. +1
    -1
      mindspore/dataset/text/transforms.py

+ 4
- 0
mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/build_sentence_piece_vocab_node.cc View File

@@ -74,6 +74,10 @@ Status BuildSentenceVocabNode::ValidateParams() {
RETURN_STATUS_SYNTAX_ERROR(err_msg);
}

if (!col_names_.empty()) {
RETURN_IF_NOT_OK(ValidateDatasetColumnParam("BuildVocabNode", "columns", col_names_));
}

return Status::OK();
}



+ 2
- 4
mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv/lite_mat.cc View File

@@ -198,8 +198,7 @@ void LiteMat::Init(int width, int height, void *p_data, LDataType data_type) {
c_step_ = height_ * width_;
size_ = c_step_ * channel_ * elem_size_;
data_ptr_ = p_data;
ref_count_ = new int[1];
*ref_count_ = 0;
ref_count_ = nullptr;
}

void LiteMat::Init(int width, int height, int channel, LDataType data_type) {
@@ -227,8 +226,7 @@ void LiteMat::Init(int width, int height, int channel, void *p_data, LDataType d
c_step_ = height_ * width_;
size_ = c_step_ * channel_ * elem_size_;
data_ptr_ = p_data;
ref_count_ = new int[1];
*ref_count_ = 0;
ref_count_ = nullptr;
}

bool LiteMat::IsEmpty() const { return data_ptr_ == 0 || data_ptr_ == nullptr || c_step_ * channel_ == 0; }


+ 1
- 1
mindspore/dataset/text/transforms.py View File

@@ -76,7 +76,7 @@ class Lookup(cde.LookupOp):
>>> # Load vocabulary from list
>>> vocab = text.Vocab.from_list(['深', '圳', '欢', '迎', '您'])
>>> # Use Lookup operator to map tokens to ids
>>> lookup = text.Lookup(vocab, "<unk>")
>>> lookup = text.Lookup(vocab)
>>> data1 = data1.map(operations=[lookup])
"""



Loading…
Cancel
Save