---
title: 简介
description: "CompileTimeTensorDesc用于描述编译时张量的基本信息，包括数据类型（ge::DataType）、数据排布格式（gert::StorageFormat，包括原始格式和运行时格式）以及原始格式向运行时格式转换时的补维规则。该类提供了对张量数据类型的获取和设置方法，同时支持对原始格式和运行时格式的管理。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/maintenref/basicdataapi/atlasopapi_07_00545.html
sourcePath: /source/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi_07_00545.html
indexId: fffdf90c72b6e83d95a13da57393fc31f1b0321a5416ae02b8b016f94a6f494a78
---
# 简介

CompileTimeTensorDesc用于描述编译时张量的基本信息，包括数据类型（ge::DataType）、数据排布格式（gert::StorageFormat，包括原始格式和运行时格式）以及原始格式向运行时格式转换时的补维规则。该类提供了对张量数据类型的获取和设置方法，同时支持对原始格式和运行时格式的管理。

#### 需要包含的头文件

```
#include <compute_node_info.h>
```


#### Public成员函数

```
CompileTimeTensorDesc
()
ge::DataType
GetDataType
() const
const
StorageFormat
&
GetFormat
() const
ge::Format
GetOriginFormat
() const
ge::Format
GetStorageFormat
() const
ExpandDimsType
GetExpandDimsType
() const
void
SetDataType
(const
ge::DataType
data_type)
void
SetStorageFormat
(const
ge::Format
format)
void
SetOriginFormat
(const
ge::Format
format)
void
SetExpandDimsType
(const
ExpandDimsType
&expand_dims_type)
```
