MNN/source/backend/cpu/CPUTensorConvert.hpp

27 lines
813 B
C++
Raw Normal View History

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"
#include "compute/CommonOptFunction.h"
2019-04-17 10:49:11 +08:00
namespace MNN {
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);
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 */