Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
6856a45a
Unverified
Commit
6856a45a
authored
Apr 11, 2023
by
James Lamb
Committed by
GitHub
Apr 11, 2023
Browse files
[python-package] fix mypy error in Dataset.__init_from_list_np2d() (#5826)
parent
7c1e92dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
python-package/lightgbm/basic.py
python-package/lightgbm/basic.py
+2
-2
No files found.
python-package/lightgbm/basic.py
View file @
6856a45a
...
...
@@ -2008,7 +2008,7 @@ class Dataset:
ptr_data
=
(
ctypes
.
POINTER
(
ctypes
.
c_float
)
*
len
(
mats
))()
holders
=
[]
type_ptr_data
=
None
type_ptr_data
=
-
1
for
i
,
mat
in
enumerate
(
mats
):
if
len
(
mat
.
shape
)
!=
2
:
...
...
@@ -2025,7 +2025,7 @@ class Dataset:
mats
[
i
]
=
np
.
array
(
mat
.
reshape
(
mat
.
size
),
dtype
=
np
.
float32
)
chunk_ptr_data
,
chunk_type_ptr_data
,
holder
=
_c_float_array
(
mats
[
i
])
if
type_ptr_data
is
not
None
and
chunk_type_ptr_data
!=
type_ptr_data
:
if
type_ptr_data
!=
-
1
and
chunk_type_ptr_data
!=
type_ptr_data
:
raise
ValueError
(
'Input chunks must have same type'
)
ptr_data
[
i
]
=
chunk_ptr_data
type_ptr_data
=
chunk_type_ptr_data
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment