MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / get_target_sample_len

Function get_target_sample_len

DeepSpeedExample/megatron/data/helpers.cpp:125–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123
124
125inline int32_t get_target_sample_len(const int32_t short_seq_ratio,
126 const int32_t max_length,
127 std::mt19937& rand32_gen) {
128 /* Training sample length. */
129 const auto random_number = rand32_gen();
130 if ((random_number % short_seq_ratio) == 0) {
131 return 2 + random_number % (max_length - 1);
132 }
133 return max_length;
134}
135
136
137template<typename DocIdx>

Callers 1

build_mapping_implFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected