| 72 | normal0 = radius * std::sin(angle); |
| 73 | normal1 = radius * std::cos(angle); |
| 74 | } |
| 75 | |
| 76 | float 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 |
no test coverage detected