Skip to content

Commit 8549e0e

Browse files
authored
Merge pull request #1684 from GianlucaMega/dev_1.10.2
fix: fixed np.sum in art/defences/postprocessor/gaussian_noise.py
2 parents 6d98749 + e50e827 commit 8549e0e

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)