6d27701311a5d0f013cf608dc5947e2fd0813882,hls4ml/model/hls_model.py,WeightVariable,update_precision,#WeightVariable#Any#,428

Before Change


            if match is not None:
                precision_bits = match.group(1).split(",")
                decimal_bits = int(precision_bits[0]) - int(precision_bits[1])
                decimal_spaces = int(np.floor(np.log10(2 ** decimal_bits - 1))) + 1
                self.precision_fmt = "%.{}f".format(decimal_spaces)
            else:
                self.precision_fmt = "%f"

After Change


                if lsb < 1:
                    // Use str to represent the float with digits, get the length
                    // to right of decimal point
                    decimal_spaces = len(str(lsb).split(".")[1])
                else:
                    decimal_spaces = len(str(2**integer_bits)) 
                self.precision_fmt = "%.{}f".format(decimal_spaces)
            else:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: hls-fpga-machine-learning/hls4ml
Commit Name: 6d27701311a5d0f013cf608dc5947e2fd0813882
Time: 2020-05-04
Author: sioni.summers10@imperial.ac.uk
File Name: hls4ml/model/hls_model.py
Class Name: WeightVariable
Method Name: update_precision


Project Name: tiberiu44/TTS-Cube
Commit Name: 9cf2bcdb24f23a17ec11e69b8885851771dfd3d8
Time: 2018-10-25
Author: boros@adobe.com
File Name: cube/models/vocoder.py
Class Name: BeeCoder
Method Name: learn


Project Name: pfnet/optuna
Commit Name: 1b2c694c91a2061d53b21c51ab92c44043ac7749
Time: 2021-02-15
Author: k_nzw@klis.tsukuba.ac.jp
File Name: optuna/visualization/matplotlib/_parallel_coordinate.py
Class Name:
Method Name: _get_parallel_coordinate_plot