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
OpenDAS
Fairseq
Commits
1ec5f0a0
Commit
1ec5f0a0
authored
Apr 17, 2018
by
Myle Ott
Browse files
Use eval() to parse args.lr
parent
fa7c575a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
fairseq/options.py
fairseq/options.py
+2
-1
No files found.
fairseq/options.py
View file @
1ec5f0a0
...
@@ -57,7 +57,8 @@ def parse_args_and_arch(parser, input_args=None):
...
@@ -57,7 +57,8 @@ def parse_args_and_arch(parser, input_args=None):
args
=
parser
.
parse_args
(
input_args
)
args
=
parser
.
parse_args
(
input_args
)
# Post-process args.
# Post-process args.
args
.
lr
=
list
(
map
(
float
,
args
.
lr
.
split
(
','
)))
args
.
lr
=
eval
(
args
.
lr
)
args
.
lr
=
[
args
.
lr
]
if
isinstance
(
args
.
lr
,
float
)
else
list
(
args
.
lr
)
args
.
update_freq
=
list
(
map
(
float
,
args
.
update_freq
.
split
(
','
)))
args
.
update_freq
=
list
(
map
(
float
,
args
.
update_freq
.
split
(
','
)))
if
args
.
max_sentences_valid
is
None
:
if
args
.
max_sentences_valid
is
None
:
args
.
max_sentences_valid
=
args
.
max_sentences
args
.
max_sentences_valid
=
args
.
max_sentences
...
...
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