---
title: GetTensorType
description: "用于获取Tensor的内存类型。"
url: https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/latest/Application%20Development%20Guide/msadg/mxvisionug_0429.html
sourcePath: /source/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application Development Guide/msadg/mxvisionug_0429.html
indexId: 3aa7f851e3ea883e2a0240d5f9a58e832efa5623b3bb43373bdeb9331e5eb6b1102
---
# GetTensorType

#### 函数功能

用于获取Tensor的内存类型。


#### 函数原型

```
MemoryData::MemoryType GetTensorType() const;
```


#### 返回参数说明

| 数据结构 | 说明 |
| --- | --- |
| MemoryType | 申请的内存类型： ● MEMORY\_HOST：对应Host侧。 ● MEMORY\_DEVICE：对应Device侧。 ● MEMORY\_DVPP：对应DVPP侧。 ● MEMORY\_HOST\_MALLOC：对应malloc申请内存。 ● MEMORY\_HOST\_NEW：对应new申请内存。 |
