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/01/26 21:21:20 UTC

[GitHub] piiswrong closed pull request #9569: fix CreateOp of altering shape operations to accept dtypes of uint8 and int32

piiswrong closed pull request #9569: fix CreateOp of altering shape operations to accept dtypes of uint8 and int32
URL: https://github.com/apache/incubator-mxnet/pull/9569
 
 
   

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/sequence_last.cc b/src/operator/sequence_last.cc
index d943cd68a3..f87400b21f 100644
--- a/src/operator/sequence_last.cc
+++ b/src/operator/sequence_last.cc
@@ -30,7 +30,7 @@ namespace op {
 template <>
 Operator *CreateOp<cpu>(SequenceLastParam param, int dtype) {
   Operator *op = NULL;
-  MSHADOW_REAL_TYPE_SWITCH(dtype, DType,
+  MSHADOW_TYPE_SWITCH(dtype, DType,
                            { op = new SequenceLastOp<cpu, DType>(param); })
   return op;
 }
@@ -77,14 +77,14 @@ Example::
                       [  22.,   23.,   24.],
                       [  25.,   26.,   27.]]
 
-   // sequence_length y is used
-   SequenceLast(x, y=[1,1,1], use_sequence_length=True) =
+   // sequence_length is used
+   SequenceLast(x, sequence_length=[1,1,1], use_sequence_length=True) =
             [[  1.,   2.,   3.],
              [  4.,   5.,   6.],
              [  7.,   8.,   9.]]
 
-   // sequence_length y is used
-   SequenceLast(x, y=[1,2,3], use_sequence_length=True) =
+   // sequence_length is used
+   SequenceLast(x, sequence_length=[1,2,3], use_sequence_length=True) =
             [[  1.,    2.,   3.],
              [  13.,  14.,  15.],
              [  25.,  26.,  27.]]
diff --git a/src/operator/sequence_last.cu b/src/operator/sequence_last.cu
index c63369d580..dfc4e59d1b 100644
--- a/src/operator/sequence_last.cu
+++ b/src/operator/sequence_last.cu
@@ -30,7 +30,7 @@ namespace mxnet {
 namespace op {
 template <> Operator *CreateOp<gpu>(SequenceLastParam param, int dtype) {
   Operator *op = NULL;
-  MSHADOW_REAL_TYPE_SWITCH(dtype, DType,
+  MSHADOW_TYPE_SWITCH(dtype, DType,
                            { op = new SequenceLastOp<gpu, DType>(param); })
   return op;
 }
diff --git a/src/operator/sequence_mask.cc b/src/operator/sequence_mask.cc
index 48a97680b5..047634cc7b 100644
--- a/src/operator/sequence_mask.cc
+++ b/src/operator/sequence_mask.cc
@@ -30,7 +30,7 @@ namespace op {
 template <>
 Operator *CreateOp<cpu>(SequenceMaskParam param, int dtype) {
   Operator *op = NULL;
-  MSHADOW_REAL_TYPE_SWITCH(dtype, DType,
+  MSHADOW_TYPE_SWITCH(dtype, DType,
                            { op = new SequenceMaskOp<cpu, DType>(param); })
   return op;
 }
@@ -89,7 +89,7 @@ Example::
 
    // sequence_length [1,1] means 1 of each batch will be kept
    // and other rows are masked with default mask value = 0
-   SequenceMask(x, y=[1,1], use_sequence_length=True) =
+   SequenceMask(x, sequence_length=[1,1], use_sequence_length=True) =
                 [[[  1.,   2.,   3.],
                   [  4.,   5.,   6.]],
 
@@ -101,7 +101,7 @@ Example::
 
    // sequence_length [2,3] means 2 of batch B1 and 3 of batch B2 will be kept
    // and other rows are masked with value = 1
-   SequenceMask(x, y=[2,3], use_sequence_length=True, value=1) =
+   SequenceMask(x, sequence_length=[2,3], use_sequence_length=True, value=1) =
                 [[[  1.,   2.,   3.],
                   [  4.,   5.,   6.]],
 
diff --git a/src/operator/sequence_mask.cu b/src/operator/sequence_mask.cu
index b82157a3b6..2ca8832242 100644
--- a/src/operator/sequence_mask.cu
+++ b/src/operator/sequence_mask.cu
@@ -31,7 +31,7 @@ namespace op {
 
 template <> Operator *CreateOp<gpu>(SequenceMaskParam param, int dtype) {
   Operator *op = NULL;
-  MSHADOW_REAL_TYPE_SWITCH(dtype, DType,
+  MSHADOW_TYPE_SWITCH(dtype, DType,
                            { op = new SequenceMaskOp<gpu, DType>(param); })
   return op;
 }
diff --git a/src/operator/sequence_reverse.cc b/src/operator/sequence_reverse.cc
index 9a2f6983f0..834e4f401e 100644
--- a/src/operator/sequence_reverse.cc
+++ b/src/operator/sequence_reverse.cc
@@ -30,7 +30,7 @@ namespace op {
 template <>
 Operator *CreateOp<cpu>(SequenceReverseParam param, int dtype) {
   Operator *op = NULL;
-  MSHADOW_REAL_TYPE_SWITCH(dtype, DType,
+  MSHADOW_TYPE_SWITCH(dtype, DType,
                            { op = new SequenceReverseOp<cpu, DType>(param); })
   return op;
 }
@@ -88,7 +88,7 @@ Example::
 
    // sequence_length [2,2] means 2 rows of
    // both batch B1 and B2 will be reversed.
-   SequenceReverse(x, y=[2,2], use_sequence_length=True) =
+   SequenceReverse(x, sequence_length=[2,2], use_sequence_length=True) =
                      [[[  7.,   8.,   9.],
                        [ 10.,  11.,  12.]],
 
@@ -100,7 +100,7 @@ Example::
 
    // sequence_length [2,3] means 2 of batch B2 and 3 of batch B3
    // will be reversed.
-   SequenceReverse(x, y=[2,3], use_sequence_length=True) =
+   SequenceReverse(x, sequence_length=[2,3], use_sequence_length=True) =
                     [[[  7.,   8.,   9.],
                       [ 16.,  17.,  18.]],
 
diff --git a/src/operator/sequence_reverse.cu b/src/operator/sequence_reverse.cu
index 531fde167c..9c1574814a 100644
--- a/src/operator/sequence_reverse.cu
+++ b/src/operator/sequence_reverse.cu
@@ -30,7 +30,7 @@ namespace mxnet {
 namespace op {
 template <> Operator *CreateOp<gpu>(SequenceReverseParam param, int dtype) {
   Operator *op = NULL;
-  MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
+  MSHADOW_TYPE_SWITCH(dtype, DType, {
     op = new SequenceReverseOp<gpu, DType>(param);
   })
   return op;
diff --git a/src/operator/swapaxis.cc b/src/operator/swapaxis.cc
index 0b32db7b46..12bc52e1f6 100644
--- a/src/operator/swapaxis.cc
+++ b/src/operator/swapaxis.cc
@@ -32,7 +32,7 @@ namespace op {
 template<>
 Operator* CreateOp<cpu>(SwapAxisParam param, int dtype) {
   Operator *op = NULL;
-  MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
+  MSHADOW_TYPE_SWITCH(dtype, DType, {
     op = new SwapAxisOp<cpu, DType>(param);
   });
   return op;
diff --git a/src/operator/swapaxis.cu b/src/operator/swapaxis.cu
index e622958a47..90dcefd961 100644
--- a/src/operator/swapaxis.cu
+++ b/src/operator/swapaxis.cu
@@ -32,7 +32,7 @@ namespace op {
 template<>
 Operator *CreateOp<gpu>(SwapAxisParam param, int dtype) {
   Operator *op = NULL;
-  MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
+  MSHADOW_TYPE_SWITCH(dtype, DType, {
     op =  new SwapAxisOp<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