Browse Source

!1893 Fix codex problem

Merge pull request !1893 from xiefangqi/xfq_fix_codex3
tags/v0.5.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
03d9130b18
8 changed files with 20 additions and 13 deletions
  1. +2
    -2
      mindspore/ccsrc/dataset/engine/datasetops/source/celeba_op.cc
  2. +7
    -3
      mindspore/ccsrc/dataset/engine/datasetops/source/cifar_op.cc
  3. +2
    -2
      mindspore/ccsrc/dataset/engine/datasetops/source/image_folder_op.cc
  4. +2
    -2
      mindspore/ccsrc/dataset/engine/datasetops/source/manifest_op.cc
  5. +1
    -0
      mindspore/ccsrc/dataset/engine/datasetops/source/mindrecord_op.cc
  6. +2
    -2
      mindspore/ccsrc/dataset/engine/datasetops/source/mnist_op.cc
  7. +2
    -2
      mindspore/ccsrc/dataset/engine/datasetops/source/voc_op.cc
  8. +2
    -0
      mindspore/ccsrc/dataset/text/kernels/ngram_op.cc

+ 2
- 2
mindspore/ccsrc/dataset/engine/datasetops/source/celeba_op.cc View File

@@ -38,8 +38,8 @@ Status CelebAOp::Builder::Build(std::shared_ptr<CelebAOp> *op) {
MS_LOG(DEBUG) << "Celeba dataset type is " << builder_dataset_type_.c_str() << ".";
RETURN_IF_NOT_OK(SanityCheck());
if (builder_sampler_ == nullptr) {
int64_t num_samples = 0;
int64_t start_index = 0;
const int64_t num_samples = 0;
const int64_t start_index = 0;
builder_sampler_ = std::make_shared<SequentialSampler>(start_index, num_samples);
}



+ 7
- 3
mindspore/ccsrc/dataset/engine/datasetops/source/cifar_op.cc View File

@@ -46,8 +46,8 @@ CifarOp::Builder::Builder() : sampler_(nullptr) {
Status CifarOp::Builder::Build(std::shared_ptr<CifarOp> *ptr) {
RETURN_IF_NOT_OK(SanityCheck());
if (sampler_ == nullptr) {
int64_t num_samples = 0;
int64_t start_index = 0;
const int64_t num_samples = 0;
const int64_t start_index = 0;
sampler_ = std::make_shared<SequentialSampler>(start_index, num_samples);
}
schema_ = std::make_unique<DataSchema>();
@@ -430,7 +430,11 @@ Status CifarOp::CountTotalRows(const std::string &dir, bool isCIFAR10, int64_t *
std::string err_msg = "Invalid cifar100 file path";
RETURN_STATUS_UNEXPECTED(err_msg);
}
std::string file_name(file.substr(pos + 1));
std::string file_name;
if (file.size() > 0)
file_name = file.substr(pos + 1);
else
RETURN_STATUS_UNEXPECTED("Invalid string length!");
if (file_name.find("test") != std::string::npos) {
num_cifar100_records = 10000;
} else if (file_name.find("train") != std::string::npos) {


+ 2
- 2
mindspore/ccsrc/dataset/engine/datasetops/source/image_folder_op.cc View File

@@ -36,8 +36,8 @@ ImageFolderOp::Builder::Builder() : builder_decode_(false), builder_recursive_(f
Status ImageFolderOp::Builder::Build(std::shared_ptr<ImageFolderOp> *ptr) {
RETURN_IF_NOT_OK(SanityCheck());
if (builder_sampler_ == nullptr) {
int64_t num_samples = 0; // default num samples of 0 means to sample entire set of data
int64_t start_index = 0;
const int64_t num_samples = 0; // default num samples of 0 means to sample entire set of data
const int64_t start_index = 0;
builder_sampler_ = std::make_shared<SequentialSampler>(start_index, num_samples);
}
builder_schema_ = std::make_unique<DataSchema>();


+ 2
- 2
mindspore/ccsrc/dataset/engine/datasetops/source/manifest_op.cc View File

@@ -39,8 +39,8 @@ ManifestOp::Builder::Builder() : builder_sampler_(nullptr), builder_decode_(fals
Status ManifestOp::Builder::Build(std::shared_ptr<ManifestOp> *ptr) {
RETURN_IF_NOT_OK(SanityCheck());
if (builder_sampler_ == nullptr) {
int64_t num_samples = 0;
int64_t start_index = 0;
const int64_t num_samples = 0;
const int64_t start_index = 0;
builder_sampler_ = std::make_shared<SequentialSampler>(start_index, num_samples);
}
builder_schema_ = std::make_unique<DataSchema>();


+ 1
- 0
mindspore/ccsrc/dataset/engine/datasetops/source/mindrecord_op.cc View File

@@ -124,6 +124,7 @@ MindRecordOp::MindRecordOp(int32_t num_mind_record_workers, int32_t rows_per_buf
operators_(operators),
num_mind_record_workers_(num_mind_record_workers),
block_reader_(block_reader),
num_rows_(0),
buffers_needed_(0),
buf_cnt_(0),
ended_worker_(0),


+ 2
- 2
mindspore/ccsrc/dataset/engine/datasetops/source/mnist_op.cc View File

@@ -41,8 +41,8 @@ MnistOp::Builder::Builder() : builder_sampler_(nullptr) {
Status MnistOp::Builder::Build(std::shared_ptr<MnistOp> *ptr) {
RETURN_IF_NOT_OK(SanityCheck());
if (builder_sampler_ == nullptr) {
int64_t num_samples = 0;
int64_t start_index = 0;
const int64_t num_samples = 0;
const int64_t start_index = 0;
builder_sampler_ = std::make_shared<SequentialSampler>(start_index, num_samples);
}
builder_schema_ = std::make_unique<DataSchema>();


+ 2
- 2
mindspore/ccsrc/dataset/engine/datasetops/source/voc_op.cc View File

@@ -55,8 +55,8 @@ VOCOp::Builder::Builder() : builder_decode_(false), builder_sampler_(nullptr) {
Status VOCOp::Builder::Build(std::shared_ptr<VOCOp> *ptr) {
RETURN_IF_NOT_OK(SanityCheck());
if (builder_sampler_ == nullptr) {
int64_t num_samples = 0;
int64_t start_index = 0;
const int64_t num_samples = 0;
const int64_t start_index = 0;
builder_sampler_ = std::make_shared<SequentialSampler>(start_index, num_samples);
}
builder_schema_ = std::make_unique<DataSchema>();


+ 2
- 0
mindspore/ccsrc/dataset/text/kernels/ngram_op.cc View File

@@ -59,6 +59,8 @@ Status NgramOp::Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Te
if (end_ind - start_ind < n) {
res.emplace_back(std::string()); // push back empty string
} else {
if (end_ind - n < 0) RETURN_STATUS_UNEXPECTED("loop condition error!");

for (int i = start_ind; i < end_ind - n; i++) {
res.emplace_back(str_buffer.substr(offsets[i], offsets[i + n] - offsets[i] - separator_.size()));
}


Loading…
Cancel
Save