---
title: GetDeviceId
description: "用于获取Tensor的设备号。"
url: https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/latest/Application%20Development%20Guide/msadg/mxvisionug_0435.html
sourcePath: /source/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application Development Guide/msadg/mxvisionug_0435.html
indexId: 2a30c9fb2451feb011cc78e9172127a2d4212adafaabee0914fb9b9b2ca9bbde102
---
# GetDeviceId

#### 函数功能

用于获取Tensor的设备号。


#### 函数原型

```
int32_t GetDeviceId() const;
```


#### 返回参数说明

| 数据结构 | 说明 |
| --- | --- |
| tensor | 返回设备号，是一个int类型。 |
