MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / compute_samples_hash

Function compute_samples_hash

common/train.cpp:364–374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362}
363
364size_t compute_samples_hash(const char* fn, const size_t* samples_begin, const size_t* samples_size, size_t sample_count) {
365 std::hash<std::string> h_string;
366 std::hash<unsigned long long> h_ull;
367 size_t h = h_string(std::string(fn));
368 h = hash_combine(h, h_ull((unsigned long long) sample_count));
369 for (size_t i=0; i< sample_count; ++i) {
370 h = hash_combine(h, h_ull((unsigned long long) samples_begin[i]));
371 h = hash_combine(h, h_ull((unsigned long long) samples_size[i]));
372 }
373 return h;
374}
375
376std::string replace_str(const char * s, const char * needle, const char * replacement) {
377 std::string str = s;

Callers 2

mainFunction · 0.85
mainFunction · 0.85

Calls 2

hash_combineFunction · 0.85
stringFunction · 0.50

Tested by

no test coverage detected