From 7443440abb8ed9e1dce423014c5c26001c3830e4 Mon Sep 17 00:00:00 2001 From: georgeyiasemis Date: Thu, 9 Nov 2023 18:34:20 +0100 Subject: [PATCH] Codacy complains --- direct/engine.py | 1 - direct/functionals/ssim.py | 3 ++- direct/nn/conv/conv.py | 24 ++++++++++++------------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/direct/engine.py b/direct/engine.py index 8deeb468..404bf129 100644 --- a/direct/engine.py +++ b/direct/engine.py @@ -38,7 +38,6 @@ from direct.utils.events import CommonMetricPrinter, EventStorage, JSONWriter, TensorboardWriter, get_event_storage from direct.utils.io import write_json - logging.captureWarnings(True) diff --git a/direct/functionals/ssim.py b/direct/functionals/ssim.py index 913acb65..1de05128 100644 --- a/direct/functionals/ssim.py +++ b/direct/functionals/ssim.py @@ -9,6 +9,8 @@ # All rights reserved. # Some changes are made to work together with DIRECT. +# pylint: disable=too-many-locals + import torch import torch.nn as nn import torch.nn.functional as F @@ -95,7 +97,6 @@ def forward(self, input_data: torch.Tensor, target_data: torch.Tensor, data_rang ------- torch.Tensor """ - # pylint: disable=too-many-locals data_range = data_range[:, None, None, None, None] C1 = (self.k1 * data_range) ** 2 C2 = (self.k2 * data_range) ** 2 diff --git a/direct/nn/conv/conv.py b/direct/nn/conv/conv.py index e3246770..51deae81 100644 --- a/direct/nn/conv/conv.py +++ b/direct/nn/conv/conv.py @@ -202,18 +202,6 @@ def __init__( adjust_scale=False, **kwargs, ): - super().__init__( - in_channels, - out_channels, - kernel_size, - stride, - padding, - output_padding, - groups, - bias, - dilation, - **kwargs, - ) """Inits :class:`CWNConvTranspose2d`. Parameters @@ -239,6 +227,18 @@ def __init__( adjust_scale : bool, optional If True, the scale factor is adjusted as a learnable parameter. Default: False. """ + super().__init__( + in_channels, + out_channels, + kernel_size, + stride, + padding, + output_padding, + groups, + bias, + dilation, + **kwargs, + ) self.weight_normalization = CWNorm() self.scale_ = torch.ones(in_channels, 1, 1, 1).fill_(n_scale) if adjust_scale: