93d1a4fc4febbe510be10aaf160ad4a5fc083e21,test/test_keras.py,KerasTests,test_load_model_custom_optimizers,#KerasTests#,100

Before Change


            self.assertEqual(type(new_opt).__name__, "TestOptimizer")
            self.assertEqual(K.get_value(opt.lr), K.get_value(new_opt.lr))
            self.assertEqual(len(opt.get_weights()), len(new_opt.get_weights()))
            for weights, new_weights in zip(opt.get_weights(),
                                            new_opt.get_weights()):
                self.assertListEqual(weights.tolist(), new_weights.tolist())

    def test_load_model_custom_objects(self):
        class TestOptimizer(keras.optimizers.RMSprop):
            def __init__(self, **kwargs):
                super(TestOptimizer, self).__init__(**kwargs)

After Change



            self.assertEqual(type(new_opt).__module__, "horovod._keras")
            self.assertEqual(type(new_opt).__name__, "TestOptimizer")
            self._check_optimizer_weights(opt, new_opt)

    def test_load_model_custom_objects(self):
        class TestOptimizer(keras.optimizers.RMSprop):
            def __init__(self, **kwargs):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: horovod/horovod
Commit Name: 93d1a4fc4febbe510be10aaf160ad4a5fc083e21
Time: 2019-09-10
Author: taddair@uber.com
File Name: test/test_keras.py
Class Name: KerasTests
Method Name: test_load_model_custom_optimizers


Project Name: horovod/horovod
Commit Name: 93d1a4fc4febbe510be10aaf160ad4a5fc083e21
Time: 2019-09-10
Author: taddair@uber.com
File Name: test/test_keras.py
Class Name: KerasTests
Method Name: test_load_model


Project Name: horovod/horovod
Commit Name: 93d1a4fc4febbe510be10aaf160ad4a5fc083e21
Time: 2019-09-10
Author: taddair@uber.com
File Name: test/test_keras.py
Class Name: KerasTests
Method Name: test_load_model_custom_objects