python/ray/tune/schedulers/resource_changing_scheduler.py
def _validate(
        self, base_trial_resource: PlacementGroupFactory, result: Dict[str, Any]
    ) -> bool:
        """Return False if we should keep the current resources outright."""
        if not isinstance(base_trial_resource, PlacementGroupFactory):
            raise ValueError(
                f"{self.__class__.__name__} only supports PlacementGroupFactories."
            )

        if not self.add_bundles and len(base_trial_resource.bundles) > 1:
            raise ValueError(
                "If `add_bundles` is False, the number of bundles in "
                "`resources_per_trial` must be 1 "
                f"(got {len(base_trial_resource.bundles)})."
            )

        # Don't bother if this is just the first iteration
        if result["training_iteration"] < 1:
            return False
        return True
Return False if we should keep the current resources outright.
Return False if we should keep the current resources outright.
Return False if we should keep the current resources outright .
def _validate(
        self, base_trial_resource: PlacementGroupFactory, result: Dict[str, Any]
    ) -> bool:
        if not isinstance(base_trial_resource, PlacementGroupFactory):
            raise ValueError(
                f"{self.__class__.__name__} only supports PlacementGroupFactories."
            )
        if not self.add_bundles and len(base_trial_resource.bundles) > 1:
            raise ValueError(
                "If `add_bundles` is False, the number of bundles in "
                "`resources_per_trial` must be 1 "
                f"(got {len(base_trial_resource.bundles)})."
            )
        if result["training_iteration"] < 1:
            return False
        return True
def _validate ( self , base_trial_resource : PlacementGroupFactory , result : Dict [ str , Any ] ) -> bool : if not isinstance ( base_trial_resource , PlacementGroupFactory ) : raise ValueError ( f"{self.__class__.__name__} only supports PlacementGroupFactories." ) if not self . add_bundles and len ( base_trial_resource . bundles ) > 1 : raise ValueError ( "If `add_bundles` is False, the number of bundles in " "`resources_per_trial` must be 1 " f"(got {len(base_trial_resource.bundles)})." ) if result [ "training_iteration" ] < 1 : return False return True
Return False if we should keep the current resources outright.
Return False if we should keep the current resources outright .
"""Return False if we should keep the current resources outright.""" # Don't bother if this is just the first iteration
self
base_trial_resource
PlacementGroupFactory
result
Dict[str, Any]