Skip to content

Commit badfa3e

Browse files
committed
1 parent 8bb740e commit badfa3e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "vector-quantize-pytorch"
3-
version = "1.22.12"
3+
version = "1.22.14"
44
description = "Vector Quantization - Pytorch"
55
authors = [
66
{ name = "Phil Wang", email = "lucidrains@gmail.com" }

vector_quantize_pytorch/residual_fsq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def is_distributed():
3939
def get_maybe_sync_seed(device, max_size = 10_000):
4040
rand_int = torch.randint(0, max_size, (), device = device)
4141

42-
if is_distributed():
42+
if is_distributed() and torch.is_grad_enabled():
4343
dist.all_reduce(rand_int)
4444

4545
return rand_int.item()

vector_quantize_pytorch/residual_lfq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def is_distributed():
3434
def get_maybe_sync_seed(device, max_size = 10_000):
3535
rand_int = torch.randint(0, max_size, (), device = device)
3636

37-
if is_distributed():
37+
if is_distributed() and torch.is_grad_enabled():
3838
dist.all_reduce(rand_int)
3939

4040
return rand_int.item()

0 commit comments

Comments
 (0)