Module Wrappers
Generated from Python docstrings by scripts/generate_api_docs.py.
GreyhoundCausalConv1d
Section titled “GreyhoundCausalConv1d”greyhound.nn.causal_conv1d.GreyhoundCausalConv1d
GreyhoundCausalConv1d(channels: int, kernel_size: int, bias: bool = True, activation: str | None = None, device: torch.device | str | None = None, dtype: torch.dtype | None = None)Causal 1D depthwise convolution with optional SiLU activation.
Wraps the fused Greyhound kernel as a drop-in replacement for depthwise
nn.Conv1d with causal (left) padding. The kernel handles boundary
conditions internally via masked loads, avoiding the cost of explicit
F.pad().
Inherits from nn.Conv1d with groups=channels (depthwise),
stride=1, dilation=1, and padding=0 (causal padding is
applied inside the kernel).
Parameters
channels(int): Number of input (and output) channels.kernel_size(int): Width of the convolution kernel (typically 2-4).bias(bool, default:True): IfTrue, adds a learnable bias. Default:True.activation(str | None, default:None): Activation to apply after convolution."silu"for SiLU activation, orNonefor no activation. Default:None.device(torch.device | str | None, default:None): Device for parameter initialization.dtype(torch.dtype | None, default:None): Data type for parameters.
forward
Section titled “forward”forward(input: torch.Tensor) -> torch.TensorApply causal depthwise convolution.
Parameters
input(torch.Tensor): Input tensor of shape[B, D, T].
Returns
torch.Tensor
Output tensor of shape [B, D, T].