-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Add cpu implementation for Deformable Convolution #14879
Conversation
Great Work! Thanks for your contribution! Could you please add a forward consistance check in /~https://github.com/apache/incubator-mxnet/blob/master/tests/python/gpu/test_operator_gpu.py ? Thank you! |
@mxnet-label-bot add [pr-awaiting-review] |
@wkcn Could you please review this PR once again? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! LGTM.
Thanks for your contribution!
} | ||
else { | ||
h_high = h_low + 1; | ||
} | ||
|
||
if (w_low >= width - 1) { | ||
w_high = w_low = width - 1; | ||
w = (DType)w_low; | ||
w = static_cast<DType>(w_low); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have overflows?
// num_axes should be smaller than block size | ||
index_t num_spatial_axes = kernel_shape.ndim(); | ||
int num_spatial_axes = kernel_shape.ndim(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be const?
|
||
if (h_low >= height - 1) { | ||
h_high = height - 1; | ||
h = static_cast<DType>(h_low); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we overflow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I'll look into the code in the perspective of overflow and change the type of int used in indexing and tensor size to index_t.
For int to float conversion, I think the overflow can't happens in float32 or float64.
* add cpu deformable_im2col * fix doc string * fix lint * add consistency check * fix code style * add cpu deformable_col2im, deformable_col2im_coord * update consistency test * unify variable names * fix lint * update to index_t
Description
Add cpu deformable_im2col implementation, also fix some errors in doc string.
Update:
The whole cpu part is implemented, and the code style is fixed to pass lint check.
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments