---
title: ArrayAttr
description: "AI处理器与昇腾产品的对应关系，请参见《昇腾产品形态说明(https://www.hiascend.com/document/detail/zh/AscendFAQ/ProduTech/productform/hardwaredesc_0001.html)》"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/devaids/Profiling/mindieprofiling_0054.html
sourcePath: /source/zh/canncommercial/900/devaids/Profiling/mindieprofiling_0054.html
indexId: c36e27dc8b7a95e59beb262df4159568672c15de4ac399766ab900952751414173
---
# ArrayAttr

#### 产品支持情况

AI处理器与昇腾产品的对应关系，请参见《昇腾产品形态说明(https://www.hiascend.com/document/detail/zh/AscendFAQ/ProduTech/productform/hardwaredesc_0001.html)》


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


针对 Atlas A2 训练系列产品 / Atlas A2 推理系列产品 ，当前仅支持该系列产品中的 Atlas 800I A2 推理产品 。

针对 Atlas 推理系列产品 ，当前仅支持该系列产品中的Atlas 300I Duo 推理卡+Atlas 800 推理服务器（型号：3000）。


#### 功能说明

通过回调函数自定义添加数组属性。


#### 函数原型

```
template <Level levelAttr = level, typename T>
Profiler &ArrayAttr(const char *attrName, const T &startIter, const T &endIter, typename ArrayCollectorHelper<Profiler<level>, T>::AttrCollectCallback callback)
```


#### 参数说明


**表1 参数说明**

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| attrName | 输入 | 属性名。 |
| startIter | 输入 | 任意的迭代器开始。 |
| endIter | 输入 | 任意的迭代器结束。 |
| callback | 输入 | 回调函数第一个入参是当前对象，可以调用它添加属性，第二个入参是当前迭代，可以用它获取需要记录的属性内容。 |


#### 返回值说明

Profiler&返回当前对象，支持链式调用。
