Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
pylint error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cassiniXu authored and cassiniXu committed Jan 21, 2020
1 parent 1ef04d2 commit 2c31a1c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 21 deletions.
30 changes: 13 additions & 17 deletions python/mxnet/ndarray/numpy/_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -6577,21 +6577,17 @@ def pad(array, pad_width=None, mode="constant", reflect_type="even", constant_va

if not isinstance(array, NDArray):
raise TypeError("Input data should be NDarray")
if mode == "constant":
return _npi.pad(array, pad_width, 1, reflect_type, constant_values)
elif mode == "symmetric" and reflect_type == "even":
return _npi.pad(array, pad_width, 2, "even", constant_values)
elif mode == "edge":
return _npi.pad(array, pad_width, 3, reflect_type, constant_values)
elif mode == "reflect" and reflect_type == "even":
return _npi.pad(array, pad_width, 4, "even", constant_values)
elif mode == "maximum":
return _npi.pad(array, pad_width, 5, "even", constant_values)
elif mode == "minimum":
return _npi.pad(array, pad_width, 6, "even", constant_values)
else:
if mode == "constant":
return _npi.pad(array, pad_width, 1, reflect_type, constant_values)
elif mode == "symmetric" and reflect_type == "even":
return _npi.pad(array, pad_width, 2, "even", constant_values)
elif mode == "edge":
return _npi.pad(array, pad_width, 3, reflect_type, constant_values)
elif mode == "reflect" and reflect_type == "even":
return _npi.pad(array, pad_width, 4, "even", constant_values)
elif mode == "empty":
pass
elif mode == "maximum":
return _npi.pad(array, pad_width, 5, "even", constant_values)
elif mode == "minimum":
return _npi.pad(array, pad_width, 6, "even", constant_values)
else:
raise ValueError("didn't support these modes and reflect_types.")

raise ValueError("didn't support these modes and reflect_types.")
2 changes: 1 addition & 1 deletion python/mxnet/numpy/multiarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -8609,7 +8609,7 @@ def pad(x, pad_width=None, mode="constant", constant_values=0, reflect_type="eve
pad : ndarray
Padded array of rank equal to `array` with shape increased
according to `pad_width`.
Examples
--------
>>> a = [1, 2, 3, 4, 5]
Expand Down
4 changes: 1 addition & 3 deletions python/mxnet/symbol/numpy/_symbol.py
Original file line number Diff line number Diff line change
Expand Up @@ -5923,7 +5923,7 @@ def pad(array, pad_width=None, mode="constant", reflect_type="even", constant_va
end_values : not supported yet
reflect_type : {'even', 'odd'}, optional
only support even now
Returns
-------
pad : ndarray
Expand All @@ -5938,8 +5938,6 @@ def pad(array, pad_width=None, mode="constant", reflect_type="even", constant_va
return _npi.pad(array, pad_width, 3, reflect_type, constant_values)
elif mode == "reflect" and reflect_type == "even":
return _npi.pad(array, pad_width, 4, "even", constant_values)
elif mode == "empty":
pass
elif mode == "maximum":
return _npi.pad(array, pad_width, 5, "even", constant_values)
elif mode == "minimum":
Expand Down

0 comments on commit 2c31a1c

Please sign in to comment.