Refactor a bit of silly logic in HardTanh.Train