def ensure_eager_execution():
    """
    Ensures that Tensorflow is in eager-execution mode.
    """
    from tensorflow import executing_eagerly
    if not executing_eagerly():
        raise RuntimeError(f'Tensorflow V2 not in eager-execution mode')
