已关闭
[Requirement|需求建议]: op_def 中罗列数据类型两两组合,手写太麻烦,提取为公共方法自动组合 #2748
zhanw_coding创建于  23 天前关闭于  21 天前
zhanw_coding
zhanw_coding成员
23 天前 创建

Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.

一、背景信息 (必填)

op_def 中罗列数据类型两两组合,手写太麻烦,希望提取为公共方法自动组合
比如输入 X1 支持10种类型,X2 支持2种类型,这些类型要两两组合,就得手写20种组合
这样一容易遗漏、二可读性差

二、价值/作用 (必填)

简化代码开发,提高代码可读性

三、设计方案 (必填)

新增公共头文件 math_def_util.h,提供多输入 data type 两两组合的编译期常量生成方法

旧写法

x1_datatype_list = [bf16, fp16, fp32, fp64, bf16, fp16, fp32, fp64]
x2_datatype_list = [int32, int32, int32, int32, int64, int64, int64, int64]

=>
新写法

x1_datatypes = [bf16, fp16, fp32, fp64]
x2_datatypes = [int32, int64]
x1_datatype_list, x2_datatype_list = combine_data_type(x1_datatypes, x2_datatypes)

💡 备注(选填)

likedislike
zhanw_codingzhanw_coding成员
23 天前 添加了label:requirement
zhanw_codingzhanw_coding成员
23 天前 修改了issue 的描述
zhanw_coding
zhanw_coding成员
23 天前 评论:

/assign

likedislike
CANN-robotCANN-robot成员
23 天前 将 zhanw_coding 设为负责人
zhanw_codingzhanw_coding成员
23 天前 修改了issue 的描述
CANN-robotCANN-robot成员
21 天前 关闭了 issue
CANN-robotCANN-robot成员
21 天前 添加了label:resolved