Merge pull request !39834 from jiaorui/cleancode-1.8
This commit is contained in:
i-robot 2022-08-08 03:30:21 +00:00 committed by Gitee
commit d0184c70ab
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 1 additions and 2 deletions

View File

@ -14,7 +14,6 @@
* limitations under the License.
*/
#include "plugin/device/cpu/kernel/eigen/random_poisson_cpu_kernel.h"
#include <ctime>
#include <random>
#include "Eigen/Core"
#include "unsupported/Eigen/CXX11/Tensor"
@ -123,7 +122,7 @@ template <typename T>
class PoissonRandomGenerator {
public:
// Uses the given "seed" if non-zero, otherwise uses a random seed.
PoissonRandomGenerator(double rate, uint64_t seed) : m_rate(rate) { m_state = PCG_XSH_RS_state(seed); }
PoissonRandomGenerator(double rate, uint64_t seed) : m_rate(rate), m_state(PCG_XSH_RS_state(seed)) {}
void setRate(double rate) { m_rate = rate; }
T gen() const {
T result = RandomToTypePoisson<T>(&m_state, m_stream, m_rate);