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

Unexpected behavior sparse add #367

Open
KukumavMozolo opened this issue Feb 29, 2024 · 1 comment
Open

Unexpected behavior sparse add #367

KukumavMozolo opened this issue Feb 29, 2024 · 1 comment

Comments

@KukumavMozolo
Copy link

KukumavMozolo commented Feb 29, 2024

When executing the following code:

x = torch.zeros((2,4))
y = torch.ones((1,4))
print(x+y)
#---> tensor([[1., 1., 1., 1.],
#        [1., 1., 1., 1.]])
x = SparseTensor.from_dense(x)
y = SparseTensor.from_dense(y)
res = add(x,y)
print(res.to_dense())
#--->tensor([[1., 1., 1., 1.],
#        [0., 0., 0., 0.]])

Is broadcasting not supported?

@rusty1s
Copy link
Owner

rusty1s commented Mar 1, 2024

Broadcasting is indeed not supported. For addition, we currently just assume the output size is max(size_x, size_y).

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

No branches or pull requests

2 participants