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

Function NeedsInitValue

tensorflow/compiler/xla/tests/test_utils.cc:479–487  ·  view source on GitHub ↗

Reduce, ReduceWindow, and SelectAndScatter ops may need a non-random initialization value.

Source from the content-addressed store, hash-verified

477// Reduce, ReduceWindow, and SelectAndScatter ops may need a non-random
478// initialization value.
479bool NeedsInitValue(const HloUse& use) {
480 const HloInstruction* const instruction = use.instruction;
481 const HloOpcode opcode = instruction->opcode();
482 const int64 op_num = use.operand_number;
483 return ((opcode == HloOpcode::kReduceWindow && op_num == 1) ||
484 (opcode == HloOpcode::kSelectAndScatter && op_num == 2) ||
485 (opcode == HloOpcode::kReduce &&
486 op_num >= instruction->operand_count() / 2));
487}
488
489// Generate random values that are constrained to the input_shape minus the
490// output_shape so as not to produce wrapping slices, for instance.

Callers 1

FindConstrainedUsesFunction · 0.85

Calls 2

opcodeMethod · 0.80
operand_countMethod · 0.80

Tested by

no test coverage detected