mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 04:07:01 +08:00
Merge pull request #152 from amplab/fixnumpyscalar
Fix serialization of numpy scalars, implement more numpy types, empty arrays
This commit is contained in:
@@ -70,6 +70,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)
|
||||
|
||||
Reference in New Issue
Block a user