- ray.put(value: Any, *, _owner: Optional[ray.actor.ActorHandle] = None) ray.ObjectRef [source]#
Store an object in the object store.
The object may not be evicted while a reference to the returned ID exists.
Related patterns and anti-patterns:
Anti-pattern: Returning ray.put() ObjectRefs from a task harms performance and fault tolerance
Anti-pattern: Passing the same large argument by value repeatedly harms performance
Anti-pattern: Closure capturing large objects harms performance
value – The Python object to be stored.
[Experimental] (_owner) – The actor that should own this object. This allows creating objects with lifetimes decoupled from that of the creating process. The owner actor must be passed a reference to the object prior to the object creator exiting, otherwise the reference will still be lost. Note that this argument is an experimental API and should be avoided if possible.
The object ref assigned to this value.
PublicAPI: This API is stable across Ray releases.