Skip to content

Commit

Permalink
Codacy/pylint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
georgeyiasemis committed Jan 7, 2025
1 parent 5fe696b commit d3997f5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
12 changes: 6 additions & 6 deletions direct/nn/transformers/transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ class ImageDomainMRIUFormer(nn.Module):
Whether to apply normalization before and denormalization after the forward pass. Default: True.
"""

# pylint: disable=too-many-arguments
def __init__(
self,
forward_operator: Callable[[tuple[Any, ...]], torch.Tensor],
Expand Down Expand Up @@ -163,8 +162,9 @@ def __init__(
Whether to apply normalization before and denormalization after the forward pass. Default: True.
**kwargs: Other keyword arguments to pass to the parent constructor.
"""
# pylint: disable=too-many-arguments
super().__init__()
for extra_key in kwargs.keys():
for extra_key in kwargs:
if extra_key not in [
"model_name",
]:
Expand Down Expand Up @@ -332,7 +332,7 @@ def __init__(
Whether to normalize the input tensor. Default: True.
"""
super().__init__()
for extra_key in kwargs.keys():
for extra_key in kwargs:
if extra_key not in [
"model_name",
]:
Expand Down Expand Up @@ -490,7 +490,7 @@ def __init__(
Whether to normalize the input tensor. Default: True.
"""
super().__init__()
for extra_key in kwargs.keys():
for extra_key in kwargs:
if extra_key not in [
"model_name",
]:
Expand Down Expand Up @@ -654,7 +654,7 @@ def __init__(
Whether to compute the output per coil.
"""
super().__init__()
for extra_key in kwargs.keys():
for extra_key in kwargs:
if extra_key not in [
"model_name",
]:
Expand Down Expand Up @@ -849,7 +849,7 @@ def __init__(
Whether to compute the output per coil.
"""
super().__init__()
for extra_key in kwargs.keys():
for extra_key in kwargs:
if extra_key not in [
"model_name",
]:
Expand Down
2 changes: 2 additions & 0 deletions direct/nn/transformers/uformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ def __init__(
proj_drop : float
Dropout rate for the output of the last linear projection layer.
"""
# pylint: disable=too-many-locals
super().__init__()
self.dim = dim
self.win_size = win_size # Wh, Ww
Expand Down Expand Up @@ -1277,6 +1278,7 @@ def forward(self, x: torch.Tensor, mask: Optional[torch.Tensor] = None) -> torch
-------
torch.Tensor
"""
# pylint: disable=too-many-locals
B, L, C = x.shape
H = int(math.sqrt(L))
W = int(math.sqrt(L))
Expand Down
1 change: 1 addition & 0 deletions direct/nn/transformers/vit.py
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,7 @@ def __init__(
normalized : bool
Whether to normalize the input tensor. Default: True.
"""
# pylint: disable=too-many-locals
super().__init__()

self.dimensionality = dimensionality
Expand Down

0 comments on commit d3997f5

Please sign in to comment.