Skip to content

Commit

Permalink
Fix for warnings reported by the pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
CNOCycle committed Jul 31, 2024
1 parent ea923b2 commit 87c5b9b
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,7 @@ def compare(self, target: "TileObj") -> bool:
if self.bcount < target.bcount:
return False

Check warning on line 242 in art/attacks/evasion/steal_now_attack_later/steal_now_attack_later.py

View check run for this annotation

Codecov / codecov/patch

art/attacks/evasion/steal_now_attack_later/steal_now_attack_later.py#L242

Added line #L242 was not covered by tests

if self.diff < target.diff:
return True
else:
return False
return bool(self.diff < target.diff)

Check warning on line 244 in art/attacks/evasion/steal_now_attack_later/steal_now_attack_later.py

View check run for this annotation

Codecov / codecov/patch

art/attacks/evasion/steal_now_attack_later/steal_now_attack_later.py#L244

Added line #L244 was not covered by tests


class TileArray:
Expand Down Expand Up @@ -357,8 +354,8 @@ def generate(self, x: np.ndarray, y: Optional[np.ndarray] = None, **kwargs) -> n
return x_adv

Check warning on line 354 in art/attacks/evasion/steal_now_attack_later/steal_now_attack_later.py

View check run for this annotation

Codecov / codecov/patch

art/attacks/evasion/steal_now_attack_later/steal_now_attack_later.py#L354

Added line #L354 was not covered by tests

def _generate_batch(
self, x_batch: np.ndarray, y_batch: Optional[np.ndarray] = None
) -> np.ndarray: # pylint: disable=W0613
self, x_batch: np.ndarray, y_batch: Optional[np.ndarray] = None # pylint: disable=W0613
) -> np.ndarray:
"""
Run the attack on a batch of images.
Expand Down Expand Up @@ -523,9 +520,9 @@ def _get_loss(self, pert: "torch.tensor", epsilon: float) -> "torch.tensor": #

return loss

Check warning on line 521 in art/attacks/evasion/steal_now_attack_later/steal_now_attack_later.py

View check run for this annotation

Codecov / codecov/patch

art/attacks/evasion/steal_now_attack_later/steal_now_attack_later.py#L521

Added line #L521 was not covered by tests

def _color_projection(
def _color_projection( # pylint: disable=R0201
self, tile: "torch.tensor", x_ref: "torch.tensor", epsilon: float
) -> "torch.tensor": # pylint: disable=R0201
) -> "torch.tensor":
"""
Convert statistics information from target to source.
Expand Down

0 comments on commit 87c5b9b

Please sign in to comment.