espnet2.asr_transducer.encoder.modules.convolution.DepthwiseConvolution
Less than 1 minute
espnet2.asr_transducer.encoder.modules.convolution.DepthwiseConvolution
class espnet2.asr_transducer.encoder.modules.convolution.DepthwiseConvolution(size: int, kernel_size: int, causal: bool = False)
Bases: Module
Depth-wise Convolution module definition.
- Parameters:
- size β Initial size to determine the number of channels.
- kernel_size β Size of the convolving kernel.
- causal β Whether to use causal convolution (set to True if streaming).
Construct a DepthwiseConvolution object.
forward(x: Tensor, mask: Tensor | None = None, cache: Tensor | None = None) β Tuple[Tensor, Tensor]
Compute convolution module.
- Parameters:
- x β DepthwiseConvolution input sequences. (B, T, D_hidden)
- mask β Source mask. (B, T_2)
- cache β DepthwiseConvolution input cache. (1, conv_kernel, D_hidden)
- Returns: DepthwiseConvolution output sequences. (B, ?, D_hidden)
- Return type: x
