Skip to content

Commit 2ac386d

Browse files
authored
Revert PCG Generator for FusedRandom temporarily (#1958)
1 parent b142af8 commit 2ac386d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

itex/core/kernels/cpu/fused_random_op.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ typedef Eigen::ThreadPoolDevice CPUDevice;
3030
template <typename Device, typename T>
3131
class FusedRandomOp : public OpKernel {
3232
public:
33-
typedef random::UniformDistribution<random::PCGRandom, T> Uniform;
33+
typedef random::UniformDistribution<random::PhiloxRandom, T> Uniform;
3434
explicit FusedRandomOp(OpKernelConstruction* ctx) : OpKernel(ctx) {
3535
OP_REQUIRES_OK(ctx, generator_.Init(ctx));
3636
OP_REQUIRES_OK(ctx, ctx->GetAttr("direction", &direction_));
@@ -69,17 +69,17 @@ class FusedRandomOp : public OpKernel {
6969
OP_REQUIRES(ctx, dims == 0,
7070
errors::InvalidArgument("Only support compare dim is 0 "));
7171
// TODO(yifeng): To support binary operations other than GreaterEqual.
72-
functor::FillPCGRandom<CPUDevice, Uniform>()(
72+
functor::FillPhiloxRandom<CPUDevice, Uniform>()(
7373
ctx, ctx->eigen_device<CPUDevice>(),
7474
// Multiplier 256 is the same as in FillRandomTask; do not change it
7575
// just here.
7676
generator_.ReserveRandomOutputs(output_flat.size(), 256),
77-
output_flat.data(), output_flat.size(), Uniform(),
77+
output_flat.data(), output_flat.size(), Uniform(), nullptr, nullptr,
7878
compare.flat<T>().data());
7979
}
8080

8181
private:
82-
GuardedPCGRandom generator_;
82+
GuardedPhiloxRandom generator_;
8383
int direction_ = 0;
8484
std::vector<string> fused_ops_;
8585
};

0 commit comments

Comments
 (0)