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

Function torch_cuda_randn_element

src/framework/sampling/torch_random.cpp:74–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72 normal0 = radius * std::sin(angle);
73 normal1 = radius * std::cos(angle);
74}
75
76float torch_cuda_randn_element(uint64_t seed, uint64_t index) {
77 const Philox4 counter{
78 0U,
79 0U,
80 static_cast<uint32_t>(index),
81 static_cast<uint32_t>(index >> 32U),
82 };
83 const Philox4 random = philox_4x32_10(counter, seed);
84 float normal0 = 0.0F;
85 float normal1 = 0.0F;
86 box_muller(random.x, random.y, normal0, normal1);
87 return normal0;
88}
89

Callers 1

fill_torch_cuda_randnFunction · 0.85

Calls 2

philox_4x32_10Function · 0.85
box_mullerFunction · 0.85

Tested by

no test coverage detected