Always run iterator deleter in eager mode for safety.

PiperOrigin-RevId: 173947019
This commit is contained in:
Alexandre Passos 2017-10-30 14:10:55 -07:00 committed by TensorFlower Gardener
parent efcbf6e34e
commit 3639aa7ff1

View File

@ -84,7 +84,7 @@ class Iterator(object):
def __del__(self):
if self._resource is not None:
with ops.device("/device:CPU:0"):
with ops.device("/device:CPU:0"), context.eager_mode():
resource_variable_ops.destroy_resource_op(self._resource)
self._resource = None