---
title: 简介
description: "Graph类用于表示和操作计算图。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendgraphapi/atlasgeapi_07_0710.html
sourcePath: /source/zh/canncommercial/900/API/ascendgraphapi/atlasgeapi_07_0710.html
indexId: 45e19453e14cc11e4049cd0b4312bd7fbe4e792614a56be0d426c3cd85da3e2772
---
# 简介

Graph类用于表示和操作计算图。

基本图操作调用示例：

```
from ge.graph import Graph, DataType, Format

# 创建图
graph = Graph("my_graph")

# 获取所有节点
nodes = graph.get_all_nodes()

# 设置和获取属性
graph.set_attr("my_attr", "value")
attr_value = graph.get_attr("my_attr")

# 导出图
graph.dump_to_file(format=DumpFormat.kReadable, suffix="debug")
```
