f3bc59666e114d46885de0f7309cc2f42eae4b82,tests/models/test_auto_naming.py,Auto_Naming_Test,test_dynamic_model_auto_naming,#Auto_Naming_Test#,76

Before Change



        try:
            model_nested_given_repeat_name = nested_dynamic_model(inner_model_name_2="basic_dynamic_model_1")
            self.fail("Failed to detect nested repeat user given names")
        except Exception as e:
            pass

        try:

After Change



    def test_dynamic_model_auto_naming(self):
        print("-" * 20, "test_dynamic_model_auto_naming", "-" * 20)
        test_flag = True

        model_basic = basic_dynamic_model()
        model_basic_1 = basic_dynamic_model()
        model_basic_2 = basic_dynamic_model("basic_dynamic_model_2")
        model_basic_3 = basic_dynamic_model()
        model_basic_given_name = basic_dynamic_model("a_dynamic_model")

        self.assertEqual(model_basic.name, "basic_dynamic_model")
        self.assertEqual(model_basic.conv1.name, "conv1")
        self.assertEqual(model_basic_1.name, "basic_dynamic_model_1")
        self.assertEqual(model_basic_1.conv1.name, "conv1")
        self.assertEqual(model_basic_2.name, "basic_dynamic_model_2")
        self.assertEqual(model_basic_3.name, "basic_dynamic_model_3")
        self.assertEqual(model_basic_given_name.name, "a_dynamic_model")

        try:
            model_basic_given_repeat_name = basic_dynamic_model("basic_dynamic_model_1")
            test_flag = False
        except Exception as e:
            pass
        if not test_flag:
            self.fail("Failed to detect repeat user given names")

        model_nested = nested_dynamic_model()
        model_nested_1 = nested_dynamic_model(inner_model_name_1="a_inner_dynamic_model")

        self.assertEqual(model_nested.name, "nested_dynamic_model")
        self.assertEqual(model_nested.inner_model_1.name, "basic_dynamic_model_4")
        self.assertEqual(model_nested.inner_model_2.name, "basic_dynamic_model_5")
        self.assertEqual(model_nested_1.name, "nested_dynamic_model_1")
        self.assertEqual(model_nested_1.inner_model_1.name, "a_inner_dynamic_model")
        self.assertEqual(model_nested_1.inner_model_2.name, "basic_dynamic_model_6")

        try:
            model_nested_given_repeat_name = nested_dynamic_model(inner_model_name_2="basic_dynamic_model_1")
            test_flag = False
        except Exception as e:
            pass
        if not test_flag:
            self.fail("Failed to detect nested repeat user given names")

        try:
            model_nested_given_repeat_name_1 = nested_dynamic_model(name="basic_dynamic_model_5")
            test_flag = False
        except Exception as e:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: tensorlayer/tensorlayer
Commit Name: f3bc59666e114d46885de0f7309cc2f42eae4b82
Time: 2019-04-06
Author: ivbensekin@gmail.com
File Name: tests/models/test_auto_naming.py
Class Name: Auto_Naming_Test
Method Name: test_dynamic_model_auto_naming


Project Name: tensorlayer/tensorlayer
Commit Name: f3bc59666e114d46885de0f7309cc2f42eae4b82
Time: 2019-04-06
Author: ivbensekin@gmail.com
File Name: tests/models/test_auto_naming.py
Class Name: Auto_Naming_Test
Method Name: test_vgg_auto_naming


Project Name: tensorlayer/tensorlayer
Commit Name: f3bc59666e114d46885de0f7309cc2f42eae4b82
Time: 2019-04-06
Author: ivbensekin@gmail.com
File Name: tests/models/test_auto_naming.py
Class Name: Auto_Naming_Test
Method Name: test_static_model_auto_naming