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

Function mean

src/backend/cpu/mean.cpp:32–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30
31template<typename Ti, typename Tw, typename To>
32Array<To> mean(const Array<Ti> &in, const int dim) {
33 dim4 odims = in.dims();
34 odims[dim] = 1;
35 Array<To> out = createEmptyArray<To>(odims);
36 static const mean_dim_func<Ti, Tw, To> mean_funcs[] = {
37 kernel::mean_dim<Ti, Tw, To, 1>(), kernel::mean_dim<Ti, Tw, To, 2>(),
38 kernel::mean_dim<Ti, Tw, To, 3>(), kernel::mean_dim<Ti, Tw, To, 4>()};
39
40 getQueue().enqueue(mean_funcs[in.ndims() - 1], out, 0, in, 0, dim);
41 return out;
42}
43
44template<typename T, typename Tw>
45using mean_weighted_dim_func =

Callers

nothing calls this directly

Calls 8

getQueueFunction · 0.50
dimsMethod · 0.45
enqueueMethod · 0.45
ndimsMethod · 0.45
evalMethod · 0.45
syncMethod · 0.45
stridesMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected