---
title: 函数：set_exec_config_opt
description: "| C函数原型 | aclError aclmdlSetExecConfigOpt(aclmdlExecConfigHandle \\*handle, aclmdlExecConfigAttr attr, const void \\*attrValue, size\\_t valueSize) |"
url: "https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application%20Development%20Guide/aadgp/aclpythondevg_01_0155.html"
---

# 函数：set_exec_config_opt

| C函数原型 | aclError aclmdlSetExecConfigOpt(aclmdlExecConfigHandle \*handle, aclmdlExecConfigAttr attr, const void \*attrValue, size\_t valueSize) |
| --- | --- |
| Python函数 | ret = acl.mdl.set\_exec\_config\_opt(handle, attr, attrValue) |
| 函数功能 | 设置模型执行的配置对象中的各属性的取值。 |
| 输入说明 | handle：int，模型执行的配置对象的指针地址。需提前调用acl.mdl.create\_exec\_config\_handle接口创建该对象的指针地址。 attr：int，指定需设置的属性。具体请参见aclmdlExecConfigAttr。 attrValue：“attr”对应的属性取值。 |
| 返回值说明 | ret：int，错误码。 返回0表示成功。 返回其它值表示失败。 |
| 约束说明 | 本接口需要配合其它接口一起使用，实现模型执行，接口调用顺序如下： 调用acl.mdl.create\_exec\_config\_handle接口创建模型执行的配置对象。 多次调用acl.mdl.set\_exec\_config\_opt接口设置配置对象中每个属性的值。 调用acl.mdl.execute\_v2接口指定模型执行时需要的配置信息，并进行模型执行。 模型加载成功后，调用acl.mdl.destroy\_exec\_config\_handle接口销毁。 |
