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

Change space_elem == other behavior? #1249

Open
kohr-h opened this issue Nov 25, 2017 · 1 comment · May be fixed by #1475
Open

Change space_elem == other behavior? #1249

kohr-h opened this issue Nov 25, 2017 · 1 comment · May be fixed by #1475

Comments

@kohr-h
Copy link
Member

kohr-h commented Nov 25, 2017

We differ from Numpy in the way we interpret ==. Our use case has quite limited usability, and Numpy users will be surprised by the interpretation.
Another issue that comes with this difference is our current inability to do things like x[x > 0] = 1 or so, which would be nice to have. Then, of course, == cannot be an exception.

Question: How about we change our tensors to behave like Numpy arrays in that respect?

@adler-j
Copy link
Member

adler-j commented Nov 25, 2017

I frankly vote yes for this. My suggestion is as follows: simply bypass of of these by making

def __eq__(self, other):
    return np.equal(self, other)

and equivalently for the others.

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

Successfully merging a pull request may close this issue.

2 participants