1 // 2 // CoreMLRaster.hpp 3 // MNN 4 // 5 // Created by MNN on 2021/03/25. 6 // Copyright © 2018, Alibaba Group Holding Limited 7 // 8 9 #ifndef MNN_COREMLRASTER_HPP 10 #define MNN_COREMLRASTER_HPP 11 12 #include "CoreMLCommonExecution.hpp" 13 #include "CoreMLBackend.hpp" 14 15 namespace MNN { 16 17 class CoreMLRaster : public CoreMLCommonExecution { 18 public: 19 CoreMLRaster(Backend *b, const Op *op, const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs); 20 ErrorCode onResize(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs); 21 virtual ~CoreMLRaster() = default; 22 private: 23 bool rasterOptimization(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs); 24 bool buildPermute(CoreML__Specification__NeuralNetworkLayer* layer, const Tensor* input, const Tensor* output); 25 bool buildReshape(CoreML__Specification__NeuralNetworkLayer* layer, const Tensor* input, const Tensor* output); 26 bool buildPad(CoreML__Specification__NeuralNetworkLayer* layer, const Tensor* input, const Tensor* output); 27 bool buildCrop(CoreML__Specification__NeuralNetworkLayer* layer, const Tensor* input, const Tensor* output); 28 bool buildSlice(CoreML__Specification__NeuralNetworkLayer* layer, const Tensor* input, const Tensor* output); 29 }; 30 } // namespace MNN 31 32 #endif // MNN_COREMLRASTER_HPP 33