espnet2.enh.decoder.abs_decoder.AbsDecoder
espnet2.enh.decoder.abs_decoder.AbsDecoder
class espnet2.enh.decoder.abs_decoder.AbsDecoder(*args, **kwargs)
Bases: Module
, ABC
Initializes internal Module state, shared by both nn.Module and ScriptModule.
abstract forward(input: Tensor, ilens: Tensor, fs: int | None = None) → Tuple[Tensor, Tensor]
Defines the computation performed at every call.
Should be overridden by all subclasses.
NOTE
Although the recipe for forward pass needs to be defined within this function, one should call the Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
forward_streaming(input_frame: Tensor)
streaming_merge(chunks: Tensor, ilens: tensor | None = None)
Stream merge.
It merges the frame-level processed audio chunks in the streaming simulation. It is noted that, in real applications, the processed audio should be sent to the output channel frame by frame. You may refer to this function to manage your streaming output buffer.
- Parameters:
- chunks – List [(B, frame_size),]
- ilens – [B]
- Returns: [B, T]
- Return type: merge_audio