code: def sample_uniform_initial_state(
      parameter,
      return_constrained=True,
      init_sample_shape=(),
      seed=None,
  ):
      """Initialize from a uniform [-2, 2] distribution in unconstrained space.
  
      Args:
        parameter: `sts.Parameter` named tuple instance.
        return_constrained: if `True`, re-applies the constraining bijector
          to return initializations in the original domain. Otherwise, returns
          initializations in the unconstrained space.
          Default value: `True`.
        init_sample_shape: `sample_shape` of the sampled initializations.
          Default value: `[]`.
        seed: PRNG seed; see `tfp.random.sanitize_seed` for details.
  
      Returns:
        uniform_initializer: `Tensor` of shape `concat([init_sample_shape,
        parameter.prior.batch_shape, transformed_event_shape])`, where
        `transformed_event_shape` is `parameter.prior.event_shape`, if
        `return_constrained=True`, and otherwise it is
        `parameter.bijector.inverse_event_shape(parameteter.prior.event_shape)`.
      """
      # Get the shape and dtype of the unconstrained parameter value we'll
      # use in inference, which should match the shape of a prior sample. If
      # possible, elide the actual sampling by using `tf.function` to
      # read off the shape statically.
      unconstrained_prior_sample_fn = tf.function(
          lambda: parameter.bijector.inverse(  # pylint: disable=g-long-lambda
              parameter.prior.sample(init_sample_shape)
          )
      )
      param_shape = (
          unconstrained_prior_sample_fn.get_concrete_function().output_shapes
      )
      if not tensorshape_util.is_fully_defined(param_shape):
          param_shape = tf.shape(unconstrained_prior_sample_fn())
  
      uniform_initializer = (
          4
          * samplers.uniform(
              shape=param_shape,
              dtype=unconstrained_prior_sample_fn.get_concrete_function().output_dtypes,
              seed=seed,
          )
          - 2
      )
      if return_constrained:
          return parameter.bijector.forward(uniform_initializer)
      else:
          return uniform_initializer
  
file_path: probability/tensorflow_probability/python/sts/fitting.py
imports: import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.experimental import vi
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.mcmc import dual_averaging_step_size_adaptation
  from tensorflow_probability.python.mcmc import hmc
  from tensorflow_probability.python.mcmc import sample
  from tensorflow_probability.python.mcmc import transformed_kernel
  from tensorflow_probability.python.sts.internal import util
  from tensorflow_probability.python.vi import optimization
  from tensorflow.python.util import deprecation
label_desc: Use image node_id 1 for calling a global function with example usage: sample_uniform_initial_state(parameter, return_constrained, init_sample_shape, seed) and returns: parameter, uniform_initializer