| 156 | ggml_can_repeat(repeat_node.src[0], &consumer); |
| 157 | } |
| 158 | |
| 159 | bool rewrite_excluded( |
| 160 | const GraphOptimizationOptions & options, |
| 161 | GraphOptimizationRewriteKind kind, |
| 162 | const ggml_tensor * node, |
| 163 | const ggml_tensor * consumer, |
| 164 | int consumer_src_index, |
| 165 | int nodes_before) { |
| 166 | if (options.exclude_rewrite == nullptr) { |
| 167 | return false; |
| 168 | } |
| 169 | return options.exclude_rewrite( |
| 170 | GraphOptimizationRewriteContext{ |
| 171 | kind, |
| 172 | options.backend, |
| 173 | nodes_before, |
| 174 | node, |
| 175 | consumer, |
| 176 | consumer_src_index, |
| 177 | }, |
| 178 | options.exclude_rewrite_user_data); |
| 179 | } |
| 180 | |
| 181 | } // namespace |