class_docstr: Computes a running mean.
  
  In computation, samples can be provided individually or in chunks. A
  "chunk" of size M implies incorporating M samples into a single expectation
  computation at once, which is more efficient than one by one.
  
  `RunningMean` is meant to serve general streaming expectations.
  For a specialized version that fits streaming over MCMC samples, see
  `ExpectationsReducer` in `tfp.experimental.mcmc`.
docstr: Initialize an empty `RunningMean`.
  
  Args:
    example: A `Tensor`.  The `RunningMean` will accept samples
      of the same dtype and broadcast-compatible shape as the example.
  
  Returns:
    state: `RunningMean` representing a stream of no inputs.  Note
      that by convention, the supplied example is used only for
      initialization, but not counted as a sample.
docstr_tok: ["Initialize","an","empty","`","RunningMean","`",".","Args",":","example",":","A","`","Tensor","`",".","The","`","RunningMean","`","will","accept","samples","of","the","same","dtype","and","broadcast-compatible","shape","as","the","example",".","Returns",":","state",":","`","RunningMean","`","representing","a","stream","of","no","inputs",".","Note","that","by","convention",",","the","supplied","example","is","used","only","for","initialization",",","but","not","counted","as","a","sample","."]
code: def from_example(cls, example):
      """Initialize an empty `RunningMean`.
  
      Args:
        example: A `Tensor`.  The `RunningMean` will accept samples
          of the same dtype and broadcast-compatible shape as the example.
  
      Returns:
        state: `RunningMean` representing a stream of no inputs.  Note
          that by convention, the supplied example is used only for
          initialization, but not counted as a sample.
      """
      return cls.from_shape(ps.shape(example), example.dtype)
  
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 5 for calling the RunningMean obj's underlying member method code with example usage: obj.from_example(cls, example) and returns: cls