Return a window function. Args: win_type (str): Window type. Can either be one of the window function provided in PyTorch ['hann_window', 'bartlett_window', 'blackman_window', 'hamming_window', 'kaiser_window'] or any of the windows provided by [SciPy](https://do
(win_type: str, win_length: int)
| 269 | return count |
| 270 | |
| 271 | def get_window(win_type: str, win_length: int): |
| 272 | """Return a window function. |
| 273 | |
| 274 | Args: |
| 275 | win_type (str): Window type. Can either be one of the window function provided in PyTorch |
| 276 | ['hann_window', 'bartlett_window', 'blackman_window', 'hamming_window', 'kaiser_window'] |
| 277 | or any of the windows provided by [SciPy](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.windows.get_window.html). |
| 278 | win_length (int): Window length |
| 279 | |
| 280 | Returns: |
| 281 | win: The window as a 1D torch tensor |
| 282 | """ |
| 283 | |
| 284 | try: |
| 285 | win = getattr(torch, win_type)(win_length) |
| 286 | except: |
| 287 | win = torch.from_numpy(scipy.signal.windows.get_window(win_type, win_length)) |
| 288 | |
| 289 | return win |
| 290 | |
| 291 | |
| 292 | # https://github.com/facebookresearch/pytorch3d/blob/main/pytorch3d/transforms/rotation_conversions.py |
no outgoing calls
no test coverage detected