Skip to content

Commit d453160

Browse files
committed
modified random sample softmax
1 parent 006420c commit d453160

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ops/random_sample/cuda/random_sample.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ __global__ void softmax(
3434
int topk,
3535
float temperature, int voc) {
3636
float sum_s = 0.0f;
37-
for (int i = threadIdx.x; i < topk; i += BLOCK_DIM) {
37+
for (int i = threadIdx.x; i < voc; i += BLOCK_DIM) {
3838
sum_s += __expf(static_cast<float>(val_out[i] - val_out[0]) / temperature);
3939
}
4040
__shared__ float sum_inverse_total;

0 commit comments

Comments
 (0)