Source code for torchtraining.exceptions
"""Exceptions which allow users to finish pipes abruptly.
Usually shouldn't be used except for the above.
"""
[docs]class EpochsException(Exception):
"""Special exception caught by `torchtraining.epochs.EpochsBase` objects.
User should throw this exception if he wants to stop current iteration immediately
and proceed with the rest of program.
Should be used with cautious.
Currently used by `torchtraining.callbacks.EarlyStopping`, `torchtraining.callbacks.TimeStopping`
and `torchtraining.callbacks.TerminateOnNan`.
"""
pass
[docs]class IterationsException(Exception):
"""Special exception caught by `torchtraining.iterations.IterationsBase` objects.
User should throw this exception if he wants to stop current iteration immediately
and proceed with the rest of program.
Should be used with cautious.
"""
pass
[docs]class EarlyStopping(EpochsException):
"""EarlyStopping special exception"""
pass
[docs]class TimeStopping(EpochsException):
"""TimeStopping special exception"""
pass
[docs]class TerminateOnNan(EpochsException):
"""TerminateOnNaN special exception"""
pass