ray.runtime_context.RuntimeContext.get_assigned_resources#

RuntimeContext.get_assigned_resources()[source]#

Get the assigned resources to this worker.

By default for tasks, this will return {“CPU”: 1}. By default for actors, this will return {}. This is because actors do not have CPUs assigned to them by default.

Returns:

A dictionary mapping the name of a resource to a float, where the float represents the amount of that resource reserved for this worker.