Skip to content

Commit ab44bb9

Browse files
committed
fix a "Tensor need to be contiguous" error in nccl distributed training
1 parent 970d416 commit ab44bb9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
setup(
44
name = 'vector_quantize_pytorch',
55
packages = find_packages(),
6-
version = '0.10.3',
6+
version = '0.10.4',
77
license='MIT',
88
description = 'Vector Quantization - Pytorch',
99
long_description_content_type = 'text/markdown',

vector_quantize_pytorch/vector_quantize_pytorch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ def forward(self, x):
295295
ema_inplace(self.cluster_size, cluster_size, self.decay)
296296

297297
embed_sum = einsum('h n d, h n c -> h c d', flatten, embed_onehot)
298-
self.all_reduce_fn(embed_sum)
298+
self.all_reduce_fn(embed_sum.contiguous())
299299

300300
cluster_size = laplace_smoothing(self.cluster_size, self.codebook_size, self.eps) * self.cluster_size.sum()
301301

0 commit comments

Comments
 (0)