Skip to content

Commit

Permalink
Be resilient towards graphs without source/sink connectivity.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 228756459
  • Loading branch information
Sanjoy Das authored and tensorflower-gardener committed Jan 10, 2019
1 parent a76a7e8 commit 0b3c3c5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tensorflow/compiler/jit/mark_for_compilation_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,11 @@ Status MarkForCompilationPass::Run(
VLOG(1) << "flags->tf_xla_auto_jit = " << flags->tf_xla_auto_jit;
const FunctionLibraryDefinition* fld = options.flib_def;

// Deadness analysis expects a graph with source and sink edges properly
// connected but sometimes the incoming graph does not follow this invariant.
// So fix up the source and sink edges before calling into deadness analysis.
FixupSourceAndSinkEdges(options.graph->get());

std::unique_ptr<DeadnessAnalysis> deadness;
{
XLA_SCOPED_LOGGING_TIMER_LEVEL("DeadnessAnalysis", 1);
Expand Down

0 comments on commit 0b3c3c5

Please sign in to comment.