Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update framework.py #27849

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 15 additions & 1 deletion tensorflow/python/debug/wrappers/framework.py
Expand Up @@ -111,6 +111,8 @@
from __future__ import division
from __future__ import print_function

import collections

import abc
import re
import threading
Expand Down Expand Up @@ -460,7 +462,19 @@ def run(self,
"but are used simultaneously.")

self.increment_run_call_count()
empty_fetches = not nest.flatten(fetches)

def is_empty(x):
"""Check whether a possibly nested structure is empty."""
if not nest.is_nested(x):
return False
if isinstance(x, collections.Mapping):
return is_empty(list(x.values()))
for item in x:
if not is_empty(item):
return False
return True

empty_fetches = is_empty(fetches)
if empty_fetches:
tf_logging.info(
"Due to empty fetches, tfdbg Session wrapper is letting a "
Expand Down