class_docstr: Base class for RLlib TensorFlow RLModules.
class_docstr_tok: ["Base","class","for","RLlib","TensorFlow","RLModules","."]
docstr: Saves the weights of this RLModule to the directory dir.
  
  Args:
      dir: The directory to save the checkpoint to.
  
  NOTE: For this TfRLModule, we save the weights in the TF checkpoint
      format, so the file name should have no ending and should be a plain string.
      e.g. "my_checkpoint" instead of "my_checkpoint.h5". This method of
      checkpointing saves the module weights as multiple files, so we recommend
      passing a file path relative to a directory, e.g.
      "my_checkpoint/module_state".
docstr_tok: ["Saves","the","weights","of","this","RLModule","to","the","directory","dir",".","Args",":","dir",":","The","directory","to","save","the","checkpoint","to",".","NOTE",":","For","this","TfRLModule",",","we","save","the","weights","in","the","TF","checkpoint","format",",","so","the","file","name","should","have","no","ending","and","should","be","a","plain","string",".","e.g",".","``","my_checkpoint","''","instead","of","``","my_checkpoint.h5","''",".","This","method","of","checkpointing","saves","the","module","weights","as","multiple","files",",","so","we","recommend","passing","a","file","path","relative","to","a","directory",",","e.g",".","``","my_checkpoint\/module_state","''","."]
code: def save_state(self, dir: Union[str, pathlib.Path]) -> None:
      """Saves the weights of this RLModule to the directory dir.
  
      Args:
          dir: The directory to save the checkpoint to.
  
      NOTE: For this TfRLModule, we save the weights in the TF checkpoint
          format, so the file name should have no ending and should be a plain string.
          e.g. "my_checkpoint" instead of "my_checkpoint.h5". This method of
          checkpointing saves the module weights as multiple files, so we recommend
          passing a file path relative to a directory, e.g.
          "my_checkpoint/module_state".
  
      """
      path = str(pathlib.Path(dir) / self._module_state_file_name())
      self.save_weights(path, save_format="tf")
  
file_path: ray/rllib/core/rl_module/tf/tf_rl_module.py
imports: import pathlib
  from typing import Any, Mapping, Union
  from ray.rllib.core.rl_module import RLModule
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.framework import try_import_tf
label_desc: Use image node_id 6 for calling the TfRLModule obj's underlying member method code with example usage: obj.save_state(dir) without return types