MCPcopy Create free account
hub / github.com/Tencent/embedx / Init

Method Init

src/sampler/sampling/word2vec_sampling.cc:130–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130bool Word2vecSampling::Init(const vec_float_t& freqs) {
131 if (freqs.empty()) {
132 DXERROR("Frequency tables are empty!");
133 return false;
134 }
135 Clear();
136 return table_.Init(freqs);
137}
138
139std::unique_ptr<Sampling> NewWord2vecSampling(const vec_float_t* probs) {
140 return Word2vecSampling::Create(*probs);

Callers 1

CreateMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected