2020-11-05 16:41:56 +08:00
|
|
|
//
|
|
|
|
// ConvertUtils.hpp
|
|
|
|
// MNN
|
|
|
|
//
|
|
|
|
// Created by MNN on 2020/04/03.
|
|
|
|
// Copyright © 2018, Alibaba Group Holding Limited
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef ConvertUtils_hpp
|
|
|
|
#define ConvertUtils_hpp
|
|
|
|
#include "geometry/GeometryComputer.hpp"
|
|
|
|
#include "core/TensorUtils.hpp"
|
|
|
|
namespace MNN {
|
|
|
|
class ConvertUtils {
|
|
|
|
public:
|
|
|
|
static bool compute(Tensor* input, Tensor* output, CommandBuffer& res);
|
2021-11-30 10:10:53 +08:00
|
|
|
// numpy broadcast like: [3, 4] -> [2, 3, 4]
|
|
|
|
// forward = true: [4] -> [4, 3, 2]
|
|
|
|
static void broadcastto(Tensor* input, Tensor* output, bool forward = false);
|
2020-11-05 16:41:56 +08:00
|
|
|
};
|
|
|
|
} // namespace MNN
|
|
|
|
|
|
|
|
#endif
|