| 114 | # of a tensor, we keep the source argument the same so that |
| 115 | # the pipeline can backtrack through the user-defined graph |
| 116 | def _to_backend(self, backend) -> DataNode: |
| 117 | if self.device == backend: |
| 118 | return self |
| 119 | |
| 120 | from nvidia.dali import _conditionals |
| 121 | |
| 122 | if _conditionals.conditionals_enabled(): |
| 123 | # Treat it the same way as regular operator would behave |
| 124 | [self_split], _ = _conditionals.apply_conditional_split_to_args([self], {}) |
| 125 | transferred_node = DataNode( |
| 126 | self_split.name, backend, self_split.source, self_split.index |
| 127 | ) |
| 128 | _conditionals.register_data_nodes(transferred_node, [self]) |
| 129 | return transferred_node |
| 130 | return DataNode(self.name, backend, self.source, self.index) |
| 131 | |
| 132 | def __add__(self, other) -> DataNode: |
| 133 | return _arithm_op("add", self, other) |