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
24f1f9cd
Commit
24f1f9cd
authored
Nov 02, 2016
by
Guolin Ke
Browse files
fixed some IO bugs
parent
c96ae6af
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
include/LightGBM/utils/text_reader.h
include/LightGBM/utils/text_reader.h
+3
-0
src/io/metadata.cpp
src/io/metadata.cpp
+1
-1
No files found.
include/LightGBM/utils/text_reader.h
View file @
24f1f9cd
...
@@ -34,6 +34,9 @@ public:
...
@@ -34,6 +34,9 @@ public:
#else
#else
file
=
fopen
(
filename
,
"r"
);
file
=
fopen
(
filename
,
"r"
);
#endif
#endif
if
(
file
==
NULL
)
{
Log
::
Fatal
(
"failed to open file %s"
,
filename
);
}
std
::
stringstream
str_buf
;
std
::
stringstream
str_buf
;
int
read_c
=
-
1
;
int
read_c
=
-
1
;
read_c
=
fgetc
(
file
);
read_c
=
fgetc
(
file
);
...
...
src/io/metadata.cpp
View file @
24f1f9cd
...
@@ -310,7 +310,7 @@ void Metadata::LoadFromMemory(const void* memory) {
...
@@ -310,7 +310,7 @@ void Metadata::LoadFromMemory(const void* memory) {
if
(
label_
!=
nullptr
)
{
delete
[]
label_
;
}
if
(
label_
!=
nullptr
)
{
delete
[]
label_
;
}
label_
=
new
float
[
num_data_
];
label_
=
new
float
[
num_data_
];
std
::
memcpy
(
label_
,
mem_ptr
,
sizeof
(
float
)
*
num_data_
);
std
::
memcpy
(
label_
,
mem_ptr
,
sizeof
(
float
)
*
num_data_
);
mem_ptr
+=
sizeof
(
float
)
*
num_
weights
_
;
mem_ptr
+=
sizeof
(
float
)
*
num_
data
_
;
if
(
num_weights_
>
0
)
{
if
(
num_weights_
>
0
)
{
if
(
weights_
!=
nullptr
)
{
delete
[]
weights_
;
}
if
(
weights_
!=
nullptr
)
{
delete
[]
weights_
;
}
...
...
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