---
title: 函数：set_attr_string
description: "| C函数原型 | aclError aclopSetAttrString(aclopAttr \*attr, const char \*attrName, const char\* attrValue); |"
url: https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/latest/Application%20Development%20Guide/aadgp/aclpythondevg_01_0771.html
sourcePath: /source/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application Development Guide/aadgp/aclpythondevg_01_0771.html
indexId: 067837cc29c496070c1f4205c494fea9cfdc98da51a9c2a00e2bb31c1e946668108
---
# 函数：set_attr_string

| C函数原型 | aclError aclopSetAttrString(aclopAttr \*attr, const char \*attrName, const char\* attrValue); |
| --- | --- |
| Python函数 | ret = acl.op.set\_attr\_string(attr, attr\_name, attr\_value) |
| 函数功能 | 设置字符串类型标量的属性值，同步接口。 |
| 输入说明 | attr：int，acl算子属性地址对象, 此对象使用调用acl.op.create\_attr创建。 attr\_name：str，属性名。 attr\_value：str，属性值。 |
| 返回值说明 | ret：int，错误码。 返回0表示成功。 返回其它值表示失败。 |
| 约束说明 | 无 |
