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
f66e9cb5
Commit
f66e9cb5
authored
Sep 06, 2018
by
Myle Ott
Browse files
Disable c10d for AdaptiveLoss
parent
1082ba35
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
fairseq/criterions/adaptive_loss.py
fairseq/criterions/adaptive_loss.py
+6
-0
No files found.
fairseq/criterions/adaptive_loss.py
View file @
f66e9cb5
...
@@ -22,6 +22,12 @@ class AdaptiveLoss(FairseqCriterion):
...
@@ -22,6 +22,12 @@ class AdaptiveLoss(FairseqCriterion):
def
__init__
(
self
,
args
,
task
):
def
__init__
(
self
,
args
,
task
):
super
().
__init__
(
args
,
task
)
super
().
__init__
(
args
,
task
)
if
not
args
.
no_c10d
:
raise
Exception
(
'AdaptiveLoss is not compatible with the c10d version of '
'DistributedDataParallel. Please add the `--no-c10d` flag.'
)
def
forward
(
self
,
model
,
sample
,
reduce
=
True
):
def
forward
(
self
,
model
,
sample
,
reduce
=
True
):
"""Compute the loss for the given sample.
"""Compute the loss for the given sample.
...
...
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