o
    1 iy                     @   sX   d dl mZmZmZ d dlZd dlmZ d dlmZ d dl	m
Z
 e
G dd deZdS )    )AnyDictListN)DAGNode)get_dag_node_str)DeveloperAPIc                
       sp   e Zd ZdZ	d fdd	Zdee deeef deeef deeef fd	d
Z	dd Z
defddZ  ZS )FunctionNodez/Represents a bound task node in a Ray task DAG.Nc                    s   || _ t j||||d d S N)other_args_to_resolve)_bodysuper__init__)selfZ	func_bodyZ	func_argsZfunc_kwargsZfunc_optionsr
   	__class__ a/home/app/PaddleOCR-VL-test/.venv_paddleocr/lib/python3.10/site-packages/ray/dag/function_node.pyr      s   
zFunctionNode.__init__new_args
new_kwargsnew_optionsnew_other_args_to_resolvec                 C   s   t | j||||dS r	   )r   r   )r   r   r   r   r   r   r   r   
_copy_impl   s   zFunctionNode._copy_implc                 O   s*   t | jjdi | jj| ji | jS )a:  Executor of FunctionNode by ray.remote().

        Args and kwargs are to match base class signature, but not in the
        implementation. All args and kwargs should be resolved and replaced
        with value in bound_args and bound_kwargs via bottom-up recursion when
        current node is executed.
        Nr   )rayremoter   optionsZ_bound_optionsZ_bound_argsZ_bound_kwargs)r   argskwargsr   r   r   _execute_impl,   s   
	zFunctionNode._execute_implreturnc                 C   s   t | t| jS N)r   strr   )r   r   r   r   __str__:   s   zFunctionNode.__str__r   )__name__
__module____qualname____doc__r   r   r   r   r    r   r   r!   __classcell__r   r   r   r   r   	   s    



r   )typingr   r   r   r   Zray.dag.dag_noder   Zray.dag.format_utilsr   Zray.util.annotationsr   r   r   r   r   r   <module>   s    