MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / moments

Function moments

src/backend/opencl/moments.cpp:25–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23
24template<typename T>
25Array<float> moments(const Array<T> &in, const af_moment_type moment) {
26 in.eval();
27 dim4 odims, idims = in.dims();
28 dim_t moments_dim = bitCount(moment);
29
30 odims[0] = moments_dim;
31 odims[1] = 1;
32 odims[2] = idims[2];
33 odims[3] = idims[3];
34
35 Array<float> out = createValueArray<float>(odims, 0.f);
36 out.eval();
37
38 kernel::moments<T>(out, in, moment);
39 return out;
40}
41
42#define INSTANTIATE(T) \
43 template Array<float> moments<T>(const Array<T> &in, \

Callers

nothing calls this directly

Calls 3

bitCountFunction · 0.70
evalMethod · 0.45
dimsMethod · 0.45

Tested by

no test coverage detected