Last active
October 17, 2023 18:42
-
-
Save mikecvet/22dc33029167a0366b1c90e3bbd63d4a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let patches = self.patches(input); | |
for p in patches.iter() { | |
let depth = p.data.dim().2; | |
let v: Vec<f64> = (0..depth).map(|i| { | |
p.data | |
.slice(s![.., .., i]) | |
.fold(f64::NEG_INFINITY, |acc, &v| acc.max(v)) | |
}).collect(); | |
a.slice_mut(s![p.x, p.y, ..]).assign(&Array1::from(v)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment