python/ray/tune/tuner.py
def fit(self) -> ResultGrid:
        """Executes hyperparameter tuning job as configured and returns result.

        Failure handling:
        For the kind of exception that happens during the execution of a trial,
        one may inspect it together with stacktrace through the returned result grid.
        See ``ResultGrid`` for reference. Each trial may fail up to a certain number.
        This is configured by ``RunConfig.FailureConfig.max_failures``.

        Exception that happens beyond trials will be thrown by this method as well.
        In such cases, there will be instruction like the following printed out
        at the end of console output to inform users on how to resume.

        Please use tuner = Tuner.restore("~/ray_results/tuner_resume")
        to resume.

        Raises:
            RayTaskError when the exception happens in trainable else TuneError.
        """

        if not self._is_ray_client:
            try:
                return self._local_tuner.fit()
            except Exception as e:
                raise TuneError(
                    f"Tune run failed. "
                    f'Please use tuner = Tuner.restore("'
                    f'{self._local_tuner.get_experiment_checkpoint_dir()}") to resume.'
                ) from e
        else:
            experiment_checkpoint_dir = ray.get(
                self._remote_tuner.get_experiment_checkpoint_dir.remote()
            )
            try:
                return ray.get(self._remote_tuner.fit.remote())
            except Exception as e:
                raise TuneError(
                    f"Tune run failed. "
                    f'Please use tuner = Tuner.restore("'
                    f'{experiment_checkpoint_dir}") to resume.'
                ) from e
Executes hyperparameter tuning job as configured and returns result.

        Failure handling:
        For the kind of exception that happens during the execution of a trial,
        one may inspect it together with stacktrace through the returned result grid.
        See ``ResultGrid`` for reference. Each trial may fail up to a certain number.
        This is configured by ``RunConfig.FailureConfig.max_failures``.

        Exception that happens beyond trials will be thrown by this method as well.
        In such cases, there will be instruction like the following printed out
        at the end of console output to inform users on how to resume.

        Please use tuner = Tuner.restore("~/ray_results/tuner_resume")
        to resume.

        Raises:
            RayTaskError when the exception happens in trainable else TuneError.
        
Executes hyperparameter tuning job as configured and returns result.
Failure handling:
For the kind of exception that happens during the execution of a trial,
one may inspect it together with stacktrace through the returned result grid.
See ``ResultGrid`` for reference. Each trial may fail up to a certain number.

Exception that happens beyond trials will be thrown by this method as well.
In such cases, there will be instruction like the following printed out
at the end of console output to inform users on how to resume.

Please use tuner = Tuner.restore("~/ray_results/tuner_resume")
to resume.

RayTaskError when the exception happens in trainable else TuneError.
Executes hyperparameter tuning job as configured and returns result . Failure handling : For the kind of exception that happens during the execution of a trial one may inspect it together with stacktrace through the returned result grid . See ` ` ResultGrid ` ` for reference . Each trial may fail up to a certain number . Exception that happens beyond trials will be thrown by this method as well . In such cases there will be instruction like the following printed out at the end of console output to inform users on how to resume . Please use tuner = Tuner . restore ( " ~ / ray_results / tuner_resume " ) to resume . RayTaskError when the exception happens in trainable else TuneError .
def fit(self) -> ResultGrid:
        if not self._is_ray_client:
            try:
                return self._local_tuner.fit()
            except Exception as e:
                raise TuneError(
                    f"Tune run failed. "
                    f'Please use tuner = Tuner.restore("'
                    f'{self._local_tuner.get_experiment_checkpoint_dir()}") to resume.'
                ) from e
        else:
            experiment_checkpoint_dir = ray.get(
                self._remote_tuner.get_experiment_checkpoint_dir.remote()
            )
            try:
                return ray.get(self._remote_tuner.fit.remote())
            except Exception as e:
                raise TuneError(
                    f"Tune run failed. "
                    f'Please use tuner = Tuner.restore("'
                    f'{experiment_checkpoint_dir}") to resume.'
                ) from e
def fit ( self ) -> ResultGrid : if not self . _is_ray_client : try : return self . _local_tuner . fit ( ) except Exception as e : raise TuneError ( f"Tune run failed. " f'Please use tuner = Tuner.restore("' f'{self._local_tuner.get_experiment_checkpoint_dir()}") to resume.' ) from e else : experiment_checkpoint_dir = ray . get ( self . _remote_tuner . get_experiment_checkpoint_dir . remote ( ) ) try : return ray . get ( self . _remote_tuner . fit . remote ( ) ) except Exception as e : raise TuneError ( f"Tune run failed. " f'Please use tuner = Tuner.restore("' f'{experiment_checkpoint_dir}") to resume.' ) from e
Executes hyperparameter tuning job as configured and returns result.
Executes hyperparameter tuning job as configured and returns result .
"""Executes hyperparameter tuning job as configured and returns result.

        Failure handling:
        For the kind of exception that happens during the execution of a trial,
        one may inspect it together with stacktrace through the returned result grid.
        See ``ResultGrid`` for reference. Each trial may fail up to a certain number.
        This is configured by ``RunConfig.FailureConfig.max_failures``.

        Exception that happens beyond trials will be thrown by this method as well.
        In such cases, there will be instruction like the following printed out
        at the end of console output to inform users on how to resume.

        Please use tuner = Tuner.restore("~/ray_results/tuner_resume")
        to resume.

        Raises:
            RayTaskError when the exception happens in trainable else TuneError.
        """
self