espnet2.enh.encoder.abs_encoder.AbsEncoder
espnet2.enh.encoder.abs_encoder.AbsEncoder
class espnet2.enh.encoder.abs_encoder.AbsEncoder(*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: Tensor)
abstract property output_dim : int
streaming_frame(audio: Tensor)
Stream frame.
It splits the continuous audio into frame-level audio chunks in the streaming simulation. It is noted that this function takes the entire long audio as input for a streaming simulation. You may refer to this function to manage your streaming input buffer in a real streaming application.
- Parameters:audio – (B, T)
- Returns: List [(B, frame_size),]
- Return type: chunked