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

Function PhiloxBitGenerator

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

Source from the content-addressed store, hash-verified

455}
456
457RngOutput PhiloxBitGenerator(XlaOp key, XlaOp initial_state,
458 const Shape& shape) {
459 PrimitiveType type = shape.element_type();
460 switch (type) {
461 case F32:
462 case U32:
463 case S32:
464 return PhiloxRngBit32(key, initial_state, shape);
465 case F64:
466 case U64:
467 case S64:
468 return PhiloxRngBit64(key, initial_state, shape);
469 default:
470 return {key.builder()->ReportError(Unimplemented(
471 "Types other than F32, F64, U32, S32, U64 and S64 "
472 "are not implemented by PhiloxFryBitGenerator; got %s",
473 primitive_util::LowercasePrimitiveTypeName(type))),
474 initial_state};
475 }
476}
477
478std::pair<XlaOp, XlaOp> ScramblePhiloxKey(XlaOp key) {
479 Philox4x32Key pkey = Uint64ToUint32s(key);

Callers 1

GetComputationForRngFunction · 0.85

Calls 6

PhiloxRngBit32Function · 0.85
PhiloxRngBit64Function · 0.85
UnimplementedFunction · 0.85
element_typeMethod · 0.45
ReportErrorMethod · 0.45
builderMethod · 0.45

Tested by

no test coverage detected