Skip to content

Commit d71e24f

Browse files
committed
isort src
1 parent 87d96dd commit d71e24f

File tree

7 files changed

+12
-9
lines changed

7 files changed

+12
-9
lines changed

src/model_constructor/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from .convmixer import ConvMixer
2-
from .model_constructor import ModelConstructor, ModelCfg
2+
from .model_constructor import ModelCfg, ModelConstructor
33
from .version import __version__

src/model_constructor/activations.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# forked from https://github.com/rwightman/pytorch-image-models/timm/models/layers/activations.py
22
import torch
33
from torch import nn as nn
4-
from torch.nn import functional as F
54
from torch.nn import Mish
6-
5+
from torch.nn import functional as F
76

87
__all__ = [
98
"mish",

src/model_constructor/helpers.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,18 @@ def print_set_fields(self) -> None:
140140
else:
141141
print("Nothing changed")
142142

143-
def print_changed_fields(self, show_default: bool = False, separator: str = " | ") -> None:
143+
def print_changed_fields(
144+
self, show_default: bool = False, separator: str = " | "
145+
) -> None:
144146
"""Print fields changed at init."""
145147
if self.changed_fields:
146148
default_value = ""
147149
print("Changed fields:")
148150
for field in self.changed_fields:
149151
if show_default:
150-
default_value = f"{separator}{self._get_str(self.model_fields[field].default)}"
152+
default_value = (
153+
f"{separator}{self._get_str(self.model_fields[field].default)}"
154+
)
151155
print(f"{field}: {self._get_str_value(field)}{default_value}")
152156
else:
153157
print("Nothing changed")

src/model_constructor/model_constructor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from collections import OrderedDict
22
from functools import partial
3-
from typing import Any, Callable, Dict, List, Optional, Union, Type
3+
from typing import Any, Callable, Dict, List, Optional, Type, Union
44

55
from pydantic import field_validator
66
from pydantic_core.core_schema import FieldValidationInfo

src/model_constructor/mxresnet.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from typing import List, Type
2+
23
from torch import nn
34

45
from .xresnet import XResNet

src/model_constructor/xresnet.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from torch import nn
55

66
from .blocks import BottleneckBlock
7-
from .helpers import ListStrMod, nn_seq, ModSeq
7+
from .helpers import ListStrMod, ModSeq, nn_seq
88
from .model_constructor import ModelCfg, ModelConstructor
99

1010
__all__ = [

src/model_constructor/yaresnet.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010
from model_constructor.helpers import ModSeq, nn_seq
1111

1212
from .layers import ConvBnAct, get_act
13-
from .model_constructor import ListStrMod, ModelConstructor, ModelCfg
13+
from .model_constructor import ListStrMod, ModelCfg, ModelConstructor
1414
from .xresnet import xresnet_stem
1515

16-
1716
__all__ = [
1817
"YaBasicBlock",
1918
"YaBottleneckBlock",

0 commit comments

Comments
 (0)