oneflow.save

oneflow.save(obj: Any, path_or_buffer: Union[os.PathLike, BinaryIO, IO[bytes], pathlib.Path], global_dst_rank: Optional[int] = None, save_as_external_data: bool = False)None

Save an object to a directory.

Parameters
  • obj – The object to be saved

  • path_or_buffer – a file-like object (has to implement write and flush) or a string or os.PathLike object containing a file name

  • global_dst_rank (int, optional) – The destination rank for saving global tensors. When specified, whole tensors will be saved by the process whose rank == global_src_rank, while other processes will not do any disk I/O.

  • save_as_external_data (bool) – useful only if path_or_buffer is a string or os.PathLike object containing a file name