Skip to content

Commit 75a8646

Browse files
CosmosShadowsoumith
authored andcommitted
fix bug for THTensor data access
1 parent f5daa71 commit 75a8646

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/TH/generic/THTensorRandom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ void THTensor_(multinomialAliasSetup)(THTensor *probs, THLongTensor *J, THTensor
147147
THTensor_fastSet1d(J, small, large);
148148
q_data[large * q->stride[0]] -= 1.0 - THTensor_fastGet1d(q, small);
149149

150-
if(q_data[large] < 1.0)
150+
if(q_data[large * q->stride[0]] < 1.0)
151151
{
152152
THTensor_fastSet1d(smaller, small_c-1, large);
153153
large_c -= 1;

0 commit comments

Comments
 (0)