Skip to content

Commit e50e827

Browse files
g.megaGianlucaMega
authored andcommitted
fix: fixed np.sum in art/defences/postprocessor/gaussian_noise.py
Signed-off-by: GianlucaMega <[email protected]>
1 parent cb95baf commit e50e827

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

art/defences/postprocessor/gaussian_noise.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def __call__(self, preds: np.ndarray) -> np.ndarray:
6969
# Finally normalize probability output
7070
if all_probability:
7171
post_preds[post_preds < 0.0] = 0.0
72-
sums = np.sum(post_preds, axis=1)
72+
sums = np.sum(post_preds, axis=1, keepdims=True)
7373
post_preds /= sums
7474
else:
7575
post_preds[post_preds < 0.0] = 0.0

0 commit comments

Comments
 (0)