執行 a 與矩陣 b 的量化矩陣乘法,並帶有偏差
用法
tf.raw_ops.QuantizedMatMulWithBiasAndRelu(
a, b, bias, min_a, max_a, min_b, max_b, Toutput=tf.dtypes.qint32,
transpose_a=False, transpose_b=False, input_quant_mode='MIN_FIRST',
name=None
)添加和重新融合。
輸入必須是二維矩陣和一維偏置向量。並且a的內部維度(如果transpose_a非零則轉置後)必須匹配b的外部維度(如果transposed_b非零則轉置後)。然後對矩陣乘法結果使用偏差值進行廣播加法運算。偏差大小必須與 b 的內部尺寸相匹配。然後進行 relu 激活以獲得非負結果。
參數:a:ATensor.必須是以下類型之一:qint8,quint8,qint32,qint16,quint16.要相乘的矩陣。必須是類型的二維張量quint8. b:ATensor.必須是以下類型之一:qint8,quint8,qint32,qint16,quint16.要相乘的矩陣,必須是類型的二維張量qint8.偏差:ATensor類型float32.尺寸與內部尺寸匹配的一維偏置張量b(轉置後如果transposed_b是非零)。 min_a:ATensor類型float32.最低量化的浮點值a值代表。 max_a:ATensor類型float32.最高量化的浮點值a值代表。 min_b:ATensor類型float32.最低量化的浮點值b值代表。 max_b:ATensor類型float32.最高量化的浮點值b值代表。 T輸出:可選tf.dtypes.DType從:tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16.默認為tf.qint32. transpose_a:可選bool.默認為False.如果是真的,a在乘法之前轉置。 transpose_b:可選bool.默認為False.如果是真的,b在乘法之前轉置。 input_quant_mode:可選string從:"MIN_FIRST", "SCALED".默認為"MIN_FIRST".輸入數據量化模式。 MIN_FIRST(默認)或 SCALED。 name:操作的名稱(可選)。
返回:Tensor 對象的元組(輸出,min_out,max_out)。
out:A `Tensor` of type `Toutput`.
min_out:A `Tensor` of type `float32`.
max_out:A `Tensor` of type `float32`.
相關用法
- Python tf.raw_ops.QuantizedMatMulWithBiasAndReluAndRequantize用法及代碼示例
- Python tf.raw_ops.QuantizedMatMulWithBias用法及代碼示例
- Python tf.raw_ops.QuantizedReshape用法及代碼示例
- Python tf.raw_ops.QuantizeV2用法及代碼示例
- Python tf.raw_ops.Qr用法及代碼示例
- Python tf.raw_ops.TPUReplicatedInput用法及代碼示例
- Python tf.raw_ops.Bitcast用法及代碼示例
- Python tf.raw_ops.SelfAdjointEigV2用法及代碼示例
- Python tf.raw_ops.BatchMatMul用法及代碼示例
- Python tf.raw_ops.OneHot用法及代碼示例
- Python tf.raw_ops.ResourceScatterNdSub用法及代碼示例
- Python tf.raw_ops.ReadVariableXlaSplitND用法及代碼示例
- Python tf.raw_ops.GatherV2用法及代碼示例
- Python tf.raw_ops.Expm1用法及代碼示例
- Python tf.raw_ops.BitwiseAnd用法及代碼示例
- Python tf.raw_ops.UniqueWithCounts用法及代碼示例
- Python tf.raw_ops.DecodeGif用法及代碼示例
- Python tf.raw_ops.Size用法及代碼示例
- Python tf.raw_ops.ScatterUpdate用法及代碼示例
- Python tf.raw_ops.ParallelConcat用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.raw_ops.QuantizedMatMulWithBiasAndRelu。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
