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
d72d9359
Commit
d72d9359
authored
Jan 13, 2017
by
Guolin Ke
Browse files
change warning message for wrong parameter type.
parent
300cee50
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
include/LightGBM/config.h
include/LightGBM/config.h
+3
-3
No files found.
include/LightGBM/config.h
View file @
d72d9359
...
@@ -272,7 +272,7 @@ inline bool ConfigBase::GetInt(
...
@@ -272,7 +272,7 @@ inline bool ConfigBase::GetInt(
const
std
::
string
&
name
,
int
*
out
)
{
const
std
::
string
&
name
,
int
*
out
)
{
if
(
params
.
count
(
name
)
>
0
)
{
if
(
params
.
count
(
name
)
>
0
)
{
if
(
!
Common
::
AtoiAndCheck
(
params
.
at
(
name
).
c_str
(),
out
))
{
if
(
!
Common
::
AtoiAndCheck
(
params
.
at
(
name
).
c_str
(),
out
))
{
Log
::
Fatal
(
"Parameter %s should be of type int, got
[%s]
"
,
Log
::
Fatal
(
"Parameter %s should be of type int, got
\"
%s
\"
"
,
name
.
c_str
(),
params
.
at
(
name
).
c_str
());
name
.
c_str
(),
params
.
at
(
name
).
c_str
());
}
}
return
true
;
return
true
;
...
@@ -285,7 +285,7 @@ inline bool ConfigBase::GetDouble(
...
@@ -285,7 +285,7 @@ inline bool ConfigBase::GetDouble(
const
std
::
string
&
name
,
double
*
out
)
{
const
std
::
string
&
name
,
double
*
out
)
{
if
(
params
.
count
(
name
)
>
0
)
{
if
(
params
.
count
(
name
)
>
0
)
{
if
(
!
Common
::
AtofAndCheck
(
params
.
at
(
name
).
c_str
(),
out
))
{
if
(
!
Common
::
AtofAndCheck
(
params
.
at
(
name
).
c_str
(),
out
))
{
Log
::
Fatal
(
"Parameter %s should be of type double, got
[%s]
"
,
Log
::
Fatal
(
"Parameter %s should be of type double, got
\"
%s
\"
"
,
name
.
c_str
(),
params
.
at
(
name
).
c_str
());
name
.
c_str
(),
params
.
at
(
name
).
c_str
());
}
}
return
true
;
return
true
;
...
@@ -304,7 +304,7 @@ inline bool ConfigBase::GetBool(
...
@@ -304,7 +304,7 @@ inline bool ConfigBase::GetBool(
}
else
if
(
value
==
std
::
string
(
"true"
)
||
value
==
std
::
string
(
"+"
))
{
}
else
if
(
value
==
std
::
string
(
"true"
)
||
value
==
std
::
string
(
"+"
))
{
*
out
=
true
;
*
out
=
true
;
}
else
{
}
else
{
Log
::
Fatal
(
"Parameter %s should be
\"
true
\"
/
\"
+
\"
or
\"
false
\"
/
\"
-
\"
, got
[%s]
"
,
Log
::
Fatal
(
"Parameter %s should be
\"
true
\"
/
\"
+
\"
or
\"
false
\"
/
\"
-
\"
, got
\"
%s
\"
"
,
name
.
c_str
(),
params
.
at
(
name
).
c_str
());
name
.
c_str
(),
params
.
at
(
name
).
c_str
());
}
}
return
true
;
return
true
;
...
...
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