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

Method testAsDefault

tensorflow/python/client/session_test.py:1814–1822  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1812
1813 @test_util.run_v1_only('b/120545219')
1814 def testAsDefault(self):
1815 c = constant_op.constant(37)
1816 sess = session.Session()
1817 with sess.as_default():
1818 self.assertEqual(37, c.eval())
1819
1820 # Ensure that the session remains valid even when it is not captured.
1821 with session.Session().as_default():
1822 self.assertEqual(37, c.eval())
1823
1824 def testReentry(self):
1825 sess = session.Session()

Callers

nothing calls this directly

Calls 4

constantMethod · 0.45
SessionMethod · 0.45
as_defaultMethod · 0.45
evalMethod · 0.45

Tested by

no test coverage detected