Fix OneCycleLR zero division error (#1498)
* Add regression test for onecyclelr zerodivision error
* Wrap computation of lr and mom decay factors in try except block
This handles the case when decay_step_size is set to zero, which is the default case,
and prevents a zero division error
* Use boolean attributes instead of try/except block