vconv
函数功能
vconv指令抽象。
y = vconv(x, dtype), vconv表示对输入数据进行类型转换的向量计算。
目前支持转换类型包括:BF16->FP32, FP16->FP32, FP16->INT16, FP16->INT32, FP16->INT4, FP16->INT8, FP16->UINT8, FP32->BF16, FP32->FP16, FP32->INT32, FP32->INT64,INT4->FP16, INT64->FP32, INT8->FP16, UINT8->FP16。
函数原型
class Vconv(x, y, dtype)
参数说明
参数名  | 
输入/输出  | 
数据类型  | 
说明  | 
|---|---|---|---|
x  | 
输入  | 
tensor变量  | 
输入x向量tensor。  | 
y  | 
输出  | 
tensor变量  | 
输出y向量tensor。  | 
dtype  | 
输入  | 
字符串  | 
表示目标tensor的数据类型。  | 
使用示例
ub_x, ub_y = Tensor("UB", "FP16"), Tensor("UB")
ub_x.load(gm_x)
out = vconv(ub_x, ub_y, "FP32")()
父主题: mskpp对外接口使用说明