---
title: NodeAttrFeature构造函数和析构函数
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/TensorFlowCommunity/latest/Convergence/tfscopedevg/atlassfpapi_07_0167.html
sourcePath: /source/zh/TensorFlowCommunity/910/Convergence/tfscopedevg/atlassfpapi_07_0167.html
indexId: 55cd77869b3365618d489827dd6912a143b9a36e2a286862aba89510e97b508483
---
# NodeAttrFeature构造函数和析构函数

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Ascend 950PR / Ascend 950DT | √ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | √ |
| Atlas 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |


#### 函数功能

NodeAttrFeature构造函数和析构函数。


#### 函数原型

数据类型为string的接口后续版本会废弃，建议使用数据类型为非string的接口。


```
NodeAttrFeature(std::string nodeType, std::string attr_name, ge::DataType datatype, ScopeAttrValue &attr_value);
NodeAttrFeature(const char_t *node_type, const char_t *attr_name, ge::DataType data_type, ScopeAttrValue &attr_value);
NodeAttrFeature(NodeAttrFeature const &feature);
NodeAttrFeature &operator=(NodeAttrFeature const &feature);
~NodeAttrFeature() override;
```


#### 参数说明

| 参数名 | 输入/输出 | 描述 |
| --- | --- | --- |
| nodeType | 输入 | 算子类型 |
| attr\_name | 输入 | 属性名称 |
| datatype | 输入 | 属性值的类型，当前支持DT\_FLOAT/DT\_INT32/DT\_STRING/DT\_BOOL。 |
| attr\_value | 输入 | 属性值 |
| node\_type | 输入 | 算子类型 |
| data\_type | 输入 | 属性值的类型，当前支持DT\_FLOAT/DT\_INT32/DT\_STRING/DT\_BOOL。 |
| feature | 输入 | NodeAttrFeature对象 |


#### 返回值

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


#### 异常处理

无。


#### 约束说明

无。
