Skip to content

Commit c302cf3

Browse files
committed
address #159
1 parent 5930411 commit c302cf3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
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.17.1"
3+
version = "1.17.2"
44
description = "Vector Quantization - Pytorch"
55
authors = [
66
{ name = "Phil Wang", email = "lucidrains@gmail.com" }

vector_quantize_pytorch/lookup_free_quantization.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
from functools import partial, cache
1111
from collections import namedtuple
1212
from contextlib import nullcontext
13+
1314
import torch.distributed as dist
15+
from torch.distributed import nn as dist_nn
1416

1517
import torch
1618
from torch import nn, einsum
@@ -36,7 +38,7 @@ def maybe_distributed_mean(t):
3638
if not is_distributed():
3739
return t
3840

39-
dist.nn.all_reduce(t)
41+
dist_nn.all_reduce(t)
4042
t = t / dist.get_world_size()
4143
return t
4244

0 commit comments

Comments
 (0)