Process the DataNode that is an input to an operator call. Detect if the DataNode was produced on the same nesting level. If not, split accordingly to the stack of the previous conditions. Caches the previously processed DataNodes to not do repeated splitting.
(self, data_node)
| 291 | return produced_data_node |
| 292 | |
| 293 | def preprocess_input(self, data_node): |
| 294 | """Process the DataNode that is an input to an operator call. Detect if the DataNode was |
| 295 | produced on the same nesting level. If not, split accordingly to the stack of the previous |
| 296 | conditions. Caches the previously processed DataNodes to not do repeated splitting. |
| 297 | """ |
| 298 | stack_level = self._find_closest(data_node) |
| 299 | logging.log( |
| 300 | 8, |
| 301 | ( |
| 302 | f"{self._indent()}[IF/Input] {data_node} accessed at level" |
| 303 | f" {self.stack_depth() - 1} found at {stack_level}." |
| 304 | ), |
| 305 | ) |
| 306 | # We already have it cached or produced in this scope. |
| 307 | if stack_level == self.stack_depth() - 1: |
| 308 | return self.top().get(data_node) |
| 309 | # otherwise, we need to fill in the splits. |
| 310 | return self._realize_split(data_node, stack_level) |
| 311 | |
| 312 | def register_data_nodes(self, data_nodes, global_scope=False): |
| 313 | """Register the data nodes as produced in current scope, otherwise if `global_scope` is True |