o
    Ô2úhR  ã                   @   s6   d Z ddlmZ ddlmZ ddlmZ ddd„ZdS )	z3A Python interface for creating TensorFlow servers.é    )Údevice_attributes_pb2)Úpywrap_tensorflow)Ú_pywrap_device_libNc                    s4   dd„ ‰ d}| dur|   ¡ }‡ fdd„t |¡D ƒS )zÒList the available devices available in the local process.

  Args:
    session_config: a session config proto or None to use the default config.

  Returns:
    A list of `DeviceAttribute` protocol buffers.
  c                 S   s   t  ¡ }| | ¡ |S ©N)r   ÚDeviceAttributesÚParseFromString)Úpb_strÚm© r
   ú^/var/www/html/chatgem/venv/lib/python3.10/site-packages/tensorflow/python/client/device_lib.pyÚ_convert    s   
z$list_local_devices.<locals>._convertNc                    s   g | ]}ˆ |ƒ‘qS r
   r
   )Ú.0Ús©r   r
   r   Ú
<listcomp>(   s    ÿz&list_local_devices.<locals>.<listcomp>)ÚSerializeToStringr   Úlist_devices)Úsession_configÚserialized_configr
   r   r   Úlist_local_devices   s   	
ÿr   r   )Ú__doc__Útensorflow.core.frameworkr   Útensorflow.pythonr   Útensorflow.python.clientr   r   r
   r
   r
   r   Ú<module>   s
   