Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

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
Contributor

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants