mirror of
https://github.com/open-mmlab/mmdeploy.git
synced 2025-01-14 08:09:43 +08:00
* first * fix0 * fix1 * dirty work * wip * add allocator * finally done! * lint * fix lint * better gather * better onnx2ncnn * fix expand * [Fix] NCNN TensorSlice op bugs (#42) * fix custom ops support, fix multiple mark bug, add name mapping * check if the value_info need to be added * remove unnecessary print * add nms implement * two stage split wip * add two stage split * add split retinanet visualize * add two stage split (wip) * finish two stage split * fix lint * move parse string to mmdeploy.utils * add calib data generator * create calib dataset * finish end2end int8 * add split two stage tensorrt visualize * fix tensorslice bugs * fix lint * fix clang-format * remove comments * int param * fix lint Co-authored-by: grimoire <yaoqian@sensetime.com> * add two stage ncnn support * remove unused ops * git unused config * remove no_grad, should add in refactor * add ncnn wrapper * fix lint * size return tuple * Resolve grammar error * Fix lint * Trim Trailing Whitespace * fix trim * update wrapper * remove logs * remove * csrc optimize Co-authored-by: hanrui1sensetime <83800577+hanrui1sensetime@users.noreply.github.com>
31 lines
695 B
C++
Executable File
31 lines
695 B
C++
Executable File
#ifndef NCNN_OPS_DEFINER_H
|
|
#define NCNN_OPS_DEFINER_H
|
|
|
|
#include <string>
|
|
|
|
#include "layer.h"
|
|
#include "ncnn_ops_register.h"
|
|
|
|
namespace mmlab {
|
|
|
|
class NCNNOpsDefiner {
|
|
public:
|
|
NCNNOpsDefiner(const std::string& ops_name,
|
|
const ncnn::layer_creator_func& creator_func = 0,
|
|
const ncnn::layer_destroyer_func& destroyer_func = 0)
|
|
: _ops_name(ops_name) {
|
|
get_mm_layer_creator()[_ops_name.c_str()] = creator_func;
|
|
}
|
|
|
|
private:
|
|
const std::string _ops_name;
|
|
};
|
|
|
|
#define DEFINE_NCNN_OPS(ops_name, OpsLayer) \
|
|
static mmlab::NCNNOpsDefiner NCNNOpsDefiner##ops_name{ \
|
|
#ops_name, OpsLayer##_layer_creator};
|
|
|
|
} // namespace mmlab
|
|
|
|
#endif
|