Skip to content

Add torchaudio.functional.resample API mapping and alignment tests#885

Open
PlumBlossomMaid wants to merge 1 commit into
PaddlePaddle:masterfrom
PlumBlossomMaid:master
Open

Add torchaudio.functional.resample API mapping and alignment tests#885
PlumBlossomMaid wants to merge 1 commit into
PaddlePaddle:masterfrom
PlumBlossomMaid:master

Conversation

@PlumBlossomMaid
Copy link
Copy Markdown

PR Docs

此次变更涉及对应文档说明:
添加 torchaudio.functional.resamplepaddle.audio.functional.resample 的 API 映射规则,并补充对应的测试用例。本次改动基于 PaConvert 转换器框架,使用 ChangeAPIMatcher 完成。

PR APIs

  • 新增 api_mapping.json 映射条目:
  "torchaudio.functional.resample": {
    "Matcher": "ChangeAPIMatcher",
    "paddle_api": "paddle.audio.functional.resample",
    "args_list": [
      "waveform",
      "orig_freq",
      "new_freq",
      "lowpass_filter_width",
      "rolloff",
      "resampling_method",
      "beta"
    ]
  }
  • 新建测试目录:tests/torchaudio_tests/

  • 新增测试文件:tests/torchaudio_tests/test_functional_resample.py

  • 测试覆盖场景(共 6 个 case):

    1. 基本位置参数调用
    2. 全部关键字参数调用
    3. 重排关键字参数顺序调用
    4. 自定义 lowpass_filter_width 和 rolloff
    5. 使用 kaiser 方法并指定 beta 参数
    6. 批量输入(batch input)

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 29, 2026

CLA assistant check
All committers have signed the CLA.

@paddle-bot
Copy link
Copy Markdown

paddle-bot Bot commented May 29, 2026

Thanks for your contribution!

@paddle-bot paddle-bot Bot added the contributor External developers label May 29, 2026
- Add torchaudio.functional.resample -> paddle.audio.functional.resample mapping
  in paconvert/api_mapping.json using ChangeAPIMatcher
- Create tests/torchaudio_tests/ directory for torchaudio API tests
- Add test_functional_resample.py with 6 test cases covering:
  basic positional args, all kwargs, reordered kwargs, custom lowpass/rolloff,
  kaiser method with beta, and batch input
@PlumBlossomMaid
Copy link
Copy Markdown
Author

@luotao1 帮我安排一下review谢谢~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants