| 81 | : AnonymousResourceOp<RandomSeedGenerator>(ctx) {} |
| 82 | |
| 83 | void AnonymousRandomSeedGeneratorHandleOp::Compute(OpKernelContext* ctx) { |
| 84 | int64 seed; |
| 85 | OP_REQUIRES_OK(ctx, ParseScalarArgument<int64>(ctx, kSeed, &seed)); |
| 86 | int64 seed2; |
| 87 | OP_REQUIRES_OK(ctx, ParseScalarArgument<int64>(ctx, kSeed2, &seed2)); |
| 88 | if (seed == 0 && seed2 == 0) { |
| 89 | seed = random::New64(); |
| 90 | seed2 = random::New64(); |
| 91 | } |
| 92 | seed_ = seed; |
| 93 | seed2_ = seed2; |
| 94 | AnonymousResourceOp<RandomSeedGenerator>::Compute(ctx); |
| 95 | } |
| 96 | |
| 97 | string AnonymousRandomSeedGeneratorHandleOp::name() { |
| 98 | return kRandomSeedGenerator; |