---
title: 函数：trans_tensor_desc_format
description: "| C函数原型 | aclError aclTransTensorDescFormat(const aclTensorDesc \\*srcDesc, aclFormat dstFormat, aclTensorDesc \\*\\*dstDesc) |"
url: "https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application%20Development%20Guide/aadgp/aclpythondevg_01_0047.html"
---

# 函数：trans_tensor_desc_format

| C函数原型 | aclError aclTransTensorDescFormat(const aclTensorDesc \*srcDesc, aclFormat dstFormat, aclTensorDesc \*\*dstDesc) |
| --- | --- |
| Python函数 | dstDesc, ret = acl.trans\_tensor\_desc\_format(srcDesc, dstFormat) |
| 函数功能 | 按指定dstFormat转换源aclTensorDesc中的Format，生成新的目标aclTensorDesc，源aclTensorDesc中的Format保持不变。同步接口。当前版本不支持该接口，预留接口。 |
| 输入说明 | srcDesc：int，输入源aclTensorDesc数据的指针地址。需提前调用函数：create\_tensor\_desc接口创建aclTensorDesc类型。 dstFormat：int，需要设置的目标Format。 |
| 输出说明 | dstDesc：int，输出aclTensorDesc的指针地址。需提前调用aclCreateTensorDesc接口创建aclTensorDesc类型。 |
| 返回值说明 | ret：int，错误码。 返回0表示成功。 返回其它值表示失败。 |
| 约束说明 | 无 |
