Skip to content

Linear

Bases: BaseModule

Fully-connected linear layer with an optional ReLU activation.

Operates in FP32 on 2-D [B, N] tensors.

Parameters:

Name Type Description Default
in_features int

Number of input features.

required
out_features int

Number of output features.

required
bias bool

Whether to include an additive bias term.

required
device str

Torch device for the wrapped linear layer.

'cpu'
act_func str | None

Either "relu" or None.

None