Closed jiangzc86 closed 3 years ago
@staticmethod
def _check_get_repeat_times(repeat_times):
"""Check validation of input repeat_times."""
_repeat_times = repeat_times
try:
_repeat_times = int(_repeat_times)
except ValueError:
logging.warning("repeat_times {} is not a valid integer".format(_repeat_times))
abort(400, "repeat_times {} is not a valid integer".format(_repeat_times))
if not 0 < _repeat_times <= MAX_EVAL_EPOCHS:
logging.warning("repeat_times {} is not in valid range (1-{})".format(_repeat_times, MAX_EVAL_EPOCHS))
abort(400, "repeat_times {} is not in valid range (1-{})".format(_repeat_times, MAX_EVAL_EPOCHS))
return _repeat_times