larroy commented on a change in pull request #14879: Add cpu implementation for 
Deformable Convolution
URL: https://github.com/apache/incubator-mxnet/pull/14879#discussion_r286361018
 
 

 ##########
 File path: src/operator/contrib/nn/deformable_im2col.h
 ##########
 @@ -65,11 +65,197 @@
 #include <mxnet/operator.h>
 #include <cstring>
 #include <vector>
+#include <algorithm>
 #include "../../mxnet_op.h"
 
 namespace mxnet {
 namespace op {
 
+template <typename DType>
+inline DType im2col_bilinear_cpu(const DType* data,
+                                 const int height,
+                                 const int width,
+                                 DType h, DType w) {
+  int h_low = floor(h);
+  int w_low = floor(w);
+  int h_high;
+  int w_high;
+
+  if (h_low >= height - 1) {
+    h_high = height - 1;
+    h = static_cast<DType>(h_low);
 
 Review comment:
   could we overflow?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to