---
title: 函数：allocator_unregister
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/runtimeapi/aclpythondevg_01_0982.html
sourcePath: /source/zh/canncommercial/900/API/runtimeapi/aclpythondevg_01_0982.html
indexId: ad68da3acdc266395caef2e3a0c33b8f6fb07ad46f0eafd381fe36fd5450d51971
---
# 函数：allocator_unregister

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | √ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |
| Atlas 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | x |


#### 功能说明

取消注册用户提供的Allocator以及Allocator对应的回调函数，用于取消使用用户提供的Allocator。


#### 函数原型

- C函数原型
  1 aclError aclrtAllocatorUnregister(aclrtStream stream)

- python函数
  1 ret = acl.rt.allocator_unregister(stream)


#### 参数说明

| 参数名 | 说明 |
| --- | --- |
| stream | int，该Allocator对应的stream。 |


#### 返回值说明

| 返回值 | 说明 |
| --- | --- |
| ret | int，错误码，返回0表示成功，返回其它值表示失败。 |


#### 约束说明

- Atlas 200I/500 A2推理产品，不支持该接口。
- 用户销毁Allocator前，调用本接口取消注册。
- 待取消注册的Stream不存在，或多次调用本接口取消注册，本接口内部不做任何操作，返回成功。


#### 资源参考

接口调用示例，参见动态Shape输入（设置Shape范围）(https://www.hiascend.comdocument/detail/zh/canncommercial/900/programug/acldevg/aclpythondevg_0047.html)。
