mindspore.ops.custom_info_register
- mindspore.ops.custom_info_register(*reg_info)[源代码]
- 装饰器,用于将注册信息绑定到: - mindspore.ops.Custom的 func 参数。- 说明 - reg_info 将添加到算子库 'oplib' 中。 - 参数:
- reg_info (tuple[str, dict]) - json格式的算子注册信息。 
 
- 返回:
- function,返回算子信息注册的装饰器。 
- 异常:
- TypeError - 如果 reg_info 不是tuple。 
 
- 支持平台:
- Ascend- GPU- CPU
 - 样例: - >>> from mindspore.ops import custom_info_register, CustomRegOp, DataType >>> custom_func_ascend_info = CustomRegOp() \ ... .input(0, "x", "dynamic") \ ... .output(0, "y") \ ... .dtype_format(DataType.F16_Default, DataType.F16_Default) \ ... .dtype_format(DataType.F32_Default, DataType.F32_Default) \ ... .target("Ascend") \ ... .get_op_info() >>> >>> @custom_info_register(custom_func_ascend_info) ... def custom_func(x): ... pass