Skip to content

Commit 191c4d3

Browse files
committed
Update test and format for composite adversarial attack
Signed-off-by: Beat Buesser <[email protected]>
1 parent d8f2a10 commit 191c4d3

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

art/attacks/evasion/composite_adversarial_attack.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,7 @@ def _check_params(self) -> None:
210210
if (
211211
not isinstance(self.epsilons[i], tuple)
212212
or not len(self.epsilons[i]) == 2
213-
or not (
214-
isinstance(self.epsilons[i][0], float) and isinstance(self.epsilons[i][1], float)
215-
)
213+
or not (isinstance(self.epsilons[i][0], float) and isinstance(self.epsilons[i][1], float))
216214
):
217215
logger.info(
218216
"The argument `%s` must be an interval within %s of type tuple.",
@@ -224,10 +222,7 @@ def _check_params(self) -> None:
224222
f"within {_epsilons_range[i][2]} of type tuple."
225223
)
226224

227-
if (not (
228-
_epsilons_range[i][1][0] <= self.epsilons[i][0] <= self.epsilons[i][1] <= _epsilons_range[i][1][1]
229-
)
230-
):
225+
if not (_epsilons_range[i][1][0] <= self.epsilons[i][0] <= self.epsilons[i][1] <= _epsilons_range[i][1][1]):
231226
logger.info(
232227
"The argument `%s` must be an interval within %s of type tuple.",
233228
_epsilons_range[i][0],

tests/attacks/evasion/test_composite_adversarial_attack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def fix_get_cifar10_subset(get_cifar10_dataset):
3939

4040

4141
@pytest.mark.skip_framework(
42-
"tensorflow1", "tensorflow2", "tensorflow2v1", "keras", "non_dl_frameworks", "mxnet", "kerastf"
42+
"tensorflow1", "tensorflow2", "tensorflow2v1", "keras", "non_dl_frameworks", "mxnet", "kerastf", "huggingface"
4343
)
4444
def test_generate(art_warning, fix_get_cifar10_subset):
4545
try:

0 commit comments

Comments
 (0)