def quadrature_scheme_softmaxnormal_quantiles(<EOL>normal_loc, normal_scale, quadrature_size,<EOL>validate_args=False, name=None):
with tf.name_scope(name or "<STR_LIT>"):<EOL><INDENT>normal_loc = tf.convert_to_tensor(value=normal_loc, name="<STR_LIT>")<EOL>dt = dtype_util.base_dtype(normal_loc.dtype)<EOL>normal_scale = tf.convert_to_tensor(<EOL>value=normal_scale, dtype=dt, name="<STR_LIT>")<EOL>normal_scale = maybe_check_quadrature_param(<EOL>normal_scale, "<STR_LIT>", validate_args)<EOL>dist = normal.Normal(loc=normal_loc, scale=normal_scale)<EOL>def _get_batch_ndims():<EOL><INDENT>"""<STR_LIT>"""<EOL>ndims = tensorshape_util.rank(dist.batch_shape)<EOL>if ndims is None:<EOL><INDENT>ndims = tf.shape(input=dist.batch_shape_tensor())[<NUM_LIT:0>]<EOL><DEDENT>return ndims<EOL><DEDENT>batch_ndims = _get_batch_ndims()<EOL>def _get_final_shape(qs):<EOL><INDENT>"""<STR_LIT>"""<EOL>bs = tensorshape_util.with_rank_at_least(dist.batch_shape, <NUM_LIT:1>)<EOL>num_components = tf.compat.dimension_value(bs[-<NUM_LIT:1>])<EOL>if num_components is not None:<EOL><INDENT>num_components += <NUM_LIT:1><EOL><DEDENT>tail = tf.TensorShape([num_components, qs])<EOL>return bs[:-<NUM_LIT:1>].concatenate(tail)<EOL><DEDENT>def _compute_quantiles():<EOL><INDENT>"""<STR_LIT>"""<EOL>zero = tf.zeros([], dtype=dist.dtype)<EOL>edges = tf.linspace(zero, <NUM_LIT:1.>, quadrature_size + <NUM_LIT:3>)[<NUM_LIT:1>:-<NUM_LIT:1>]<EOL>edges = tf.reshape(<EOL>edges,<EOL>shape=tf.concat(<EOL>[[-<NUM_LIT:1>], tf.ones([batch_ndims], dtype=tf.int32)], axis=<NUM_LIT:0>))<EOL>quantiles = dist.quantile(edges)<EOL>quantiles = softmax_centered_bijector.SoftmaxCentered().forward(quantiles)<EOL>perm = tf.concat([tf.range(<NUM_LIT:1>, <NUM_LIT:1> + batch_ndims), [<NUM_LIT:0>]], axis=<NUM_LIT:0>)<EOL>quantiles = tf.transpose(a=quantiles, perm=perm)<EOL>tensorshape_util.set_shape(<EOL>quantiles, _get_final_shape(quadrature_size + <NUM_LIT:1>))<EOL>return quantiles<EOL><DEDENT>quantiles = _compute_quantiles()<EOL>grid = (quantiles[..., :-<NUM_LIT:1>] + quantiles[..., <NUM_LIT:1>:]) / <NUM_LIT><EOL>tensorshape_util.set_shape(grid, _get_final_shape(quadrature_size))<EOL>probs = tf.fill(<EOL>dims=[quadrature_size], value=<NUM_LIT:1.> / tf.cast(quadrature_size, dist.dtype))<EOL>return grid, probs<EOL><DEDENT>
Use SoftmaxNormal quantiles to form quadrature on `K - 1` simplex.

    A `SoftmaxNormal` random variable `Y` may be generated via

    ```
    Y = SoftmaxCentered(X),
    X = Normal(normal_loc, normal_scale)
    ```

    Args:
      normal_loc: `float`-like `Tensor` with shape `[b1, ..., bB, K-1]`, B>=0.
        The location parameter of the Normal used to construct the SoftmaxNormal.
      normal_scale: `float`-like `Tensor`. Broadcastable with `normal_loc`.
        The scale parameter of the Normal used to construct the SoftmaxNormal.
      quadrature_size: Python `int` scalar representing the number of quadrature
        points.
      validate_args: Python `bool`, default `False`. When `True` distribution
        parameters are checked for validity despite possibly degrading runtime
        performance. When `False` invalid inputs may silently render incorrect
        outputs.
      name: Python `str` name prefixed to Ops created by this class.

    Returns:
      grid: Shape `[b1, ..., bB, K, quadrature_size]` `Tensor` representing the
        convex combination of affine parameters for `K` components.
        `grid[..., :, n]` is the `n`-th grid point, living in the `K - 1` simplex.
      probs:  Shape `[b1, ..., bB, K, quadrature_size]` `Tensor` representing the
        associated with each grid point.