(self, cycles)
| 113 | self.assertFalse(imported.v2.trainable) |
| 114 | |
| 115 | def test_variables_name(self, cycles): |
| 116 | root = tracking.AutoTrackable() |
| 117 | # Test 2 variables with same name: should work as the checkpoint |
| 118 | # is based on object name and not on variable name. |
| 119 | root.v1 = variables.Variable(1., trainable=True, name="v1") |
| 120 | root.v2 = variables.Variable(2., trainable=False, name="v1") |
| 121 | imported = cycle(root, cycles) |
| 122 | self.assertEqual(imported.v1.numpy(), 1.0) |
| 123 | self.assertEqual(imported.v2.numpy(), 2.0) |
| 124 | self.assertEqual(imported.v1.name, root.v1.name) |
| 125 | self.assertEqual(imported.v2.name, root.v2.name) |
| 126 | with variable_scope.variable_scope("foo"): |
| 127 | imported = cycle(root, cycles) |
| 128 | self.assertTrue(imported.v1.name.startswith("foo/")) |
| 129 | self.assertTrue(imported.v2.name.startswith("foo/")) |
| 130 | |
| 131 | def test_partially_defined_variable_shape(self, cycles): |
| 132 |
nothing calls this directly
no test coverage detected