tensorflow/cc/framework/cc_op_gen.cc
// Returns a <string, bool> pair. The string is the C++ type name to be used for
// attr_type when defining an object of that type. The bool is a flag to
// indicate whether to treat the type as const when accepting the C++ type as an
// argument to a function.
Returns a  pair. The string is the C++ type name to be used for
attr_type when defining an object of that type. The bool is a flag to
indicate whether to treat the type as const when accepting the C++ type as an
argument to a function.
Returns a pair . The string is the C ++ type name to be used for attr_type when defining an object of that type . The bool is a flag to indicate whether to treat the type as const when accepting the C ++ type as an argument to a function .
std::pair<const char*, bool> AttrTypeName(StringPiece attr_type) {
  static const auto* attr_type_map =
      new std::unordered_map<StringPiece, std::pair<const char*, bool>,
                             StringPieceHasher>{
          {"string", {"StringPiece", false}},
          {"list(string)", {"gtl::ArraySlice<::tensorflow::tstring>", true}},
          {"int", {"int64", false}},
          {"list(int)", {"gtl::ArraySlice<int>", true}},
          {"float", {"float", false}},
          {"list(float)", {"gtl::ArraySlice<float>", true}},
          {"bool", {"bool", false}},
          {"list(bool)", {"gtl::ArraySlice<bool>", true}},
          {"type", {"DataType", false}},
          {"list(type)", {"DataTypeSlice", true}},
          {"shape", {"PartialTensorShape", false}},
          {"list(shape)", {"gtl::ArraySlice<PartialTensorShape>", true}},
          {"tensor", {"TensorProto", true}},
          {"list(tensor)", {"gtl::ArraySlice<TensorProto>", true}},
          {"func", {"NameAttrList", true}},
          {"list(func)", {"gtl::ArraySlice<NameAttrList>", true}},
      };
  auto entry = attr_type_map->find(attr_type);
  if (entry == attr_type_map->end()) {
    LOG(FATAL) << "Unsupported Attr type: " << attr_type;
    return {"", false};
  }
  return entry->second;
}
std :: pair < const char * , bool > AttrTypeName ( StringPiece attr_type ) { static const auto * attr_type_map = new std :: unordered_map < StringPiece , std :: pair < const char * , bool > , StringPieceHasher > { { " " , { " " , false } } , { " " , { " " , true } } , { " " , { " " , false } } , { " " , { " " , true } } , { " " , { " " , false } } , { " " , { " " , true } } , { " " , { " " , false } } , { " " , { " " , true } } , { " " , { " " , false } } , { " " , { " " , true } } , { " " , { " " , false } } , { " " , { " " , true } } , { " " , { " " , true } } , { " " , { " " , true } } , { " " , { " " , true } } , { " " , { " " , true } } , } ; auto entry = attr_type_map -> find ( attr_type ) ; if ( entry == attr_type_map -> end ( ) ) { LOG ( FATAL ) << " " << attr_type ; return { " " , false } ; } return entry -> second ; }
Returns a <string, bool> pair.
Returns a <string bool > pair .