From 68bf45a128862c2bbf563bb7c2173e3e6fd4ca7b Mon Sep 17 00:00:00 2001 From: JMGaljaard Date: Fri, 2 Sep 2022 12:57:05 +0200 Subject: [PATCH] Make DistributedConfig only import for type checking to prevent cyclic imports --- fltk/nets/util/model.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fltk/nets/util/model.py b/fltk/nets/util/model.py index f5266095..2ec9224e 100644 --- a/fltk/nets/util/model.py +++ b/fltk/nets/util/model.py @@ -1,3 +1,4 @@ +from __future__ import annotations import logging from collections import OrderedDict from pathlib import Path @@ -6,8 +7,12 @@ import torch from torch.utils.tensorboard import SummaryWriter -from fltk.util.config import DistributedConfig + from fltk.util.results import EpochData +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from fltk.util.config import DistributedConfig def flatten_params(model_description: Union[torch.nn.Module, OrderedDict]):