Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gpuCI] Auto-merge branch-0.17 to branch-0.18 [skip ci] #460

Merged
merged 1 commit into from
Dec 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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