8c4ca59b578a5e4bc7ef82c69722247307280160,hls4ml/model/optimizer/passes/qkeras.py,QKerasPO2Quantizer,__call__,#QKerasPO2Quantizer#Any#,15
Before Change
x = tf.convert_to_tensor(data)
y = self.quantizer_fn(x)
sign = np.where(y < 0 , np.zeros_like(y), np.ones_like(y))
y = (tf.math.log(tf.math.abs(y)) / tf.math.log(2 .)).numpy().astype("int" )
return np.stack((sign, y), axis=-1 )
class OutputRoundingSaturationMode (OptimizerPass ):
"""
Set the Rounding and Saturation mode of the output (and accumulator , if applicable )
After Change
x = tf.convert_to_tensor(data)
y = self.quantizer_fn(x)
if hasattr (y, "numpy" ) :
y = y.numpy()
return y
class OutputRoundingSaturationMode (OptimizerPass) :
"""
Set the Rounding and Saturation mode of the output (and accumulator, if applicable)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances Project Name: hls-fpga-machine-learning/hls4ml
Commit Name: 8c4ca59b578a5e4bc7ef82c69722247307280160
Time: 2020-11-18
Author: sioni.summers10@imperial.ac.uk
File Name: hls4ml/model/optimizer/passes/qkeras.py
Class Name: QKerasPO2Quantizer
Method Name: __call__
Project Name: tensorflow/ranking
Commit Name: d3f1a5ad4507e88b016e0a829f4ba142294c16e6
Time: 2019-11-12
Author: xuanhui@google.com
File Name: tensorflow_ranking/python/losses.py
Class Name: _SoftmaxLoss
Method Name: _precompute
Project Name: hls-fpga-machine-learning/hls4ml
Commit Name: 8c4ca59b578a5e4bc7ef82c69722247307280160
Time: 2020-11-18
Author: sioni.summers10@imperial.ac.uk
File Name: hls4ml/converters/keras/qkeras.py
Class Name: QKerasPO2Quantizer
Method Name: __call__