Skip to content
  • Michael Reneer's avatar
    Add a compiler function to the `ExecutionContext` object. · 187f78aa
    Michael Reneer authored
    This change adds a compiler function to the `ExecutionContext` object. Conceptually a `Context` can be thought of as an "environment" which owns compilation and owns execution for a given computation. Additionally, this change replaces `set_default_executor` with higher level functions in order to simplify how contexts are constructed.
    
    * Added compiler function to the `ExecutionContext`.
    * Deprecated `set_default_executor`.
    * Removed all usage of `set_default_executor` internally.
    * Added convenience high level functions that set an execution context:
      * tff.backends.native.set_local_execution_context
    * Updated `set_default_executor` call-sites to either use the convenience high level functions or to manually construct a context and use `set_default_context`.
    
    Note that we should consider creating the following convenience high level functions:
      * tff.backends.native.set_remote_execution_context
      * tff.backends.native.set_sizing_execution_context
      * tff.backends.iree.set_iree_execution_context
    
    PiperOrigin-RevId: 321263709
    187f78aa