---
title: DumpToFile
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendgraphapi/atlasgeapi_07_0195.html
sourcePath: /source/zh/canncommercial/900/API/ascendgraphapi/atlasgeapi_07_0195.html
indexId: 0c9240b1bd125afd1520c216b29fabcc8f8a5d05cc5995e422ef87f7c5fccb5772
---
# DumpToFile

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | √ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | √ |
| Atlas 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |


#### 头文件/库文件

- 头文件：#include <graph/graph.h>
- 库文件：libgraph.so


#### 功能说明

将graph序列化到执行路径下的文件中。

不包含权重等数据，只包含图结构及相关属性。


#### 函数原型

```
graphStatus DumpToFile(DumpFormat format, const AscendString &suffix) const
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| format | 输入 | dump文件的格式，有onnx、txt等。DumpFormat枚举请参见DumpFormat。 |
| suffix | 输入 | 文件名称的前缀，比如ge\_proto\_xxxx\_GraphPreRunBegin.txt中的GraphPreRunBegin为前缀 |


#### 返回值说明

| 参数名 | 类型 | 说明 |
| --- | --- | --- |
| \- | graphStatus | GRAPH\_SUCCESS(0)：成功。 其他值：失败，详情请参见"ge::graphStatus(https://www.hiascend.comdocument/detail/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi\_07\_00513.html)"。 |


#### 约束说明

无
