summaryrefslogtreecommitdiff
path: root/text_recognizer/networks/convnext
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2022-09-18 18:11:21 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2022-09-18 18:11:53 +0200
commit2cc6aa059139b57057609817913ad515063c2eab (patch)
tree5433f69a5eaf63e064a100bf900783127c7b1ff4 /text_recognizer/networks/convnext
parent88caa5c466225d4752541c352c5777235f8f0c61 (diff)
Format imports
Format imports
Diffstat (limited to 'text_recognizer/networks/convnext')
-rw-r--r--text_recognizer/networks/convnext/__init__.py2
-rw-r--r--text_recognizer/networks/convnext/attention.py4
-rw-r--r--text_recognizer/networks/convnext/downsample.py2
-rw-r--r--text_recognizer/networks/convnext/norm.py2
-rw-r--r--text_recognizer/networks/convnext/residual.py3
5 files changed, 7 insertions, 6 deletions
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):