MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CheckPhiloxState

Function CheckPhiloxState

tensorflow/core/kernels/stateful_random_ops.cc:57–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57Status 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
71template <typename Device, typename Distribution>
72Status UpdateVariableAndFill(

Callers 2

UpdateVariableAndFillFunction · 0.85
ComputeMethod · 0.85

Calls 2

InvalidArgumentFunction · 0.85
NumElementsMethod · 0.45

Tested by

no test coverage detected