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

== and != do not work as expected #443

Open
ReyhaneAskari opened this issue May 29, 2017 · 1 comment
Open

== and != do not work as expected #443

ReyhaneAskari opened this issue May 29, 2017 · 1 comment

Comments

@ReyhaneAskari
Copy link
Member

Here is a MWE that shows the equal method is not defined properly in libgpyarray main class:

import pygpu
ctx = pygpu.init("cuda")
g1 = pygpu.zeros((2, 2), context=ctx)
g2 = pygpu.zeros((2, 2), context=ctx)
print g1 == g2

-> False

if the class is defined as pygpu._array.ndgpuarray, it works as expected:

import pygpu
ctx = pygpu.init("cuda")
g1 = pygpu.zeros((2, 2), context=ctx, cls=pygpu._array.ndgpuarray)
g2 = pygpu.zeros((2, 2), context=ctx, cls=pygpu._array.ndgpuarray)
print g1 == g2

-> [[ True True] [ True True]]

@abergeron
Copy link
Member

To fix this we should port the functionality of ndgpuarray to the base Cython class. This should be doable now that GpuElemewise is available in C.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants