Skip to content

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

Open

Description

@ReyhaneAskari

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]]

Activity

  1. abergeron commented on May 29, 2017

    @abergeron
    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions