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

#### 产品支持情况

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


#### 功能说明

将图导出到文件。


#### 函数原型

```
dump_to_file(format: DumpFormat = DumpFormat.kReadable, suffix: str = "") -> None
```


#### 参数说明

| 参数名 | 输入/输出 | 描述 |
| --- | --- | --- |
| format | 输入 | 导出格式，默认为kReadable，详见DumpFormat。 |
| suffix | 输入 | 文件名后缀，string类型，默认为空字符串。 |


#### 返回值说明

无


#### 约束说明

- 如果format不是有效的DumpFormat，抛出TypeError。
- 如果suffix不是字符串，抛出TypeError。
- 如果导出失败，抛出RuntimeError。
- 导出的pbtxt格式只包含图结构，不包含权重数据或其他属性。
