pytorch / pytorch/audio

torchaudio.functional.resample() doesn't work with complex types

Open
#3,276 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

triaged
Dominant language
Python
Stars
2.9k
Forks
799
Avg merge
58m
Merged PRs (30d)
3

Description

🐛 Describe the bug

torchaudio.functional.resample() doesn't work with complex types.

Example:

x = torch.randn(1024, 2)
x = torch.view_as_complex(x)
y = torchaudio.functional.resample(x, 1.0, 2.0)

Gives error:

RuntimeError: "arange_cpu" not implemented for 'ComplexFloat'
Versions
>>> import torch
>>> import torchaudio
>>> torch.__version__
'2.0.0+cu117'
>>> torchaudio.__version__
'2.0.1+cu117'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided complex-tensor example through torchaudio.functional.resample() and trace the resampling path that reaches the arange_cpu error. Check existing resampling tests and add coverage for complex input; done means the example completes successfully without the complex-type error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
audio-video-rtc
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.