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

Method _cache

tensorflow/python/ops/distributions/bijector_impl.py:1013–1023  ·  view source on GitHub ↗

Helper which stores mapping info in forward/inverse dicts.

(self, mapping)

Source from the content-addressed store, hash-verified

1011 (self.dtype, x.dtype))
1012
1013 def _cache(self, mapping):
1014 """Helper which stores mapping info in forward/inverse dicts."""
1015 # Merging from lookup is an added check that we're not overwriting anything
1016 # which is not None.
1017 mapping = mapping.merge(mapping=self._lookup(
1018 mapping.x, mapping.y, mapping.kwargs))
1019 if mapping.x is None and mapping.y is None:
1020 raise ValueError("Caching expects at least one of (x,y) to be known, "
1021 "i.e., not None.")
1022 self._from_x[mapping.x_key] = mapping
1023 self._from_y[mapping.y_key] = mapping
1024
1025 def _lookup(self, x=None, y=None, kwargs=None):
1026 """Helper which retrieves mapping info from forward/inverse dicts."""

Callers 4

_call_forwardMethod · 0.95
_call_inverseMethod · 0.95

Calls 2

_lookupMethod · 0.95
mergeMethod · 0.45

Tested by

no test coverage detected