Browse Source

!3452 [MD] Gets rid of uncessary print calls

Merge pull request !3452 from nhussain/refactor_name_function
tags/v0.7.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
84c8b85ddc
93 changed files with 95 additions and 143 deletions
  1. +4
    -0
      mindspore/ccsrc/minddata/dataset/engine/datasetops/barrier_op.h
  2. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/batch_op.cc
  3. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/batch_op.h
  4. +0
    -2
      mindspore/ccsrc/minddata/dataset/engine/datasetops/bucket_batch_by_length_op.cc
  5. +1
    -4
      mindspore/ccsrc/minddata/dataset/engine/datasetops/bucket_batch_by_length_op.h
  6. +2
    -0
      mindspore/ccsrc/minddata/dataset/engine/datasetops/build_sentence_piece_vocab_op.h
  7. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/build_vocab_op.cc
  8. +1
    -0
      mindspore/ccsrc/minddata/dataset/engine/datasetops/build_vocab_op.h
  9. +3
    -0
      mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_base_op.h
  10. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_lookup_op.h
  11. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_merge_op.cc
  12. +2
    -0
      mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_merge_op.h
  13. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_op.h
  14. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/concat_op.cc
  15. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/concat_op.h
  16. +2
    -0
      mindspore/ccsrc/minddata/dataset/engine/datasetops/dataset_op.cc
  17. +26
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/dataset_op.h
  18. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/device_queue_op.cc
  19. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/device_queue_op.h
  20. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/epoch_ctrl_op.cc
  21. +1
    -0
      mindspore/ccsrc/minddata/dataset/engine/datasetops/epoch_ctrl_op.h
  22. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/filter_op.cc
  23. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/filter_op.h
  24. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op.cc
  25. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op.h
  26. +2
    -0
      mindspore/ccsrc/minddata/dataset/engine/datasetops/parallel_op.h
  27. +2
    -0
      mindspore/ccsrc/minddata/dataset/engine/datasetops/pipeline_op.h
  28. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/project_op.cc
  29. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/project_op.h
  30. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/rename_op.cc
  31. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/rename_op.h
  32. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/repeat_op.cc
  33. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/repeat_op.h
  34. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/shuffle_op.cc
  35. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/shuffle_op.h
  36. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/skip_op.cc
  37. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/skip_op.h
  38. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/take_op.cc
  39. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/take_op.h
  40. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/zip_op.cc
  41. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/zip_op.h
  42. +0
    -1
      mindspore/ccsrc/minddata/dataset/kernels/data/concatenate_op.h
  43. +0
    -2
      mindspore/ccsrc/minddata/dataset/kernels/data/duplicate_op.h
  44. +0
    -1
      mindspore/ccsrc/minddata/dataset/kernels/data/fill_op.h
  45. +0
    -2
      mindspore/ccsrc/minddata/dataset/kernels/data/mask_op.h
  46. +0
    -2
      mindspore/ccsrc/minddata/dataset/kernels/data/one_hot_op.h
  47. +0
    -2
      mindspore/ccsrc/minddata/dataset/kernels/data/pad_end_op.h
  48. +0
    -2
      mindspore/ccsrc/minddata/dataset/kernels/data/slice_op.h
  49. +0
    -2
      mindspore/ccsrc/minddata/dataset/kernels/data/to_float16_op.h
  50. +0
    -1
      mindspore/ccsrc/minddata/dataset/kernels/data/type_cast_op.h
  51. +0
    -2
      mindspore/ccsrc/minddata/dataset/kernels/image/auto_contrast_op.h
  52. +0
    -2
      mindspore/ccsrc/minddata/dataset/kernels/image/bounding_box_augment_op.h
  53. +0
    -1
      mindspore/ccsrc/minddata/dataset/kernels/image/decode_op.h
  54. +0
    -3
      mindspore/ccsrc/minddata/dataset/kernels/image/equalize_op.h
  55. +0
    -2
      mindspore/ccsrc/minddata/dataset/kernels/image/hwc_to_chw_op.h
  56. +0
    -3
      mindspore/ccsrc/minddata/dataset/kernels/image/invert_op.h
  57. +0
    -2
      mindspore/ccsrc/minddata/dataset/kernels/image/pad_op.h
  58. +0
    -4
      mindspore/ccsrc/minddata/dataset/kernels/image/random_color_adjust_op.h
  59. +1
    -2
      mindspore/ccsrc/minddata/dataset/kernels/image/random_crop_decode_resize_op.h
  60. +1
    -1
      mindspore/ccsrc/minddata/dataset/kernels/image/random_crop_op.h
  61. +1
    -1
      mindspore/ccsrc/minddata/dataset/kernels/image/random_crop_with_bbox_op.h
  62. +0
    -2
      mindspore/ccsrc/minddata/dataset/kernels/image/random_horizontal_flip_op.h
  63. +0
    -2
      mindspore/ccsrc/minddata/dataset/kernels/image/random_horizontal_flip_with_bbox_op.h
  64. +1
    -3
      mindspore/ccsrc/minddata/dataset/kernels/image/random_resize_op.h
  65. +1
    -1
      mindspore/ccsrc/minddata/dataset/kernels/image/random_resize_with_bbox_op.h
  66. +0
    -4
      mindspore/ccsrc/minddata/dataset/kernels/image/random_rotation_op.h
  67. +0
    -2
      mindspore/ccsrc/minddata/dataset/kernels/image/random_vertical_flip_op.h
  68. +0
    -2
      mindspore/ccsrc/minddata/dataset/kernels/image/random_vertical_flip_with_bbox_op.h
  69. +1
    -1
      mindspore/ccsrc/minddata/dataset/kernels/image/rescale_op.h
  70. +0
    -1
      mindspore/ccsrc/minddata/dataset/kernels/image/resize_bilinear_op.cc
  71. +0
    -4
      mindspore/ccsrc/minddata/dataset/kernels/image/resize_bilinear_op.h
  72. +1
    -1
      mindspore/ccsrc/minddata/dataset/kernels/image/resize_op.h
  73. +1
    -1
      mindspore/ccsrc/minddata/dataset/kernels/image/resize_with_bbox_op.h
  74. +1
    -1
      mindspore/ccsrc/minddata/dataset/kernels/image/uniform_aug_op.h
  75. +0
    -2
      mindspore/ccsrc/minddata/dataset/kernels/no_op.h
  76. +0
    -2
      mindspore/ccsrc/minddata/dataset/kernels/tensor_op.cc
  77. +5
    -2
      mindspore/ccsrc/minddata/dataset/kernels/tensor_op.h
  78. +0
    -2
      mindspore/ccsrc/minddata/dataset/text/kernels/basic_tokenizer_op.h
  79. +0
    -2
      mindspore/ccsrc/minddata/dataset/text/kernels/bert_tokenizer_op.h
  80. +0
    -2
      mindspore/ccsrc/minddata/dataset/text/kernels/case_fold_op.h
  81. +1
    -2
      mindspore/ccsrc/minddata/dataset/text/kernels/jieba_tokenizer_op.h
  82. +0
    -2
      mindspore/ccsrc/minddata/dataset/text/kernels/normalize_utf8_op.h
  83. +0
    -2
      mindspore/ccsrc/minddata/dataset/text/kernels/regex_replace_op.h
  84. +0
    -2
      mindspore/ccsrc/minddata/dataset/text/kernels/regex_tokenizer_op.h
  85. +1
    -1
      mindspore/ccsrc/minddata/dataset/text/kernels/sentence_piece_tokenizer_op.h
  86. +0
    -4
      mindspore/ccsrc/minddata/dataset/text/kernels/sliding_window_op.h
  87. +0
    -2
      mindspore/ccsrc/minddata/dataset/text/kernels/truncate_sequence_pair_op.h
  88. +0
    -2
      mindspore/ccsrc/minddata/dataset/text/kernels/unicode_char_tokenizer_op.h
  89. +0
    -2
      mindspore/ccsrc/minddata/dataset/text/kernels/unicode_script_tokenizer_op.h
  90. +0
    -2
      mindspore/ccsrc/minddata/dataset/text/kernels/whitespace_tokenizer_op.h
  91. +0
    -2
      mindspore/ccsrc/minddata/dataset/text/kernels/wordpiece_tokenizer_op.h
  92. +4
    -1
      tests/ut/cpp/dataset/batch_op_test.cc
  93. +0
    -8
      tests/ut/cpp/dataset/concatenate_op_test.cc

