class_docstr: For when you want to get (nested) fields by usual attribute access.
  
  Example usage:
  
  ```
  results = ...
  wrapped = UnnestingWrapper(results)
  wrapped.my_attr  # equivalent to `get_innermost(results, 'my_attr')
  
  # Use `_object` to get at the wrapped object.
  new_results = replace_innermost(wrapped._object, ...)
  ```
class_docstr_tok: ["For","when","you","want","to","get","(","nested",")","fields","by","usual","attribute","access",".","Example","usage",":","``","`","results","=","...","wrapped","=","UnnestingWrapper","(","results",")","wrapped.my_attr","#","equivalent","to","`","get_innermost","(","results",",","'my_attr","'",")","#","Use","`","_object","`","to","get","at","the","wrapped","object",".","new_results","=","replace_innermost","(","wrapped._object",",","...",")","``","`"]
code: def __getattr__(self, attr):
      if self._innermost:
          return get_innermost(self._object, attr)
      else:
          return get_outermost(self._object, attr)
  
file_path: probability/tensorflow_probability/python/internal/unnest.py
imports: import collections
label_desc: Use image node_id 2 for calling the UnnestingWrapper obj's underlying member method code with example usage: obj.__getattr__(attr) and returns: get_innermost, get_outermost