Skip to content

Commit c46684c

Browse files
authored
points_in_boxes_all的mmcv适配 (#3186)
1 parent c39e9eb commit c46684c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include "pytorch_npu_helper.hpp"
2+
3+
using namespace NPU_NAME_SPACE;
4+
using namespace std;
5+
6+
void points_in_boxes_all_forward_impl_npu(int batch_size, int boxes_num,
7+
int pts_num, const Tensor boxes,
8+
const Tensor pts,
9+
Tensor box_idx_of_points) {
10+
c10::SmallVector<int64_t, 8> output_size = {pts.size(0), pts.size(1), boxes.size(1)};
11+
auto boxes_trans = boxes.transpose(1, 2).contiguous();
12+
EXEC_NPU_CMD(aclnnPointsInBoxAll, boxes_trans, pts, box_idx_of_points);
13+
}
14+
void points_in_boxes_all_forward_impl(int batch_size, int boxes_num,
15+
int pts_num, const Tensor boxes,
16+
const Tensor pts,
17+
Tensor box_idx_of_points);
18+
REGISTER_NPU_IMPL(points_in_boxes_all_forward_impl,
19+
points_in_boxes_all_forward_impl_npu);

0 commit comments

Comments
 (0)