Fix serialization of numpy scalars and implement more numpy types as well as empty arrays

This commit is contained in:
Philipp Moritz
2016-06-23 18:39:02 -07:00
parent 1951252689
commit 5ecc2ab67d
4 changed files with 89 additions and 112 deletions
+3
View File
@@ -69,6 +69,9 @@ class Worker(object):
result = serialization.Str(result)
elif isinstance(result, np.ndarray):
result = result.view(serialization.NDArray)
elif isinstance(result, np.generic):
return result
# TODO(pcm): close the associated memory segment; if we don't, this leaks memory (but very little, so it is ok for now)
elif result == None:
return None # can't subclass None and don't need to because there is a global None
# TODO(pcm): close the associated memory segment; if we don't, this leaks memory (but very little, so it is ok for now)