Repository: pytorch
Issue: iSTFT produces RuntimeError with center=False and Blackman/Bartlett/Hann windows
Labels: triaged,module: fft

### 🐛 Describe the bug

When using the `torch.istft` function with the option `center=False` and windows produced by `torch.blackman_window`, `torch.hann_window` or `torch.bartlett_window`, then a `RuntimeError` is produced with message
`window overlap add min: 1`.

The expected behavior is that no error is produced.

```python
import math
import torch


f = 1500.0  # exactly periodic
fs = 48000
nfft = 1024
hop = 256
dtype = torch.float64

original = torch.sin(2 * math.pi * f / fs * torch.arange(2 * fs, dtype=dtype))

# torch
# - use `center=False`
# - zero-pad the front of the signal
windows = {
    "hamming": torch.hamming_window(nfft, dtype=dtype),
    "kaiser": torch.kaiser_window(nfft, dtype=dtype),
    "blackman": torch.blackman_window(nfft, dtype=dtype),
    "bartlett": torch.bartlett_window(nfft, dtype=dtype),
    "hann": torch.hann_window(nfft, dtype=dtype),
}

for center in [True, False]:
    for win_name, win in windows.items():
        # center == True
        try:
            PT = torch.stft(
                original,
                n_fft=nfft,
                hop_length=hop,
                window=win,
                return_complex=True,
                pad_mode="constant",
                center=center,
            )
            recon_pt = torch.istft(
                PT, n_fft=nfft, hop_length=hop, window=win, center=center
            )
            err = float(abs(recon_pt - original[: recon_pt.shape[0]]).max())
            print(
                f"{win_name=:9s} {center=} {err=:.6e}",
            )
        except RuntimeError as e:
            print(
                f"{win_name=:9s} {center=} Exception!!!",
            )
            print(e)
```

Output
```
win_name=hamming   center=True err=7.771561e-16
win_name=kaiser    center=True err=7.771561e-16
win_name=blackman  center=True err=6.661338e-16
win_name=bartlett  center=True err=5.551115e-16
win_name=hann      center=True err=6.661338e-16
win_name=hamming   center=False err=6.217249e-15
win_name=kaiser    center=False err=3.472223e-12
win_name=blackman  center=False Exception!!!
istft(CPUComplexDoubleType[513, 372], n_fft=1024, hop_length=256, win_length=1024, window=torch.DoubleTensor{[1024]}, center=0, normalized=0, onesided=None, length=None, return_complex=0) window overlap add min: 1
[ CPUBoolType{} ]
win_name=bartlett  center=False Exception!!!
istft(CPUComplexDoubleType[513, 372], n_fft=1024, hop_length=256, win_length=1024, window=torch.DoubleTensor{[1024]}, center=0, normalized=0, onesided=None, length=None, return_complex=0) window overlap add min: 1
[ CPUBoolType{} ]
win_name=hann      center=False Exception!!!
istft(CPUComplexDoubleType[513, 372], n_fft=1024, hop_length=256, win_length=1024, window=torch.DoubleTensor{[1024]}, center=0, normalized=0, onesided=None, length=None, return_complex=0) window overlap add min: 1
[ CPUBoolType{} ]
```

### Versions

PyTorch version: 1.13.1
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 12.6.1 (arm64)
GCC version: Could not collect
Clang version: 13.1.6 (clang-1316.0.21.2.5)
CMake version: Could not collect
Libc version: N/A

Python version: 3.10.8 (main, Nov 24 2022, 08:08:27) [Clang 14.0.6 ] (64-bit runtime)
Python platform: macOS-12.6.1-arm64-arm-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.23.4
[pip3] torch==1.13.1
[pip3] torchaudio==0.13.1
[conda] numpy                     1.23.4          py310hb93e574_0
[conda] numpy-base                1.23.4          py310haf87e8b_0
[conda] torch                     1.13.1                   pypi_0    pypi
[conda] torchaudio                0.13.1                   pypi_0    pypi

cc @mruberry @peterbell10