(self, weight=None, bias=None, device=None)
| 33 | """Compressed Linear Layer.""" |
| 34 | |
| 35 | def __init__(self, weight=None, bias=None, device=None): |
| 36 | super().__init__() |
| 37 | if weight is None: |
| 38 | self.weight = None |
| 39 | elif isinstance(weight, Tensor): |
| 40 | self.weight = compress(weight.data.to(device), default_compression_config) |
| 41 | else: |
| 42 | self.weight = weight |
| 43 | self.bias = bias |
| 44 | |
| 45 | def forward(self, input: Tensor) -> Tensor: |
| 46 | weight = decompress(self.weight, default_compression_config) |
nothing calls this directly
no test coverage detected