range must be positive; each value would be negated with prob 0.5
| 139 | |
| 140 | //! range must be positive; each value would be negated with prob 0.5 |
| 141 | class UniformIntNonZeroRNG : public UniformIntRNG { |
| 142 | std::uniform_int_distribution<dt_int32> m_dist_flip{0, 1}; |
| 143 | |
| 144 | public: |
| 145 | UniformIntNonZeroRNG(int a, int b) : UniformIntRNG(a, b) { |
| 146 | megdnn_assert(a > 0 && b > a); |
| 147 | } |
| 148 | |
| 149 | dt_float32 gen_single_val() override; |
| 150 | }; |
| 151 | |
| 152 | class UniformFloatRNG : public IIDRNG { |
| 153 | public: |