[Autoscaler] Proper resource demand plumbing (#10329)

This commit is contained in:
Alex Wu
2020-08-26 23:36:01 -07:00
committed by GitHub
parent 9056854c06
commit 6d2af33a01
5 changed files with 115 additions and 18 deletions
+19
View File
@@ -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