11 with extension_loader.DlopenGuard():
14 if num_cuda_devices():
15 has_gpu_support =
True 17 has_gpu_support =
False 18 except ImportError
as e:
20 'This caffe2 python run does not have GPU support. ' 21 'Will run in CPU only mode.')
22 logging.warning(
'Debug message: {0}'.format(str(e)))
23 has_gpu_support =
False 26 except ImportError
as e:
28 'Cannot load caffe2.python. Error: {0}'.format(str(e)))
33 atexit.register(on_module_exit)
37 def _TensorCPU_shape(self):
38 return tuple(self._shape)
41 def _TensorCPU_reshape(self, shape):
42 return self._reshape(list(shape))
44 TensorCPU.shape = property(_TensorCPU_shape)
45 TensorCPU.reshape = _TensorCPU_reshape