e6ef08f367e0389e811d63eaa5afb16183a19e2b,src/sdk/pynni/nni/compression/tensorflow/compressor.py,PrunerLayerWrapper,call,#PrunerLayerWrapper#,202

Before Change


        for weight in self.layer.weights:
            mask = self.masks.get(weight.name)
            if mask is not None:
                new_weights.append(tf.math.multiply(weight, mask).numpy())
            else:
                new_weights.append(weight.numpy())
        self.layer.set_weights(new_weights)

After Change


                new_weights.append(weight)
        if new_weights and not hasattr(new_weights[0], "numpy"):
            raise RuntimeError("NNI: Compressed model can only run in eager mode")
        self.layer.set_weights([weight.numpy() for weight in new_weights])
        return self.layer(*inputs)

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: microsoft/nni
Commit Name: e6ef08f367e0389e811d63eaa5afb16183a19e2b
Time: 2020-08-24
Author: 40699903+liuzhe-lz@users.noreply.github.com
File Name: src/sdk/pynni/nni/compression/tensorflow/compressor.py
Class Name: PrunerLayerWrapper
Method Name: call


Project Name: AKSHAYUBHAT/DeepVideoAnalytics
Commit Name: 5e82853bb435e7c46e2e3bafa2c1d0a4c40ffb38
Time: 2017-02-03
Author: AKSHAYUBHAT@GMAIL.COM
File Name: dvalib/indexer.py
Class Name: BaseIndexer
Method Name: apply


Project Name: ray-project/ray
Commit Name: d9f1874e3489edc915228dcfdae64d5294034464
Time: 2020-10-27
Author: sven@anyscale.io
File Name: rllib/agents/pg/tests/test_pg.py
Class Name: TestPG
Method Name: test_pg_loss_functions