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

Method testWeakrefEagerTensor

tensorflow/python/eager/ops_test.py:406–414  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

404 t1.join()
405
406 def testWeakrefEagerTensor(self):
407 x = constant_op.constant([[1.]])
408 x.at1 = constant_op.constant([[2.]])
409 x.at2 = 3.
410 weak_x = weakref.ref(x)
411 weak_xat1 = weakref.ref(x.at1)
412 del x
413 self.assertIs(weak_x(), None)
414 self.assertIs(weak_xat1(), None)
415
416 def testWeakKeyDictionaryTensor(self):
417 weak_key_dict = weakref.WeakKeyDictionary()

Callers

nothing calls this directly

Calls 2

refMethod · 0.80
constantMethod · 0.45

Tested by

no test coverage detected