parameters: ()
return_statement: return device.DeviceSpec.from_string(current_device).device_type
docstring: Parse the current context and return the device type, eg CPU/GPU.
docstring_summary: Parse the current context and return the device type, eg CPU/GPU.
docstring_tokens: Parse the current context and return the device type eg CPU / GPU .
function: def _get_context_device_type():
    """Parse the current context and return the device type, eg CPU/GPU."""
    current_device = context.context().device_name
    if current_device is None:
      return None
    return device.DeviceSpec.from_string(current_device).device_type
function_tokens: def _get_context_device_type ( ) : current_device = context . context ( ) . device_name if current_device is None : return None return device . DeviceSpec . from_string ( current_device ) . device_type