forked from mindspore-Ecosystem/mindspore
!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:
commit
b2f52c881b
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -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…
Reference in New Issue