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

Function fill_torch_cuda_randn

src/framework/sampling/torch_random.cpp:159–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159} // namespace
160
161void fill_torch_cuda_randn(
162 float * output,
163 size_t count,
164 uint64_t seed,
165 TorchRandnPrecision precision,
166 uint64_t start_index) {
167 if (output == nullptr && count != 0) {
168 throw std::invalid_argument("torch CUDA randn output pointer is null");
169 }
170 for (size_t index = 0; index < count; ++index) {
171 float value = torch_cuda_randn_element(seed, start_index + static_cast<uint64_t>(index));
172 if (precision == TorchRandnPrecision::BFloat16) {
173 value = round_to_bfloat16(value);
174 }
175 output[index] = value;
176 }
177}
178

Calls 2

torch_cuda_randn_elementFunction · 0.85
round_to_bfloat16Function · 0.85

Tested by 2