ray.experimental.set_target_for_ref#
- ray.experimental.set_target_for_ref(ref: ray._raylet.ObjectRef, target: List[Any])[source]#
Set target buffers for an RDT ObjectRef to fetch tensors into when
ray.getis called.This is only supported by some transports (e.g., NIXL). If the transport does not support this feature, an exception will be raised during ray.get.
Before receiving, Ray validates that the provided target buffers match the metadata of the tensors in the object (e.g., shape, dtype, device). If validation fails, a
ValueErroris raised. We recommend sending over lists of tensors and passing a list of the same length here because the serialization order from the sender-side must match the order of the target tensors here.- Parameters:
ref – The ObjectRef to set the target buffers for. The ref must be for an RDT object.
target – A list of tensors to be used as the target buffers to receive into.
PublicAPI (alpha): This API is in alpha and may change before becoming stable.