python/ray/ml/config.py
def as_placement_group_factory(self) -> "PlacementGroupFactory":
        """Returns a PlacementGroupFactory to specify resources for Tune."""
        from ray.tune.trainable import PlacementGroupFactory

        trainer_resources = (
            self.trainer_resources if self.trainer_resources else {"CPU": 1}
        )
        trainer_bundle = [trainer_resources]
        worker_resources = {
            "CPU": self.num_cpus_per_worker,
            "GPU": self.num_gpus_per_worker,
        }
        worker_resources_extra = (
            {} if self.resources_per_worker is None else self.resources_per_worker
        )
        worker_bundles = [
            {**worker_resources, **worker_resources_extra}
            for _ in range(self.num_workers if self.num_workers else 0)
        ]
        bundles = trainer_bundle + worker_bundles
        return PlacementGroupFactory(bundles, strategy=self.placement_strategy)
Returns a PlacementGroupFactory to specify resources for Tune.
Returns a PlacementGroupFactory to specify resources for Tune.
Returns a PlacementGroupFactory to specify resources for Tune .
def as_placement_group_factory(self) -> "PlacementGroupFactory":
        from ray.tune.trainable import PlacementGroupFactory
        trainer_resources = (
            self.trainer_resources if self.trainer_resources else {"CPU": 1}
        )
        trainer_bundle = [trainer_resources]
        worker_resources = {
            "CPU": self.num_cpus_per_worker,
            "GPU": self.num_gpus_per_worker,
        }
        worker_resources_extra = (
            {} if self.resources_per_worker is None else self.resources_per_worker
        )
        worker_bundles = [
            {**worker_resources, **worker_resources_extra}
            for _ in range(self.num_workers if self.num_workers else 0)
        ]
        bundles = trainer_bundle + worker_bundles
        return PlacementGroupFactory(bundles, strategy=self.placement_strategy)
def as_placement_group_factory ( self ) -> "PlacementGroupFactory" : from ray . tune . trainable import PlacementGroupFactory trainer_resources = ( self . trainer_resources if self . trainer_resources else { "CPU" : 1 } ) trainer_bundle = [ trainer_resources ] worker_resources = { "CPU" : self . num_cpus_per_worker , "GPU" : self . num_gpus_per_worker , } worker_resources_extra = ( { } if self . resources_per_worker is None else self . resources_per_worker ) worker_bundles = [ { ** worker_resources , ** worker_resources_extra } for _ in range ( self . num_workers if self . num_workers else 0 ) ] bundles = trainer_bundle + worker_bundles return PlacementGroupFactory ( bundles , strategy = self . placement_strategy )
Returns a PlacementGroupFactory to specify resources for Tune.
Returns a PlacementGroupFactory to specify resources for Tune .
"""Returns a PlacementGroupFactory to specify resources for Tune."""
self