简介
【免费下载链接】geGE(Graph Engine)是面向昇腾的图编译器和执行器,提供了计算图优化、多流并行、内存复用和模型下沉等技术手段,加速模型执行效率,减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力,并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/ge
获取推理上下文对象,并设置相应对象的形状和数据类型,主要用于资源类算子。
需要包含的头文件
#include <graph/inference_context.h>Public成员函数
void SetInputHandleShapesAndTypes(std::vector<std::vector<ShapeAndType>> &&shapes_and_types) void SetOutputHandleShapesAndTypes(const std::vector<std::vector<ShapeAndType>> &shapes_and_types) void SetOutputHandleShapesAndTypes(std::vector<std::vector<ShapeAndType>> &&shapes_and_types) const std::vector<std::vector<ShapeAndType>> &GetInputHandleShapesAndTypes() const const std::vector<std::vector<ShapeAndType>> &GetOutputHandleShapesAndTypes() const void SetMarks(const std::vector<std::string> &marks) void SetMarks(const std::vector<AscendString> &marks) const std::vector<std::string> &GetMarks() const void GetMarks(std::vector<AscendString> &marks) const static std::unique_ptr<InferenceContext> Create( void *resource_context_mgr = nullptr ) ResourceContext *GetResourceContext(const ge::AscendString &key) graphStatus SetResourceContext(const ge::AscendString &key, ResourceContext *resource_context) graphStatus RegisterReliedOnResourceKey(const ge::AscendString &key) graphStatus AddChangedResourceKey(const ge::AscendString &key) const std::set<ge::AscendString>& GetReliedOnResourceKeys() const const std::set<ge::AscendString>& GetChangedResourceKeys() const void ClearChangedResourceKeys()【免费下载链接】geGE(Graph Engine)是面向昇腾的图编译器和执行器,提供了计算图优化、多流并行、内存复用和模型下沉等技术手段,加速模型执行效率,减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力,并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/ge
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考