Skip to content

Commit

Permalink
Fix for coding style by black
Browse files Browse the repository at this point in the history
  • Loading branch information
CNOCycle committed Jul 31, 2024
1 parent 387471e commit ea923b2
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ class TileObj:
"""
Internally used object that stores information about each tile.
"""

def __init__(self, tile_size: int, device: "torch.cuda.device") -> None:
"""
Create a tile instance.
Expand Down Expand Up @@ -250,6 +251,7 @@ class TileArray:
"""
Internally used object that stores the list of tiles.
"""

def __init__(self, xyxy: list, threshold: int, tile_size: int, k: int, device: "torch.cuda.device") -> None:
"""
Initialization operation.
Expand Down Expand Up @@ -354,7 +356,9 @@ def generate(self, x: np.ndarray, y: Optional[np.ndarray] = None, **kwargs) -> n

return x_adv

Check warning on line 357 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#L357

Added line #L357 was not covered by tests

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

return loss

Check warning on line 524 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#L524

Added line #L524 was not covered by tests

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

0 comments on commit ea923b2

Please sign in to comment.