(self)
| 250 | self.assertIsNot(z, w.experimental_ref().deref()) |
| 251 | |
| 252 | def testRefInSet(self): |
| 253 | x1 = constant_op.constant(3) |
| 254 | x2 = x1 |
| 255 | y = constant_op.constant(3) |
| 256 | z = constant_op.constant([6, 10]) |
| 257 | w = variables.Variable(5) |
| 258 | |
| 259 | self.assertEqual(x1.experimental_ref(), x2.experimental_ref()) |
| 260 | |
| 261 | tensor_set = { |
| 262 | x1.experimental_ref(), |
| 263 | x2.experimental_ref(), |
| 264 | y.experimental_ref(), |
| 265 | z.experimental_ref(), |
| 266 | w.experimental_ref(), |
| 267 | } |
| 268 | |
| 269 | self.assertEqual(len(tensor_set), 4) |
| 270 | self.assertIn(x1.experimental_ref(), tensor_set) |
| 271 | self.assertIn(x2.experimental_ref(), tensor_set) |
| 272 | self.assertIn(y.experimental_ref(), tensor_set) |
| 273 | self.assertIn(z.experimental_ref(), tensor_set) |
| 274 | self.assertIn(w.experimental_ref(), tensor_set) |
| 275 | |
| 276 | def testRefInDict(self): |
| 277 | x1 = constant_op.constant(3) |
nothing calls this directly
no test coverage detected