+ 4
- 0
mindspore/ccsrc/minddata/dataset/engine/datasetops/barrier_op.h View File

@@ -121,6 +121,10 @@ class BarrierOp : public PipelineOp {
// @param show_all - if it should print everything
void Print(std::ostream &out, bool show_all) const override;

// Op name getter
// @return Name of the current Op
std::string Name() const override { return kBarrierOp; }

// Provide stream operator for displaying it
friend std::ostream &operator<<(std::ostream &out, const BarrierOp &bo) {
bo.Print(out, false);


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/batch_op.cc View File

@@ -136,7 +136,7 @@ Status BatchOp::operator()() {

void BatchOp::Print(std::ostream &out, bool show_all) const {
// Always show the id and name as first line regardless if this summary or detailed print
out << "(" << std::setw(2) << operator_id_ << ") <BatchOp>:";
out << "(" << std::setw(2) << operator_id_ << ") <" << Name() << ">:";
if (!show_all) {
// Call the super class for displaying any common 1-liner info
ParallelOp::Print(out, show_all);


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/batch_op.h View File

@@ -200,7 +200,7 @@ class BatchOp : public ParallelOp {

// Op name getter
// @return Name of the current Op
std::string Name() const override { return "BatchOp"; }
std::string Name() const override { return kBatchOp; }

// batch the rows in src table then put it to dest table
// @param const std::unique_ptr<TensorQTable> *src - table that has the rows for batching


+ 0
- 2
mindspore/ccsrc/minddata/dataset/engine/datasetops/bucket_batch_by_length_op.cc View File

@@ -107,8 +107,6 @@ Status BucketBatchByLengthOp::EoeReceived(int32_t) {
return Status::OK();
}

void BucketBatchByLengthOp::Print(std::ostream &out, bool show_all) const { out << "BucketBatchByLengthOp\n"; }

Status BucketBatchByLengthOp::operator()() {
TaskManager::FindMe()->Post();



+ 1
- 4
mindspore/ccsrc/minddata/dataset/engine/datasetops/bucket_batch_by_length_op.h View File

@@ -109,10 +109,7 @@ class BucketBatchByLengthOp : public PipelineOp {
// @return Status - The error code returned
Status EoeReceived(int32_t) override;

// A print method typically used for debugging
// @param out - The output stream to write output to
// @param show_all - A bool to control if you want to show all info or just a summary
void Print(std::ostream &out, bool show_all) const override;
std::string Name() const override { return kBucketBatchByLengthOp; }

// << Stream output operator overload
// @notes This allows you to write the debug print info using stream operators


+ 2
- 0
mindspore/ccsrc/minddata/dataset/engine/datasetops/build_sentence_piece_vocab_op.h View File

@@ -157,6 +157,8 @@ class BuildSentencePieceVocabOp : public PipelineOp {

Status Reset() override { RETURN_STATUS_UNEXPECTED("Reset shouldn't be called in BuildSentencePieceVocabOp"); }

std::string Name() const override { return kBuildSentencePieceVocabOp; }

// build the input params for sentence api
std::unordered_map<std::string, std::string> BuildParams();



+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/build_vocab_op.cc View File

@@ -208,7 +208,7 @@ BuildVocabOp::Builder::Builder()
// A print method typically used for debugging
void BuildVocabOp::Print(std::ostream &out, bool show_all) const {
// Always show the id and name as first line regardless if this summary or detailed print
out << "(" << std::setw(2) << operator_id_ << ") <BuildVocabOp>:";
out << "(" << std::setw(2) << operator_id_ << ") <" << Name() << ">:";
if (!show_all) {
// Call the super class for displaying any common 1-liner info
ParallelOp::Print(out, show_all);


+ 1
- 0
mindspore/ccsrc/minddata/dataset/engine/datasetops/build_vocab_op.h View File

@@ -135,6 +135,7 @@ class BuildVocabOp : public ParallelOp {
/// \param[out] out The output stream to write output to
/// \param[in] show_all A bool to control if you want to show all info or just a summary
void Print(std::ostream &out, bool show_all) const override;
std::string Name() const override { return kBuildVocabOp; }

/// \briefStream output operator overload
/// \notes This allows you to write the debug print info using stream operators


+ 3
- 0
mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_base_op.h View File

@@ -59,6 +59,9 @@ class CacheBase : public ParallelOp {
/// \param show_all A bool to control if you want to show all info or just a summary
void Print(std::ostream &out, bool show_all) const override;

/// \brief Gives a name to the class, typically used for debugging
std::string Name() const override { return kCacheBase; }

/// \brief << Stream output operator overload
/// \notes This allows you to write the debug print info using stream operators
/// \param out reference to the output stream being overloaded


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_lookup_op.h View File

@@ -100,7 +100,7 @@ class CacheLookupOp : public CacheBase, public Sampler {
Status GetNextSample(std::unique_ptr<DataBuffer> *out_buffer) override;
void Print(std::ostream &out, bool show_all) const override;
bool AllowCacheMiss() override { return true; }
std::string Name() const override { return "CacheLookupOp"; }
std::string Name() const override { return kCacheLookupOp; }

/// \brief Base-class override for NodePass visitor acceptor
/// \param[in] p The node to visit


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_merge_op.cc View File

@@ -30,7 +30,7 @@ namespace dataset {
CacheMergeOp::~CacheMergeOp() = default;
void CacheMergeOp::Print(std::ostream &out, bool show_all)
const { // Always show the id and name as first line regardless if this is summary or detailed print
out << "(" << std::setw(2) << operator_id_ << ") <CacheMergeOp>:";
out << "(" << std::setw(2) << operator_id_ << ") <" << Name() << ">:";
if (!show_all) {
// Call the super class for displaying any common 1-liner info
ParallelOp::Print(out, show_all);


+ 2
- 0
mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_merge_op.h View File

@@ -140,6 +140,8 @@ class CacheMergeOp : public ParallelOp {
std::shared_ptr<CacheClient> cache_client, const std::shared_ptr<Sampler> &sampler);
~CacheMergeOp();
void Print(std::ostream &out, bool show_all) const override;
std::string Name() const override { return kCacheMergeOp; }

friend std::ostream &operator<<(std::ostream &out, const CacheMergeOp &mo) {
mo.Print(out, false);
return out;


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_op.h View File

@@ -140,7 +140,7 @@ class CacheOp : public CacheBase, public RandomAccessOp {
/// \brief Base-class override for handling cases if we allow cache miss
bool AllowCacheMiss() override { return false; }
/// \brief Base-class override for the name of this operator
std::string Name() const override { return "CacheOp"; }
std::string Name() const override { return kCacheOp; }
/// \brief A public wrapper for creating the cache through the client
/// \param[in] cache_crc The crc that identifies the cache
/// \see cache_pass.cc


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/concat_op.cc View File

@@ -43,7 +43,7 @@ ConcatOp::ConcatOp(int32_t op_connector_size) : PipelineOp(op_connector_size), c
// A function that prints info about the Operator
void ConcatOp::Print(std::ostream &out, bool show_all) const {
// Always show the id and name as first line regardless if this is summary or detailed print
out << "(" << std::setw(2) << operator_id_ << ") <ConcatOp>:";
out << "(" << std::setw(2) << operator_id_ << ") <" << Name() << ">:";
if (!show_all) {
// Call the super class for displaying any common 1-liner info
PipelineOp::Print(out, show_all);


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/concat_op.h View File

@@ -77,7 +77,7 @@ class ConcatOp : public PipelineOp {

// Op name getter
// @return Name of the current Op
std::string Name() const override { return "ConcatOp"; }
std::string Name() const override { return kConcatOp; }

// Private function for computing the assignment of the column name map.
// @return - Status


+ 2
- 0
mindspore/ccsrc/minddata/dataset/engine/datasetops/dataset_op.cc View File

@@ -239,6 +239,8 @@ void DatasetOp::Print(std::ostream &out, bool show_all) const {
if (sampler_) {
sampler_->Print(out, show_all);
}
} else {
out << Name() << std::endl;
}
}



+ 26
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/dataset_op.h View File

@@ -28,6 +28,31 @@
namespace mindspore {
namespace dataset {

constexpr char kBarrierOp[] = "BarrierOp";
constexpr char kBatchOp[] = "BatchOp";
constexpr char kBucketBatchByLengthOp[] = "BucketBatchByLengthOp";
constexpr char kBuildSentencePieceVocabOp[] = "BuildSentencePieceVocabOp";
constexpr char kBuildVocabOp[] = "BuildVocabOp";
constexpr char kCacheBase[] = "CacheBase";
constexpr char kCacheLookupOp[] = "CacheLookupOp";
constexpr char kCacheMergeOp[] = "CacheMergeOp";
constexpr char kCacheOp[] = "CacheOp";
constexpr char kConcatOp[] = "ConcatOp";
constexpr char kDatasetOp[] = "DatasetOp";
constexpr char kDeviceQueueOp[] = "DeviceQueueOp";
constexpr char kEpochCtrlOp[] = "EpochCtrlOp";
constexpr char kFilterOp[] = "FilterOp";
constexpr char kMapOp[] = "MapOp";
constexpr char kParallelOp[] = "ParallelOp";
constexpr char kPipelineOp[] = "PipelineOp";
constexpr char kProjectOp[] = "ProjectOp";
constexpr char kRenameOp[] = "RenameOp";
constexpr char kRepeatOp[] = "RepeatOp";
constexpr char kShuffleOp[] = "ShuffleOp";
constexpr char kSkipOp[] = "SkipOp";
constexpr char kTakeOp[] = "TakeOp";
constexpr char kZipOp[] = "ZipOp";

// Forward declare
class ExecutionTree;

@@ -292,7 +317,7 @@ class DatasetOp : public std::enable_shared_from_this<DatasetOp> {

/// Op name getter
/// \return Name of the current Op
virtual std::string Name() const { return "DatasetOp"; }
virtual std::string Name() const = 0;

/// Execution Tree getter
/// \return Pointer to the ExecutionTree the current op belongs to, no ownership


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/device_queue_op.cc View File

@@ -308,7 +308,7 @@ Status DeviceQueueOp::SendDataToCPU() {

void DeviceQueueOp::Print(std::ostream &out, bool show_all) const {
// Always show the id and name as first line regardless if this summary or detailed print
out << "(" << std::setw(2) << operator_id_ << ") <DeviceQueueOp>:";
out << "(" << std::setw(2) << operator_id_ << ") <" << Name() << ">:";
if (!show_all) {
// Call the super class for displaying any common 1-liner info
PipelineOp::Print(out, show_all);


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/device_queue_op.h View File

@@ -146,7 +146,7 @@ class DeviceQueueOp : public PipelineOp {

// Op name getter
// @return Name of the current Op
std::string Name() const override { return "DeviceQueueOp"; }
std::string Name() const override { return kDeviceQueueOp; }

private:
// Name: checkExceptions(DataBuffer);


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/epoch_ctrl_op.cc View File

@@ -43,7 +43,7 @@ EpochCtrlOp::~EpochCtrlOp() {}
// A print method typically used for debugging
void EpochCtrlOp::Print(std::ostream &out, bool show_all) const {
// Always show the id and name as first line regardless if this summary or detailed print
out << "(" << std::setw(2) << operator_id_ << ") <EpochCtrlOp>:";
out << "(" << std::setw(2) << operator_id_ << ") <" << Name() << ">:";
if (!show_all) {
// Call the super class for displaying any common 1-liner info
PipelineOp::Print(out, show_all);


+ 1
- 0
mindspore/ccsrc/minddata/dataset/engine/datasetops/epoch_ctrl_op.h View File

@@ -52,6 +52,7 @@ class EpochCtrlOp : public RepeatOp {
// @param out - The output stream to write output to
// @param show_all - A bool to control if you want to show all info or just a summary
void Print(std::ostream &out, bool show_all) const override;
std::string Name() const override { return kEpochCtrlOp; }

// This function returns the buffer that is at the top of our output connector. The caller is
// typically our parent node, when the parent is asking us to provide the next buffer of data.


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/filter_op.cc View File

@@ -91,7 +91,7 @@ Status FilterOp::ValidateInColumns(const std::vector<std::string> *input_columns
// A print method typically used for debugging.
void FilterOp::Print(std::ostream &out, bool show_all) const {
// Always show the id and name as first line regardless if this summary or detailed print
out << "(" << std::setw(2) << operator_id_ << ") <FilterOp>:";
out << "(" << std::setw(2) << operator_id_ << ") <" << Name() << ">:";
if (!show_all) {
// Call the super class for displaying any common 1-liner info
ParallelOp::Print(out, show_all);


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/filter_op.h View File

@@ -129,7 +129,7 @@ class FilterOp : public ParallelOp {

// Op name getter
// @return Name of the current Op
std::string Name() const override { return "FilterOp"; }
std::string Name() const override { return kFilterOp; }

private:
// predicate_func python callable which returns a boolean value.


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op.cc View File

@@ -84,7 +84,7 @@ int32_t MapOp::num_consumers() const {
// A print method typically used for debugging
void MapOp::Print(std::ostream &out, bool show_all) const {
// Always show the id and name as first line regardless if this summary or detailed print
out << "(" << std::setw(2) << operator_id_ << ") <MapOp>:";
out << "(" << std::setw(2) << operator_id_ << ") <" << Name() << ">:";
if (!show_all) {
// Call the super class for displaying any common 1-liner info
ParallelOp::Print(out, show_all);


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op.h View File

@@ -179,7 +179,7 @@ class MapOp : public ParallelOp {

// Op name getter
// @return Name of the current Op
std::string Name() const override { return "MapOp"; }
std::string Name() const override { return kMapOp; }

// List of tensor ops getter/setter
// @Return the vector of tensor ops by non-const reference


+ 2
- 0
mindspore/ccsrc/minddata/dataset/engine/datasetops/parallel_op.h View File

@@ -17,6 +17,7 @@
#define MINDSPORE_CCSRC_MINDDATA_DATASET_ENGINE_DATASETOPS_PARALLEL_OP_H_

#include <memory>
#include <string>
#include <vector>
#include "minddata/dataset/core/constants.h"
#include "minddata/dataset/engine/datasetops/dataset_op.h"
@@ -54,6 +55,7 @@ class ParallelOp : public DatasetOp {
// @param out - The output stream to write output to
// @param show_all - A bool to control if you want to show all info or just a summary
void Print(std::ostream &out, bool show_all) const override;
std::string Name() const override { return kParallelOp; }

// << Stream output operator overload
// @notes This allows you to write the debug print info using stream operators


+ 2
- 0
mindspore/ccsrc/minddata/dataset/engine/datasetops/pipeline_op.h View File

@@ -17,6 +17,7 @@
#define MINDSPORE_CCSRC_MINDDATA_DATASET_ENGINE_DATASETOPS_PIPELINE_OP_H_

#include <memory>
#include <string>
#include <vector>
#include "minddata/dataset/engine/datasetops/dataset_op.h"

@@ -42,6 +43,7 @@ class PipelineOp : public DatasetOp {
// @param out - The output stream to write output to
// @param show_all - A bool to control if you want to show all info or just a summary
void Print(std::ostream &out, bool show_all) const override;
std::string Name() const override { return kPipelineOp; }

// << Stream output operator overload
// @notes This allows you to write the debug print info using stream operators


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/project_op.cc View File

@@ -52,7 +52,7 @@ ProjectOp::ProjectOp(const std::vector<std::string> &columns_to_project)

void ProjectOp::Print(std::ostream &out, bool show_all) const {
// Always show the id and name as first line regardless if this summary or detailed print
out << "(" << std::setw(2) << operator_id_ << ") <ProjectOp>:";
out << "(" << std::setw(2) << operator_id_ << ") <" << Name() << ">:";
if (!show_all) {
// Call the super class for displaying any common 1-liner info
PipelineOp::Print(out, show_all);


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/project_op.h View File

@@ -109,7 +109,7 @@ class ProjectOp : public PipelineOp {

// Op name getter
// @return Name of the current Op
std::string Name() const override { return "ProjectOp"; }
std::string Name() const override { return kProjectOp; }

private:
std::vector<std::string> columns_to_project_;


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/rename_op.cc View File

@@ -142,7 +142,7 @@ Status RenameOp::ComputeColMap() {
void RenameOp::Print(std::ostream &out, // In: The output stream to print to
bool show_all) const { // In: T/F if it should print everything
// Always show the id and name as first line regardless if this summary or detailed print
out << "(" << std::setw(2) << operator_id_ << ") <RenameOp>:";
out << "(" << std::setw(2) << operator_id_ << ") <" << Name() << ">:";
if (!show_all) {
// Call the super class for displaying any common 1-liner info
PipelineOp::Print(out, show_all);


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/rename_op.h View File

@@ -118,7 +118,7 @@ class RenameOp : public PipelineOp {

// Op name getter
// @return Name of the current Op
std::string Name() const override { return "RenameOp"; }
std::string Name() const override { return kRenameOp; }

protected:
// Rename core functionality


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/repeat_op.cc View File

@@ -54,7 +54,7 @@ RepeatOp::~RepeatOp() {}
// A print method typically used for debugging
void RepeatOp::Print(std::ostream &out, bool show_all) const {
// Always show the id and name as first line regardless if this summary or detailed print
out << "(" << std::setw(2) << operator_id_ << ") <RepeatOp>:";
out << "(" << std::setw(2) << operator_id_ << ") <" << Name() << ">:";
if (!show_all) {
// Call the super class for displaying any common 1-liner info
PipelineOp::Print(out, show_all);


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/repeat_op.h View File

@@ -129,7 +129,7 @@ class RepeatOp : public PipelineOp {

// Op name getter
// @return Name of the current Op
std::string Name() const override { return "RepeatOp"; }
std::string Name() const override { return kRepeatOp; }

// \brief Adds an operator to the repeat ops list of tracked leaf/eoe nodes
// \param[in] eoe_op The input leaf/eoe operator to add to the list


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/shuffle_op.cc View File

@@ -101,7 +101,7 @@ Status ShuffleOp::SelfReset() {
// A print method typically used for debugging
void ShuffleOp::Print(std::ostream &out, bool show_all) const {
// Always show the id and name as first line regardless if this summary or detailed print
out << "(" << std::setw(2) << operator_id_ << ") <ShuffleOp>:";
out << "(" << std::setw(2) << operator_id_ << ") <" << Name() << ">:";
if (!show_all) {
// Call the super class for displaying any common 1-liner info
PipelineOp::Print(out, show_all);


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/shuffle_op.h View File

@@ -163,7 +163,7 @@ class ShuffleOp : public PipelineOp {

// Op name getter
// @return Name of the current Op
std::string Name() const override { return "ShuffleOp"; }
std::string Name() const override { return kShuffleOp; }

private:
// Private function to add a new row to the shuffle buffer.


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/skip_op.cc View File

@@ -59,7 +59,7 @@ SkipOp::~SkipOp() {}
// A print method typically used for debugging
void SkipOp::Print(std::ostream &out, bool show_all) const {
// Always show the id and name as first line regardless if this summary or detailed print
out << "(" << std::setw(2) << operator_id_ << ") <SkipOp>:";
out << "(" << std::setw(2) << operator_id_ << ") <" << Name() << ">:";
if (!show_all) {
// Call the super class for displaying any common 1-liner info
PipelineOp::Print(out, show_all);


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/skip_op.h View File

@@ -82,7 +82,7 @@ class SkipOp : public PipelineOp {

// Op name getter
// @return Name of the current Op
std::string Name() const override { return "SkipOp"; }
std::string Name() const override { return kSkipOp; }

private:
int32_t max_skips_; // The number of skips that the user requested


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/take_op.cc View File

@@ -54,7 +54,7 @@ TakeOp::TakeOp(int32_t count, int32_t op_connector_size)
// A print method typically used for debugging
void TakeOp::Print(std::ostream &out, bool show_all) const {
// Always show the id and name as first line regardless if this summary or detailed print
out << "(" << std::setw(2) << operator_id_ << ") <TakeOp>:";
out << "(" << std::setw(2) << operator_id_ << ") <" << Name() << ">:";
if (!show_all) {
// Call the super class for displaying any common 1-liner info
PipelineOp::Print(out, show_all);


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/take_op.h View File

@@ -86,7 +86,7 @@ class TakeOp : public PipelineOp {

// Op name getter
// @return Name of the current Op
std::string Name() const override { return "TakeOp"; }
std::string Name() const override { return kTakeOp; }

private:
int32_t max_takes_; // The number of takes that the user requested


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/zip_op.cc View File

@@ -209,7 +209,7 @@ Status ZipOp::drainPipeline() {
void ZipOp::Print(std::ostream &out, // In: The output stream to print to
bool show_all) const { // In: T/F if it should print everything
// Always show the id and name as first line regardless if this is summary or detailed print
out << "(" << std::setw(2) << operator_id_ << ") <ZipOp>:";
out << "(" << std::setw(2) << operator_id_ << ") <" << Name() << ">:";
if (!show_all) {
// Call the super class for displaying any common 1-liner info
PipelineOp::Print(out, show_all);


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/zip_op.h View File

@@ -112,7 +112,7 @@ class ZipOp : public PipelineOp {

// Op name getter
// @return Name of the current Op
std::string Name() const override { return "ZipOp"; }
std::string Name() const override { return kZipOp; }

private:
// Handles preprocessing of the main loop, used when starting new epoch


+ 0
- 1
mindspore/ccsrc/minddata/dataset/kernels/data/concatenate_op.h View File

@@ -40,7 +40,6 @@ class ConcatenateOp : public TensorOp {

/// Print method to see which tensor Op this is.
/// @param std::ostream &out - output stream object.
void Print(std::ostream &out) const override { out << "ConcatenateOp"; }

/// Compute method allowing multiple tensors as inputs
/// @param TensorRow &input - input tensor rows


+ 0
- 2
mindspore/ccsrc/minddata/dataset/kernels/data/duplicate_op.h View File

@@ -32,8 +32,6 @@ class DuplicateOp : public TensorOp {

~DuplicateOp() override = default;

void Print(std::ostream &out) const override { out << "DuplicateOp"; }

Status Compute(const TensorRow &input, TensorRow *output) override;

uint32_t NumOutput() override { return 2; }


+ 0
- 1
mindspore/ccsrc/minddata/dataset/kernels/data/fill_op.h View File

@@ -31,7 +31,6 @@ class FillOp : public TensorOp {
explicit FillOp(std::shared_ptr<Tensor> value) : fill_value_(value) {}

~FillOp() override = default;
void Print(std::ostream &out) const override { out << "FillOp"; }

Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;



+ 0
- 2
mindspore/ccsrc/minddata/dataset/kernels/data/mask_op.h View File

@@ -37,8 +37,6 @@ class MaskOp : public TensorOp {

~MaskOp() override = default;

void Print(std::ostream &out) const override { out << "MaskOp"; }

Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;

Status OutputType(const std::vector<DataType> &inputs, std::vector<DataType> &outputs) override;


+ 0
- 2
mindspore/ccsrc/minddata/dataset/kernels/data/one_hot_op.h View File

@@ -31,8 +31,6 @@ class OneHotOp : public TensorOp {

~OneHotOp() override = default;

void Print(std::ostream &out) const override { out << "OneHotOp"; }

Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;

Status OutputShape(const std::vector<TensorShape> &inputs, std::vector<TensorShape> &outputs) override;


+ 0
- 2
mindspore/ccsrc/minddata/dataset/kernels/data/pad_end_op.h View File

@@ -32,8 +32,6 @@ class PadEndOp : public TensorOp {

~PadEndOp() override = default;

void Print(std::ostream &out) const override { out << "PadEndOp"; }

Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;

Status OutputShape(const std::vector<TensorShape> &inputs, std::vector<TensorShape> &outputs) override;


+ 0
- 2
mindspore/ccsrc/minddata/dataset/kernels/data/slice_op.h View File

@@ -67,8 +67,6 @@ class SliceOp : public TensorOp {

~SliceOp() override = default;

void Print(std::ostream &out) const override { out << "SliceOp"; }

Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;

std::string Name() const override { return kSliceOp; }


+ 0
- 2
mindspore/ccsrc/minddata/dataset/kernels/data/to_float16_op.h View File

@@ -39,8 +39,6 @@ class ToFloat16Op : public TensorOp {
// @return Status - The error code return
Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;

void Print(std::ostream &out) const override { out << "ToFloat16Op"; }

Status OutputType(const std::vector<DataType> &inputs, std::vector<DataType> &outputs) override;

std::string Name() const override { return kToFloat16Op; }


+ 0
- 1
mindspore/ccsrc/minddata/dataset/kernels/data/type_cast_op.h View File

@@ -39,7 +39,6 @@ class TypeCastOp : public TensorOp {

Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;

void Print(std::ostream &out) const override { out << "TypeCastOp"; }
Status OutputType(const std::vector<DataType> &inputs, std::vector<DataType> &outputs) override;

std::string Name() const override { return kTypeCastOp; }


+ 0
- 2
mindspore/ccsrc/minddata/dataset/kernels/image/auto_contrast_op.h View File

@@ -45,8 +45,6 @@ class AutoContrastOp : public TensorOp {
return out;
}

void Print(std::ostream &out) const override { out << Name(); }

std::string Name() const override { return kAutoContrastOp; }

Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;


+ 0
- 2
mindspore/ccsrc/minddata/dataset/kernels/image/bounding_box_augment_op.h View File

@@ -47,8 +47,6 @@ class BoundingBoxAugmentOp : public TensorOp {
return out;
}

void Print(std::ostream &out) const override { out << "BoundingBoxAugmentOp"; }

Status Compute(const TensorRow &input, TensorRow *output) override;

std::string Name() const override { return kBoundingBoxAugmentOp; }


+ 0
- 1
mindspore/ccsrc/minddata/dataset/kernels/image/decode_op.h View File

@@ -37,7 +37,6 @@ class DecodeOp : public TensorOp {

Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;

void Print(std::ostream &out) const override { out << "DecodeOp"; }
Status OutputShape(const std::vector<TensorShape> &inputs, std::vector<TensorShape> &outputs) override;
Status OutputType(const std::vector<DataType> &inputs, std::vector<DataType> &outputs) override;



+ 0
- 3
mindspore/ccsrc/minddata/dataset/kernels/image/equalize_op.h View File

@@ -32,9 +32,6 @@ class EqualizeOp : public TensorOp {
EqualizeOp() {}
~EqualizeOp() = default;

// Description: A function that prints info about the node
void Print(std::ostream &out) const override { out << Name(); }

Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;

std::string Name() const override { return kEqualizeOp; }


+ 0
- 2
mindspore/ccsrc/minddata/dataset/kernels/image/hwc_to_chw_op.h View File

@@ -28,8 +28,6 @@ namespace mindspore {
namespace dataset {
class HwcToChwOp : public TensorOp {
public:
void Print(std::ostream &out) const override { out << "HwcToChw"; }

Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;
Status OutputShape(const std::vector<TensorShape> &inputs, std::vector<TensorShape> &outputs) override;



+ 0
- 3
mindspore/ccsrc/minddata/dataset/kernels/image/invert_op.h View File

@@ -31,9 +31,6 @@ class InvertOp : public TensorOp {
InvertOp() {}
~InvertOp() = default;

// Description: A function that prints info about the node
void Print(std::ostream &out) const override { out << Name(); }

Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;

std::string Name() const override { return kInvertOp; }


+ 0
- 2
mindspore/ccsrc/minddata/dataset/kernels/image/pad_op.h View File

@@ -49,8 +49,6 @@ class PadOp : public TensorOp {

~PadOp() override = default;

void Print(std::ostream &out) const override { out << "PadOp: "; }

Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;
Status OutputShape(const std::vector<TensorShape> &inputs, std::vector<TensorShape> &outputs) override;



+ 0
- 4
mindspore/ccsrc/minddata/dataset/kernels/image/random_color_adjust_op.h View File

@@ -47,10 +47,6 @@ class RandomColorAdjustOp : public TensorOp {

~RandomColorAdjustOp() override = default;

// Print function for RandomJitter.
// @param out output stream to print to.
void Print(std::ostream &out) const override { out << "RandomColorAdjustOp: "; }

// Overrides the base class compute function.
// Calls multiple transform functions in ImageUtils, this function takes an input tensor.
// and transforms its data using openCV, the output memory is manipulated to contain the result.


+ 1
- 2
mindspore/ccsrc/minddata/dataset/kernels/image/random_crop_decode_resize_op.h View File

@@ -40,8 +40,7 @@ class RandomCropDecodeResizeOp : public RandomCropAndResizeOp {
~RandomCropDecodeResizeOp() override = default;

void Print(std::ostream &out) const override {
out << "RandomCropDecodeResize: " << RandomCropAndResizeOp::target_height_ << " "
<< RandomCropAndResizeOp::target_width_;
out << Name() << ": " << RandomCropAndResizeOp::target_height_ << " " << RandomCropAndResizeOp::target_width_;
}

Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;


+ 1
- 1
mindspore/ccsrc/minddata/dataset/kernels/image/random_crop_op.h View File

@@ -52,7 +52,7 @@ class RandomCropOp : public TensorOp {

~RandomCropOp() override = default;

void Print(std::ostream &out) const override { out << "RandomCropOp: " << crop_height_ << " " << crop_width_; }
void Print(std::ostream &out) const override { out << Name() << ": " << crop_height_ << " " << crop_width_; }

Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;



+ 1
- 1
mindspore/ccsrc/minddata/dataset/kernels/image/random_crop_with_bbox_op.h View File

@@ -38,7 +38,7 @@ class RandomCropWithBBoxOp : public RandomCropOp {
~RandomCropWithBBoxOp() override = default;

void Print(std::ostream &out) const override {
out << "RandomCropWithBBoxOp: " << RandomCropOp::crop_height_ << " " << RandomCropOp::crop_width_;
out << Name() << ": " << RandomCropOp::crop_height_ << " " << RandomCropOp::crop_width_;
}

Status Compute(const TensorRow &input, TensorRow *output) override;


+ 0
- 2
mindspore/ccsrc/minddata/dataset/kernels/image/random_horizontal_flip_op.h View File

@@ -44,8 +44,6 @@ class RandomHorizontalFlipOp : public TensorOp {
return out;
}

void Print(std::ostream &out) const override { out << "RandomHorizontalFlipOp"; }

Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;

std::string Name() const override { return kRandomHorizontalFlipOp; }


+ 0
- 2
mindspore/ccsrc/minddata/dataset/kernels/image/random_horizontal_flip_with_bbox_op.h View File

@@ -45,8 +45,6 @@ class RandomHorizontalFlipWithBBoxOp : public TensorOp {
return out;
}

void Print(std::ostream &out) const override { out << "RandomHorizontalFlipWithBBoxOp"; }

Status Compute(const TensorRow &input, TensorRow *output) override;

std::string Name() const override { return kRandomHorizontalFlipWithBBoxOp; }


+ 1
- 3
mindspore/ccsrc/minddata/dataset/kernels/image/random_resize_op.h View File

@@ -40,9 +40,7 @@ class RandomResizeOp : public ResizeOp {
~RandomResizeOp() = default;

// Description: A function that prints info about the node
void Print(std::ostream &out) const override {
out << "RandomResizeOp: " << ResizeOp::size1_ << " " << ResizeOp::size2_;
}
void Print(std::ostream &out) const override { out << Name() << ": " << ResizeOp::size1_ << " " << ResizeOp::size2_; }

Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;



+ 1
- 1
mindspore/ccsrc/minddata/dataset/kernels/image/random_resize_with_bbox_op.h View File

@@ -42,7 +42,7 @@ class RandomResizeWithBBoxOp : public ResizeWithBBoxOp {

// Description: A function that prints info about the node
void Print(std::ostream &out) const override {
out << "RandomResizeWithBBoxOp: " << ResizeWithBBoxOp::size1_ << " " << ResizeWithBBoxOp::size2_;
out << Name() << ": " << ResizeWithBBoxOp::size1_ << " " << ResizeWithBBoxOp::size2_;
}

Status Compute(const TensorRow &input, TensorRow *output) override;


+ 0
- 4
mindspore/ccsrc/minddata/dataset/kernels/image/random_rotation_op.h View File

@@ -58,10 +58,6 @@ class RandomRotationOp : public TensorOp {

~RandomRotationOp() override = default;

// Print function for RandomRotation
// @param out output stream to print to
void Print(std::ostream &out) const override { out << "RandomRotationOp: "; }

// Overrides the base class compute function
// Calls the rotate function in ImageUtils, this function takes an input tensor
// and transforms its data using openCV, the output memory is manipulated to contain the result


+ 0
- 2
mindspore/ccsrc/minddata/dataset/kernels/image/random_vertical_flip_op.h View File

@@ -38,8 +38,6 @@ class RandomVerticalFlipOp : public TensorOp {

~RandomVerticalFlipOp() override = default;

void Print(std::ostream &out) const override { out << "RandomVerticalFlipOp"; }

Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;

std::string Name() const override { return kRandomVerticalFlipOp; }


+ 0
- 2
mindspore/ccsrc/minddata/dataset/kernels/image/random_vertical_flip_with_bbox_op.h View File

@@ -39,8 +39,6 @@ class RandomVerticalFlipWithBBoxOp : public TensorOp {

~RandomVerticalFlipWithBBoxOp() override = default;

void Print(std::ostream &out) const override { out << "RandomVerticalFlipWithBBoxOp"; }

Status Compute(const TensorRow &input, TensorRow *output) override;

std::string Name() const override { return kRandomVerticalFlipWithBBoxOp; }


+ 1
- 1
mindspore/ccsrc/minddata/dataset/kernels/image/rescale_op.h View File

@@ -33,7 +33,7 @@ class RescaleOp : public TensorOp {
~RescaleOp() override = default;

void Print(std::ostream &out) const override {
out << "RescaleOp: shift: " << shift_ << ", Rescale: " << rescale_ << std::endl;
out << Name() << ": shift: " << shift_ << ", Rescale: " << rescale_ << std::endl;
}

Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;


+ 0
- 1
mindspore/ccsrc/minddata/dataset/kernels/image/resize_bilinear_op.cc View File

@@ -22,6 +22,5 @@ namespace mindspore {
namespace dataset {
const int32_t ResizeBilinearOp::kDefWidth = 0;

void ResizeBilinearOp::Print(std::ostream &out) const { out << "ResizeBilinearOp: "; }
} // namespace dataset
} // namespace mindspore

+ 0
- 4
mindspore/ccsrc/minddata/dataset/kernels/image/resize_bilinear_op.h View File

@@ -48,10 +48,6 @@ class ResizeBilinearOp : public ResizeOp {
// Description: Destructor
~ResizeBilinearOp() = default;

// Name: Print()
// Description: A function that prints info about the node
void Print(std::ostream &out) const override;

std::string Name() const override { return kResizeBilinearOp; }
};
} // namespace dataset


+ 1
- 1
mindspore/ccsrc/minddata/dataset/kernels/image/resize_op.h View File

@@ -50,7 +50,7 @@ class ResizeOp : public TensorOp {

~ResizeOp() override = default;

void Print(std::ostream &out) const override { out << "ResizeOp: " << size1_ << " " << size2_; }
void Print(std::ostream &out) const override { out << Name() << ": " << size1_ << " " << size2_; }

Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;
Status OutputShape(const std::vector<TensorShape> &inputs, std::vector<TensorShape> &outputs) override;


+ 1
- 1
mindspore/ccsrc/minddata/dataset/kernels/image/resize_with_bbox_op.h View File

@@ -34,7 +34,7 @@ class ResizeWithBBoxOp : public ResizeOp {

~ResizeWithBBoxOp() override = default;

void Print(std::ostream &out) const override { out << "ResizeWithBBoxOp: " << size1_ << " " << size2_; }
void Print(std::ostream &out) const override { out << Name() << ": " << size1_ << " " << size2_; }

Status Compute(const TensorRow &input, TensorRow *output) override;



+ 1
- 1
mindspore/ccsrc/minddata/dataset/kernels/image/uniform_aug_op.h View File

@@ -40,7 +40,7 @@ class UniformAugOp : public TensorOp {
// Destructor
~UniformAugOp() override = default;

void Print(std::ostream &out) const override { out << "UniformAugOp:: number of ops " << num_ops_; }
void Print(std::ostream &out) const override { out << Name() << ":: number of ops " << num_ops_; }

// Overrides the base class compute function
// @return Status - The error code return


+ 0
- 2
mindspore/ccsrc/minddata/dataset/kernels/no_op.h View File

@@ -31,8 +31,6 @@ class NoOp : public TensorOp {
return Status::OK();
}

void Print(std::ostream &out) const override { out << "NoOp"; };

std::string Name() const override { return kNoOp; }
};
} // namespace dataset


+ 0
- 2
mindspore/ccsrc/minddata/dataset/kernels/tensor_op.cc View File

@@ -48,8 +48,6 @@ Status TensorOp::Compute(const TensorRow &input, TensorRow *output) {
"Is this TensorOp oneToOne? If no, please implement this Compute() in the derived class.");
}

void TensorOp::Print(std::ostream &out) const { out << "TensorOp" << std::endl; }

Status TensorOp::OutputShape(const std::vector<TensorShape> &inputs, std::vector<TensorShape> &outputs) {
if (inputs.size() != NumInput())
return Status(StatusCode::kUnexpectedError,


+ 5
- 2
mindspore/ccsrc/minddata/dataset/kernels/tensor_op.h View File

@@ -86,6 +86,9 @@
namespace mindspore {
namespace dataset {

// base class
constexpr char kTensorOp[] = "TensorOp";

// image
constexpr char kAutoContrastOp[] = "AutoContrastOp";
constexpr char kBoundingBoxAugmentOp[] = "BoundingBoxAugmentOp";
@@ -142,7 +145,7 @@ constexpr char kRandomSelectSubpolicyOp[] = "RandomSelectSubpolicyOp";
constexpr char kSentencepieceTokenizerOp[] = "SentencepieceTokenizerOp";

// data
constexpr char kConcatenateOp[] = "kConcatenateOp";
constexpr char kConcatenateOp[] = "ConcatenateOp";
constexpr char kDuplicateOp[] = "DuplicateOp";
constexpr char kFillOp[] = "FillOp";
constexpr char kMaskOp[] = "MaskOp";
@@ -165,7 +168,7 @@ class TensorOp {

// A function that prints info about the tensor operation
// @param out
virtual void Print(std::ostream &out) const;
virtual void Print(std::ostream &out) const { out << Name() << std::endl; }

// Provide stream operator for displaying it
// @param output stream


+ 0
- 2
mindspore/ccsrc/minddata/dataset/text/kernels/basic_tokenizer_op.h View File

@@ -45,8 +45,6 @@ class BasicTokenizerOp : public TensorOp {

~BasicTokenizerOp() override = default;

void Print(std::ostream &out) const override { out << "BasicTokenizerOp"; }

Status Compute(const TensorRow &input, TensorRow *output) override;

protected:


+ 0
- 2
mindspore/ccsrc/minddata/dataset/text/kernels/bert_tokenizer_op.h View File

@@ -42,8 +42,6 @@ class BertTokenizerOp : public TensorOp {

~BertTokenizerOp() override = default;

void Print(std::ostream &out) const override { out << "BertTokenizerOp"; }

Status Compute(const TensorRow &input, TensorRow *output) override;

std::string Name() const override { return kBertTokenizerOp; }


+ 0
- 2
mindspore/ccsrc/minddata/dataset/text/kernels/case_fold_op.h View File

@@ -31,8 +31,6 @@ class CaseFoldOp : public TensorOp {

~CaseFoldOp() override = default;

void Print(std::ostream &out) const override { out << "CaseFoldOp"; }

Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;

std::string Name() const override { return kCaseFoldOp; }


+ 1
- 2
mindspore/ccsrc/minddata/dataset/text/kernels/jieba_tokenizer_op.h View File

@@ -46,8 +46,7 @@ class JiebaTokenizerOp : public TensorOp {
~JiebaTokenizerOp() override = default;

void Print(std::ostream &out) const override {
out << "JiebaTokenizerOp: " << jieba_mode_ << "hmm_model_path_ " << hmm_model_path_ << "mp_dict_path_"
<< mp_dict_path_;
out << Name() << ": " << jieba_mode_ << "hmm_model_path_ " << hmm_model_path_ << "mp_dict_path_" << mp_dict_path_;
}

Status Compute(const TensorRow &input, TensorRow *output) override;


+ 0
- 2
mindspore/ccsrc/minddata/dataset/text/kernels/normalize_utf8_op.h View File

@@ -39,8 +39,6 @@ class NormalizeUTF8Op : public TensorOp {

~NormalizeUTF8Op() override = default;

void Print(std::ostream &out) const override { out << "NormalizeUTF8Op"; }

Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;

std::string Name() const override { return kNormalizeUTF8Op; }


+ 0
- 2
mindspore/ccsrc/minddata/dataset/text/kernels/regex_replace_op.h View File

@@ -38,8 +38,6 @@ class RegexReplaceOp : public TensorOp {

~RegexReplaceOp() override = default;

void Print(std::ostream &out) const override { out << "RegexReplaceOp"; }

Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;

std::string Name() const override { return kRegexReplaceOp; }


+ 0
- 2
mindspore/ccsrc/minddata/dataset/text/kernels/regex_tokenizer_op.h View File

@@ -43,8 +43,6 @@ class RegexTokenizerOp : public TensorOp {

~RegexTokenizerOp() override = default;

void Print(std::ostream &out) const override { out << "RegexTokenizerOp"; }

Status Compute(const TensorRow &input, TensorRow *output) override;

protected:


+ 1
- 1
mindspore/ccsrc/minddata/dataset/text/kernels/sentence_piece_tokenizer_op.h View File

@@ -45,7 +45,7 @@ class SentencePieceTokenizerOp : public TensorOp {
Status GetModelRealPath(const std::string &model_path, const std::string &filename);

void Print(std::ostream &out) const override {
out << "SentencePieceTokenizerOp out_type = " << out_type_ << " load_type = " << load_type_;
out << Name() << " out_type = " << out_type_ << " load_type = " << load_type_;
}

Status Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) override;


+ 0
- 4
mindspore/ccsrc/minddata/dataset/text/kernels/sliding_window_op.h View File

@@ -52,10 +52,6 @@ class SlidingWindowOp : public TensorOp {
/// \return Status return code
Status OutputShape(const std::vector<TensorShape> &inputs, std::vector<TensorShape> &outputs) override;

/// \brief Print args for debugging.
/// \param[in] out - std::ostream &out.
void Print(std::ostream &out) const override { out << "SliceWindowOp"; }

/// \brief Print name of op.
std::string Name() const override { return kSlidingWindowOp; }



+ 0
- 2
mindspore/ccsrc/minddata/dataset/text/kernels/truncate_sequence_pair_op.h View File

@@ -36,8 +36,6 @@ class TruncateSequencePairOp : public TensorOp {

~TruncateSequencePairOp() override = default;

void Print(std::ostream &out) const override { out << "TruncateSequencePairOp"; }

Status Compute(const TensorRow &input, TensorRow *output) override;

std::string Name() const override { return kTruncateSequencePairOp; }


+ 0
- 2
mindspore/ccsrc/minddata/dataset/text/kernels/unicode_char_tokenizer_op.h View File

@@ -33,8 +33,6 @@ class UnicodeCharTokenizerOp : public TensorOp {

~UnicodeCharTokenizerOp() override = default;

void Print(std::ostream &out) const override { out << "UnicodeCharTokenizerOp"; }

Status Compute(const TensorRow &input, TensorRow *output) override;

std::string Name() const override { return kUnicodeCharTokenizerOp; }


+ 0
- 2
mindspore/ccsrc/minddata/dataset/text/kernels/unicode_script_tokenizer_op.h View File

@@ -36,8 +36,6 @@ class UnicodeScriptTokenizerOp : public TensorOp {

~UnicodeScriptTokenizerOp() override = default;

void Print(std::ostream &out) const override { out << "UnicodeScriptTokenizerOp"; }

Status Compute(const TensorRow &input, TensorRow *output) override;

std::string Name() const override { return kUnicodeScriptTokenizerOp; }


+ 0
- 2
mindspore/ccsrc/minddata/dataset/text/kernels/whitespace_tokenizer_op.h View File

@@ -33,8 +33,6 @@ class WhitespaceTokenizerOp : public TensorOp {

~WhitespaceTokenizerOp() override = default;

void Print(std::ostream &out) const override { out << "WhitespaceTokenizerOp"; }

Status Compute(const TensorRow &input, TensorRow *output) override;

std::string Name() const override { return kWhitespaceTokenizerOp; }


+ 0
- 2
mindspore/ccsrc/minddata/dataset/text/kernels/wordpiece_tokenizer_op.h View File

@@ -44,8 +44,6 @@ class WordpieceTokenizerOp : public TensorOp {
~WordpieceTokenizerOp() override = default;
void Print(std::ostream &out) const override { out << "WordpieceTokenizerOp"; }
Status Compute(const TensorRow &input, TensorRow *output) override;
protected:


+ 4
- 1
tests/ut/cpp/dataset/batch_op_test.cc View File

@@ -78,7 +78,10 @@ std::shared_ptr<de::ExecutionTree> Build(std::vector<std::shared_ptr<de::Dataset
TEST_F(MindDataTestBatchOp, TestSimpleBatch) {
std::string schema_file = datasets_root_path_ + "/testBatchDataset/test.data";
bool success = false;
auto tree = Build({TFReader(schema_file), Batch(12)});
const std::shared_ptr<de::BatchOp> &op = Batch(12);
EXPECT_EQ(op->Name(), "BatchOp");

auto tree = Build({TFReader(schema_file), op});
tree->Prepare();
Status rc = tree->Launch();
if (rc.IsError()) {


+ 0
- 8
tests/ut/cpp/dataset/concatenate_op_test.cc View File

@@ -55,13 +55,5 @@ TEST_F(MindDataTestConcatenateOp, TestOp) {
ASSERT_TRUE(output->type() == expected->type());
MS_LOG(DEBUG) << *output << std::endl;
MS_LOG(DEBUG) << *expected << std::endl;

ASSERT_TRUE(*output == *expected);

// std::vector<TensorShape> inputs = {TensorShape({3})};
// std::vector<TensorShape> outputs = {};
// s = op->OutputShape(inputs, outputs);
// EXPECT_TRUE(s.IsOk());
// ASSERT_TRUE(outputs[0] == TensorShape{6});
// MS_LOG(INFO) << "MindDataTestConcatenateOp-TestOp end.";
}

Loading…
Cancel
Save