---
title: InferenceContext构造函数和析构函数
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendgraphapi/atlasgeapi_07_0592.html
sourcePath: /source/zh/canncommercial/900/API/ascendgraphapi/atlasgeapi_07_0592.html
indexId: 6d71a19d28c91f516e03ff066666577a8e1ef818f58d6f6332f93ec12d290a2d72
---
# InferenceContext构造函数和析构函数

#### 产品支持情况

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


#### 头文件/库文件

- 头文件：#include <graph/inference_context.h>
- 库文件：libgraph.so


#### 功能说明

InferenceContext对象的构造函数和析构函数。


#### 函数原型

```
~InferenceContext() = default
InferenceContext(const InferenceContext &context) = delete
InferenceContext(const InferenceContext &&context) = delete
InferenceContext &operator=(const InferenceContext &context) = delete
InferenceContext &operator=(const InferenceContext &&context) = delete
```


#### 参数说明

| 参数名 | 输入/输出 | 描述 |
| --- | --- | --- |
| context | 输入 | InferenceContext内容，供初始化使用。 |


#### 返回值说明

InferenceContext构造函数返回InferenceContext类型的对象。


#### 异常处理

无。


#### 约束说明

无。
