diff options
author | Allen Lavoie <allenl@google.com> | 2018-07-24 15:03:46 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-07-24 15:11:40 -0700 |
commit | eabda97225faf53ec528621299f5b6c57a7847b0 (patch) | |
tree | a831a1f5170a389d09eb956133622931e677d266 /tensorflow/python/client | |
parent | d09afb711610b88f394d318622e862fcd327f440 (diff) |
Dictionary tracking for tf.keras.Model attribute assignment
Does not inherit from dict (and so won't pass isinstance checks). I've written a small tome about why in a comment on the class definition. This seems not to break anyone, but if it does we can add Mapping to the problematic isinstance checks (as I've done for TF's nest util and Session fetching); ideally custom mappings would be supported everywhere dicts are anyway.
PiperOrigin-RevId: 205898305
Diffstat (limited to 'tensorflow/python/client')
-rw-r--r-- | tensorflow/python/client/session.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tensorflow/python/client/session.py b/tensorflow/python/client/session.py index 8ede6ab54c..180bb74d00 100644 --- a/tensorflow/python/client/session.py +++ b/tensorflow/python/client/session.py @@ -18,6 +18,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function +import collections import functools import re import threading @@ -243,7 +244,7 @@ class _FetchMapper(object): elif isinstance(fetch, (list, tuple)): # NOTE(touts): This is also the code path for namedtuples. return _ListFetchMapper(fetch) - elif isinstance(fetch, dict): + elif isinstance(fetch, collections.Mapping): return _DictFetchMapper(fetch) else: # Look for a handler in the registered expansions. |