robustML/advertrain/dependencies/cleverhans/utils.py
2
F541:
f-string is missing placeholders
23
raise
ValueError
(
f
"Norm must be np.inf, 1, or 2."
)
83
raise
ValueError
(
f
"Only L-inf, L1 and L2 norms are currently implemented."
)
1
E501:
line too long (152 > 120 characters)
30
norm_val
=
torch
.
sqrt
(
torch
.
sum
(
eta
**
2
,
dim
=
reduc_ind
,
keepdim
=
True
))
if
norm
==
2
else
torch
.
sum
(
torch
.
abs
(
eta
),
dim
=
reduc_ind
,
keepdim
=
True
)