| 
									
										
										
										
											2019-04-17 10:49:11 +08:00
										 |  |  | //
 | 
					
						
							|  |  |  | //  CPUCrop.hpp
 | 
					
						
							|  |  |  | //  MNN
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | //  Created by MNN on 2018/10/16.
 | 
					
						
							|  |  |  | //  Copyright © 2018, Alibaba Group Holding Limited
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef CPUCrop_hpp
 | 
					
						
							|  |  |  | #define CPUCrop_hpp
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-27 22:16:57 +08:00
										 |  |  | #include "core/Execution.hpp"
 | 
					
						
							| 
									
										
										
										
											2019-04-17 10:49:11 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace MNN { | 
					
						
							|  |  |  | class CPUCrop : public Execution { | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     CPUCrop(Backend* b, const MNN::Op* op); | 
					
						
							|  |  |  |     virtual ~CPUCrop() = default; | 
					
						
							|  |  |  |     virtual ErrorCode onExecute(const std::vector<Tensor*>& inputs, const std::vector<Tensor*>& outputs) override; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     int mAxis = 2; | 
					
						
							|  |  |  |     std::vector<int> mOffsets; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     static void cropCopy(const Tensor* inputTensor, Tensor* outputTensor, const std::vector<int>& offsets); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | } // namespace MNN
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif /* CPUCrop_hpp */
 |