Class: TorchAudio::Transforms::MuLawEncoding

Inherits:
Torch::NN::Module
  • Object
show all
Defined in:
lib/torchaudio/transforms/mu_law_encoding.rb

Instance Method Summary collapse

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