MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _DictFetchMapper

Class _DictFetchMapper

tensorflow/python/client/session.py:401–424  ·  view source on GitHub ↗

Fetch mapper for dicts.

Source from the content-addressed store, hash-verified

399
400
401class _DictFetchMapper(_FetchMapper):
402 """Fetch mapper for dicts."""
403
404 def __init__(self, fetches):
405 """Creates a _DictFetchMapper.
406
407 Args:
408 fetches: Dict of fetches.
409 """
410 self._fetch_type = type(fetches)
411 self._keys = fetches.keys()
412 self._mappers = [
413 _FetchMapper.for_fetch(fetch) for fetch in fetches.values()
414 ]
415 self._unique_fetches, self._value_indices = _uniquify_fetches(self._mappers)
416
417 def unique_fetches(self):
418 return self._unique_fetches
419
420 def build_results(self, values):
421 results = self._fetch_type()
422 for k, m, vi in zip(self._keys, self._mappers, self._value_indices):
423 results[k] = m.build_results([values[j] for j in vi])
424 return results
425
426
427class _AttrsFetchMapper(_FetchMapper):

Callers 1

for_fetchMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected