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

Class _TensorCaches

tensorflow/python/eager/context.py:153–171  ·  view source on GitHub ↗

Thread local tensor caches.

Source from the content-addressed store, hash-verified

151
152
153class _TensorCaches(threading.local):
154 """Thread local tensor caches."""
155
156 def __init__(self):
157 super(_TensorCaches, self).__init__()
158 self._ones_rank_cache = None
159 self._zeros_cache = None
160
161 @property
162 def ones_rank_cache(self):
163 if not self._ones_rank_cache:
164 self._ones_rank_cache = _EagerTensorCache()
165 return self._ones_rank_cache
166
167 @property
168 def zeros_cache(self):
169 if not self._zeros_cache:
170 self._zeros_cache = _EagerTensorCache()
171 return self._zeros_cache
172
173
174class _ThreadLocalData(threading.local):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected