Skip to content

Commit

Permalink
[Feature] Repalce the implementation of roi_align_rotated with mlu-ops
Browse files Browse the repository at this point in the history
  • Loading branch information
tudejiang committed Mar 13, 2023
1 parent 4e614de commit d1998b0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mmcv/ops/csrc/pytorch/mlu/roi_align_rotated_mlu.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void ROIAlignRotatedForwardMLUKernelLauncher(Tensor input, Tensor rois,
torch_mlu::cnnl::ops::cnnl_contiguous(rois, rois.suggest_memory_format());
auto output_contiguous =
torch_mlu::cnnl::ops::cnnl_contiguous(output, memory_format);

MluOpTensorDescriptor input_desc, rois_desc, output_desc;
input_desc.set_with_layout(input_, MLUOP_LAYOUT_NHWC);
rois_desc.set(rois_contiguous);
Expand All @@ -42,8 +42,8 @@ void ROIAlignRotatedForwardMLUKernelLauncher(Tensor input, Tensor rois,
auto handle = mluOpGetCurrentHandle();
mluOpRoiAlignRotatedForward(
handle, input_desc.desc(), input_ptr, rois_desc.desc(), rois_ptr,
pooled_height, pooled_width, sampling_ratio, spatial_scale,
aligned, clockwise, output_desc.desc(), output_ptr);
pooled_height, pooled_width, sampling_ratio, spatial_scale, aligned,
clockwise, output_desc.desc(), output_ptr);

output.copy_(output_contiguous);
}
Expand Down Expand Up @@ -77,9 +77,9 @@ void ROIAlignRotatedBackwardMLUKernelLauncher(
// get compute handle
auto handle = mluOpGetCurrentHandle();
mluOpRoiAlignRotatedBackward(
handle, top_grad_desc.desc(), top_grad_ptr, rois_desc.desc(),
rois_ptr, pooled_height, pooled_width, sampling_ratio, spatial_scale,
aligned, clockwise, bottom_grad_desc.desc(), bottom_grad_ptr);
handle, top_grad_desc.desc(), top_grad_ptr, rois_desc.desc(), rois_ptr,
pooled_height, pooled_width, sampling_ratio, spatial_scale, aligned,
clockwise, bottom_grad_desc.desc(), bottom_grad_ptr);
bottom_grad.copy_(bottom_grad_);
}

Expand Down

0 comments on commit d1998b0

Please sign in to comment.