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
48ff86e6
Unverified
Commit
48ff86e6
authored
Mar 10, 2018
by
Guolin Ke
Committed by
GitHub
Mar 10, 2018
Browse files
fix #1258
parent
b6db7e23
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
src/boosting/boosting.cpp
src/boosting/boosting.cpp
+8
-8
No files found.
src/boosting/boosting.cpp
View file @
48ff86e6
...
@@ -14,17 +14,17 @@ std::string GetBoostingTypeFromModelFile(const char* filename) {
...
@@ -14,17 +14,17 @@ std::string GetBoostingTypeFromModelFile(const char* filename) {
bool
Boosting
::
LoadFileToBoosting
(
Boosting
*
boosting
,
const
char
*
filename
)
{
bool
Boosting
::
LoadFileToBoosting
(
Boosting
*
boosting
,
const
char
*
filename
)
{
auto
start_time
=
std
::
chrono
::
steady_clock
::
now
();
auto
start_time
=
std
::
chrono
::
steady_clock
::
now
();
if
(
boosting
!=
nullptr
)
{
if
(
boosting
!=
nullptr
)
{
TextReader
<
size_t
>
model_reader
(
filename
,
true
);
TextReader
<
size_t
>
model_reader
(
filename
,
true
);
size_t
buffer_len
=
0
;
size_t
buffer_len
=
0
;
auto
buffer
=
model_reader
.
ReadContent
(
&
buffer_len
);
auto
buffer
=
model_reader
.
ReadContent
(
&
buffer_len
);
if
(
!
boosting
->
LoadModelFromString
(
buffer
.
data
(),
buffer_len
))
{
if
(
!
boosting
->
LoadModelFromString
(
buffer
.
data
(),
buffer_len
))
{
return
false
;
return
false
;
}
}
}
}
std
::
chrono
::
duration
<
double
,
std
::
milli
>
delta
=
(
std
::
chrono
::
steady_clock
::
now
()
-
start_time
);
std
::
chrono
::
duration
<
double
,
std
::
milli
>
delta
=
(
std
::
chrono
::
steady_clock
::
now
()
-
start_time
);
Log
::
Info
(
"time for loading model: %f seconds"
,
1e-3
*
delta
);
Log
::
Debug
(
"time for loading model: %f seconds"
,
1e-3
*
delta
);
return
true
;
return
true
;
}
}
Boosting
*
Boosting
::
CreateBoosting
(
const
std
::
string
&
type
,
const
char
*
filename
)
{
Boosting
*
Boosting
::
CreateBoosting
(
const
std
::
string
&
type
,
const
char
*
filename
)
{
...
...
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