tf_1.8_xla_doc
|
#include <hlo_computation.h>
Classes | |
class | Builder |
Builder class for HloComputation. More... | |
Public Member Functions | |
HloInstruction * | AddInstruction (std::unique_ptr< HloInstruction > instruction) |
std::list< HloComputation * > | MakeEmbeddedComputationsList () const |
HloInstruction * | CreateFusionInstruction (tensorflow::gtl::ArraySlice< HloInstruction *> instructions_to_fuse, HloInstruction::FusionKind fusion_kind) |
Private Member Functions | |
HloInstruction * | AddInstructionInternal (std::unique_ptr< HloInstruction > instruction) |
void | FuseInstructionsInto (tensorflow::gtl::ArraySlice< HloInstruction *> instructions_to_fuse, HloInstruction *fusion_instruction) |
Google docs:
Describes a computation at the HLO level.
An HloComputation contains a directed acyclic graph of HLO instructions. The computation has a single root instruction which produces the output of the computation.
HloInstruction * xla::HloComputation::AddInstruction | ( | std::unique_ptr< HloInstruction > | instruction | ) |
xla::HloComputation::AddInstructionInternal()
|
private |
HloInstruction * xla::HloComputation::CreateFusionInstruction | ( | tensorflow::gtl::ArraySlice< HloInstruction *> | instructions_to_fuse, |
HloInstruction::FusionKind | fusion_kind | ||
) |
Creates a fusion instruction containing the given instructions.
fusion_kind
indicates the type of the fusion, e.g., loop fusion or fusion into a library call. Instructions must be in reverse topological order (root of the fused expression first). Replaces all uses of the original root instruction with the fusion instruction. The original instructions are removed if they have no uses after fusion (this is necessarily true for at least the root).
Called by xla::TransposeFolding
and xla::BatchNormExpander
instructions_to_fuse
.xla::HloComputation::AddInstruction
and xla::HloInstruction::CreateFusion()
to generate instruction.xla::HloComputation::FuseInstructionsInto
to inject into instruction.
|
private |
kFusion
fusion_instruction
to instructions_to_fuse
std::list< HloComputation * > xla::HloComputation::MakeEmbeddedComputationsList | ( | ) | const |
Google docs:
Creates and returns a list of the embedded computations called by this computation. This includes all embedded computations called directly or transitively. The embedded computations are sorted such that if computation A calls computation B (eg, via a map instruction) then A will appear after B in the list.