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

Method testInitFn

tensorflow/python/training/supervisor_test.py:521–532  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

519
520 @test_util.run_v1_only("b/120545219")
521 def testInitFn(self):
522 logdir = self._test_dir("default_init_op")
523 with ops.Graph().as_default():
524 v = variables.VariableV1([1.0, 2.0, 3.0])
525
526 def _init_fn(sess):
527 sess.run(v.initializer)
528
529 sv = supervisor.Supervisor(logdir=logdir, init_op=None, init_fn=_init_fn)
530 sess = sv.prepare_or_wait_for_session("")
531 self.assertAllClose([1.0, 2.0, 3.0], sess.run(v))
532 sv.stop()
533
534 @test_util.run_v1_only("b/120545219")
535 def testInitOpWithFeedDict(self):

Callers

nothing calls this directly

Calls 7

_test_dirMethod · 0.95
stopMethod · 0.95
as_defaultMethod · 0.45
GraphMethod · 0.45
assertAllCloseMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected