!9004 [MD]FIx Bug replace '0' to nullptr and fix sentencePiece api doc

From: @xulei2020
Reviewed-by: @jonyguo,@heleiwang
Signed-off-by: @liucunwei
pull/9004/MERGE
mindspore-ci-bot 4 years ago committed by Gitee
commit 7538c99571

@ -29,7 +29,7 @@ namespace mindspore {
namespace dataset { namespace dataset {
LiteMat::LiteMat() { LiteMat::LiteMat() {
data_ptr_ = 0; data_ptr_ = nullptr;
elem_size_ = 0; elem_size_ = 0;
width_ = 0; width_ = 0;
height_ = 0; height_ = 0;
@ -38,11 +38,11 @@ LiteMat::LiteMat() {
dims_ = 0; dims_ = 0;
size_ = 0; size_ = 0;
data_type_ = LDataType::UINT8; data_type_ = LDataType::UINT8;
ref_count_ = 0; ref_count_ = nullptr;
} }
LiteMat::LiteMat(int width, LDataType data_type) { LiteMat::LiteMat(int width, LDataType data_type) {
data_ptr_ = 0; data_ptr_ = nullptr;
elem_size_ = 0; elem_size_ = 0;
width_ = 0; width_ = 0;
height_ = 0; height_ = 0;
@ -50,13 +50,13 @@ LiteMat::LiteMat(int width, LDataType data_type) {
c_step_ = 0; c_step_ = 0;
dims_ = 0; dims_ = 0;
data_type_ = LDataType::UINT8; data_type_ = LDataType::UINT8;
ref_count_ = 0; ref_count_ = nullptr;
size_ = 0; size_ = 0;
Init(width, data_type); Init(width, data_type);
} }
LiteMat::LiteMat(int width, int height, LDataType data_type) { LiteMat::LiteMat(int width, int height, LDataType data_type) {
data_ptr_ = 0; data_ptr_ = nullptr;
elem_size_ = 0; elem_size_ = 0;
width_ = 0; width_ = 0;
height_ = 0; height_ = 0;
@ -64,13 +64,13 @@ LiteMat::LiteMat(int width, int height, LDataType data_type) {
c_step_ = 0; c_step_ = 0;
dims_ = 0; dims_ = 0;
data_type_ = LDataType::UINT8; data_type_ = LDataType::UINT8;
ref_count_ = 0; ref_count_ = nullptr;
size_ = 0; size_ = 0;
Init(width, height, data_type); Init(width, height, data_type);
} }
LiteMat::LiteMat(int width, int height, void *p_data, LDataType data_type) { LiteMat::LiteMat(int width, int height, void *p_data, LDataType data_type) {
data_ptr_ = 0; data_ptr_ = nullptr;
elem_size_ = 0; elem_size_ = 0;
width_ = 0; width_ = 0;
height_ = 0; height_ = 0;
@ -78,13 +78,13 @@ LiteMat::LiteMat(int width, int height, void *p_data, LDataType data_type) {
c_step_ = 0; c_step_ = 0;
dims_ = 0; dims_ = 0;
data_type_ = LDataType::UINT8; data_type_ = LDataType::UINT8;
ref_count_ = 0; ref_count_ = nullptr;
size_ = 0; size_ = 0;
Init(width, height, p_data, data_type); Init(width, height, p_data, data_type);
} }
LiteMat::LiteMat(int width, int height, int channel, LDataType data_type) { LiteMat::LiteMat(int width, int height, int channel, LDataType data_type) {
data_ptr_ = 0; data_ptr_ = nullptr;
elem_size_ = 0; elem_size_ = 0;
width_ = 0; width_ = 0;
height_ = 0; height_ = 0;
@ -92,13 +92,13 @@ LiteMat::LiteMat(int width, int height, int channel, LDataType data_type) {
c_step_ = 0; c_step_ = 0;
dims_ = 0; dims_ = 0;
data_type_ = LDataType::UINT8; data_type_ = LDataType::UINT8;
ref_count_ = 0; ref_count_ = nullptr;
size_ = 0; size_ = 0;
Init(width, height, channel, data_type); Init(width, height, channel, data_type);
} }
LiteMat::LiteMat(int width, int height, int channel, void *p_data, LDataType data_type) { LiteMat::LiteMat(int width, int height, int channel, void *p_data, LDataType data_type) {
data_ptr_ = 0; data_ptr_ = nullptr;
elem_size_ = 0; elem_size_ = 0;
width_ = 0; width_ = 0;
height_ = 0; height_ = 0;
@ -106,7 +106,7 @@ LiteMat::LiteMat(int width, int height, int channel, void *p_data, LDataType dat
c_step_ = 0; c_step_ = 0;
dims_ = 0; dims_ = 0;
data_type_ = LDataType::UINT8; data_type_ = LDataType::UINT8;
ref_count_ = 0; ref_count_ = nullptr;
size_ = 0; size_ = 0;
Init(width, height, channel, p_data, data_type); Init(width, height, channel, p_data, data_type);
} }

@ -142,7 +142,7 @@ class SentencePieceVocab(cde.SentencePieceVocab):
character_coverage(float): Amount of characters covered by the model, good defaults are: 0.9995 for character_coverage(float): Amount of characters covered by the model, good defaults are: 0.9995 for
languages. with rich character set like Japanese or Chinese and 1.0 for other languages with small languages. with rich character set like Japanese or Chinese and 1.0 for other languages with small
character set. character set.
model_type(SentencePieceModel): Choose from unigram (default), bpe, char, or word. The input sentence model_type(SentencePieceModel): Choose from UNIGRAM (default), BPE, CHAR, or WORD. The input sentence
must be pretokenized when using word type. must be pretokenized when using word type.
params(dict): A dictionary with no incoming parameters. params(dict): A dictionary with no incoming parameters.

Loading…
Cancel
Save