Skip to content

Commit 40243c0

Browse files
samanklesariapearu
authored andcommitted
Remove generic lfilter loop
1 parent f0a4999 commit 40243c0

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

src/libtorchaudio/lfilter.cpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -73,27 +73,6 @@ void cpu_lfilter_core_loop(
7373
});
7474
}
7575

76-
void lfilter_core_generic_loop(
77-
const torch::Tensor& input_signal_windows,
78-
const torch::Tensor& a_coeff_flipped,
79-
torch::Tensor& padded_output_waveform) {
80-
int64_t n_samples_input = input_signal_windows.size(2);
81-
int64_t n_order = a_coeff_flipped.size(1);
82-
auto coeff = a_coeff_flipped.unsqueeze(2);
83-
for (int64_t i_sample = 0; i_sample < n_samples_input; i_sample++) {
84-
auto windowed_output_signal =
85-
torch::narrow(padded_output_waveform, 2, i_sample, i_sample + n_order)
86-
.transpose(0, 1);
87-
auto o0 = torch::select(input_signal_windows, 2, i_sample) -
88-
at::matmul(windowed_output_signal, coeff).squeeze(2).transpose(0, 1);
89-
padded_output_waveform.index_put_(
90-
{torch::indexing::Slice(),
91-
torch::indexing::Slice(),
92-
i_sample + n_order - 1},
93-
o0);
94-
}
95-
}
96-
9776
} // namespace
9877

9978
TORCH_LIBRARY(torchaudio, m) {
@@ -110,7 +89,3 @@ TORCH_LIBRARY_IMPL(torchaudio, CUDA, m) {
11089
m.impl("torchaudio::_lfilter_core_loop", &cuda_lfilter_core_loop);
11190
}
11291
#endif
113-
114-
TORCH_LIBRARY_IMPL(torchaudio, CompositeExplicitAutograd, m) {
115-
m.impl("torchaudio::_lfilter_core_loop", &lfilter_core_generic_loop);
116-
}

0 commit comments

Comments
 (0)