def METHOD_NAME(caplog: LogCaptureFixture) -> None:
    """ Check that no warnings are thrown when compiling `leading_transpose` """
    dims = [1, 2, 3, 4]
    a = tf.zeros(dims)
    @tf.function
    def compiled_wrapper() -> tf.Tensor:
        return leading_transpose(a, [..., -1, -2])
    compiled_wrapper()
    # When Autograph cannot compile a function it sends a WARNING message to the
    # logs.
    log_message_levels = [record.levelname for record in caplog.records]
    assert "WARNING" not in log_message_levels