Skip to content

Let load and save rely on *_with_torchcodec #3978

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:

GPU_ARCH_ID=cu126 # This is hard-coded and must be consistent with gpu-arch-version.
PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${CHANNEL}/${GPU_ARCH_ID}"
pip install --progress-bar=off --pre torch --index-url="${PYTORCH_WHEEL_INDEX}"
pip install --progress-bar=off --pre torch torchcodec --index-url="${PYTORCH_WHEEL_INDEX}"

echo "::endgroup::"
echo "::group::Install TorchAudio"
Expand Down
9 changes: 7 additions & 2 deletions src/torchaudio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
get_audio_backend as _get_audio_backend,
info as _info,
list_audio_backends as _list_audio_backends,
load,
save,
set_audio_backend as _set_audio_backend,
)
from ._torchcodec import load_with_torchcodec, save_with_torchcodec
Expand Down Expand Up @@ -41,6 +39,13 @@
pass


def load(*args, **kwargs):
return load_with_torchcodec(*args, **kwargs)

def save(*args, **kwargs):
return save_with_torchcodec(*args, **kwargs)


__all__ = [
"AudioMetaData",
"load",
Expand Down
Loading