cpu_count may raise NotImplementedError

This commit is contained in:
arve0
2015-05-16 12:07:11 +02:00
committed by Blake Griffith
parent b2e4468e55
commit 7ac7e1078b
+4 -1
View File
@@ -80,7 +80,10 @@ def apply_chunks(function, array, chunks=None, depth=0, mode=None,
"""
if chunks is None:
shape = array.shape
ncpu = cpu_count()
try:
ncpu = cpu_count()
except NotImplementedError:
ncpu = 4
chunks = _get_chunks(shape, ncpu)
if mode == 'wrap':