GetListString
函数功能
获取list string类型的属性值。
函数原型
std::vector<std::string> GetListString() const
参数说明
无。
返回值说明
返回的属性值,std::vector<std::string>类型。
约束说明
无。
调用示例
例如,OpType为A的算子的原型定义如下所示,属性的名称为attr1,类型为ListString。
REG_OP(A)
.INPUT(x, TensorType({ DT_FLOAT }))
.OUTPUT(y, TensorType({ DT_FLOAT }))
.ATTR(attr1, ListString, {})
.OP_END_FACTORY_REG(A)
则算子实现时可使用如下接口获取算子A的属性值。
AttrValue *attr = ctx.GetAttr("attr1");
std::vector<std::string> strs = attr->GetListString();
父主题: AttrValue类