GetStrAttrVal

Function Usage

Obtains the attribute value of the string type of an operator.

Prototype

1
bool GetStrAttrVal(const char *attr_name, ge::AscendString &val) const

Parameters

Parameter

Input/Output

Description

attr_name

Input

Attribute name.

val

Output

Obtained string value.

Returns

A value indicating whether the attribute is successfully obtained.

Constraints

None

Examples

1
2
3
4
5
6
bool GetStrAttrVal(ExeResGenerationContext* context) {
  std::string attr_name = "";
  ge::AscendString val; 
  auto result = context->GetStrAttrVal(attr_name.c_str(),val);
  // ...
}