pub fn count<T>(input: &Array<T>, dim: i32) -> Array<u32> where
T: HasAfEnum,
u32: HasAfEnum,
Count number of non-zero elements along a given dimension
input
- Input Arraydim
- Dimension along which the non-zero elements are countedResult Array with number of non-zero elements along a given dimension
use arrayfire::{Dim4, gt, print, randu, count}; let dims = Dim4::new(&[5, 3, 1, 1]); let cnst: f32 = 0.5; let a = gt(&randu::<f32>(dims), &cnst, false); print(&a); let b = count(&a, 0); print(&b); let c = count(&a, 1); print(&c);
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4