rllib/agents/trainer_config.py
def build(
        self,
        env: Optional[Union[str, EnvType]] = None,
        logger_creator: Optional[Callable[[], Logger]] = None,
    ) -> "Trainer":
        """Builds a Trainer from the TrainerConfig.

        Args:
            env: Name of the environment to use (e.g. a gym-registered str),
                a full class path (e.g.
                "ray.rllib.examples.env.random_env.RandomEnv"), or an Env
                class directly. Note that this arg can also be specified via
                the "env" key in `config`.
            logger_creator: Callable that creates a ray.tune.Logger
                object. If unspecified, a default logger is created.

        Returns:
            A ray.rllib.agents.trainer.Trainer object.
        """
        if env is not None:
            self.env = env
            if self.evaluation_config is not None:
                self.evaluation_config["env"] = env

        return self.trainer_class(
            config=self.to_dict(),
            env=env,
            logger_creator=logger_creator,
        )
Builds a Trainer from the TrainerConfig.

        Args:
            env: Name of the environment to use (e.g. a gym-registered str),
                a full class path (e.g.
                "ray.rllib.examples.env.random_env.RandomEnv"), or an Env
                class directly. Note that this arg can also be specified via
                the "env" key in `config`.
            logger_creator: Callable that creates a ray.tune.Logger
                object. If unspecified, a default logger is created.

        Returns:
            A ray.rllib.agents.trainer.Trainer object.
        
Builds a Trainer from the TrainerConfig.
Builds a Trainer from the TrainerConfig .
def build(
        self,
        env: Optional[Union[str, EnvType]] = None,
        logger_creator: Optional[Callable[[], Logger]] = None,
    ) -> "Trainer":
        if env is not None:
            self.env = env
            if self.evaluation_config is not None:
                self.evaluation_config["env"] = env
        return self.trainer_class(
            config=self.to_dict(),
            env=env,
            logger_creator=logger_creator,
        )
def build ( self , env : Optional [ Union [ str , EnvType ] ] = None , logger_creator : Optional [ Callable [ [ ] , Logger ] ] = None , ) -> "Trainer" : if env is not None : self . env = env if self . evaluation_config is not None : self . evaluation_config [ "env" ] = env return self . trainer_class ( config = self . to_dict ( ) , env = env , logger_creator = logger_creator , )
Builds a Trainer from the TrainerConfig.
Builds a Trainer from the TrainerConfig .
"""Builds a Trainer from the TrainerConfig.

        Args:
            env: Name of the environment to use (e.g. a gym-registered str),
                a full class path (e.g.
                "ray.rllib.examples.env.random_env.RandomEnv"), or an Env
                class directly. Note that this arg can also be specified via
                the "env" key in `config`.
            logger_creator: Callable that creates a ray.tune.Logger
                object. If unspecified, a default logger is created.

        Returns:
            A ray.rllib.agents.trainer.Trainer object.
        """
A ray.rllib.agents.trainer.Trainer object.
A ray . rllib . agents . trainer . Trainer object .
self
env
Optional[Union[str, EnvType]]
Name of the environment to use ,
a full class path , or an Env
class directly. Note that this arg can also be specified via
the "env" key in `config`.
Name of the environment to use a full class path or an Env class directly . Note that this arg can also be specified via the " env " key in ` config ` .
logger_creator
Optional[Callable[[], Logger]]
Callable that creates a ray.tune.Logger
object. If unspecified, a default logger is created.
Callable that creates a ray . tune . Logger object . If unspecified a default logger is created .