MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _has_nchw_support

Function _has_nchw_support

tensorflow/python/keras/backend.py:635–648  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

633
634
635def _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

Callers 6

batch_normalizationFunction · 0.85
_preprocess_conv1d_inputFunction · 0.85
_preprocess_conv2d_inputFunction · 0.85
_preprocess_conv3d_inputFunction · 0.85
bias_addFunction · 0.85

Calls 2

_get_available_gpusFunction · 0.85

Tested by

no test coverage detected