ray.dag.input_node.InputNode.apply_functional#

InputNode.apply_functional(source_input_list: Any, predicate_fn: Callable, apply_fn: Callable)#

Apply a given function to DAGNodes in source_input_list, and return the replaced inputs without mutating or coping any DAGNode.

Parameters:
  • source_input_list – Source inputs to extract and apply function on all children DAGNode instances.

  • predicate_fn – Applied on each DAGNode instance found and determine if we should apply function to it. Can be used to filter node types.

  • apply_fn

    Function to apply on the node on bound attributes. Example:

    apply_fn = lambda node: node._get_serve_deployment_handle(
        node._deployment, node._bound_other_args_to_resolve
    )
    

Returns:

Outputs of apply_fn on DAGNodes in

source_input_list that passes predicate_fn.

Return type:

replaced_inputs