mirror of
https://github.com/wassname/ray.git
synced 2026-07-07 15:44:55 +08:00
[Autoscaler] Proper resource demand plumbing (#10329)
This commit is contained in:
@@ -336,6 +336,25 @@ def dicts_equal(dict1, dict2, abs_tol=1e-4):
|
||||
return True
|
||||
|
||||
|
||||
def same_elements(elems_a, elems_b):
|
||||
"""Checks if two iterables (such as lists) contain the same elements. Elements
|
||||
do not have to be hashable (this allows us to compare sets of dicts for
|
||||
example). This comparison is not necessarily efficient.
|
||||
"""
|
||||
a = list(elems_a)
|
||||
b = list(elems_b)
|
||||
|
||||
for x in a:
|
||||
if x not in b:
|
||||
return False
|
||||
|
||||
for x in b:
|
||||
if x not in a:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
||||
@ray.remote
|
||||
def _put(obj):
|
||||
return obj
|
||||
|
||||
Reference in New Issue
Block a user