code: def _initialize(
      shape, dtype, batch_ndims, scale, mode, distribution, seed=None
  ):
      """Samples a random `Tensor` per specified args."""
      if not dtype_util.is_floating(dtype):
          raise TypeError(
              'Argument `dtype` must be float type (saw: "{}").'.format(
                  dtype
              )
          )
      shape = prefer_static.reshape(
          shape, shape=[-1]
      )  # Ensure shape is vector.
      fan_in, fan_out = _compute_fans_from_shape(shape, batch_ndims)
      fans = _summarize_fans(fan_in, fan_out, mode, dtype)
      scale = prefer_static.cast(scale, dtype)
      return _sample_distribution(
          shape, scale / fans, distribution, seed, dtype
      )
  
file_path: probability/tensorflow_probability/python/experimental/nn/initializers/initializers.py
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
label_desc: Use image node_id 5 for calling a global function with example usage: _initialize(shape, dtype, batch_ndims, scale, mode, distribution, seed) and returns: _sample_distribution