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

Method testRefDeref

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

Source from the content-addressed store, hash-verified

229 self.assertNotEqual(z.experimental_ref(), w.experimental_ref())
230
231 def testRefDeref(self):
232 x1 = constant_op.constant(3)
233 x2 = x1
234 y = constant_op.constant(3)
235 z = constant_op.constant([6, 10])
236 w = variables.Variable(5)
237
238 self.assertIs(x1, x1.experimental_ref().deref())
239 self.assertIs(x2, x2.experimental_ref().deref())
240 self.assertIs(x1, x2.experimental_ref().deref())
241 self.assertIs(x2, x1.experimental_ref().deref())
242 self.assertIs(y, y.experimental_ref().deref())
243 self.assertIs(z, z.experimental_ref().deref())
244
245 self.assertIsNot(x1, y.experimental_ref().deref())
246 self.assertIsNot(x1, z.experimental_ref().deref())
247 self.assertIsNot(x1, w.experimental_ref().deref())
248 self.assertIsNot(y, z.experimental_ref().deref())
249 self.assertIsNot(y, w.experimental_ref().deref())
250 self.assertIsNot(z, w.experimental_ref().deref())
251
252 def testRefInSet(self):
253 x1 = constant_op.constant(3)

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected