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

Method save_restore_fn

tensorflow/python/ops/work_queue_test.py:183–196  ·  view source on GitHub ↗
(save_path)

Source from the content-addressed store, hash-verified

181
182 def test_monitored_session_restore(self):
183 def save_restore_fn(save_path):
184 with ops.Graph().as_default():
185 server = server_lib.Server.create_local_server()
186 with ops.device('/cpu:0'):
187 training_util.get_or_create_global_step()
188 work_queue = WorkQueue(
189 [b"fast", b"fox", b"jumps", b"over", b"lazy", b"dog"],
190 num_epochs=3, shuffle=False, name='wq_save_restore')
191 local_queue = work_queue.input_producer()
192 dequeue = local_queue.dequeue()
193 with monitored_session.MonitoredTrainingSession(
194 master=server.target,
195 checkpoint_dir=save_path) as sess:
196 sess.run(dequeue)
197 save_path = self.get_temp_dir()
198 save_proc = Process(target=save_restore_fn, args=(save_path,))
199 save_proc.start()

Callers

nothing calls this directly

Calls 8

input_producerMethod · 0.95
WorkQueueClass · 0.90
create_local_serverMethod · 0.80
as_defaultMethod · 0.45
GraphMethod · 0.45
deviceMethod · 0.45
dequeueMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected