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

Function UniformIntDistribution

tensorflow/compiler/xla/client/lib/prng.cc:496–513  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

494}
495
496RngOutput UniformIntDistribution(XlaOp key, XlaOp initial_state,
497 BitGeneratorTy bit_generator, XlaOp minval,
498 XlaOp maxval, const Shape& shape) {
499 RngOutput bits_state = bit_generator(key, initial_state, shape);
500 XlaOp bits = bits_state.value;
501 XlaOp new_state = bits_state.state;
502 PrimitiveType type = shape.element_type();
503 PrimitiveType unsigned_type;
504 if (type == U32 || type == S32) {
505 unsigned_type = U32;
506 } else {
507 DCHECK(type == U64 || type == S64);
508 unsigned_type = U64;
509 }
510 return {
511 ConvertRandomBitsToUniformInt(bits, minval, maxval, type, unsigned_type),
512 new_state};
513}
514
515RngOutput NormalFloatingPointDistribution(XlaOp key, XlaOp initial_state,
516 BitGeneratorTy bit_generator,

Callers 3

StatefulRngUniformFunction · 0.85
StatelessRngUniformFunction · 0.85
GetComputationForRngFunction · 0.85

Calls 2

element_typeMethod · 0.45

Tested by

no test coverage detected