def __init__(self, device=None):
    'Creates a new instance of an eager executor.\n\n    Args:\n      device: An optional `tf.config.LogicalDevice` that this executor will\n        schedule all of its operations to run on. For example, the list of\n        logical devices can be obtained using\n        `tf.config.list_logical_devices()`.\n\n    Raises:\n      RuntimeError: If not executing eagerly.\n      TypeError: If the device is not a `tf.config.LogicalDevice`.\n      ValueError: If there is no device `device`.\n    '
    if (not tf.executing_eagerly()):
        raise RuntimeError('The eager executor may only be used in eager mode.')
    if (device is not None):
        py_typecheck.check_type(device, tf.config.LogicalDevice)
        self._device = device
    else:
        self._device = None
    self._tf_function_cache = cachetools.LRUCache(_TF_FUNCTION_CACHE_SIZE)
Creates a new instance of an eager executor.

Args:
  device: An optional `tf.config.LogicalDevice` that this executor will
    schedule all of its operations to run on. For example, the list of
    logical devices can be obtained using
    `tf.config.list_logical_devices()`.

Raises:
  RuntimeError: If not executing eagerly.
  TypeError: If the device is not a `tf.config.LogicalDevice`.
  ValueError: If there is no device `device`.
def __init__(self, device=None):
    'Creates a new instance of an eager executor.\n\n    Args:\n      device: An optional `tf.config.LogicalDevice` that this executor will\n        schedule all of its operations to run on. For example, the list of\n        logical devices can be obtained using\n        `tf.config.list_logical_devices()`.\n\n    Raises:\n      RuntimeError: If not executing eagerly.\n      TypeError: If the device is not a `tf.config.LogicalDevice`.\n      ValueError: If there is no device `device`.\n    '
    if (not tf.executing_eagerly()):
        raise RuntimeError('The eager executor may only be used in eager mode.')
    if (device is not None):
        py_typecheck.check_type(device, tf.config.LogicalDevice)
        self._device = device
    else:
        self._device = None
    self._tf_function_cache = cachetools.LRUCache(_TF_FUNCTION_CACHE_SIZE)