tensorflow/compiler/tf2xla/rearrange_function_argument.cc
// Given original output types and return value index mapping, return the new
// output types. Notice that DT_RESOURCE will be removed.
Given original output types and return value index mapping, return the new
output types. Notice that DT_RESOURCE will be removed.
Given original output types and return value index mapping return the new output types . Notice that DT_RESOURCE will be removed .
std::vector<DataType> ShuffleOutputDataTypeAttribute(
    const std::vector<DataType>& out_types,
    const std::map<int, int>& index_mapping) {
  std::vector<DataType> result(index_mapping.size());
  for (int i = 0; i < out_types.size(); i++) {
    auto iter = index_mapping.find(i);
    if (iter != index_mapping.end()) {
      result[iter->second] = out_types[i];
    }
  }
  return result;
}
std :: vector < DataType > ShuffleOutputDataTypeAttribute ( const std :: vector < DataType > & out_types , const std :: map < int , int > & index_mapping ) { std :: vector < DataType > result ( index_mapping . size ( ) ) ; for ( int i = 0 ; i < out_types . size ( ) ; i ++ ) { auto iter = index_mapping . find ( i ) ; if ( iter != index_mapping . end ( ) ) { result [ iter -> second ] = out_types [ i ] ; } } return result ; }
Given original output types and return value index mapping, return the new
output types.
Given original output types and return value index mapping return the new output types .