GeUtils【免费下载链接】geGEGraph Engine是面向昇腾的图编译器和执行器提供了计算图优化、多流并行、内存复用和模型下沉等技术手段加速模型执行效率减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/geProduct Support StatusProductSupport StatusAtlas A3 Training Series Products/Atlas A3 Inference Series Products√Atlas A2 Training Series Products/Atlas A2 Inference Series Products√Module Importfrom ge.utils import GeUtilsFunctionality DescriptionGeUtilsprovides GE (Graph Engine) common utility interfaces, including Shape derivation and AICore operator support checking functionality.infer_shape: Performs Shape derivation on computation graph. This interface only executes Shape derivation, does not perform other graph optimizations (such as constant folding, dead edge elimination etc.).check_node_support_on_aicore: Checks if node is supported on AICore, returns boolean value for support status and unsupported reason string.ClassesGeUtilsGeUtilsclass only contains static methods, can be used without instantiation.Static MethodDescriptioninfer_shapePerforms Shape derivation on computation graphcheck_node_support_on_aicoreChecks if node is supported on AICoreFunction Prototypesinfer_shapestaticmethod def infer_shape(graph: Graph, input_shapes: List[List[int]]) - NonePerforms Shape derivation on computation graph. Only executes Shape derivation, does not perform constant folding, dead edge elimination and other graph optimizations.check_node_support_on_aicorestaticmethod def check_node_support_on_aicore(node: Node) - Tuple[bool, str]Checks if node is supported on AICore, returns boolean value for support status and unsupported reason.Parameter Descriptioninfer_shapeParameterTypeRequiredDescriptiongraphGraphYesComputation graph object to perform Shape derivationinput_shapesList[List[int]]YesInput shape list. Each element in list describes shape of a graph input, each shape is integer dimension listcheck_node_support_on_aicoreParameterTypeRequiredDescriptionnodeNodeYesComputation graph node object to be checkedReturn Value Descriptioninfer_shapeNo return value. Shape derivation result is directly updated in graph object.check_node_support_on_aicoreReturn ValueTypeDescriptionis_supportedboolWhether node is supported on AICore. True means supported, False means not supportedunsupported_reasonstrDescription of unsupported reason. If node is supported, returns empty stringConstraint Descriptioninfer_shapeonly executes Shape derivation, does not perform constant folding, dead edge elimination and other graph optimization operations.input_shapesforinfer_shapemust be list of lists, each sublist elements must be integer type.check_node_support_on_aicorerequires passing validNodeobject.All methods inGeUtilsare static methods, can be called without creating instance.Usage Examplefrom ge.utils import GeUtils from ge.graph import Graph, Node # Shape derivation graph Graph(my_graph) # ... build graph ... GeUtils.infer_shape(graph, [[1, 3, 224, 224], [1, 3, 224, 224]]) # Check if node is supported on AICore【免费下载链接】geGEGraph Engine是面向昇腾的图编译器和执行器提供了计算图优化、多流并行、内存复用和模型下沉等技术手段加速模型执行效率减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/ge创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
CANN/ge GeUtils工具类API文档
发布时间:2026/7/4 7:46:02
GeUtils【免费下载链接】geGEGraph Engine是面向昇腾的图编译器和执行器提供了计算图优化、多流并行、内存复用和模型下沉等技术手段加速模型执行效率减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/geProduct Support StatusProductSupport StatusAtlas A3 Training Series Products/Atlas A3 Inference Series Products√Atlas A2 Training Series Products/Atlas A2 Inference Series Products√Module Importfrom ge.utils import GeUtilsFunctionality DescriptionGeUtilsprovides GE (Graph Engine) common utility interfaces, including Shape derivation and AICore operator support checking functionality.infer_shape: Performs Shape derivation on computation graph. This interface only executes Shape derivation, does not perform other graph optimizations (such as constant folding, dead edge elimination etc.).check_node_support_on_aicore: Checks if node is supported on AICore, returns boolean value for support status and unsupported reason string.ClassesGeUtilsGeUtilsclass only contains static methods, can be used without instantiation.Static MethodDescriptioninfer_shapePerforms Shape derivation on computation graphcheck_node_support_on_aicoreChecks if node is supported on AICoreFunction Prototypesinfer_shapestaticmethod def infer_shape(graph: Graph, input_shapes: List[List[int]]) - NonePerforms Shape derivation on computation graph. Only executes Shape derivation, does not perform constant folding, dead edge elimination and other graph optimizations.check_node_support_on_aicorestaticmethod def check_node_support_on_aicore(node: Node) - Tuple[bool, str]Checks if node is supported on AICore, returns boolean value for support status and unsupported reason.Parameter Descriptioninfer_shapeParameterTypeRequiredDescriptiongraphGraphYesComputation graph object to perform Shape derivationinput_shapesList[List[int]]YesInput shape list. Each element in list describes shape of a graph input, each shape is integer dimension listcheck_node_support_on_aicoreParameterTypeRequiredDescriptionnodeNodeYesComputation graph node object to be checkedReturn Value Descriptioninfer_shapeNo return value. Shape derivation result is directly updated in graph object.check_node_support_on_aicoreReturn ValueTypeDescriptionis_supportedboolWhether node is supported on AICore. True means supported, False means not supportedunsupported_reasonstrDescription of unsupported reason. If node is supported, returns empty stringConstraint Descriptioninfer_shapeonly executes Shape derivation, does not perform constant folding, dead edge elimination and other graph optimization operations.input_shapesforinfer_shapemust be list of lists, each sublist elements must be integer type.check_node_support_on_aicorerequires passing validNodeobject.All methods inGeUtilsare static methods, can be called without creating instance.Usage Examplefrom ge.utils import GeUtils from ge.graph import Graph, Node # Shape derivation graph Graph(my_graph) # ... build graph ... GeUtils.infer_shape(graph, [[1, 3, 224, 224], [1, 3, 224, 224]]) # Check if node is supported on AICore【免费下载链接】geGEGraph Engine是面向昇腾的图编译器和执行器提供了计算图优化、多流并行、内存复用和模型下沉等技术手段加速模型执行效率减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/ge创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考