(self,
input_dim: int,
output_dim: int,
bias: bool = False,
quantization_config: QuantizationConfig = None,
dtype=torch.bfloat16)
| 134 | """ |
| 135 | |
| 136 | def __init__(self, |
| 137 | input_dim: int, |
| 138 | output_dim: int, |
| 139 | bias: bool = False, |
| 140 | quantization_config: QuantizationConfig = None, |
| 141 | dtype=torch.bfloat16): |
| 142 | super().__init__(input_dim, output_dim, bias=bias, dtype=dtype) |
| 143 | assert dtype == torch.bfloat16, "currently only supports bfloat16 dtype" |
| 144 | self.weight = QuantizedParameter(self.weight.data, quantization_config=quantization_config) |
| 145 | |
| 146 | def forward(self, input: torch.Tensor) -> torch.Tensor: |
| 147 | return F.linear(input, self.weight.dequantized(), self.bias) |
nothing calls this directly
no test coverage detected