TensorNetwork
TensorNetwork copied to clipboard
Bug for numpy backend ``sum`` method
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)
thanks! Could you add a few lines regarding expected behaviour?
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
Hey, I would like to work on this, can you please assign this one to me.