File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -64,12 +64,12 @@ void initialize_parameters() {
6464 vector_size ++ ; // Temporarily increment to allocate space for bias
6565
6666 /* Allocate space for word vectors and context word vectors, and correspodning gradsq */
67- a = posix_memalign ((void * * )& W , 128 , 2 * vocab_size * vector_size * sizeof (real )); // Might perform better than malloc
67+ a = posix_memalign ((void * * )& W , 128 , 2 * vocab_size * ( vector_size + 1 ) * sizeof (real )); // Might perform better than malloc
6868 if (W == NULL ) {
6969 fprintf (stderr , "Error allocating memory for W\n" );
7070 exit (1 );
7171 }
72- a = posix_memalign ((void * * )& gradsq , 128 , 2 * vocab_size * vector_size * sizeof (real )); // Might perform better than malloc
72+ a = posix_memalign ((void * * )& gradsq , 128 , 2 * vocab_size * ( vector_size + 1 ) * sizeof (real )); // Might perform better than malloc
7373 if (gradsq == NULL ) {
7474 fprintf (stderr , "Error allocating memory for gradsq\n" );
7575 exit (1 );
You can’t perform that action at this time.
0 commit comments