remove unused variable 'valid'
@@ -27,7 +27,6 @@ class ManualScheduleTrigger(object):
self.prev_epoch = 0
self.points = (points if isinstance(points, list) else [points])
self.unit = unit
- self.valid = [True] * len(self.points)
def __call__(self, trainer):
"""Decides whether the extension should be called on this iteration.
@@ -47,12 +46,8 @@ class ManualScheduleTrigger(object):
if self.unit == 'epoch':
cur_epoch = updater.epoch_detail
thresh = cur_epoch - self.prev_epoch if self.prev_epoch > 0 else 0
- flag = [p <= cur_epoch < p + thresh and v for (p, v)
- in six.moves.zip(self.points, self.valid)]
- ans = any([f and v for (f, v) in six.moves.zip(flag,
- self.valid)])
- self.valid = [not f and v for (f, v) in six.moves.zip(flag,
- self.valid)]
+ ans = any(p <= cur_epoch < p + thresh for p in self.points)
+
self.prev_epoch = cur_epoch
return ans
else:
