Skip to content

Commit

Permalink
[python] removed excess condition (#2385)
Browse files Browse the repository at this point in the history
  • Loading branch information
StrikerRUS committed Sep 7, 2019
1 parent 22cd39e commit de1f3cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python-package/lightgbm/basic.py
Expand Up @@ -202,7 +202,7 @@ class LightGBMError(Exception):

def convert_from_sliced_object(data):
"""Fix the memory of multi-dimensional sliced object."""
if data.base is not None and isinstance(data, np.ndarray) and isinstance(data.base, np.ndarray):
if isinstance(data, np.ndarray) and isinstance(data.base, np.ndarray):
if not data.flags.c_contiguous:
warnings.warn("Usage of np.ndarray subset (sliced data) is not recommended "
"due to it will double the peak memory cost in LightGBM.")
Expand Down

0 comments on commit de1f3cb

Please sign in to comment.