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

Function moddimOp

src/backend/common/moddims.cpp:43–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41
42template<typename T>
43Array<T> moddimOp(const Array<T> &in, af::dim4 outDim) {
44
45 const auto &node = in.getNode();
46
47 NodeIterator<> it(node.get());
48
49 dim4 olddims_t = in.dims();
50
51 bool all_linear = true;
52 while (all_linear && it != NodeIterator<>()) {
53 all_linear &= it->isLinear(olddims_t.get());
54 ++it;
55 }
56 if (all_linear == false) in.eval();
57
58 Array<T> out = createNodeArray<T>(outDim, copyModdims(in.getNode(), outDim));
59
60 return out;
61}
62
63template<typename T>
64Array<T> modDims(const Array<T> &in, const af::dim4 &newDims) {

Callers

nothing calls this directly

Calls 6

copyModdimsFunction · 0.85
getNodeMethod · 0.45
getMethod · 0.45
dimsMethod · 0.45
isLinearMethod · 0.45
evalMethod · 0.45

Tested by

no test coverage detected