Update `print` doc (#18053)

This commit is contained in:
Carlos Mocholí 2023-07-13 13:10:07 +02:00 committed by GitHub
parent 3a55f0c0a1
commit 234a78a957
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -476,7 +476,8 @@ class Fabric:
return move_data_to_device(obj, device=self.device)
def print(self, *args: Any, **kwargs: Any) -> None:
"""Print something only on the first process.
"""Print something only on the first process. If running on multiple machines, it will print from the first
process in each machine.
Arguments passed to this method are forwarded to the Python built-in :func:`print` function.
"""

View File

@ -1069,9 +1069,8 @@ class Trainer:
self.profiler.setup(stage=self.state.fn, local_rank=local_rank, log_dir=self.log_dir)
def print(self, *args: Any, **kwargs: Any) -> None:
"""Print the arguments to standard output. When running on multiple devices on a single node, this method
will only print from one process to avoid redundant outputs. When running across multiple nodes, this
method will print from one process in each node.
"""Print something only on the first process. If running on multiple machines, it will print from the first
process in each machine.
Arguments passed to this method are forwarded to the Python built-in :func:`print` function.
"""