TensorNetwork icon indicating copy to clipboard operation
TensorNetwork copied to clipboard

Bug for numpy backend ``sum`` method

Open refraction-ray opened this issue 3 years ago • 3 comments

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)

refraction-ray avatar Nov 05 '21 08:11 refraction-ray