complextorch.nn.gauss.linear#
Classes#
Gauss-trick Complex-Valued Linear Layer |
Module Contents#
- class complextorch.nn.gauss.linear.Linear(in_features: int, out_features: int, bias: bool = True, device=None, dtype=None)[source]#
Bases:
torch.nn.ModuleGauss-trick Complex-Valued Linear Layer#
Real/imag-split implementation of complex linear multiplication using Gauss’ multiplication trick (3 real matmuls instead of the naive 4). Mirrors
torch.nn.Linear, analogous to the Gauss-trick convolutionscomplextorch.nn.gauss.Conv1dand siblings.For ordinary use prefer
complextorch.nn.Linear, which wrapstorch.nn.Linearwithdtype=torch.cfloatand is faster on modern PyTorch.Initialize internal Module state, shared by both nn.Module and ScriptModule.
- forward(input: torch.Tensor) torch.Tensor[source]#
Computes multiplication 25% faster than naive method by using Gauss’ multiplication trick
- property bias: torch.Tensor#
- linear_i#
- linear_r#
- property weight: torch.Tensor#