Commit 2c63ba91 authored by Michael Carilli's avatar Michael Carilli
Browse files

Don't launch for empty sets

parent 91362442
......@@ -154,18 +154,19 @@ class FusedSGD(Optimizer):
[fp32_grads, fp32_params, fp32_momentums]]
for launch_set, first_run in zip(launch_sets, first_runs):
multi_tensor_applier(
self.multi_tensor_sgd,
self._dummy_overflow_buf,
# Note: Need to do this as list comprehensions otherwise
# things don't seem to update properly.
launch_set,
weight_decay,
momentum,
dampening,
group['lr'],
nesterov,
first_run,
self.wd_after_momentum)
assert len(launch_set[0]) == len(launch_set[1])
assert len(launch_set[0]) == len(launch_set[2])
if len(launch_set[0]) > 0:
multi_tensor_applier(
self.multi_tensor_sgd,
self._dummy_overflow_buf,
launch_set,
weight_decay,
momentum,
dampening,
group['lr'],
nesterov,
first_run,
self.wd_after_momentum)
return loss
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment