Skip to content

Commit 1042845

Browse files
committed
drop LoggerStages
1 parent a17c941 commit 1042845

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

pytorch_lightning/trainer/connectors/logger_connector/epoch_result_store.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
from collections import defaultdict
15-
from typing import Any, Dict, List, Optional, Union
15+
from typing import Any, Dict, List, Optional
1616

1717
import torch
1818

@@ -21,26 +21,6 @@
2121
from pytorch_lightning.utilities import DistributedType, LightningEnum
2222

2323

24-
class LoggerStages(LightningEnum):
25-
""" Train/validation/test phase in each training step.
26-
>>> # you can math the type with string
27-
>>> LoggerStages.TRAIN == 'train'
28-
True
29-
"""
30-
TRAIN = "train"
31-
VAL = "validation"
32-
TEST = "test"
33-
34-
@staticmethod
35-
def determine_stage(stage_or_testing: Union[str, bool]) -> 'LoggerStages':
36-
if isinstance(stage_or_testing, str) and stage_or_testing in list(LoggerStages):
37-
return LoggerStages(stage_or_testing)
38-
if isinstance(stage_or_testing, (bool, int)):
39-
# stage_or_testing is trainer.testing
40-
return LoggerStages.TEST if bool(stage_or_testing) else LoggerStages.VAL
41-
raise RuntimeError(f"Invalid stage {stage_or_testing} of type {type(stage_or_testing)} given")
42-
43-
4424
class ResultStoreType(LightningEnum):
4525
INSIDE_BATCH_TRAIN_LOOP = "inside_batch_train_loop"
4626
OUTSIDE_BATCH_TRAIN_LOOP = "outside_batch_train_loop"

0 commit comments

Comments
 (0)