Skip to content

Commit 7f661e9

Browse files
authored
Fix random compressor
1 parent 7417fc3 commit 7f661e9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

nda/optimizers/compressor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ def random(x, a):
3232
return x
3333
if x.ndim == 2:
3434
for i in range(x.shape[1]):
35-
zero_mask = xp.random.choice(dim, a, replace=False)
35+
zero_mask = xp.random.choice(dim, dim - a, replace=False)
3636
x[zero_mask, i] = 0
3737
else:
38-
zero_mask = xp.random.choice(dim, a, replace=False)
38+
zero_mask = xp.random.choice(dim, dim - a, replace=False)
3939
x[zero_mask] = 0
4040
return x
4141

0 commit comments

Comments
 (0)