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
apex
Commits
2c63ba91
Commit
2c63ba91
authored
Apr 25, 2019
by
Michael Carilli
Browse files
Don't launch for empty sets
parent
91362442
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
+14
-13
apex/optimizers/fused_sgd.py
apex/optimizers/fused_sgd.py
+14
-13
No files found.
apex/optimizers/fused_sgd.py
View file @
2c63ba91
...
@@ -154,18 +154,19 @@ class FusedSGD(Optimizer):
...
@@ -154,18 +154,19 @@ class FusedSGD(Optimizer):
[
fp32_grads
,
fp32_params
,
fp32_momentums
]]
[
fp32_grads
,
fp32_params
,
fp32_momentums
]]
for
launch_set
,
first_run
in
zip
(
launch_sets
,
first_runs
):
for
launch_set
,
first_run
in
zip
(
launch_sets
,
first_runs
):
multi_tensor_applier
(
assert
len
(
launch_set
[
0
])
==
len
(
launch_set
[
1
])
self
.
multi_tensor_sgd
,
assert
len
(
launch_set
[
0
])
==
len
(
launch_set
[
2
])
self
.
_dummy_overflow_buf
,
if
len
(
launch_set
[
0
])
>
0
:
# Note: Need to do this as list comprehensions otherwise
multi_tensor_applier
(
# things don't seem to update properly.
self
.
multi_tensor_sgd
,
launch_set
,
self
.
_dummy_overflow_buf
,
weight_decay
,
launch_set
,
momentum
,
weight_decay
,
dampening
,
momentum
,
group
[
'lr'
],
dampening
,
nesterov
,
group
[
'lr'
],
first_run
,
nesterov
,
self
.
wd_after_momentum
)
first_run
,
self
.
wd_after_momentum
)
return
loss
return
loss
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