parameters: ()
return_statement: return False
docstring: Check if we are currently inside an XLA compile context.
docstring_summary: Check if we are currently inside an XLA compile context.
docstring_tokens: Check if we are currently inside an XLA compile context .
function: def _is_under_xla_context():
    """Check if we are currently inside an XLA compile context."""
    g = ops.get_default_graph()
    while g is not None:
      control_flow_context = g._get_control_flow_context()  # pylint: disable=protected-access
      while control_flow_context is not None:
        if control_flow_context.IsXLAContext():
          return True
        else:
          control_flow_context = control_flow_context.outer_context
      # If g is a FuncGraph, get its outer_graph.
      g = getattr(g, "outer_graph", None)
    return False
function_tokens: def _is_under_xla_context ( ) : g = ops . get_default_graph ( ) while g is not None : control_flow_context = g . _get_control_flow_context ( ) # pylint: disable=protected-access while control_flow_context is not None : if control_flow_context . IsXLAContext ( ) : return True else : control_flow_context = control_flow_context . outer_context # If g is a FuncGraph, get its outer_graph. g = getattr ( g , "outer_graph" , None ) return False