mirror of
https://github.com/zebrajr/tensorflow.git
synced 2025-12-07 12:20:24 +01:00
Always run iterator deleter in eager mode for safety.
PiperOrigin-RevId: 173947019
This commit is contained in:
parent
efcbf6e34e
commit
3639aa7ff1
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user