parameters: (config=None, device_policy=None)
docstring: Enables, for the rest of the lifetime of this program, eager execution.
  
    If not called immediately on startup risks creating breakage and bugs.
  
    Example:
    ```python
    tfe.enable_eager_execution()
  
    # After eager execution is enabled, operations are executed as they are
    # defined and `Tensor`s hold concrete values, which can be accessed as
    # `numpy.ndarray`s through the `numpy()` method.
    assert tf.multiply(6, 7).numpy() == 42
    ```
  
    Args:
      config: (Optional.) A `ConfigProto` protocol buffer with configuration
       options for the Context. Note that a lot of these options may be
       currently unimplemented or irrelevant when eager execution is enabled.
      device_policy: (Optional.) What policy to use when trying to run an
       operation on a device with inputs which are not on that device.
       Valid values:
         tfe.DEVICE_PLACEMENT_EXPLICIT: raises an error if the placement is not
           correct.
         tfe.DEVICE_PLACEMENT_WARN: copies the tensors which are not on the
           right device but raises a warning.
         tfe.DEVICE_PLACEMENT_SILENT: silently copies the tensors. This might
           hide performance problems.
  
    Raises:
      ValueError: If trying to create a context after using graph operations
       or if trying to create a context with nontrivial options which differ
       from those of the existing context.
docstring_summary: Enables, for the rest of the lifetime of this program, eager execution.
docstring_tokens: Enables for the rest of the lifetime of this program eager execution .
function: def enable_eager_execution(config=None, device_policy=None):
    """Enables, for the rest of the lifetime of this program, eager execution.
  
    If not called immediately on startup risks creating breakage and bugs.
  
    Example:
    ```python
    tfe.enable_eager_execution()
  
    # After eager execution is enabled, operations are executed as they are
    # defined and `Tensor`s hold concrete values, which can be accessed as
    # `numpy.ndarray`s through the `numpy()` method.
    assert tf.multiply(6, 7).numpy() == 42
    ```
  
    Args:
      config: (Optional.) A `ConfigProto` protocol buffer with configuration
       options for the Context. Note that a lot of these options may be
       currently unimplemented or irrelevant when eager execution is enabled.
      device_policy: (Optional.) What policy to use when trying to run an
       operation on a device with inputs which are not on that device.
       Valid values:
         tfe.DEVICE_PLACEMENT_EXPLICIT: raises an error if the placement is not
           correct.
         tfe.DEVICE_PLACEMENT_WARN: copies the tensors which are not on the
           right device but raises a warning.
         tfe.DEVICE_PLACEMENT_SILENT: silently copies the tensors. This might
           hide performance problems.
  
    Raises:
      ValueError: If trying to create a context after using graph operations
       or if trying to create a context with nontrivial options which differ
       from those of the existing context.
    """
    # pylint: disable=protected-access
    if context._default_mode == context.GRAPH_MODE:
      graph_mode_has_been_used = (
          _default_session_stack.stack or
          _default_graph_stack._global_default_graph is not None)
      if graph_mode_has_been_used:
        raise ValueError(
            "tfe.enable_eager_execution has to be called at program startup.")
    context._default_mode = context.EAGER_MODE
    if context._context is None:
      context._context = context.Context(config=config,
                                         device_policy=device_policy)
    elif ((config is not None and config is not context._context._config)
          or (device_policy is not None
              and device_policy is not context._context._device_policy)):
      raise ValueError("Trying to change the options of an active eager"
                       " execution. Context config: %s, specified config:"
                       " %s. Context device policy: %s; specified device"
                       " policy: %s." % (config, context._context._config,
                                         device_policy,
                                         context._context._device_policy))
function_tokens: def enable_eager_execution ( config = None , device_policy = None ) : # pylint: disable=protected-access if context . _default_mode == context . GRAPH_MODE : graph_mode_has_been_used = ( _default_session_stack . stack or _default_graph_stack . _global_default_graph is not None ) if graph_mode_has_been_used : raise ValueError ( "tfe.enable_eager_execution has to be called at program startup." ) context . _default_mode = context . EAGER_MODE if context . _context is None : context . _context = context . Context ( config = config , device_policy = device_policy ) elif ( ( config is not None and config is not context . _context . _config ) or ( device_policy is not None and device_policy is not context . _context . _device_policy ) ) : raise ValueError ( "Trying to change the options of an active eager" " execution. Context config: %s, specified config:" " %s. Context device policy: %s; specified device" " policy: %s." % ( config , context . _context . _config , device_policy , context . _context . _device_policy ) )