Skip to content

Commit

Permalink
Update softmax.cu
Browse files Browse the repository at this point in the history
  • Loading branch information
linjames0 authored Sep 20, 2023
1 parent 7fdb167 commit 6f5173b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions softmax.cu
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ __global__ void softmax(float *d_in, float *d_out, float *expArr, float *redArr,
}

// calculate e^(x) / sum(e^(x)) = softmax
if(col == 0) {
float sum = redArr[0];
for(int i = 0; i < N; ++i) {
if(col == 0) {
float sum = redArr[0];
for(int i = 0; i < N; ++i) {
d_out[i] = expArr[i] / sum;
}
}
Expand Down

0 comments on commit 6f5173b

Please sign in to comment.