From 2cc6aa059139b57057609817913ad515063c2eab Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 18 Sep 2022 18:11:21 +0200 Subject: Format imports Format imports --- text_recognizer/networks/convnext/__init__.py | 2 +- text_recognizer/networks/convnext/attention.py | 4 ++-- text_recognizer/networks/convnext/downsample.py | 2 +- text_recognizer/networks/convnext/norm.py | 2 +- text_recognizer/networks/convnext/residual.py | 3 ++- 5 files changed, 7 insertions(+), 6 deletions(-) (limited to 'text_recognizer/networks/convnext') diff --git a/text_recognizer/networks/convnext/__init__.py b/text_recognizer/networks/convnext/__init__.py index 1743f09..faebe6f 100644 --- a/text_recognizer/networks/convnext/__init__.py +++ b/text_recognizer/networks/convnext/__init__.py @@ -1,7 +1,7 @@ """Convnext module.""" -from text_recognizer.networks.convnext.convnext import ConvNext from text_recognizer.networks.convnext.attention import ( Attention, FeedForward, TransformerBlock, ) +from text_recognizer.networks.convnext.convnext import ConvNext diff --git a/text_recognizer/networks/convnext/attention.py b/text_recognizer/networks/convnext/attention.py index 7f03436..a373c37 100644 --- a/text_recognizer/networks/convnext/attention.py +++ b/text_recognizer/networks/convnext/attention.py @@ -1,8 +1,8 @@ """Convolution self attention block.""" -from einops import reduce, rearrange -from torch import einsum, nn, Tensor import torch.nn.functional as F +from einops import rearrange, reduce +from torch import Tensor, einsum, nn from text_recognizer.networks.convnext.norm import LayerNorm from text_recognizer.networks.convnext.residual import Residual diff --git a/text_recognizer/networks/convnext/downsample.py b/text_recognizer/networks/convnext/downsample.py index 6e4306f..c28ecca 100644 --- a/text_recognizer/networks/convnext/downsample.py +++ b/text_recognizer/networks/convnext/downsample.py @@ -1,7 +1,7 @@ from typing import Tuple from einops.layers.torch import Rearrange -from torch import nn, Tensor +from torch import Tensor, nn class Downsample(nn.Module): diff --git a/text_recognizer/networks/convnext/norm.py b/text_recognizer/networks/convnext/norm.py index 2d896e5..23cf07a 100644 --- a/text_recognizer/networks/convnext/norm.py +++ b/text_recognizer/networks/convnext/norm.py @@ -1,6 +1,6 @@ """Layer norm for conv layers.""" import torch -from torch import nn, Tensor +from torch import Tensor, nn class LayerNorm(nn.Module): diff --git a/text_recognizer/networks/convnext/residual.py b/text_recognizer/networks/convnext/residual.py index 3f44390..8e76ae9 100644 --- a/text_recognizer/networks/convnext/residual.py +++ b/text_recognizer/networks/convnext/residual.py @@ -1,6 +1,7 @@ """Generic residual layer.""" from typing import Callable -from torch import nn, Tensor + +from torch import Tensor, nn class Residual(nn.Module): -- cgit v1.2.3-70-g09d2