CANN/ge序列化API文档
Serialize【免费下载链接】geGEGraph Engine是面向昇腾的图编译器和执行器提供了计算图优化、多流并行、内存复用和模型下沉等技术手段加速模型执行效率减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/ge产品支持情况产品是否支持Atlas A3 训练系列产品 / Atlas A3 推理系列产品√Atlas A2 训练系列产品 / Atlas A2 推理系列产品√头文件#include graph/arg_desc_info.h函数功能将ArgsFormat信息序列化成数据流。函数原型static AscendString Serialize(const std::vectorArgDescInfo args_format)参数说明参数输入/输出说明args_format输入ArgsFormat信息由若干个ArgDescInfo组成。返回值返回ArgsFormat的序列化结果。失败时返回空字符串。约束说明无调用示例graphStatus Mc2GenTaskCallback(const gert::ExeResGenerationContext *context, std::vectorstd::vectoruint8_t tasks) { .... // 更改原AI Core任务的ArgsFormat auto aicore_task KernelLaunchInfo::LoadFromData(context, tasks.back()); auto aicore_args_format_str aicore_task.GetArgsFormat(); auto aicore_args_format ArgsFormatSerializer::Deserialize(aicore_args_format_str); size_t i 0UL; for (; i aicore_args_format.size(); i) { if (aicore_args_format[i].GetType() ArgDescType::kIrInput || aicore_args_format[i].GetType() ArgDescType::kInputInstance) { break; } } aicore_args_format.insert(aicore_args_format.begin() i, ArgDescInfo::CreateHiddenInput(HiddenInputSubType::kHcom)); aicore_task.SetArgsFormat(ArgsFormatSerializer::Serialize(aicore_args_format).GetString()); tasks.back() aicore_task.Serialize(); return SUCCESS; }【免费下载链接】geGEGraph Engine是面向昇腾的图编译器和执行器提供了计算图优化、多流并行、内存复用和模型下沉等技术手段加速模型执行效率减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/ge创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考