| 42 | }; |
| 43 | |
| 44 | Status CheckState(const Tensor& state) { |
| 45 | if (state.dtype() != STATE_ELEMENT_DTYPE) { |
| 46 | return errors::InvalidArgument("dtype of RNG state variable must be ", |
| 47 | DataTypeString(STATE_ELEMENT_DTYPE), |
| 48 | ", not ", DataTypeString(state.dtype())); |
| 49 | } |
| 50 | if (state.dims() != 1) { |
| 51 | return errors::InvalidArgument( |
| 52 | "RNG state must have one and only one dimension, not ", state.dims()); |
| 53 | } |
| 54 | return Status::OK(); |
| 55 | } |
| 56 | |
| 57 | Status CheckPhiloxState(const Tensor& state, int64 alg_tag_skip = 0) { |
| 58 | static_assert(std::is_same<StateElementType, int64>::value, |
no test coverage detected