Skip to content

Commit fea8f22

Browse files
committed
add an assert
1 parent 221d3df commit fea8f22

File tree

2 files changed

+3
-1
lines changed

2 files changed

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

vector_quantize_pytorch/vector_quantize_pytorch.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ def sample_multinomial(total_count, probs):
146146
total_count -= s
147147
remainder -= p
148148

149+
assert total_count == 0, f'invalid total count {total_count}'
150+
149151
return sample.to(device)
150152

151153
def all_gather_sizes(x, dim):

0 commit comments

Comments
 (0)