tensorflow/core/grappler/optimizers/data/fusion_utils.cc
// This function looks for direct edges from input to return and rewrites
// them to the corresponding input of the return of `first_function`.
This function looks for direct edges from input to return and rewrites
them to the corresponding input of the return of `first_function`.
This function looks for direct edges from input to return and rewrites them to the corresponding input of the return of ` first_function ` .
void FuseReturns(const StringCollection& first_inputs,
                 const StringCollection& second_inputs,
                 const StringCollection& first_outputs,
                 const SetInputFn& set_input,
                 protobuf::Map<string, string>* fused_ret) {
  for (auto& ret : *fused_ret) {
    auto return_input = ParseNodeConnection(ret.second);
    auto input_it =
        std::find(second_inputs.begin(), second_inputs.end(), return_input);
    if (input_it == second_inputs.end()) continue;
    auto input_idx = std::distance(second_inputs.begin(), input_it);
    ret.second =
        set_input(first_inputs, second_inputs, first_outputs, input_idx);
  }
}
void FuseReturns ( const StringCollection & first_inputs , const StringCollection & second_inputs , const StringCollection & first_outputs , const SetInputFn & set_input , protobuf :: Map < string , string > * fused_ret ) { for ( auto & ret : * fused_ret ) { auto return_input = ParseNodeConnection ( ret . second ) ; auto input_it = std :: find ( second_inputs . begin ( ) , second_inputs . end ( ) , return_input ) ; if ( input_it == second_inputs . end ( ) ) continue ; auto input_idx = std :: distance ( second_inputs . begin ( ) , input_it ) ; ret . second = set_input ( first_inputs , second_inputs , first_outputs , input_idx ) ; } }
This function looks for direct edges from input to return and rewrites
them to the corresponding input of the return of `first_function`.
This function looks for direct edges from input to return and rewrites them to the corresponding input of the return of ` first_function ` .