cbbb77338758d7cb20c5c29982f5aaac130f10d1,tests/application_driver_test.py,ApplicationDriverTest,test_multi_device_gradients,#ApplicationDriverTest#,148
Before Change
def test_multi_device_gradients(self):
test_driver = get_initialised_driver()
test_driver.graph = test_driver.create_graph(test_driver.graph)
test_driver.load_event_handlers(
["niftynet.engine.handler_sampler.SamplerThreading"])
with self.test_session(graph=test_driver.graph) as sess:
sess.run(global_vars_init_or_restore())
SESS_STARTED.send(test_driver.app, iter_msg=None)
for i in range(2):
sess.run(test_driver.app.gradient_op)
g_0, g_1, g_2, g_3, g_ave = sess.run([
test_driver.graph.get_tensor_by_name(
"worker_0/ComputeGradients/gradients/AddN_5:0"),
test_driver.graph.get_tensor_by_name(
"worker_1/ComputeGradients/gradients/AddN_5:0"),
test_driver.graph.get_tensor_by_name(
"worker_2/ComputeGradients/gradients/AddN_5:0"),
test_driver.graph.get_tensor_by_name(
"worker_3/ComputeGradients/gradients/AddN_5:0"),
After Change
test_driver.app.stop()
def test_multi_device_gradients(self):
test_driver = get_initialised_driver()
test_driver.load_event_handlers(
["niftynet.engine.handler_sampler.SamplerThreading"])
with self.test_session(graph=test_driver.create_graph()) as sess:
sess.run(global_vars_init_or_restore())
SESS_STARTED.send(test_driver.app, iter_msg=None)
for i in range(2):
sess.run(test_driver.app.gradient_op)
g_0, g_1, g_2, g_3, g_ave = sess.run([
tf.get_default_graph().get_tensor_by_name(
"worker_0/ComputeGradients/gradients/AddN_5:0"),
tf.get_default_graph().get_tensor_by_name(
"worker_1/ComputeGradients/gradients/AddN_5:0"),
tf.get_default_graph().get_tensor_by_name(
"worker_2/ComputeGradients/gradients/AddN_5:0"),
tf.get_default_graph().get_tensor_by_name(
"worker_3/ComputeGradients/gradients/AddN_5:0"),
tf.get_default_graph().get_tensor_by_name(
"ApplyGradients/Mean:0")
])
msg = "same gradients for different devices"
In pattern: SUPERPATTERN
Frequency: 6
Non-data size: 8
Instances
Project Name: NifTK/NiftyNet
Commit Name: cbbb77338758d7cb20c5c29982f5aaac130f10d1
Time: 2018-04-27
Author: wenqi.li@ucl.ac.uk
File Name: tests/application_driver_test.py
Class Name: ApplicationDriverTest
Method Name: test_multi_device_gradients
Project Name: NifTK/NiftyNet
Commit Name: cbbb77338758d7cb20c5c29982f5aaac130f10d1
Time: 2018-04-27
Author: wenqi.li@ucl.ac.uk
File Name: tests/application_driver_test.py
Class Name: ApplicationDriverTest
Method Name: test_from_file_initialisation
Project Name: NifTK/NiftyNet
Commit Name: cbbb77338758d7cb20c5c29982f5aaac130f10d1
Time: 2018-04-27
Author: wenqi.li@ucl.ac.uk
File Name: tests/application_driver_test.py
Class Name: ApplicationDriverTest
Method Name: test_multi_device_inputs
Project Name: NifTK/NiftyNet
Commit Name: cbbb77338758d7cb20c5c29982f5aaac130f10d1
Time: 2018-04-27
Author: wenqi.li@ucl.ac.uk
File Name: tests/application_driver_test.py
Class Name: ApplicationDriverTest
Method Name: test_multi_device_gradients
Project Name: NifTK/NiftyNet
Commit Name: cbbb77338758d7cb20c5c29982f5aaac130f10d1
Time: 2018-04-27
Author: wenqi.li@ucl.ac.uk
File Name: tests/application_driver_test.py
Class Name: ApplicationDriverTest
Method Name: test_training_update
Project Name: NifTK/NiftyNet
Commit Name: cbbb77338758d7cb20c5c29982f5aaac130f10d1
Time: 2018-04-27
Author: wenqi.li@ucl.ac.uk
File Name: tests/application_driver_test.py
Class Name: ApplicationDriverTest
Method Name: test_rand_initialisation
Project Name: NifTK/NiftyNet
Commit Name: cbbb77338758d7cb20c5c29982f5aaac130f10d1
Time: 2018-04-27
Author: wenqi.li@ucl.ac.uk
File Name: tests/application_driver_test.py
Class Name: ApplicationDriverTest
Method Name: test_from_latest_file_initialisation