Skip to content

Commit

Permalink
address #171
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Nov 8, 2024
1 parent 8cbdfb4 commit cd35a68
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "vector-quantize-pytorch"
version = "1.19.1"
version = "1.19.2"
description = "Vector Quantization - Pytorch"
authors = [
{ name = "Phil Wang", email = "[email protected]" }
Expand Down
4 changes: 2 additions & 2 deletions vector_quantize_pytorch/residual_fsq.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def round_up_multiple(num, mult):
def is_distributed():
return dist.is_initialized() and dist.get_world_size() > 1

def get_maybe_sync_seed(max_size = 10_000):
rand_int = torch.randint(0, max_size, ())
def get_maybe_sync_seed(device, max_size = 10_000):
rand_int = torch.randint(0, max_size, (), device = device)

if is_distributed():
dist.all_reduce(rand_int)
Expand Down

0 comments on commit cd35a68

Please sign in to comment.