def _maximum_mean(samples, envelope, high, name=None):
with tf.compat.v1.name_scope(name, '<STR_LIT>', [samples, envelope, high]):<EOL><INDENT>dtype = dtype_util.common_dtype([samples, envelope, high], tf.float32)<EOL>samples = tf.convert_to_tensor(value=samples, name='<STR_LIT>', dtype=dtype)<EOL>envelope = tf.convert_to_tensor(<EOL>value=envelope, name='<STR_LIT>', dtype=dtype)<EOL>high = tf.convert_to_tensor(value=high, name='<STR_LIT>', dtype=dtype)<EOL>xmax = tf.reduce_max(input_tensor=samples, axis=[<NUM_LIT:0>])<EOL>msg = '<STR_LIT>'<EOL>check_op = tf.compat.v1.assert_less_equal(xmax, high, message=msg)<EOL>with tf.control_dependencies([check_op]):<EOL><INDENT>return tf.identity(_do_maximum_mean(samples, envelope, high))<EOL><DEDENT><DEDENT>
Returns a stochastic upper bound on the mean of a scalar distribution.

    The idea is that if the true CDF is within an `eps`-envelope of the
    empirical CDF of the samples, and the support is bounded above, then
    the mean is bounded above as well.  In symbols,

    ```none
    sup_x(|F_n(x) - F(x)|) < eps
    ```

    The 0th dimension of `samples` is interpreted as independent and
    identically distributed samples.  The remaining dimensions are
    broadcast together with `envelope` and `high`, and operated on
    separately.

    Args:
      samples: Floating-point `Tensor` of samples from the distribution(s)
        of interest.  Entries are assumed IID across the 0th dimension.
        The other dimensions must broadcast with `envelope` and `high`.
      envelope: Floating-point `Tensor` of sizes of admissible CDF
        envelopes (i.e., the `eps` above).
      high: Floating-point `Tensor` of upper bounds on the distributions'
        supports.  `samples <= high`.
      name: A name for this operation (optional).

    Returns:
      bound: Floating-point `Tensor` of upper bounds on the true means.

    Raises:
      InvalidArgumentError: If some `sample` is found to be larger than
        the corresponding `high`.