Compressed Linear Layer.
| 24 | |
| 25 | |
| 26 | class CLinear(nn.Module): |
| 27 | """Compressed Linear Layer.""" |
| 28 | |
| 29 | def __init__(self, weight=None, bias=None, device=None): |
| 30 | super().__init__() |
| 31 | self.weight = weight |
| 32 | self.bias = bias |
| 33 | |
| 34 | def forward(self, input): |
| 35 | return F.linear(input.to(self.weight.dtype), self.weight, self.bias) |
| 36 | |
| 37 | |
| 38 | def compress_module(module, target_device): |
no outgoing calls
no test coverage detected