---
title: 函数：set_tensor_storage_format
description: "此接口后续版本会废弃，请使用acl.set_tensor_format接口。"
url: https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/latest/Application%20Development%20Guide/aadgp/aclpythondevg_01_0035.html
sourcePath: /source/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application Development Guide/aadgp/aclpythondevg_01_0035.html
indexId: 82312b1d8fa42b7288c2a328e5e8c0c09ce72f7752865e48e31921a9bf7f3e30108
---
# 函数：set_tensor_storage_format

此接口后续版本会废弃，请使用acl.set_tensor_format接口。


| C函数原型 | aclError aclSetTensorStorageFormat(aclTensorDesc \*desc, aclFormat format) |
| --- | --- |
| Python函数 | ret = acl.set\_tensor\_storage\_format(desc, format) |
| 函数功能 | 调用acl.create\_tensor\_desc接口创建Tensor描述信息后，可通过acl.set\_tensor\_storage\_format设置Tensor的实际Format信息，当前主要用于PyTorch场景下，同步接口。 |
| 输入说明 | desc：int，aclTensorDesc类型的指针地址。 需提前调用acl.create\_tensor\_desc接口创建aclTensorDesc类型。 format：int， 指定Tensor描述的格式。 |
| 返回值说明 | ret：int，错误码。 返回0表示成功。 返回其它值表示失败。 |
| 约束说明 | 无 |
