Skip to content

Commit

Permalink
fix CreateOp of altering shape operations to accept dtypes of uint8 a…
Browse files Browse the repository at this point in the history
…nd int32 (apache#9569)

* fix CreateOp of shape related operation to accept dtypes of uint8 and int32

* fix wrong argument y to sequence_length in sequence_reverse's api document

* fix wrong argument y to sequence_length in api doc

fix wrong argument y to sequence_length in api doc

* remove y in api document
  • Loading branch information
Soonhwan-Kwon authored and piiswrong committed Jan 26, 2018
1 parent 6f3f171 commit 55163bd
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions src/operator/sequence_last.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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.]]
Expand Down
2 changes: 1 addition & 1 deletion src/operator/sequence_last.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions src/operator/sequence_mask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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.]],
Expand All @@ -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.]],
Expand Down
2 changes: 1 addition & 1 deletion src/operator/sequence_mask.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions src/operator/sequence_reverse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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.]],
Expand All @@ -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.]],
Expand Down
2 changes: 1 addition & 1 deletion src/operator/sequence_reverse.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/operator/swapaxis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/operator/swapaxis.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 55163bd

Please sign in to comment.