MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / testRefInSet

Method testRefInSet

tensorflow/python/framework/ops_test.py:252–274  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 4

experimental_refMethod · 0.95
VariableMethod · 0.80
constantMethod · 0.45
experimental_refMethod · 0.45

Tested by

no test coverage detected