Skip to content

Commit

Permalink
[c10d Store] Store Python Docs Fixes (#49130)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #49130

The Python Store API docs had some typos, where boolean value were
lower case, which is incorrect Python syntax. This diff fixes those typos.

Test Plan: Built and Rendered Docs

Reviewed By: mrshenli

Differential Revision: D25411492

fbshipit-source-id: fdbf1e6b8f81e9589e638286946cad68eb7c9252
  • Loading branch information
osalpekar authored and facebook-github-bot committed Dec 16, 2020
1 parent 4b3f05a commit 09c7418
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions torch/csrc/distributed/c10d/init.cpp
Expand Up @@ -383,7 +383,7 @@ value with the new supplied ``value``.
Example::
>>> import torch.distributed as dist
>>> store = dist.TCPStore("127.0.0.1", 0, true, timedelta(seconds=30))
>>> store = dist.TCPStore("127.0.0.1", 0, True, timedelta(seconds=30))
>>> store.set("first_key", "first_value")
>>> # Should return "first_value"
>>> store.get("first_key")
Expand Down Expand Up @@ -411,7 +411,7 @@ when initializing the store, before throwing an exception.
Example::
>>> import torch.distributed as dist
>>> store = dist.TCPStore("127.0.0.1", 0, true, timedelta(seconds=30))
>>> store = dist.TCPStore("127.0.0.1", 0, True, timedelta(seconds=30))
>>> store.set("first_key", "first_value")
>>> # Should return "first_value"
>>> store.get("first_key")
Expand All @@ -435,7 +435,7 @@ in an exception.
Example::
>>> import torch.distributed as dist
>>> # Using TCPStore as an example, other store types can also be used
>>> store = dist.TCPStore("127.0.0.1", 0, true, timedelta(seconds=30))
>>> store = dist.TCPStore("127.0.0.1", 0, True, timedelta(seconds=30))
>>> store.add("first_key", 1)
>>> store.add("first_key", 6)
>>> # Should return 7
Expand All @@ -457,12 +457,12 @@ Deletes the key-value pair associated with ``key`` from the store. Returns
key (str): The key to be deleted from the store
Returns:
`true` if ``key`` was deleted, otherwise `false`.
`True` if ``key`` was deleted, otherwise `False`.
Example::
>>> import torch.distributed as dist
>>> # Using TCPStore as an example, HashStore can also be used
>>> store = dist.TCPStore("127.0.0.1", 0, true, timedelta(seconds=30))
>>> store = dist.TCPStore("127.0.0.1", 0, True, timedelta(seconds=30))
>>> store.set("first_key")
>>> # This should return true
>>> store.delete_key("first_key")
Expand All @@ -489,7 +489,7 @@ the workers using the store.
Example::
>>> import torch.distributed as dist
>>> # Using TCPStore as an example, HashStore can also be used
>>> store = dist.TCPStore("127.0.0.1", 0, true, timedelta(seconds=30))
>>> store = dist.TCPStore("127.0.0.1", 0, True, timedelta(seconds=30))
>>> store.set("first_key", "first_value")
>>> # This should return 2
>>> store.num_keys()
Expand All @@ -508,7 +508,7 @@ Sets the store's default timeout. This timeout is used during initialization and
Example::
>>> import torch.distributed as dist
>>> # Using TCPStore as an example, other store types can also be used
>>> store = dist.TCPStore("127.0.0.1", 0, true, timedelta(seconds=30))
>>> store = dist.TCPStore("127.0.0.1", 0, True, timedelta(seconds=30))
>>> store.set_timeout(timedelta(seconds=10))
>>> # This will throw an exception after 10 seconds
>>> store.wait(["bad_key"])
Expand All @@ -530,7 +530,7 @@ will throw an exception.
Example::
>>> import torch.distributed as dist
>>> # Using TCPStore as an example, other store types can also be used
>>> store = dist.TCPStore("127.0.0.1", 0, true, timedelta(seconds=30))
>>> store = dist.TCPStore("127.0.0.1", 0, True, timedelta(seconds=30))
>>> # This will throw an exception after 30 seconds
>>> store.wait(["bad_key"])
)")
Expand All @@ -553,7 +553,7 @@ if the keys have not been set by the supplied ``timeout``.
Example::
>>> import torch.distributed as dist
>>> # Using TCPStore as an example, other store types can also be used
>>> store = dist.TCPStore("127.0.0.1", 0, true, timedelta(seconds=30))
>>> store = dist.TCPStore("127.0.0.1", 0, True, timedelta(seconds=30))
>>> # This will throw an exception after 10 seconds
>>> store.wait(["bad_key"], timedelta(seconds=10))
)");
Expand Down Expand Up @@ -618,8 +618,8 @@ pair, :meth:`~torch.distributed.store.get` to retrieve a key-value pair, etc.
Example::
>>> import torch.distributed as dist
>>> server_store = dist.TCPStore("127.0.0.1", 0, true, timedelta(seconds=30))
>>> client_store = dist.TCPStore("127.0.0.1", 0, false)
>>> server_store = dist.TCPStore("127.0.0.1", 0, True, timedelta(seconds=30))
>>> client_store = dist.TCPStore("127.0.0.1", 0, False)
>>> # Use any of the store methods from either the client or server after initialization
>>> server_store.set("first_key", "first_value")
>>> client_store.get("first_key")
Expand Down

0 comments on commit 09c7418

Please sign in to comment.