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

Function propagateModdimsShape

src/backend/cpu/kernel/Array.hpp:47–66  ·  view source on GitHub ↗

Sets the shape of the buffer node_index_map under the moddims node to the new shape

Source from the content-addressed store, hash-verified

45/// Sets the shape of the buffer node_index_map under the moddims node to the
46/// new shape
47void propagateModdimsShape(
48 std::vector<std::shared_ptr<common::Node>> &node_clones) {
49 using arrayfire::common::NodeIterator;
50 for (auto &node : node_clones) {
51 if (node->getOp() == af_moddims_t) {
52 common::ModdimNode *mn =
53 static_cast<common::ModdimNode *>(node.get());
54
55 NodeIterator<> it(node.get());
56 while (it != NodeIterator<>()) {
57 it = std::find_if(it, NodeIterator<>(), common::isBuffer);
58 if (it == NodeIterator<>()) { break; }
59
60 it->setShape(mn->m_new_shape);
61
62 ++it;
63 }
64 }
65 }
66}
67
68/// Removes node_index_map whos operation matchs a unary operation \p op.
69void removeNodeOfOperation(

Callers 1

evalMultipleFunction · 0.85

Calls 3

getOpMethod · 0.45
getMethod · 0.45
setShapeMethod · 0.45

Tested by

no test coverage detected