diff options
author | Akshay Modi <nareshmodi@google.com> | 2018-02-13 12:10:40 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-02-13 12:14:29 -0800 |
commit | ca07b694fc5307b9eec6e3c449382d823b78a162 (patch) | |
tree | e2bddc896ce8973cad848c46e2b2219d5dc94ac8 /tensorflow/python/framework/test_util.py | |
parent | 142351b998a6471f26b5c9ba74d09b107cd96c68 (diff) |
Add cache for _zeros in backprop
PiperOrigin-RevId: 185567508
Diffstat (limited to 'tensorflow/python/framework/test_util.py')
-rw-r--r-- | tensorflow/python/framework/test_util.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tensorflow/python/framework/test_util.py b/tensorflow/python/framework/test_util.py index bfdd98819e..c09e2d8084 100644 --- a/tensorflow/python/framework/test_util.py +++ b/tensorflow/python/framework/test_util.py @@ -463,8 +463,7 @@ def assert_no_new_tensors(f): f(self, **kwargs) # Make an effort to clear caches, which would otherwise look like leaked # Tensors. - backprop._last_zero = [None] - backprop._shape_dtype = [None, None] + backprop._zeros_cache.flush() context.get_default_context().scalar_cache().clear() gc.collect() tensors_after = [ |