当前位置: 首页 > news >正文

CANN/ge GE Python API GeApi类文档

GeApi

【免费下载链接】geGE(Graph Engine)是面向昇腾的图编译器和执行器,提供了计算图优化、多流并行、内存复用和模型下沉等技术手段,加速模型执行效率,减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力,并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/ge

Product Support Status

ProductSupport Status
Atlas A3 Training Series Products/Atlas A3 Inference Series Products
Atlas A2 Training Series Products/Atlas A2 Inference Series Products

Module Import

from ge.ge_global import GeApi from ge.error import GeError

Functionality Description

GeApi class provides GE global initialization and resource release interfaces. ge_initialize must be called before using other GE interfaces, ge_finalize is called when program exits to release resources. Both methods are class methods, can be called without instantiating GeApi.

Class Definition

class GeApi: @classmethod def ge_initialize(cls, config: dict) -> None @classmethod def ge_finalize(cls) -> None

Function Description

ge_initialize

@classmethod def ge_initialize(cls, config: dict) -> None

Functionality Description: Initializes GE, prepares execution environment. This method is a class method, can be called without instantiating GeApi. Must be called before using other GE interfaces.

Parameter Description:

ParameterTypeRequired/OptionalDescription
configdictRequiredGE initialization configuration dictionary, key-value pairs are string type, used to specify GE runtime parameters.

Return Value Description: No return value.

Constraint Description:

  • config must be dict type, otherwise throws TypeError.
  • config cannot be empty dictionary, otherwise throws TypeError.
  • When GE initialization fails, will throw GeError, exception information contains GE internal error information and interface context.
  • Must call this method before using other GE interfaces.
  • Do not repeatedly call ge_initialize, repeated calls may cause undefined behavior.

ge_finalize

@classmethod def ge_finalize(cls) -> None

Functionality Description: Releases GE resources, cleans up execution environment. This method is a class method, can be called without instantiating GeApi. Should be called when program exits or no longer needs GE.

Parameter Description: No parameters.

Return Value Description: No return value.

Constraint Description:

  • Before calling ge_finalize, must ensure all Sessions are destroyed, all graph resources are released.
  • When GE resource release fails, will throw GeError, exception information contains GE internal error information and interface context.
  • Do not continue using any GE interfaces after ge_finalize.

【免费下载链接】geGE(Graph Engine)是面向昇腾的图编译器和执行器,提供了计算图优化、多流并行、内存复用和模型下沉等技术手段,加速模型执行效率,减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力,并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/ge

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

http://www.jsqmd.com/news/1124264/

相关文章:

  • CANN/ge DataFlow MetaRunContext类
  • Sublime Text Orgmode插件常见问题解决方案:从安装到高级使用
  • SVD++ 算法 Python 实现:利用隐式反馈将推荐准确率提升 3%
  • 从推箱子到世界模型:用PyTorch实现AI规划能力与JEPA架构解析
  • 一文读懂GhostDB的持久化机制:AOF日志与快照技术全解析
  • GoExec任务计划模块实战:demand与create命令实现无文件落地攻击
  • Touch WX开发常见问题解答:新手必看的避坑指南
  • 终极macOS窗口管理神器:AutoRaise让鼠标悬停自动聚焦,工作效率提升300%
  • GalaxyBudsClient固件刷写技术深度解析:跨平台固件管理实现方案
  • BigFunctions快速入门:10分钟学会在BigQuery中调用公共函数
  • 如何快速上手YiShaAdmin:权限管理系统实战指南
  • MMKV如何解决移动端跨平台数据同步的三大核心挑战:实战指南
  • 如何用GZDoom让经典射击游戏重获新生?
  • jqjq实战应用:10个高效JSON数据处理技巧
  • ftpserver多用户管理实战:如何配置不同云存储后端的访问权限
  • 计算机毕业设计之springboot校园食堂评价系统
  • 警惕AI模型标题党:解析Claude真实版本演进与评测逻辑
  • jinjava快速上手:5分钟学会Java中的Jinja模板渲染
  • ReactList 移动端优化:使用translate3d提升移动设备滚动性能
  • Exercises Dataset容器编排:Kubernetes部署与管理的完整指南
  • 深度解析ValveResourceFormat:从VPK文件到3D模型的完整实战指南
  • Juggl全局图模式与本地图模式对比:选择适合你的可视化策略
  • 如何免费获得10倍GitHub下载速度:Fast-GitHub终极加速指南
  • 大三嵌入式系统课程设计:打造nwpu-cram智能家居控制系统的完整指南
  • Kronos:用AI读懂金融市场的语言,开启股票预测新时代
  • 基于深度学习的多模态音乐推荐系统实战
  • ESP-CSI入门指南:5步掌握Wi-Fi信道状态信息应用开发
  • Hearthstone-Script:终极炉石传说自动化脚本完整指南
  • CANN/cannbot-skills:验证报告输出模式定义
  • 如何扩展SENet-Tensorflow:支持自定义数据集与网络架构的终极指南