Class: TorchAudio::Transforms::MuLawEncoding
- Inherits:
-
Torch::NN::Module
- Object
- Torch::NN::Module
- TorchAudio::Transforms::MuLawEncoding
- Defined in:
- lib/torchaudio/transforms/mu_law_encoding.rb
Instance Method Summary collapse
- #forward(x) ⇒ Object
-
#initialize(quantization_channels: 256) ⇒ MuLawEncoding
constructor
A new instance of MuLawEncoding.
Constructor Details
#initialize(quantization_channels: 256) ⇒ MuLawEncoding
Returns a new instance of MuLawEncoding.
4 5 6 7 |
# File 'lib/torchaudio/transforms/mu_law_encoding.rb', line 4 def initialize(quantization_channels: 256) super() @quantization_channels = quantization_channels end |
Instance Method Details
#forward(x) ⇒ Object
9 10 11 |
# File 'lib/torchaudio/transforms/mu_law_encoding.rb', line 9 def forward(x) F.mu_law_encoding(x, @quantization_channels) end |