tensorflow/core/profiler/utils/step_intersection.cc
// Returns the best alignment for aligning subordinate against chief.
Returns the best alignment for aligning subordinate against chief.
Returns the best alignment for aligning subordinate against chief .
StepsAlignment FindStepsAlignment(const StepDatabaseResult& subordinate,
                                  const StepDatabaseResult& chief) {
  double max_similarity = -1;
  StepsAlignment alignment = {0, 0, 0};
  if (subordinate.step_sequence_size() == 0 || chief.step_sequence_size() == 0)
    return alignment;
  for (auto c = 0; c < chief.step_sequence_size(); c++) {
    AlignmentInfo info =
        ComputeAlignmentInfo(subordinate, 0, chief, c);
    if (info.similarity <= max_similarity) continue;
    max_similarity = info.similarity;
    alignment = info.alignment;
  }
  for (auto s = 1; s < subordinate.step_sequence_size(); s++) {
    AlignmentInfo info =
        ComputeAlignmentInfo(subordinate, s, chief, 0);
    if (info.similarity <= max_similarity) continue;
    max_similarity = info.similarity;
    alignment = info.alignment;
  }
  return alignment;
}
StepsAlignment FindStepsAlignment ( const StepDatabaseResult & subordinate , const StepDatabaseResult & chief ) { double max_similarity = -1 ; StepsAlignment alignment = { 0 , 0 , 0 } ; if ( subordinate . step_sequence_size ( ) == 0 || chief . step_sequence_size ( ) == 0 ) return alignment ; for ( auto c = 0 ; c < chief . step_sequence_size ( ) ; c ++ ) { AlignmentInfo info = ComputeAlignmentInfo ( subordinate , 0 , chief , c ) ; if ( info . similarity <= max_similarity ) continue ; max_similarity = info . similarity ; alignment = info . alignment ; } for ( auto s = 1 ; s < subordinate . step_sequence_size ( ) ; s ++ ) { AlignmentInfo info = ComputeAlignmentInfo ( subordinate , s , chief , 0 ) ; if ( info . similarity <= max_similarity ) continue ; max_similarity = info . similarity ; alignment = info . alignment ; } return alignment ; }
Returns the best alignment for aligning subordinate against chief.
Returns the best alignment for aligning subordinate against chief .
/*subordinate_anchor=*/ // s starts at 1 instead of 0, because the loop above already considers // (s=0, c=0). /*chief_anchor=*/