(self)
| 2902 | |
| 2903 | @test_util.run_deprecated_v1 |
| 2904 | def testLabelMap(self): |
| 2905 | with self.cached_session() as sess: |
| 2906 | a1 = self._get_test_attrs() |
| 2907 | with sess.graph._attr_scope({ |
| 2908 | "_A": attr_value_pb2.AttrValue(s=compat.as_bytes("foo")) |
| 2909 | }): |
| 2910 | a2 = self._get_test_attrs() |
| 2911 | with sess.graph._attr_scope({ |
| 2912 | "_A": None, |
| 2913 | "_B": attr_value_pb2.AttrValue(s=compat.as_bytes("bar")) |
| 2914 | }): |
| 2915 | a3 = self._get_test_attrs() |
| 2916 | with sess.graph._attr_scope({ |
| 2917 | "_A": attr_value_pb2.AttrValue(s=compat.as_bytes("baz")) |
| 2918 | }): |
| 2919 | a4 = self._get_test_attrs() |
| 2920 | a5 = self._get_test_attrs() |
| 2921 | a6 = self._get_test_attrs() |
| 2922 | a7 = self._get_test_attrs() |
| 2923 | |
| 2924 | self.assertAllEqual((None, None), a1) |
| 2925 | self.assertAllEqual(("foo", None), a2) |
| 2926 | self.assertAllEqual((None, "bar"), a3) |
| 2927 | self.assertAllEqual(("baz", "bar"), a4) |
| 2928 | self.assertAllEqual((None, "bar"), a5) |
| 2929 | self.assertAllEqual(("foo", None), a6) |
| 2930 | self.assertAllEqual((None, None), a7) |
| 2931 | |
| 2932 | |
| 2933 | ops.RegisterShape("KernelLabel")(common_shapes.scalar_shape) |
nothing calls this directly
no test coverage detected