| 71 | } |
| 72 | |
| 73 | void Compute(OpKernelContext* ctx) override { |
| 74 | const Tensor& shape = ctx->input(0); |
| 75 | Tensor* output; |
| 76 | OP_REQUIRES_OK(ctx, AllocateOutputWithShape(ctx, shape, 0, &output)); |
| 77 | auto output_flat = output->flat<T>(); |
| 78 | functor::FillPhiloxRandom<Device, Distribution>()( |
| 79 | ctx, ctx->eigen_device<Device>(), |
| 80 | // Multiplier 256 is the same as in FillPhiloxRandomTask; do not change |
| 81 | // it just here. |
| 82 | generator_.ReserveRandomOutputs(output_flat.size(), 256), |
| 83 | output_flat.data(), output_flat.size(), Distribution()); |
| 84 | } |
| 85 | |
| 86 | private: |
| 87 | GuardedPhiloxRandom generator_; |
nothing calls this directly
no test coverage detected