o
    1 i                     @   sx   d dl mZ d dlmZ d dlmZ edddee fddZedddee fd	d
Z	edddefddZ
dS )    )Optional)TPUAcceleratorManager)	PublicAPIalpha)Z	stabilityreturnc                  C   s   t  } | dkr
d} | S )z
    Return the name of the TPU pod that the worker is a part of.

    Returns:
        The name of the TPU pod. Returns None if not part of a TPU pod.
     N)r   Zget_current_node_tpu_name)Ztpu_name r   e/home/app/PaddleOCR-VL-test/.venv_paddleocr/lib/python3.10/site-packages/ray/util/accelerators/tpu.pyget_current_pod_name   s   r
   c                   C      t  S )z
    Count the number of workers associated with the TPU pod that the worker belongs to.

    Returns:
        The total number of workers in the TPU pod. Returns None if the worker is not
        part of a TPU pod.
    )r   Z"get_num_workers_in_current_tpu_podr   r   r   r	   get_current_pod_worker_count   s   	r   c                   C   r   )z
    Return the number of TPU chips on the node.
    Returns:
        The total number of chips on the TPU node. Returns 0 if none are found.
    )r   Z!get_current_node_num_acceleratorsr   r   r   r	   get_num_tpu_chips_on_node!   s   r   N)typingr   Zray._private.acceleratorsr   Zray.util.annotationsr   strr
   intr   r   r   r   r   r	   <module>   s    