Skip to content

Instantly share code, notes, and snippets.

@mikecvet
Last active October 17, 2023 18:42
Show Gist options
  • Save mikecvet/22dc33029167a0366b1c90e3bbd63d4a to your computer and use it in GitHub Desktop.
Save mikecvet/22dc33029167a0366b1c90e3bbd63d4a to your computer and use it in GitHub Desktop.
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