class_docstr: A container for all capture usages within FuncGraph.
docstr: Get a snapshot of current values of by-ref captures.
code: def get_by_ref_snapshot(self) -> Mapping[Hashable, Any]:
      """Get a snapshot of current values of by-ref captures."""
      snapshot = {}
      for key in self._by_ref_external:
          func = self._by_ref_external[key]
          try:
              value = func()
          except (AttributeError, RuntimeError):
              # b/269680071 In case of by-ref captures are unavailable at dispatch
              # time, use the predefined trace_type instead.
              value = self._by_ref_tracetype[key]
          snapshot[key] = value
      return snapshot
  
imports: import collections
  import functools
  from typing import Any, Callable, Hashable, Mapping, Optional
  from tensorflow.core.function import trace_type
  from tensorflow.python import pywrap_tfe
  from tensorflow.python.framework import dtypes
  from tensorflow.python.types import core
  from tensorflow.python.util import object_identity
label_desc: Use image node_id 9 for calling the FunctionCaptures obj's underlying member method code with example usage: obj.get_by_ref_snapshot() and returns: snapshot