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

Function CheckState

tensorflow/core/kernels/stateful_random_ops.cc:44–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42};
43
44Status 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
57Status CheckPhiloxState(const Tensor& state, int64 alg_tag_skip = 0) {
58 static_assert(std::is_same<StateElementType, int64>::value,

Callers 2

UpdateVariableAndFillFunction · 0.85
ComputeMethod · 0.85

Calls 4

InvalidArgumentFunction · 0.85
DataTypeStringFunction · 0.50
dtypeMethod · 0.45
dimsMethod · 0.45

Tested by

no test coverage detected