| 55 | } |
| 56 | |
| 57 | Status CheckPhiloxState(const Tensor& state, int64 alg_tag_skip = 0) { |
| 58 | static_assert(std::is_same<StateElementType, int64>::value, |
| 59 | "StateElementType must be int64"); |
| 60 | static_assert(std::is_same<PhiloxRandom::ResultElementType, uint32>::value, |
| 61 | "PhiloxRandom::ResultElementType must be uint32"); |
| 62 | if (state.NumElements() < alg_tag_skip + PHILOX_MIN_STATE_SIZE) { |
| 63 | return errors::InvalidArgument( |
| 64 | "For the Philox algorithm, the size of state" |
| 65 | " must be at least ", |
| 66 | alg_tag_skip + PHILOX_MIN_STATE_SIZE, "; got ", state.NumElements()); |
| 67 | } |
| 68 | return Status::OK(); |
| 69 | } |
| 70 | |
| 71 | template <typename Device, typename Distribution> |
| 72 | Status UpdateVariableAndFill( |
no test coverage detected