---
title: GetAddr
description: "获取Tensor的数据地址。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/maintenref/basicdataapi/atlasopapi_07_00741.html
sourcePath: /source/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi_07_00741.html
indexId: 0fbd9ed48c4233321c8868b13daec0c244e16f312a5609977853b31fd144bada78
---
# GetAddr

#### 函数功能

获取Tensor的数据地址。


#### 函数原型

```
const void *GetAddr() const
void *GetAddr()
```


#### 参数说明

无


#### 返回值说明

返回数据地址。


#### 约束说明

无


#### 调用示例

```
TensorV2 tensor{{{8, 3, 224, 224}, {16, 3, 224, 224}},       // shape                
                {ge::FORMAT_ND, ge::FORMAT_FRACTAL_NZ, {}},  // format                              
                kFollowing,                                  // placement                
                ge::DT_FLOAT16,                              //dt                
                nullptr};
auto addr = tensor.GetAddr(); // &tensor + 1
```
