1 // 2 // CPUTensorConvert.hpp 3 // MNN 4 // 5 // Created by MNN on 2018/08/04. 6 // Copyright © 2018, Alibaba Group Holding Limited 7 // 8 9 #ifndef CPUTensorConvert_hpp 10 #define CPUTensorConvert_hpp 11 12 #include "core/Execution.hpp" 13 #include "Tensor_generated.h" 14 #include "compute/CommonOptFunction.h" 15 namespace MNN { 16 17 class CPUTensorConverter { 18 public: 19 static std::tuple<int, int, int> splitDimensions(const halide_buffer_t& ib, MNN_DATA_FORMAT source); 20 static ErrorCode convert(const Tensor* input, const Tensor* output, const CoreFunctions* core = nullptr); 21 static ErrorCode convert(const void* inputRaw, void* outputRaw, MNN_DATA_FORMAT inputFormat, MNN_DATA_FORMAT outputFormat, int batch, int area, int channel, int bytes, const CoreFunctions* core); 22 }; 23 24 } // namespace MNN 25 26 #endif /* CPUTensorConvert_hpp */ 27