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

Method testRef

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

Source from the content-addressed store, hash-verified

208 self.assertEqual(len(x), 3)
209
210 def testRef(self):
211 x1 = constant_op.constant(3)
212 x2 = x1
213 y = constant_op.constant(3)
214 z = constant_op.constant([6, 10])
215 w = variables.Variable(5)
216
217 self.assertEqual(x1.experimental_ref(), x1.experimental_ref())
218 self.assertEqual(x2.experimental_ref(), x2.experimental_ref())
219 self.assertEqual(x1.experimental_ref(), x2.experimental_ref())
220 self.assertEqual(y.experimental_ref(), y.experimental_ref())
221 self.assertEqual(z.experimental_ref(), z.experimental_ref())
222 self.assertEqual(w.experimental_ref(), w.experimental_ref())
223
224 self.assertNotEqual(x1.experimental_ref(), y.experimental_ref())
225 self.assertNotEqual(x1.experimental_ref(), z.experimental_ref())
226 self.assertNotEqual(x1.experimental_ref(), w.experimental_ref())
227 self.assertNotEqual(y.experimental_ref(), z.experimental_ref())
228 self.assertNotEqual(y.experimental_ref(), w.experimental_ref())
229 self.assertNotEqual(z.experimental_ref(), w.experimental_ref())
230
231 def testRefDeref(self):
232 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