def _should_do_step(self):
    'Tells if we will be performing an optimizer step.\n\n        Returns True always if there is no gradient accumulation. With gradient\n        accumulation returns True only when the gradients will be synchronized and we\n        will be performing an optimizer step.\n        '
    update_idx = (self.num_updates // self.get_global_batchsize())
    return ((update_idx % self.optimizer_period) == (self.optimizer_period - 1))
Tells if we will be performing an optimizer step.

Returns True always if there is no gradient accumulation. With gradient
accumulation returns True only when the gradients will be synchronized and we
will be performing an optimizer step.
def _should_do_step(self):
    'Tells if we will be performing an optimizer step.\n\n        Returns True always if there is no gradient accumulation. With gradient\n        accumulation returns True only when the gradients will be synchronized and we\n        will be performing an optimizer step.\n        '
    update_idx = (self.num_updates // self.get_global_batchsize())
    return ((update_idx % self.optimizer_period) == (self.optimizer_period - 1))