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