!8680 [Data]add same colum name check in sentence_piece_vocab_node and fix lookup comment bug

From: @xulei2020
Reviewed-by: 
Signed-off-by:
This commit is contained in:
mindspore-ci-bot 2020-11-19 16:55:09 +08:00 committed by Gitee
commit b2f52c881b
3 changed files with 7 additions and 5 deletions

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();
}

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; }

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])
"""