text: /**
   * Copyright 2021 Huawei Technologies Co., Ltd
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   * http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  #ifndef MINDSPORE_CCSRC_MINDDATA_DATASET_KERNELS_IR_VISION_SLICE_PATCHES_IR_H_
  #define MINDSPORE_CCSRC_MINDDATA_DATASET_KERNELS_IR_VISION_SLICE_PATCHES_IR_H_
  
  #include <memory>
  #include <string>
  #include <utility>
  #include <vector>
  
  #include "include/api/status.h"
  #include "minddata/dataset/include/dataset/constants.h"
  #include "minddata/dataset/include/dataset/transforms.h"
  #include "minddata/dataset/kernels/ir/tensor_operation.h"
  
  namespace mindspore {
  namespace dataset {
  
  namespace vision {
  
  constexpr char kSlicePatchesOperation[] = "SlicePatches";
  
  class SlicePatchesOperation : public TensorOperation {
   public:
    SlicePatchesOperation(int32_t num_height, int32_t num_width, SliceMode slice_mode, uint8_t fill_value);
  
    ~SlicePatchesOperation();
  
    std::shared_ptr<TensorOp> Build() override;
  
    Status ValidateParams() override;
  
    std::string Name() const override;
  
    Status to_json(nlohmann::json *out_json) override;
  
    static Status from_json(nlohmann::json op_params, std::shared_ptr<TensorOperation> *operation);
  
   private:
    int32_t num_height_;
    int32_t num_width_;
    SliceMode slice_mode_;
    uint8_t fill_value_;
  };
  
  }  // namespace vision
  }  // namespace dataset
  }  // namespace mindspore
  #endif  // MINDSPORE_CCSRC_MINDDATA_DATASET_KERNELS_IR_VISION_SLICE_PATCHES_IR_H_
  