lukeiwanski / tensorflow

OpenCL support for TensorFlow via SYCL
Apache License 2.0
65 stars 14 forks source link

[OpenCL] Uses managed_session in parallel_reader tests #112

Closed jwlawson closed 7 years ago

jwlawson commented 7 years ago

The Session from a tensorflow.python.training.Supervisor should be obtained from managed_session, rather than prepare_or_wait_for_session. The managed session will ensure that the service threads are started when the session is created and that the threads are closed down properly, the session is destroyed and all resources are released.

When the prepare_or_wait_for_session method is used to create a session, the user is responsible for all of this. These tests did not contain any shutdown code previously and so the session was not being destroyed properly.

These tests should not be testing the handling of an incomplete shutdown, if that should be tested then it is probably better to have this in the supervisor_test test cases.