class_docstr: Efficient tree aggregator to compute accumulated noise.
  
  This class implements the efficient tree aggregation algorithm based on
  Honaker 2015 "Efficient Use of Differentially Private Binary Trees".
  The noise standard deviation for a node at depth d is roughly
  `sigma * sqrt(2^{d-1}/(2^d-1))`. which becomes `sigma / sqrt(2)` when
  the tree is very tall.
  
  Example usage:
    random_generator = GaussianNoiseGenerator(...)
    tree_aggregator = EfficientTreeAggregator(random_generator)
    state = tree_aggregator.init_state()
    for leaf_node_idx in range(total_steps):
      assert leaf_node_idx == get_step_idx(state))
      noise, state = tree_aggregator.get_cumsum_and_update(state)
  
  Attributes:
    value_generator: A `ValueGenerator` or a no-arg function to generate a noise
      value for each tree node.
class_docstr_tok: ["Efficient","tree","aggregator","to","compute","accumulated","noise",".","This","class","implements","the","efficient","tree","aggregation","algorithm","based","on","Honaker","2015","``","Efficient","Use","of","Differentially","Private","Binary","Trees","''",".","The","noise","standard","deviation","for","a","node","at","depth","d","is","roughly","`","sigma","*","sqrt","(","2^","{","d-1","}","\/","(","2^d-1",")",")","`",".","which","becomes","`","sigma","\/","sqrt","(","2",")","`","when","the","tree","is","very","tall",".","Example","usage",":","random_generator","=","GaussianNoiseGenerator","(","...",")","tree_aggregator","=","EfficientTreeAggregator","(","random_generator",")","state","=","tree_aggregator.init_state","(",")","for","leaf_node_idx","in","range","(","total_steps",")",":","assert","leaf_node_idx","==","get_step_idx","(","state",")",")","noise",",","state","=","tree_aggregator.get_cumsum_and_update","(","state",")","Attributes",":","value_generator",":","A","`","ValueGenerator","`","or","a","no-arg","function","to","generate","a","noise","value","for","each","tree","node","."]
docstr: Initialize the aggregator with a noise generator.
  
  Args:
    value_generator: A `ValueGenerator` or a no-arg function to generate a
      noise value for each tree node.
docstr_tok: ["Initialize","the","aggregator","with","a","noise","generator",".","Args",":","value_generator",":","A","`","ValueGenerator","`","or","a","no-arg","function","to","generate","a","noise","value","for","each","tree","node","."]
code: def __init__(
      self, value_generator: Union[ValueGenerator, Callable[[], Any]]
  ):
      """Initialize the aggregator with a noise generator.
  
      Args:
        value_generator: A `ValueGenerator` or a no-arg function to generate a
          noise value for each tree node.
      """
      if isinstance(value_generator, ValueGenerator):
          self.value_generator = value_generator
      else:
          self.value_generator = StatelessValueGenerator(
              value_generator
          )
  
imports: import abc
  import collections
  from typing import Any, Callable, Collection, NamedTuple, Optional, Tuple, Union
  import tensorflow
label_desc: Use image node_id 1 to create a new EfficientTreeAggregator object  with example: obj = EfficientTreeAggregator(value_generator)