mirror of
https://github.com/wassname/ray.git
synced 2026-07-02 13:40:51 +08:00
Properly mock ray submodules when building documentation. (#337)
This commit is contained in:
committed by
Philipp Moritz
parent
0a233b7144
commit
a7ddac6fb1
@@ -4,7 +4,7 @@ from __future__ import print_function
|
||||
|
||||
import numpy as np
|
||||
|
||||
import ray.numbuf as numbuf
|
||||
import ray.numbuf
|
||||
import ray.pickling as pickling
|
||||
|
||||
def check_serializable(cls):
|
||||
@@ -139,5 +139,11 @@ def deserialize(serialized_obj):
|
||||
obj.__dict__.update(serialized_obj)
|
||||
return obj
|
||||
|
||||
# Register the callbacks with numbuf.
|
||||
numbuf.register_callbacks(serialize, deserialize)
|
||||
def set_callbacks():
|
||||
"""Register the custom callbacks with numbuf.
|
||||
|
||||
The serialize callback is used to serialize objects that numbuf does not know
|
||||
how to serialize (for example custom Python classes). The deserialize callback
|
||||
is used to serialize objects that were serialized by the serialize callback.
|
||||
"""
|
||||
ray.numbuf.register_callbacks(serialize, deserialize)
|
||||
|
||||
Reference in New Issue
Block a user