mlx.core.dequantize#
- mlx.core.dequantize(w: array, /, scales: array, biases: array, group_size: int = 64, bits: int = 4, *, stream: Union[None, Stream, Device] = None) array#
Dequantize the matrix
wusing the providedscalesandbiasesand thegroup_sizeandbitsconfiguration.Formally, given the notation in
quantize(), we compute \(w_i\) from \(\hat{w_i}\) and corresponding \(s\) and \(\beta\) as follows\[w_i = s \hat{w_i} - \beta\]- Parameters:
w (array) – Matrix to be quantized
scales (array) – The scales to use per
group_sizeelements ofwbiases (array) – The biases to use per
group_sizeelements ofwgroup_size (int, optional) – The size of the group in
wthat shares a scale and bias. (default:64)bits (int, optional) – The number of bits occupied by each element in
w. (default:4)
- Returns:
The dequantized version of
w- Return type:
result (array)