Sets the shape of the buffer node_index_map under the moddims node to the new shape
| 45 | /// Sets the shape of the buffer node_index_map under the moddims node to the |
| 46 | /// new shape |
| 47 | void 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. |
| 69 | void removeNodeOfOperation( |
no test coverage detected