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

This commit is contained in:
Philipp Moritz committed 2016-06-23 18:39:02 -07:00
1 parent 1951252689
commit 5ecc2ab67d
4 files changed
+88 -111

No files matched your search

+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)