pub fn pickle(
py: Python<'_>,
obj: Py<PyAny>,
allow_pending_pickles: bool,
allow_tensor_engine_references: bool,
) -> PyResult<PicklingState>Expand description
Pickle an object with support for pending pickles and tensor engine references.
This function creates a PicklingState and calls cloudpickle.dumps with an active thread-local PicklingState, allowing reduce implementations to push tensor engine references and pending pickles.
§Arguments
obj- The Python object to pickleallow_pending_pickles- If true, allow PyShared values to be registered as pendingallow_tensor_engine_references- If true, allow tensor engine references to be registered
§Returns
A PicklingState containing the pickled buffer and any registered references/pending pickles