complextorch.nn.masked.linear ============================= .. py:module:: complextorch.nn.masked.linear .. autoapi-nested-parse:: Masked Linear / Bilinear (Complex) ================================== Layers that apply a fixed binary mask to their complex weight at forward time. Used to deploy a learned-sparsity pattern at inference. Classes ------- .. autoapisummary:: complextorch.nn.masked.linear.BilinearMasked complextorch.nn.masked.linear.LinearMasked Module Contents --------------- .. py:class:: BilinearMasked(in1_features: int, in2_features: int, out_features: int, bias: bool = True, conjugate: bool = True, device=None, dtype: torch.dtype = torch.cfloat) Bases: :py:obj:`complextorch.nn.masked.base.MaskedWeightMixin`, :py:obj:`complextorch.nn.masked.base.BaseMasked` Complex bilinear with a fixed binary weight mask. Initialize internal Module state, shared by both nn.Module and ScriptModule. .. py:method:: forward(input1: torch.Tensor, input2: torch.Tensor) -> torch.Tensor .. py:attribute:: conjugate :value: True .. py:attribute:: in1_features .. py:attribute:: in2_features .. py:attribute:: out_features .. py:attribute:: weight .. py:class:: LinearMasked(in_features: int, out_features: int, bias: bool = True, device=None, dtype: torch.dtype = torch.cfloat) Bases: :py:obj:`complextorch.nn.masked.base.MaskedWeightMixin`, :py:obj:`complextorch.nn.masked.base.BaseMasked` Complex linear with a fixed binary weight mask. Initialize internal Module state, shared by both nn.Module and ScriptModule. .. py:method:: forward(input: torch.Tensor) -> torch.Tensor .. py:attribute:: in_features .. py:attribute:: out_features .. py:attribute:: weight