Skip to content

Commit

Permalink
Apply comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DoumanAsh committed Dec 1, 2018
1 parent f9d1d38 commit 091287c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/rnn/mikolov_rnn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,25 +182,25 @@ Status MikolovModelReader::parse() {
data_->alloc = data_->memmgr.value().core();
auto& alloc = data_->alloc;

const auto embedding_size = static_cast<size_t>(hdr.layerSize) * static_cast<size_t>(hdr.vocabSize);
const auto matrix_size = static_cast<size_t>(hdr.layerSize) * static_cast<size_t>(hdr.layerSize);
const auto embedding_matrix_size = static_cast<size_t>(hdr.layerSize) * static_cast<size_t>(hdr.vocabSize);
const auto transition_matrix_size = static_cast<size_t>(hdr.layerSize) * static_cast<size_t>(hdr.layerSize);

data_->embeddingData =
alloc->allocateBuf<float>(embedding_size, 64);
alloc->allocateBuf<float>(embedding_matrix_size, 64);
data_->nceEmbeddingData =
alloc->allocateBuf<float>(embedding_size, 64);
alloc->allocateBuf<float>(embedding_matrix_size, 64);
data_->matrixData =
alloc->allocateBuf<float>(matrix_size, 64);
alloc->allocateBuf<float>(transition_matrix_size, 64);
data_->maxentWeightData = alloc->allocateBuf<float>(static_cast<size_t>(hdr.maxentSize), 64);

JPP_RIE_MSG(copyArray(contents, data_->embeddingData,
embedding_size, &start),
embedding_matrix_size, &start),
"embeds");
JPP_RIE_MSG(copyArray(contents, data_->nceEmbeddingData,
embedding_size, &start),
embedding_matrix_size, &start),
"nce embeds");
JPP_RIE_MSG(copyArray(contents, data_->matrixData,
matrix_size, &start),
transition_matrix_size, &start),
"matrix");
JPP_RIE_MSG(
copyArray(contents, data_->maxentWeightData, static_cast<size_t>(hdr.maxentSize), &start),
Expand Down Expand Up @@ -249,4 +249,4 @@ StringPiece MikolovRnn::maxentWeightsAsStringpiece() const {

} // namespace mikolov
} // namespace rnn
} // namespace jumanpp
} // namespace jumanpp

0 comments on commit 091287c

Please sign in to comment.