aclSetTensorPlaceMent
aclSetTensorPlaceMent
函数功能
设置TensorDesc的placement属性,用于标识存放Tensor数据的内存类型。同步接口。
函数原型
aclError aclSetTensorPlaceMent(****aclTensorDesc *desc, aclMemType memType)
参数说明
| 参数名 | 输入/输出 | 说明 |
|---|---|---|
| desc | 输出 | aclTensorDesc类型的指针。 需提前调用aclCreateTensorDesc接口创建aclTensorDesc类型。 |
| memType | 输入 | 指定placement属性值。 |
返回值说明
返回0表示成功,返回其它值表示失败。
父主题: aclTensorDesc
aclSetTensorValueRange
函数功能
调用aclCreateTensorDesc接口创建tensor描述信息后,可通过本接口设置tensor的数据值的范围。同步接口。
使用场景:部分算子input的值就是该算子的输出Shape,在动态Shape场景下,这个Shape的值就有一个取值范围,在执行算子时,需要在input上设置Shape值的范围(例如:[[16,16],[1,128],[20,20],[1,10]]),AscendCL才能正常编译、执行算子。
函数原型
aclError aclSetTensorValueRange(aclTensorDesc* desc, size_t valueCount, int64_t valueRange[][ACL_TENSOR_VALUE_RANGE_NUM])
参数说明
| 参数名 | 输入/输出 | 说明 |
|---|---|---|
| desc | 输出 | aclTensorDesc类型的指针。 需提前调用aclCreateTensorDesc接口创建aclTensorDesc类型。 |
| valueCount | 输入 | 需设置范围的数据值的个数。 |
| valueRange | 输入 | valueRange为每个数据值的范围,用二维数组表示范围。 text<br>#define ACL_TENSOR_VALUE_RANGE_NUM 2<br> |
返回值说明
返回0表示成功,返回其它值表示失败。
父主题: aclTensorDesc
aclopCreateAttr
函数功能
创建aclopAttr类型的数据,该数据类型用于保存算子的属性。同步接口。
如需销毁aclopAttr类型的数据,请参见aclopDestroyAttr。
函数原型
aclopAttr *aclopCreateAttr()
参数说明
无
返回值说明
返回aclopAttr类型的指针。
父主题: aclopAttr
aclopDestroyAttr
函数功能
销毁通过aclopCreateAttr接口创建的aclopAttr类型的数据。同步接口。
函数原型
void aclopDestroyAttr(const aclopAttr *attr)
参数说明
| 参数名 | 输入/输出 | 说明 |
|---|---|---|
| attr | 输入 | 待销毁的aclopAttr类型指针。 |
返回值说明
无
父主题: aclopAttr
aclopSetAttrBool
函数功能
设置bool类型标量的属性值。同步接口。
函数原型
aclError aclopSetAttrBool(aclopAttr *attr, const char *attrName, uint8_t attrValue)
参数说明
| 参数名 | 输入/输出 | 说明 |
|---|---|---|
| attr | 输出 | aclopAttr类型的指针。 需提前调用aclopCreateAttr接口创建aclopAttr类型。 |
| attrName | 输入 | 属性名的指针。 |
| attrValue | 输入 | 属性值。 |
返回值说明
返回0表示成功,返回非0表示失败。
父主题: aclopAttr
aclopSetAttrInt
函数功能
设置int64_t类型标量的属性值。同步接口。
函数原型
aclError aclopSetAttrInt(****aclopAttr *attr, const char *attrName, int64_t attrValue)
参数说明
| 参数名 | 输入/输出 | 说明 |
|---|---|---|
| attr | 输出 | aclopAttr类型的指针。 需提前调用aclopCreateAttr接口创建aclopAttr类型。 |
| attrName | 输入 | 属性名的指针。 |
| attrValue | 输入 | 属性值。 |
返回值说明
返回0表示成功,返回非0表示失败。
父主题: aclopAttr
在线提单