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

sptensor.logical_or has inconsistent output #257

Closed
dmdunla opened this issue Sep 25, 2023 · 0 comments · Fixed by #269
Closed

sptensor.logical_or has inconsistent output #257

dmdunla opened this issue Sep 25, 2023 · 0 comments · Fixed by #269
Assignees
Labels
documentation Improvements or additions to documentation doing Actively being worked on invalid This doesn't seem right
Milestone

Comments

@dmdunla
Copy link
Collaborator

dmdunla commented Sep 25, 2023

As in #256, sptensor.logical_or has inconsistent output when the input is a dense tensor, scalar, and sparse tensor:

>>> import pyttb as ttb
>>> import numpy as np
>>> S = ttb.sptensor()
>>> S[0,0] = 1; S[1,1] = 2
>>> S
sparse tensor of shape (2, 2) with 2 nonzeros
[0, 0] = 1.0
[1, 1] = 2.0

>>> S.logical_or(S)
sparse tensor of shape (2, 2) with 2 nonzeros
[0, 0] = 1.0
[1, 1] = 1.0

>>> T = S.to_tensor()
>>> S.logical_or(T)
tensor of shape (2, 2)
data[:, :] =
[[ True False]
 [False  True]]

>>> S.logical_or(1)
tensor of shape (2, 2)
data[:, :] =
[[ True  True]
 [ True  True]]
@dmdunla dmdunla added documentation Improvements or additions to documentation invalid This doesn't seem right labels Sep 25, 2023
@dmdunla dmdunla added this to the v2.0 milestone Sep 25, 2023
@ntjohnson1 ntjohnson1 self-assigned this Sep 27, 2023
@ntjohnson1 ntjohnson1 added the doing Actively being worked on label Sep 27, 2023
@ntjohnson1 ntjohnson1 linked a pull request Sep 27, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation doing Actively being worked on invalid This doesn't seem right
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants