Skip to content

Commit

Permalink
Merge pull request #460 from rapidsai/branch-0.17
Browse files Browse the repository at this point in the history
[gpuCI] Auto-merge branch-0.17 to branch-0.18 [skip ci]
  • Loading branch information
GPUtester authored Dec 2, 2020
2 parents 77ade0b + fb6c892 commit a8c6fc0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
18 changes: 18 additions & 0 deletions dask_cuda/proxy_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,24 @@ def __iter__(self):
def __array__(self):
return getattr(self._obj_pxy_deserialize(), "__array__")()

def __lt__(self, other):
return self._obj_pxy_deserialize() < other

def __le__(self, other):
return self._obj_pxy_deserialize() <= other

def __eq__(self, other):
return self._obj_pxy_deserialize() == other

def __ne__(self, other):
return self._obj_pxy_deserialize() != other

def __gt__(self, other):
return self._obj_pxy_deserialize() > other

def __ge__(self, other):
return self._obj_pxy_deserialize() >= other

def __add__(self, other):
return self._obj_pxy_deserialize() + other

Expand Down
6 changes: 6 additions & 0 deletions dask_cuda/tests/test_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ def test_proxy_object_of_numpy(serializers):
assert isinstance(got, type(expect))
assert all(expect == got)

# Check proxy-proxy operations
if "i" != op_str[0]: # Skip in-place operators
expect = op(org.copy(), org)
got = op(pxy, proxy_object.asproxy(org.copy()))
assert all(expect == got)

# Check unary truth operators
for op_str in ["not_", "truth"]:
op = getattr(operator, op_str)
Expand Down

0 comments on commit a8c6fc0

Please sign in to comment.