2019-04-17 10:49:11 +08:00
|
|
|
//
|
|
|
|
// CPUTensorConvert.hpp
|
|
|
|
// MNN
|
|
|
|
//
|
|
|
|
// Created by MNN on 2018/08/04.
|
|
|
|
// Copyright © 2018, Alibaba Group Holding Limited
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef CPUTensorConvert_hpp
|
|
|
|
#define CPUTensorConvert_hpp
|
|
|
|
|
2019-12-27 22:16:57 +08:00
|
|
|
#include "core/Execution.hpp"
|
2019-04-17 10:49:11 +08:00
|
|
|
#include "Tensor_generated.h"
|
2021-06-11 17:17:13 +08:00
|
|
|
#include "compute/CommonOptFunction.h"
|
2019-04-17 10:49:11 +08:00
|
|
|
namespace MNN {
|
|
|
|
|
2021-06-11 17:17:13 +08:00
|
|
|
class CPUTensorConverter {
|
2019-04-17 10:49:11 +08:00
|
|
|
public:
|
2021-04-08 15:34:23 +08:00
|
|
|
static std::tuple<int, int, int> splitDimensions(const halide_buffer_t& ib, MNN_DATA_FORMAT source);
|
2021-06-11 17:17:13 +08:00
|
|
|
static ErrorCode convert(const Tensor* input, const Tensor* output, const CoreFunctions* core = nullptr);
|
|
|
|
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);
|
2019-04-17 10:49:11 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace MNN
|
|
|
|
|
|
|
|
#endif /* CPUTensorConvert_hpp */
|