You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/06/06 21:27:54 UTC

[GitHub] zhanghang1989 closed pull request #10815: [MXNET-402] add integer type for pad

zhanghang1989 closed pull request #10815: [MXNET-402] add integer type for pad
URL: https://github.com/apache/incubator-mxnet/pull/10815
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/operator/pad.cc b/src/operator/pad.cc
index 2332c93b8d5..6d28b47e3b6 100644
--- a/src/operator/pad.cc
+++ b/src/operator/pad.cc
@@ -50,7 +50,7 @@ void single_image_edge(const Tensor<cpu, 3, DType> dst,
   int oStartX = std::max(0, pad_l);
   int oStartY = std::max(0, pad_t);
 
-  int k, ip_x, ip_y;
+  size_t k, ip_x, ip_y;
 #pragma omp parallel for private(k, ip_x, ip_y)
   for (k = 0; k < nslices; k++) {
     int i, j;
@@ -99,7 +99,7 @@ void single_image_edge_grad(const Tensor<cpu, 3, DType> &grad_in,
   int oStartX = std::max(0, pad_l);
   int oStartY = std::max(0, pad_t);
 
-  int k, ip_x, ip_y;
+  size_t k, ip_x, ip_y;
 #pragma omp parallel for private(k, ip_x, ip_y)
   for (k = 0; k < nslices; k++) {
     int i, j;
@@ -200,7 +200,7 @@ void single_image_reflect(const Tensor<cpu, 3, DType> &dst,
   int oStartX = std::max(0, pad_l);
   int oStartY = std::max(0, pad_t);
 
-  int k, ip_x, ip_y;
+  size_t k, ip_x, ip_y;
 #pragma omp parallel for private(k, ip_x, ip_y)
 
   for (k = 0; k < nslices; k++) {
@@ -251,7 +251,7 @@ void single_image_reflect_grad(const Tensor<cpu, 3, DType> &grad_in,
   int oStartX = std::max(0, pad_l);
   int oStartY = std::max(0, pad_t);
 
-  int k, ip_x, ip_y;
+  size_t k, ip_x, ip_y;
 #pragma omp parallel for private(k, ip_x, ip_y)
 
   for (k = 0; k < nslices; k++) {
@@ -312,7 +312,7 @@ void single_image_edge(const Tensor<cpu, 4, DType> dst,
   int oStartY = std::max(0, pad_t);
   int oStartZ = std::max(0, pad_f);
 
-  int k, ip_x, ip_y, ip_z;
+  size_t k, ip_x, ip_y, ip_z;
 #pragma omp parallel for private(k, ip_x, ip_y, ip_z)
   for (k = 0; k < nslices; k++) {
     int i, j, z;
@@ -380,7 +380,7 @@ void single_image_edge_grad(const Tensor<cpu, 4, DType> &grad_in,
   int oStartY = std::max(0, pad_t);
   int oStartZ = std::max(0, pad_f);
 
-  int k, ip_x, ip_y, ip_z;
+  size_t k, ip_x, ip_y, ip_z;
 #pragma omp parallel for private(k, ip_x, ip_y, ip_z)
   for (k = 0; k < nslices; k++) {
     int i, j, z;
@@ -508,10 +508,10 @@ void single_image_reflect(const Tensor<cpu, 4, DType> &dst,
   int oStartY = std::max(0, pad_t);
   int oStartZ = std::max(0, pad_f);
 
-  int l, ip_x, ip_y, ip_z;
+  size_t l, ip_x, ip_y, ip_z;
 #pragma omp parallel for private(l, ip_x, ip_y, ip_z)
   for (l = 0; l < nslices; l++) {
-    int i, j, k;
+    size_t i, j, k;
     for (k = 0; k < odepth; k++) {
       for (i = 0; i < oheight; i++) {
         for (j = 0; j < owidth; j++) {
@@ -576,10 +576,10 @@ void single_image_reflect_grad(const Tensor<cpu, 4, DType> &grad_in,
   int oStartY = std::max(0, pad_t);
   int oStartZ = std::max(0, pad_f);
 
-  int l, ip_x, ip_y, ip_z;
+  size_t l, ip_x, ip_y, ip_z;
 /*#pragma omp parallel for private(l, ip_x, ip_y, ip_z)*/
   for (l = 0; l < nslices; l++) {
-    int i, j, k;
+    size_t i, j, k;
     for (k = 0; k < odepth; k++) {
       for (i = 0; i < oheight; i++) {
         for (j = 0; j < owidth; j++) {
@@ -669,7 +669,7 @@ namespace op {
 template <>
 Operator *CreateOp<cpu>(PadParam param, int dtype) {
   Operator *op = NULL;
-  MSHADOW_REAL_TYPE_SWITCH(dtype, DType, { op = new PadOp<cpu, DType>(param); })
+  MSHADOW_TYPE_SWITCH(dtype, DType, { op = new PadOp<cpu, DType>(param); })
   return op;
 }
 
diff --git a/src/operator/pad.cu b/src/operator/pad.cu
index 372683a2be8..ff612b0d746 100644
--- a/src/operator/pad.cu
+++ b/src/operator/pad.cu
@@ -729,7 +729,7 @@ namespace op {
 template <>
 Operator *CreateOp<gpu>(PadParam param, int dtype) {
   Operator *op = NULL;
-  MSHADOW_REAL_TYPE_SWITCH(dtype, DType, { op = new PadOp<gpu, DType>(param); })
+  MSHADOW_TYPE_SWITCH(dtype, DType, { op = new PadOp<gpu, DType>(param); })
   return op;
 }
 


 

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


With regards,
Apache Git Services