Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
momo609 committed Apr 23, 2024
1 parent f8b17a5 commit 571d8af
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void furthest_point_sampling_with_dist_npu(Tensor points_tensor,
m, result);
}

void furthest_point_sampling_with_dist_forward_impl(Tensor points_tensor,
void furthest_point_sampling_with_dist_forward_impl(Tensor points_tensor,
Tensor temp_tensor,
Tensor idx_tensor, int b,
int n, int m);
Expand Down
24 changes: 11 additions & 13 deletions mmcv/ops/csrc/pytorch/npu/ms_deform_attn_npu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
using namespace NPU_NAME_SPACE;
using namespace std;

Tensor ms_deform_attn_impl_forward(
const Tensor &value,
const Tensor &value_spatial_shapes,
const Tensor &value_level_start_index,
const Tensor &sampling_locations,
const Tensor &attention_weights,
const int im2col_step);
Tensor ms_deform_attn_impl_forward(const Tensor &value,
const Tensor &value_spatial_shapes,
const Tensor &value_level_start_index,
const Tensor &sampling_locations,
const Tensor &attention_weights,
const int im2col_step);

void check_support(const Tensor &value, const Tensor &attention_weights) {
TORCH_CHECK(
Expand Down Expand Up @@ -78,12 +77,11 @@ Tensor ms_deform_attn_forward_npu(

REGISTER_NPU_IMPL(ms_deform_attn_impl_forward, ms_deform_attn_forward_npu);

void ms_deform_attn_impl_backward(
const Tensor &value, const Tensor &spatial_shapes,
const Tensor &level_start_index, const Tensor &sampling_loc,
const Tensor &attn_weight, const Tensor &grad_output, Tensor &grad_value,
Tensor &grad_sampling_loc, Tensor &grad_attn_weight,
const int im2col_step);
void ms_deform_attn_impl_backward(const Tensor &value, const Tensor &spatial_shapes,
const Tensor &level_start_index, const Tensor &sampling_loc,
const Tensor &attn_weight, const Tensor &grad_output, Tensor &grad_value,
Tensor &grad_sampling_loc, Tensor &grad_attn_weight,
const int im2col_step);

void ms_deform_attn_backward_npu(const Tensor &value, const Tensor &spatial_shapes,
const Tensor &level_start_index,
Expand Down
2 changes: 1 addition & 1 deletion mmcv/ops/csrc/pytorch/npu/nms3d_normal_npu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ void iou3d_nms3d_normal_forward_npu(const Tensor boxes, Tensor &keep,
int32_t data_align = 16;
int32_t mask_num = ((box_num - 1) / data_align + 1) * data_align;
at::Tensor mask =
at::empty({ box_num, mask_num }, boxes.options().dtype(at::kShort));
at::empty({box_num, mask_num}, boxes.options().dtype(at::kShort));
EXEC_NPU_CMD(aclnnNms3dNormal, boxes, nms_overlap_thresh, mask);

keep = at::zeros({box_num}, mask.options());
Expand Down
1 change: 0 additions & 1 deletion mmcv/ops/csrc/pytorch/npu/nms3d_npu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ constexpr int32_t BOX_DIM = 7;

void iou3d_nms3d_forward_npu(const Tensor boxes, Tensor &keep, Tensor &keep_num,
float nms_overlap_thresh) {
{
TORCH_CHECK((boxes.sizes()[1] == BOX_DIM),
"Input boxes shape should be (N, 7)");
int32_t box_num = boxes.size(0);
Expand Down

0 comments on commit 571d8af

Please sign in to comment.