---
title: has_attr
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendgraphapi/atlasgeapi_07_0741.html
sourcePath: /source/zh/canncommercial/900/API/ascendgraphapi/atlasgeapi_07_0741.html
indexId: f455faa29ef4cca4e939d2020f708b93f2947e6dd17781e0ddfcbc062d6eb44c72
---
# has_attr

#### 产品支持情况

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


#### 功能说明

检查节点是否具有指定属性。


#### 函数原型

```
has_attr(attr_name: str) -> bool
```


#### 参数说明

| 参数名 | 输入/输出 | 描述 |
| --- | --- | --- |
| attr\_name | 输入 | 属性名称，string类型。 |


#### 返回值说明

(bool) 是否存在该属性。


#### 约束说明

如果attr_name不是字符串，抛出TypeError。
