def assert_multivariate_true_cdf_equal_on_projections_two_sample(<EOL>samples1, samples2, num_projections, event_ndims=<NUM_LIT:1>,<EOL>false_fail_rate=<NUM_LIT>, seed=<NUM_LIT>, name=None):
<EOL>args_list = (<EOL>[samples1, samples2, num_projections, event_ndims, false_fail_rate])<EOL>strm = seed_stream.SeedStream(salt='<STR_LIT>', seed=seed)<EOL>with tf.compat.v1.name_scope(<EOL>name,<EOL>'<STR_LIT>',<EOL>args_list):<EOL><INDENT>dtype = dtype_util.common_dtype(<EOL>[samples1, samples2, false_fail_rate], tf.float32)<EOL>samples1 = tf.convert_to_tensor(<EOL>value=samples1, name='<STR_LIT>', dtype=dtype)<EOL>samples2 = tf.convert_to_tensor(<EOL>value=samples2, name='<STR_LIT>', dtype=dtype)<EOL>num_projections = tf.convert_to_tensor(<EOL>value=num_projections, name='<STR_LIT>')<EOL>false_fail_rate = tf.convert_to_tensor(<EOL>value=false_fail_rate, name='<STR_LIT>', dtype=dtype)<EOL>tf.compat.v1.assert_scalar(false_fail_rate)  <EOL>compatible_samples = tf.compat.v1.assert_equal(<EOL>tf.shape(input=samples1)[<NUM_LIT:1>:],<EOL>tf.shape(input=samples2)[<NUM_LIT:1>:])<EOL>with tf.control_dependencies([compatible_samples]):<EOL><INDENT>event_shape = tf.shape(input=samples1)[-event_ndims:]<EOL>random_projections = _random_unit_hypersphere(<EOL>[num_projections], event_shape, dtype=dtype, seed=strm())<EOL>last_axes = list(range(-<NUM_LIT:1>, -(event_ndims+<NUM_LIT:1>), -<NUM_LIT:1>))<EOL>proj1 = tf.tensordot(samples1, random_projections, [last_axes, last_axes])<EOL>proj2 = tf.tensordot(samples2, random_projections, [last_axes, last_axes])<EOL>return assert_true_cdf_equal_by_dkwm_two_sample(<EOL>proj1, proj2, false_fail_rate=false_fail_rate)<EOL><DEDENT><DEDENT>
Asserts the given multivariate distributions are equal.

    The test is a 1-D DKWM-style test of equality in distribution along the given
    number of random projections.  This is of course imperfect, but can behave
    reasonably, especially if `num_projections` is significantly more than the
    dimensionality of the sample space.

    More precisely, the test
    (i) assumes the event shape is given by the trailing `event_ndims` dimensions
        in each `samples` Tensor;
    (ii) generates `num_projections` random projections from this space to scalar;
    (iii) fails if there is enough evidence (using the
        [Dvoretzky-Kiefer-Wolfowitz-Massart inequality]
        (https://en.wikipedia.org/wiki/CDF-based_nonparametric_confidence_interval))
        along any of these projections that `samples1` and `samples2` come from
        different true distributions.

    This test works as written even if the distribution in question has atoms
    (e.g., is discrete).

    Note that the top dimension of each `samples` is treated as iid, and the
    bottom `event_ndims` dimensions are projected to scalar.  The remaining
    dimensions, if any, are treated as batch dimensions, and `false_fail_rate` is
    a total false failure rate for all the assertions in the batch (and all
    projections).  As such, if the batch is nontrivial, the assertion will insist
    on stronger evidence to fail any one member.

    A note on experiment design: This test boils down to `num_projections`
    two-sample CDF equality tests.  As such, one can compute the number of samples
    to draw or the detectable discrepancy (along any projection) using
    `min_num_samples_for_dkwm_cdf_two_sample_test` and
    `min_discrepancy_of_true_cdfs_detectable_by_dkwm_two_sample` respectively,
    just being sure to divide the false failure rate by the number of projections
    requested (no need to adjust the false pass rate).

    Args:
      samples1: Tensor of shape [n] + B + E.  Samples from some (batch of)
        distribution(s) of interest.  Assumed IID across the 0 dimension.
      samples2: Tensor of shape [m] + B + E.  Samples from some (batch of)
        distribution(s) of interest.  Assumed IID across the 0 dimension.
      num_projections: Scalar integer Tensor.  Number of projections to use.  Each
        projection will be a random direction on the unit hypershpere of shape E.
      event_ndims: Number of trailing dimensions forming the event shape.
        `rank(E) == event_ndims`.
      false_fail_rate: *Scalar* floating-point `Tensor` admissible total
        rate of mistakes.
      seed: Optional PRNG seed to use for generating the random projections.
        Changing this from the default should generally not be necessary.
      name: A name for this operation (optional).

    Returns:
      check: Op that raises `InvalidArgumentError` if the two samples do not match
        along any of the generated projections.