Commit 2bfb8648 authored by hwangjeff's avatar hwangjeff Committed by Facebook GitHub Bot
Browse files

Add logging to MelSpectrogram and Spectrogram (#2861)

Summary:
Adds API usage logging to MelSpectrogram and Spectrogram.

Pull Request resolved: https://github.com/pytorch/audio/pull/2861

Reviewed By: carolineechen

Differential Revision: D41384080

Pulled By: hwangjeff

fbshipit-source-id: caf4b0fa6e4cc3954384bfdd08a183b90d07d974
parent 793ff00b
......@@ -75,6 +75,7 @@ class Spectrogram(torch.nn.Module):
return_complex: Optional[bool] = None,
) -> None:
super(Spectrogram, self).__init__()
torch._C._log_api_usage_once("torchaudio.transforms.Spectrogram")
self.n_fft = n_fft
# number of FFT bins. the returned STFT result will have n_fft // 2 + 1
# number of frequencies due to onesided=True in torch.stft
......@@ -603,6 +604,7 @@ class MelSpectrogram(torch.nn.Module):
mel_scale: str = "htk",
) -> None:
super(MelSpectrogram, self).__init__()
torch._C._log_api_usage_once("torchaudio.transforms.MelSpectrogram")
if onesided is not None:
warnings.warn(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment