MCPcopy
hub / github.com/ray-project/ray / dumps

Function dumps

python/ray/cloudpickle/cloudpickle.py:1529–1545  ·  view source on GitHub ↗

Serialize obj as a string of bytes allocated in memory protocol defaults to cloudpickle.DEFAULT_PROTOCOL which is an alias to pickle.HIGHEST_PROTOCOL. This setting favors maximum communication speed between processes running the same Python version. Set protocol=pickle.DEFAULT_PROT

(obj, protocol=None, buffer_callback=None)

Source from the content-addressed store, hash-verified

1527
1528
1529def dumps(obj, protocol=None, buffer_callback=None):
1530 """Serialize obj as a string of bytes allocated in memory
1531
1532 protocol defaults to cloudpickle.DEFAULT_PROTOCOL which is an alias to
1533 pickle.HIGHEST_PROTOCOL. This setting favors maximum communication
1534 speed between processes running the same Python version.
1535
1536 Set protocol=pickle.DEFAULT_PROTOCOL instead if you need to ensure
1537 compatibility with older versions of Python (although this is not always
1538 guaranteed to work because cloudpickle relies on some internal
1539 implementation details that can change from one Python version to the
1540 next).
1541 """
1542 with io.BytesIO() as file:
1543 cp = Pickler(file, protocol=protocol, buffer_callback=buffer_callback)
1544 cp.dump(obj)
1545 return file.getvalue()
1546
1547
1548# Include pickles unloading functions in this namespace for convenience.

Callers 8

test_numpy_serializationFunction · 0.90
dumps_debugFunction · 0.85
_rayify_task_wrapperFunction · 0.85
execute_taskFunction · 0.85
fire_taskFunction · 0.85

Calls 2

dumpMethod · 0.95
PicklerClass · 0.70

Used in the wild real call sites across dependent graphs

searching dependent graphs…