Checks whether using this `DataNode` in a CPU operator is legal. The function checks whether it's legal to pass it as an input to a CPU operator. If the node is a result of a GPU operator which belongs to a pipeline with non-dynamic executor, an error is raised. ..
(self)
| 357 | return self.property("source_info", device=device) |
| 358 | |
| 359 | def _check_gpu2cpu(self): |
| 360 | """Checks whether using this `DataNode` in a CPU operator is legal. |
| 361 | |
| 362 | The function checks whether it's legal to pass it as an input to a CPU operator. |
| 363 | If the node is a result of a GPU operator which belongs to a pipeline with non-dynamic |
| 364 | executor, an error is raised. |
| 365 | |
| 366 | .. note:: |
| 367 | If the defining operator does not yet belong to any pipeline, the error is not raised and |
| 368 | the check is deferred until `Pipeline.build`. |
| 369 | """ |
| 370 | if self.device == "gpu" and self.source and self.source.pipeline: |
| 371 | self.source.pipeline._require_exec_dynamic( |
| 372 | "This pipeline doesn't support transition from GPU to CPU.\n" |
| 373 | "GPU->CPU transitions require " |
| 374 | ) |
| 375 | |
| 376 | |
| 377 | not_iterable(DataNode) |
no test coverage detected