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

Bug for numpy backend sum method #952

Open
refraction-ray opened this issue Nov 5, 2021 · 3 comments
Open

Bug for numpy backend sum method #952

refraction-ray opened this issue Nov 5, 2021 · 3 comments

Comments

@refraction-ray
Copy link
Contributor

See source in https://github.com/google/TensorNetwork/blob/master/tensornetwork/backends/numpy/numpy_backend.py#L607.

  def sum(self,
          tensor: Tensor,
          axis: Optional[Sequence[int]] = None,
          keepdims: bool = False) -> Tensor:
    return np.sum(tensor, axis=tuple(axis), keepdims=keepdims)

Therefore, sum(tensor) raises error for tuple(None)

@mganahl
Copy link
Collaborator

mganahl commented Nov 5, 2021

thanks! Could you add a few lines regarding expected behaviour?

@refraction-ray
Copy link
Contributor Author

thanks! Could you add a few lines regarding expected behaviour?

I guess return np.sum(tensor, axis=axis, keepdims=keepdims) is enough? Actually no idea why there is a tuple

@breakTheLimitsKP
Copy link

Hey, I would like to work on this, can you please assign this one to me.

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

3 participants