class_docstr: Abstract base class for streamable statistics of trees of tensors.
  
  Derived classes must implelement :meth:`update`, :meth:`merge`, and
  :meth:`get`.
docstr: Update state from a single sample.
  
  This mutates ``self`` and returns nothing. Updates should be
  independent of order, i.e. samples should be exchangeable.
  
  :param sample: A sample value which is a nested dictionary of
      :class:`torch.Tensor` leaves. This can have arbitrary nesting and
      shape shape, but assumes shape is constant across calls to
      ``.update()``.
docstr_tok: ["Update","state","from","a","single","sample",".","This","mutates","``","self","``","and","returns","nothing",".","Updates","should","be","independent","of","order",",","i.e",".","samples","should","be","exchangeable",".",":","param","sample",":","A","sample","value","which","is","a","nested","dictionary","of",":","class",":","`","torch.Tensor","`","leaves",".","This","can","have","arbitrary","nesting","and","shape","shape",",","but","assumes","shape","is","constant","across","calls","to","``",".update","(",")","``","."]
code: def update(self, sample) -> None:
      """
      Update state from a single sample.
  
      This mutates ``self`` and returns nothing. Updates should be
      independent of order, i.e. samples should be exchangeable.
  
      :param sample: A sample value which is a nested dictionary of
          :class:`torch.Tensor` leaves. This can have arbitrary nesting and
          shape shape, but assumes shape is constant across calls to
          ``.update()``.
      """
      raise NotImplementedError
  
imports: import copy
  from abc import ABC, abstractmethod
  from collections import defaultdict
  from typing import Any, Callable, Dict, Hashable, Union
  import torch
  from pyro.ops.welford import WelfordCovariance
label_desc: Use image node_id 1 for calling the StreamingStats obj's underlying member method code with example usage: obj.update(sample) without return types