init vector

This commit is contained in:
Hieu Hoang 2021-06-15 18:08:45 -07:00
parent 6981b21f4e
commit 395a4f94d0
3 changed files with 3 additions and 3 deletions

View File

@ -265,7 +265,7 @@ void FactoredVocab::constructGroupInfoFromFactorVocab() {
}
// determine group index ranges
groupRanges_.resize(numGroups, { SIZE_MAX, (size_t)0 });
std::vector<int> groupCounts(numGroups); // number of group members
std::vector<int> groupCounts(numGroups, 0); // number of group members
for (WordIndex u = 0; u < factorVocabSize; u++) { // determine ranges; these must be non-overlapping, verified via groupCounts
auto g = factorGroups_[u];
if (groupRanges_[g].first > u)

View File

@ -83,7 +83,7 @@ Ptr<faiss::IndexLSH> LSHShortlist::index_;
LSHShortlist::LSHShortlist(int k, int nbits, size_t lemmaSize)
: Shortlist(std::vector<WordIndex>())
, k_(k), nbits_(nbits), lemmaSize_(lemmaSize) {
//std::cerr << "LSHShortlist" << std::endl;
std::cerr << "LSHShortlist lemmaSize_=" << lemmaSize_ << std::endl;
/*
for (int i = 0; i < k_; ++i) {
indices_.push_back(i);

View File

@ -184,7 +184,7 @@ void ProdBatched(marian::Tensor C,
// This loop initializes the array pointers in the same way as the for loop
// in the normal sgemm version a few lines below
functional::Array<int, functional::Shape::size()> dims;
for(size_t i = 0; i < batchC; ++i) {
for(int i = 0; i < batchC; ++i) {
cShapeMetaF.dims(i, dims);
auto aIndex = aShapeMetaF.bindex(dims);
auto bIndex = bShapeMetaF.bindex(dims);