CANN/ge ES图构建器C++ API文档
Eager Style Graph Builder Class Relationship Documentation【免费下载链接】geGEGraph Engine是面向昇腾的图编译器和执行器提供了计算图优化、多流并行、内存复用和模型下沉等技术手段加速模型执行效率减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/geOverviewEager Style Graph Builder is a functional interface module in GraphEngine for building computation graphs, providing convenient graph building functionality. The modules external header files are located in theinc/external/ge/eager_style_graph_builder/directory.Directory Structureinc/external/ge/eager_style_graph_builder/ ├── c/ │ └── esb_funcs.h # C language interface function declarations └── cpp/ ├── compliant_node_builder.h # Compliant node builder class definition ├── es_graph_builder.h # Graph builder class definition ├── es_tensor_holder.h # Tensor holder class definition ├── es_tensor_like.h # Tensor-like type definition ├── es_c_graph_builder.h # C-style graph builder class definition └── es_c_tensor_holder.h # C-style tensor holder class definitionCore Class Relationship DiagramMain Class Detailed Explanation1. EsGraphBuilder ClassFile Location:cpp/es_graph_builder.hFunctionality: Graph builder class, used to build and manage computation graphsMain Methods:CreateInput()- Create graph input nodeCreateInputs()- Batch create graph default format input nodesCreateTensor()- Create tensor with specified shape by runtimeDataTypeCreateVector()- Create vector constantCreateScalar()- Create scalar constantCreateVariable()- Create variableSetAttr()- Set graph attributeSetOutput()- Set graph outputBuildAndReset()- Build computation graphRelationships:EncapsulatesEsCGraphBuilderC structureCreates and managesEsTensorHolderobjectsUltimately buildsge::Graphobject2. EsTensorHolder ClassFile Location:cpp/es_tensor_holder.hFunctionality: Tensor holder class, encapsulates various tensor operationsMain Methods:Arithmetic operations:operator,operator-,operator*,operator/Attribute setting:SetDataType(),SetFormat(),SetShape()Attribute management:SetAttr(),SetAttrForNode()Accessors:GetCTensorHolder(),GetProducer()【免费下载链接】geGEGraph Engine是面向昇腾的图编译器和执行器提供了计算图优化、多流并行、内存复用和模型下沉等技术手段加速模型执行效率减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/ge创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考