-
Notifications
You must be signed in to change notification settings - Fork 696
Add simulate_rir_ism method for room impulse response simulation #2880
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
Conversation
@nateanl has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
1 similar comment
@nateanl has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
7b5a3c1
to
15763cc
Compare
@nateanl has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
test/torchaudio_unittest/prototype/functional/functional_test_impl.py
Outdated
Show resolved
Hide resolved
if e_abs.shape[0] > 1: | ||
if center_frequency is None: | ||
center = torch.tensor( | ||
[125.0, 250.0, 500.0, 1000.0, 2000.0, 4000.0, 8000.0], dtype=room.dtype, device=room.device |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where do these values come from? should they be generated programmatically or made customizable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is mentioned in the note of docstring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty good to me. I have left a few comments about docstrings, and also a suggestion to not support 2D rooms.
test/torchaudio_unittest/prototype/functional/functional_test_impl.py
Outdated
Show resolved
Hide resolved
a2e3285
to
b0e2061
Compare
@nateanl has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
torchaudio/_extension/__init__.py
Outdated
_load_lib("libtorchaudio") | ||
|
||
import torchaudio.lib._torchaudio # noqa | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part is now repeated multiple times, which is redundant. Can you merge the initialization logics around extension, kaldi, RIR as follow?
_IS_RIR_AVAILABLE = False
_IS_KALDI_AVAILABLE = False
_IS_TORCHAUDIO_EXT_AVAILABLE = is_module_available("torchaudio.lib._torchaudio")
if _IS_TORCHAUDIO_EXT_AVAILABLE:
_load_lib("libtorchaudio")
import torchaudio.lib._torchaudio # noqa
_check_cuda_version()
_IS_RIR_AVAILABLE = torchaudio.lib._torchaudio.is_rir_available()
_IS_KALDI_AVAILABLE = torchaudio.lib._torchaudio.is_kaldi_available()
|
||
} // Anonymous namespace | ||
|
||
TORCH_LIBRARY_IMPL(torchaudio, CPU, m) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you put TORCH_LIBRARY_IMPL
and TORCH_LIBRARY_FRAGMENT
in anonymous namespace as well?
@nateanl has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@nateanl has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Hey @nateanl. |
replicate of #2644