MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / make_keep_mask_for_test

Function make_keep_mask_for_test

tests/unittests/test_encoder_modules.cpp:182–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180 return values;
181}
182
183std::vector<float> make_global_attention_bias_for_test(int64_t frames, int64_t valid_frames) {
184 std::vector<float> mask(static_cast<size_t>(frames * frames), -std::numeric_limits<float>::infinity());
185 for (int64_t q = 0; q < valid_frames; ++q) {
186 for (int64_t k = 0; k < valid_frames; ++k) {
187 mask[static_cast<size_t>(q * frames + k)] = 0.0f;
188 }
189 }
190 for (int64_t q = valid_frames; q < frames; ++q) {
191 mask[static_cast<size_t>(q * frames + q)] = 0.0f;

Calls

no outgoing calls

Tested by

no test coverage detected