Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/loadwordemb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ VocabAndTensor load_glove(const char * filename){
dim = get_tokens_in_first_line(fp) - 1;
n_word = get_line_numbers(fp);

dest.resize_(torch::IntArrayRef{n_word, dim});
dest.resize_(torch::IntArrayRef{static_cast<long long>(n_word), static_cast<long long>(dim)});

char buf[512];
float * data = static_cast<float*>(dest.storage().data());
Expand Down Expand Up @@ -98,7 +98,7 @@ VocabAndTensor load_word2vec(const char * filename){
size_t dim, n_word;
fscanf(fp, "%zu %zu", &n_word, &dim);

dest.resize_(torch::IntArrayRef{n_word, dim});
dest.resize_(torch::IntArrayRef{static_cast<long long>(n_word), static_cast<long long>(dim)});

char buf[512];
float * data = static_cast<float*>(dest.storage().data());
Expand Down Expand Up @@ -136,7 +136,7 @@ VocabAndTensor load_word2vec_bin(const char * filename){
fscanf(fp, "%zu %zu\n", &n_word, &dim);
//printf("%zu %zu\n", n_word, dim );

dest.resize_(torch::IntArrayRef{n_word, dim});
dest.resize_(torch::IntArrayRef{static_cast<long long>(n_word), static_cast<long long>(dim)});

char buf[512];
float * data = static_cast<float*>(dest.storage().data());
Expand Down