ConvertToListAscendString
【免费下载链接】geGE(Graph Engine)是面向昇腾的图编译器和执行器,提供了计算图优化、多流并行、内存复用和模型下沉等技术手段,加速模型执行效率,减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力,并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/ge
产品支持情况
头文件
#include <graph/operator_reg.h>
功能说明
定义了一个模板函数ConvertToListAscendString,用于将不同类型的字符串列表转换为AscendString类型的列表。
函数原型
template<typename T> std::vector<ge::AscendString> ConvertToListAscendString(T strs)支持以下两种拓展:
template<> inline std::vectorge::AscendString\ ConvertToListAscendString(std::vectorstd::string\ strs)
对于std::vectorstd::string类型的字符串列表,先将其转换为std::vector<const char *>类型,然后再进行转换。
template<> inline std::vectorge::AscendString\ ConvertToListAscendString(std::vectorge::AscendString\ strs)
对于std::vectorge::AscendString\类型的字符串列表,直接返回原列表。
参数说明
返回值说明
转换后的AscendString类型字符串列表。
约束说明
无。
【免费下载链接】geGE(Graph Engine)是面向昇腾的图编译器和执行器,提供了计算图优化、多流并行、内存复用和模型下沉等技术手段,加速模型执行效率,减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力,并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/ge
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考