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

Method IsFusible

tensorflow/compiler/xla/service/hlo_instruction.cc:2779–2803  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2777}
2778
2779bool HloInstruction::IsFusible() const {
2780 // Instructions which are traced should not be fused.
2781 if (tracing()) {
2782 return false;
2783 }
2784 // Some kinds of instructions don't make sense to fuse.
2785 switch (opcode_) {
2786 case HloOpcode::kDomain:
2787 case HloOpcode::kParameter:
2788 case HloOpcode::kWhile:
2789 case HloOpcode::kConditional:
2790 case HloOpcode::kCall:
2791 return false;
2792 // Fusions are always fusible.
2793 case HloOpcode::kFusion:
2794 // Side effecting reduce and reduce window would be invalid HLO.
2795 case HloOpcode::kMap:
2796 case HloOpcode::kReduce:
2797 case HloOpcode::kReduceWindow:
2798 return true;
2799 // Side effecting instructions cannot be fused.
2800 default:
2801 return !HasSideEffect();
2802 }
2803}
2804
2805HloInstruction::HloInstruction(HloOpcode opcode, const Shape& shape)
2806 : unique_id_(-1),

Callers 7

CanFuseOnAllPathsMethod · 0.80
RunMethod · 0.80
CloneAndFuseInternalMethod · 0.80
IsInputFusibleFunction · 0.80
IsLoopFusibleFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected