rllib/agents/trainer_config.py
def framework(
        self,
        framework: Optional[str] = None,
        *,
        eager_tracing: Optional[bool] = None,
        eager_max_retraces: Optional[int] = None,
        tf_session_args: Optional[Dict[str, Any]] = None,
        local_tf_session_args: Optional[Dict[str, Any]] = None,
    ) -> "TrainerConfig":
        """Sets the config's DL framework settings.

        Args:
            framework: tf: TensorFlow (static-graph); tf2: TensorFlow 2.x
                (eager or traced, if eager_tracing=True); torch: PyTorch
            eager_tracing: Enable tracing in eager mode. This greatly improves
                performance (speedup ~2x), but makes it slightly harder to debug
                since Python code won't be evaluated after the initial eager pass.
                Only possible if framework=tf2.
            eager_max_retraces: Maximum number of tf.function re-traces before a
                runtime error is raised. This is to prevent unnoticed retraces of
                methods inside the `..._eager_traced` Policy, which could slow down
                execution by a factor of 4, without the user noticing what the root
                cause for this slowdown could be.
                Only necessary for framework=[tf2|tfe].
                Set to None to ignore the re-trace count and never throw an error.
            tf_session_args: Configures TF for single-process operation by default.
            local_tf_session_args: Override the following tf session args on the local
                worker

        Returns:
            This updated TrainerConfig object.
        """
        if framework is not None:
            self.framework_str = framework
        if eager_tracing is not None:
            self.eager_tracing = eager_tracing
        if eager_max_retraces is not None:
            self.eager_max_retraces = eager_max_retraces
        if tf_session_args is not None:
            self.tf_session_args = tf_session_args
        if local_tf_session_args is not None:
            self.local_tf_session_args = local_tf_session_args

        return self
Sets the config's DL framework settings.

        Args:
            framework: tf: TensorFlow (static-graph); tf2: TensorFlow 2.x
                (eager or traced, if eager_tracing=True); torch: PyTorch
            eager_tracing: Enable tracing in eager mode. This greatly improves
                performance (speedup ~2x), but makes it slightly harder to debug
                since Python code won't be evaluated after the initial eager pass.
                Only possible if framework=tf2.
            eager_max_retraces: Maximum number of tf.function re-traces before a
                runtime error is raised. This is to prevent unnoticed retraces of
                methods inside the `..._eager_traced` Policy, which could slow down
                execution by a factor of 4, without the user noticing what the root
                cause for this slowdown could be.
                Only necessary for framework=[tf2|tfe].
                Set to None to ignore the re-trace count and never throw an error.
            tf_session_args: Configures TF for single-process operation by default.
            local_tf_session_args: Override the following tf session args on the local
                worker

        Returns:
            This updated TrainerConfig object.
        
Sets the config's DL framework settings.
Sets the config ' s DL framework settings .
def framework(
        self,
        framework: Optional[str] = None,
        *,
        eager_tracing: Optional[bool] = None,
        eager_max_retraces: Optional[int] = None,
        tf_session_args: Optional[Dict[str, Any]] = None,
        local_tf_session_args: Optional[Dict[str, Any]] = None,
    ) -> "TrainerConfig":
        if framework is not None:
            self.framework_str = framework
        if eager_tracing is not None:
            self.eager_tracing = eager_tracing
        if eager_max_retraces is not None:
            self.eager_max_retraces = eager_max_retraces
        if tf_session_args is not None:
            self.tf_session_args = tf_session_args
        if local_tf_session_args is not None:
            self.local_tf_session_args = local_tf_session_args
        return self
def framework ( self , framework : Optional [ str ] = None , * , eager_tracing : Optional [ bool ] = None , eager_max_retraces : Optional [ int ] = None , tf_session_args : Optional [ Dict [ str , Any ] ] = None , local_tf_session_args : Optional [ Dict [ str , Any ] ] = None , ) -> "TrainerConfig" : if framework is not None : self . framework_str = framework if eager_tracing is not None : self . eager_tracing = eager_tracing if eager_max_retraces is not None : self . eager_max_retraces = eager_max_retraces if tf_session_args is not None : self . tf_session_args = tf_session_args if local_tf_session_args is not None : self . local_tf_session_args = local_tf_session_args return self
Sets the config's DL framework settings.
Sets the config ' s DL framework settings .
"""Sets the config's DL framework settings.

        Args:
            framework: tf: TensorFlow (static-graph); tf2: TensorFlow 2.x
                (eager or traced, if eager_tracing=True); torch: PyTorch
            eager_tracing: Enable tracing in eager mode. This greatly improves
                performance (speedup ~2x), but makes it slightly harder to debug
                since Python code won't be evaluated after the initial eager pass.
                Only possible if framework=tf2.
            eager_max_retraces: Maximum number of tf.function re-traces before a
                runtime error is raised. This is to prevent unnoticed retraces of
                methods inside the `..._eager_traced` Policy, which could slow down
                execution by a factor of 4, without the user noticing what the root
                cause for this slowdown could be.
                Only necessary for framework=[tf2|tfe].
                Set to None to ignore the re-trace count and never throw an error.
            tf_session_args: Configures TF for single-process operation by default.
            local_tf_session_args: Override the following tf session args on the local
                worker

        Returns:
            This updated TrainerConfig object.
        """
This updated TrainerConfig object.
This updated TrainerConfig object .
self
framework
Optional[str]
TensorFlow (static-graph); tf2: TensorFlow 2.x
(eager or traced, if eager_tracing=True); torch: PyTorch
TensorFlow ( static - graph ) ; tf2 : TensorFlow 2 . x ( eager or traced if eager_tracing = True ) ; torch : PyTorch
eager_tracing
Optional[bool]
Enable tracing in eager mode. This greatly improves
performance (speedup ~2x), but makes it slightly harder to debug
since Python code won't be evaluated after the initial eager pass.
Only possible if framework=tf2.
Enable tracing in eager mode . This greatly improves performance ( speedup ~2x ) but makes it slightly harder to debug since Python code won ' t be evaluated after the initial eager pass . Only possible if framework = tf2 .
eager_max_retraces
Optional[int]
Maximum number of tf.function re-traces before a
runtime error is raised. This is to prevent unnoticed retraces of
methods inside the `..._eager_traced` Policy, which could slow down
execution by a factor of 4, without the user noticing what the root
cause for this slowdown could be.
Only necessary for framework=[tf2|tfe].
Set to None to ignore the re-trace count and never throw an error.
Maximum number of tf . function re - traces before a runtime error is raised . This is to prevent unnoticed retraces of methods inside the ` ... _eager_traced ` Policy which could slow down execution by a factor of 4 without the user noticing what the root cause for this slowdown could be . Only necessary for framework = [ tf2|tfe ] . Set to None to ignore the re - trace count and never throw an error .
tf_session_args
Optional[Dict[str, Any]]
Configures TF for single-process operation by default.
Configures TF for single - process operation by default .
local_tf_session_args
Optional[Dict[str, Any]]
Override the following tf session args on the local
worker
Override the following tf session args on the local worker