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

#### 产品支持情况

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


#### 头文件/库文件

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


#### 函数功能

ArgsFormat的反序列化接口。


#### 函数原型

```
static std::vector<ArgDescInfo> Deserialize(const AscendString &args_str)
```


#### 参数说明

| 参数名 | 输入/输出 | 描述 |
| --- | --- | --- |
| args\_str | 输入 | ArgsFormat的序列化字符串。 |


#### 返回值

返回ArgsFormat。

失败时，返回空的vector。


#### 约束说明

字符串必须是ArgsFormat的序列化结果。


#### 调用示例

```
graphStatus Mc2GenTaskCallback(const gert::ExeResGenerationContext *context, std::vector<std::vector<uint8_t>> &tasks) {
....
// 更改原AI Core任务的ArgsFormat
  auto aicore_task = KernelLaunchInfo::LoadFromData(context, tasks.back());
  auto aicore_args_format_str = aicore_task.GetArgsFormat();
  auto aicore_args_format = ArgsFormatSerializer::Deserialize(aicore_args_format_str);
  size_t i = 0UL;
  for (; i < aicore_args_format.size(); i++) {
    if (aicore_args_format[i].GetType() == ArgDescType::kIrInput ||
        aicore_args_format[i].GetType() == ArgDescType::kInputInstance) {
      break;
    }
  }
  aicore_args_format.insert(aicore_args_format.begin() + i, ArgDescInfo::CreateHiddenInput(HiddenInputSubType::kHcom));
  aicore_task.SetArgsFormat(ArgsFormatSerializer::Serialize(aicore_args_format).GetString());
  tasks.back() = aicore_task.Serialize();
  return SUCCESS;
}
```
