python/ray/remote_function.py
def options(self, **task_options):
        """Configures and overrides the task invocation parameters.

        The arguments are the same as those that can be passed to :obj:`ray.remote`.
        Overriding `max_calls` is not supported.

        Examples:

        .. code-block:: python

            @ray.remote(num_gpus=1, max_calls=1, num_returns=2)
            def f():
               return 1, 2
            # Task f will require 2 gpus instead of 1.
            g = f.options(num_gpus=2)
        """

        func_cls = self

        # override original options
        default_options = self._default_options.copy()
        # max_calls could not be used in ".options()", we should remove it before
        # merging options from '@ray.remote'.
        default_options.pop("max_calls", None)
        updated_options = {**default_options, **task_options}
        ray_option_utils.validate_task_options(updated_options, in_options=True)

        # only update runtime_env when ".options()" specifies new runtime_env
        if "runtime_env" in task_options:
            updated_options["runtime_env"] = parse_runtime_env(
                updated_options["runtime_env"]
            )

        class FuncWrapper:
            def remote(self, *args, **kwargs):
                return func_cls._remote(args=args, kwargs=kwargs, **updated_options)

            def bind(self, *args, **kwargs):
                """
                **Experimental**

                For ray DAG building. Implementation and interface subject to changes.
                """
                from ray.experimental.dag.function_node import FunctionNode

                return FunctionNode(func_cls._function, args, kwargs, updated_options)

        return FuncWrapper()
Configures and overrides the task invocation parameters.

        The arguments are the same as those that can be passed to :obj:`ray.remote`.
        Overriding `max_calls` is not supported.

        Examples:

        .. code-block:: python

            @ray.remote(num_gpus=1, max_calls=1, num_returns=2)
            def f():
               return 1, 2
            # Task f will require 2 gpus instead of 1.
            g = f.options(num_gpus=2)
        
Configures and overrides the task invocation parameters.
The arguments are the same as those that can be passed to :obj:`ray.remote`.
Overriding `max_calls` is not supported.
Configures and overrides the task invocation parameters . The arguments are the same as those that can be passed to : obj : ` ray . remote ` . Overriding ` max_calls ` is not supported .
def options(self, **task_options):
        func_cls = self
        default_options = self._default_options.copy()
        default_options.pop("max_calls", None)
        updated_options = {**default_options, **task_options}
        ray_option_utils.validate_task_options(updated_options, in_options=True)
        if "runtime_env" in task_options:
            updated_options["runtime_env"] = parse_runtime_env(
                updated_options["runtime_env"]
            )
        class FuncWrapper:
            def remote(self, *args, **kwargs):
                return func_cls._remote(args=args, kwargs=kwargs, **updated_options)
            def bind(self, *args, **kwargs):
                from ray.experimental.dag.function_node import FunctionNode
                return FunctionNode(func_cls._function, args, kwargs, updated_options)
        return FuncWrapper()
def options ( self , ** task_options ) : func_cls = self default_options = self . _default_options . copy ( ) default_options . pop ( "max_calls" , None ) updated_options = { ** default_options , ** task_options } ray_option_utils . validate_task_options ( updated_options , in_options = True ) if "runtime_env" in task_options : updated_options [ "runtime_env" ] = parse_runtime_env ( updated_options [ "runtime_env" ] ) class FuncWrapper : def remote ( self , * args , ** kwargs ) : return func_cls . _remote ( args = args , kwargs = kwargs , ** updated_options ) def bind ( self , * args , ** kwargs ) : """
                **Experimental**

                For ray DAG building. Implementation and interface subject to changes.
                """ from ray . experimental . dag . function_node import FunctionNode return FunctionNode ( func_cls . _function , args , kwargs , updated_options ) return FuncWrapper ( )
Configures and overrides the task invocation parameters.
Configures and overrides the task invocation parameters .
"""Configures and overrides the task invocation parameters.

        The arguments are the same as those that can be passed to :obj:`ray.remote`.
        Overriding `max_calls` is not supported.

        Examples:

        .. code-block:: python

            @ray.remote(num_gpus=1, max_calls=1, num_returns=2)
            def f():
               return 1, 2
            # Task f will require 2 gpus instead of 1.
            g = f.options(num_gpus=2)
        """ # override original options # max_calls could not be used in ".options()", we should remove it before # merging options from '@ray.remote'. # only update runtime_env when ".options()" specifies new runtime_env """
                **Experimental**

                For ray DAG building. Implementation and interface subject to changes.
                """
self
examples
None