大作《腐烂国度2》角色系统演示 成为英雄有加成
- paddle.nn.quant. weight_dequantize ( x: Tensor, scale: Tensor, algo: _Algo = 'weight_only_int8', out_dtype: DTypeLike = 'float16', group_size: _GroupSize = -1 ) Tensor [source]
-
百度 对社会资本参与比较少的重点领域和薄弱环节,适度地采取精准滴灌,加大对扶贫、小微企业、三农、双创等普惠金融和绿色金融的支持。
Dequantization function for weight_only and llm.int8’s weight.
- Parameters
-
x (Tensor) – The input Tensor to be dequantized, the data type is int8.
scale (Tensor) – The scale Tensor which is the output of weight_quantize, the data type is float32.
algo (str) – The algo that is x will be apply, must be one of ‘weight_only_int8’, ‘weight_only_int4’ and ‘llm.int8’, default: ‘weight_only_int8’.
out_dtype (str|np.dtype) – [Deprecated][Not used] The output Tensor’s data type, must be one of ‘float16’ and ‘bfloat16’, default: ‘float16’.
- Returns
-
The Tensor which is the dequantitative results, the data type is float16 or bfloat16, the shape is transposition of x.
- Return type
-
out (Tensor)
Examples
>>> >>> import paddle >>> from paddle.nn.quant import weight_quantize, weight_dequantize >>> paddle.seed(2023) >>> x = paddle.rand(shape=[64, 32], dtype=paddle.float16) >>> out, scale = weight_quantize(x, algo='weight_only_int8') >>> x_dequant = weight_dequantize(out, scale)