class_docstr: A running covariance computation.
  
  The running covariance computation supports batching. The `event_ndims`
  parameter indicates the number of trailing dimensions to treat as part of
  the event, and to compute covariance across. The leading dimensions, if
  any, are treated as batch shape, and no cross terms are computed.
  
  For example, if the incoming samples have shape `[5, 7]`, the `event_ndims`
  selects among three different covariance computations:
  - `event_ndims=0` treats the samples as a `[5, 7]` batch of scalar random
    variables, and computes their variances in batch.  The shape of the result
    is `[5, 7]`.
  - `event_ndims=1` treats the samples as a `[5]` batch of vector random
    variables of shape `[7]`, and computes their covariances in batch.  The
    shape of the result is `[5, 7, 7]`.
  - `event_ndims=2` treats the samples as a single random variable of
    shape `[5, 7]` and computes its covariance.  The shape of the result
    is `[5, 7, 5, 7]`.
  
  `RunningCovariance` is meant to serve general streaming covariance needs.
  For a specialized version that fits streaming over MCMC samples, see
  `CovarianceReducer` in `tfp.experimental.mcmc`.
code: def __init__(
      self,
      num_samples,
      mean,
      sum_squared_residuals,
      event_ndims,
      name="RunningCovariance",
  ):
      with tf.name_scope(name) as name:
          dtype = dtype_util.common_dtype(
              [num_samples, mean, sum_squared_residuals],
              dtype_hint=tf.float32,
          )
          self.num_samples = tf.convert_to_tensor(
              num_samples, dtype=dtype
          )
          self.mean = tf.convert_to_tensor(mean, dtype=dtype)
          self.sum_squared_residuals = tf.convert_to_tensor(
              sum_squared_residuals, dtype=dtype
          )
          self.event_ndims = event_ndims
          self.name = name
  
imports: import functools
  import math
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import nest_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.mcmc import diagnostic
  from tensorflow.python.util import nest
label_desc: Use image node_id 1 to create a new RunningCovariance object from inherited base classes: ACClass with example: obj = RunningCovariance(num_samples, mean, sum_squared_residuals, event_ndims, name)