---
title: MemInfo
description: "构造MemInfo，通常在CacheManager的remap_registered_memory接口中作为参数类型使用。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/hixlug/llmprv2_42_0055.html
sourcePath: /source/zh/canncommercial/900/API/hixlug/llmprv2_42_0055.html
indexId: bd27bcdafa702dc505ce9e054a90b8b3334a66809ea8cb44e151aa7aa49b156861
---
# MemInfo

#### 函数功能

构造MemInfo，通常在CacheManager的remap_registered_memory接口中作为参数类型使用。


#### 函数原型

```
__init__(mem_type: Memtype, addr: int, size: int)
```


#### 参数说明

| 参数名称 | 数据类型 | 取值说明 |
| --- | --- | --- |
| mem\_type | MemType | 内存地址类型。 |
| addr | int | 内存地址。 |
| size | int | 内存地址对应大小，单位字节。 |


#### 调用示例

```
from llm_datadist import MemInfo
mem_info = MemInfo(Memtype.MEM_TYPE_DEVICE, 1234, 10)
```


#### 返回值

正常情况下返回MemInfo的实例。

传入数据类型错误情况下会抛出TypeError或ValueError异常。


#### 约束说明

无
