开发者
下载
[object Object][object Object]

全量芯片支持。

[object Object]
  • 头文件:#include <graph/operator.h>
  • 库文件:libgraph.so
[object Object]

设置算子属性的属性值。

算子可以包括多个属性,初次设置值后,算子属性值的类型固定,算子属性值的类型包括:

  • 整型:接受int64_t、uint32_t、int32_t类型的整型值

    使用SetAttr(const string& name, int64_t attrValue)设置属性值,以GetAttr(const string& name, int32_t& attrValue) 、GetAttr(const string& name, uint32_t& attrValue) 取值时,用户需保证整型数据没有截断,同理针对int32_t和uint32_t混用时需要保证不被截断。

  • 整型列表:接受std::vector<int64_t>、std::vector<int32_t>、std::vector<uint32_t>、std::initializer_list<int64_t>&&表示的整型列表数据

  • 浮点数:float

  • 浮点数列表:std::vector<float>

  • 字符串:string

  • 字符串列表:std::vector<std::string>

  • 布尔:bool

  • 布尔列表:std::vector<bool>

  • Tensor:Tensor

  • Tensor列表:std::vector<Tensor>

  • Bytes:字节数组,SetAttr接受通过OpBytes(即vector<uint8_t>),和(const uint8_t* data, size_t size)表示的字节数组

  • AttrValue类型

  • 整型二维列表类型:std::vector<std::vector<int64_t>>

  • DataType列表类型:std::vector<ge::DataType>

  • DataType类型:ge::DataType

  • NamedAttrs类型: ge::NamedAttrs

  • NamedAttrs列表类型:std::vector<ge::NamedAttrs>

[object Object]
[object Object]
[object Object]
[object Object][object Object]undefined
[object Object]

对象本身。

[object Object]