Check whether the current scope supports NCHW ops. TensorFlow does not support NCHW on CPU. Therefore we check if we are not explicitly put on CPU, and have GPUs available. In this case there will be soft-placing on the GPU device. Returns: bool: if the current scope device placeme
()
| 633 | |
| 634 | |
| 635 | def _has_nchw_support(): |
| 636 | """Check whether the current scope supports NCHW ops. |
| 637 | |
| 638 | TensorFlow does not support NCHW on CPU. Therefore we check if we are not |
| 639 | explicitly put on |
| 640 | CPU, and have GPUs available. In this case there will be soft-placing on the |
| 641 | GPU device. |
| 642 | |
| 643 | Returns: |
| 644 | bool: if the current scope device placement would support nchw |
| 645 | """ |
| 646 | explicitly_on_cpu = _is_current_explicit_device('CPU') |
| 647 | gpus_available = bool(_get_available_gpus()) |
| 648 | return not explicitly_on_cpu and gpus_available |
| 649 | |
| 650 | |
| 651 | # VARIABLE MANIPULATION |
no test coverage detected