d1e6e624ef891543c5bba32bb0a696d350714693,coremltools/models/utils.py,,_convert_nn_spec_to_half_precision,#Any#,172

Before Change


            continue

        elif layer_type in quantized_layers:
            raise Exception("Half precision for " + layer_type +
                            " not yet implemented\n")
        else:
            raise Exception("Unknown layer " + layer_type)

    return spec

After Change


        if layer_type not in quantized_layers:
            params = getattr(layer, layer_type, None)
            params = params.ListFields() if params else []
            param_types = [p[0].message_type.name if p[0].message_type else None for p in params]

            if "WeightParams" in param_types:
                raise NotImplementedError("Quantization for layer "" + layer_type + "" not implemented.")
            continue  // print("Skipping layer {}. No need to quantize.".format(layer.name))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: apple/coremltools
Commit Name: d1e6e624ef891543c5bba32bb0a696d350714693
Time: 2019-08-20
Author: smq@apple.com
File Name: coremltools/models/utils.py
Class Name:
Method Name: _convert_nn_spec_to_half_precision


Project Name: lingpy/lingpy
Commit Name: 2af05895503496529a3b567aa6c58cd0ff33d607
Time: 2013-11-20
Author: mattis.list@posteo.de
File Name: lingpy/read/qlc.py
Class Name:
Method Name: read_qlc


Project Name: rwth-i6/returnn
Commit Name: 46a2eba54edfedac80dae8e20625e0ac257aa5b2
Time: 2021-02-18
Author: pwilken@apptek.com
File Name: returnn/datasets/hdf.py
Class Name: HDFDatasetWriter
Method Name: dump_from_dataset