27 lines
539 B
C
Raw Normal View History

2021-11-30 15:00:37 +08:00
// Copyright (c) OpenMMLab. All rights reserved.
#ifndef LAYER_TOPK_H
#define LAYER_TOPK_H
#include "layer.h"
namespace mmdeploy {
class TopK : public ncnn::Layer {
public:
TopK();
virtual int load_param(const ncnn::ParamDict& pd);
virtual int forward(const std::vector<ncnn::Mat>& bottom_blobs,
std::vector<ncnn::Mat>& top_blobs,
const ncnn::Option& opt) const;
public:
int axis;
int largest;
int sorted;
[Feature] Add NCNN on MMSegmentation (#55) * 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 * first * fix0 * fix1 * dirty work * wip * add allocator * finally done! * lint * fix lint * better gather * better onnx2ncnn * fix tensorslice bugs * fix lint * fix clang-format * remove comments * fix expand * int param * fix lint * [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 * add argmax to topk * add ArgMax parse * add ncnn mmseg deploy cfg * utils add ncnn mmseg * add ncnn * fix lint * fix yapf * fix clang-format-9 * remove debugging code Co-authored-by: grimoire <yaoqian@sensetime.com> Co-authored-by: grimoire <streetyao@live.com> Co-authored-by: maningsheng <mnsheng@yeah.net>
2021-09-03 15:19:54 +08:00
int keep_dims;
};
} // namespace mmdeploy
#endif // LAYER_TOPK_H