mindspore.ops.CustomRegOp
- class mindspore.ops.CustomRegOp(op_name='Custom')[source]
Class used for generating the registration information for the func parameter of
mindspore.ops.Custom
.- Parameters
op_name (str) – kernel name. No need to set this value as Custom, operator will generate a unique name automatically. Default: “Custom”.
Examples
>>> from mindspore.ops import CustomRegOp, DataType >>> custom_op_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()
- attr(name=None, param_type=None, value_type=None, default_value=None, **kwargs)[source]
Register Custom op attribute information.
- Parameters
name (str) – Name of the attribute. Default: None.
param_type (str) – Param type of the attribute. Default: None.
value_type (str) – Value type of the attribute. Default: None.
default_value (str) – Default value of attribute. If value is a list, each item should split by ‘,’. For example, if value_type is “listInt”, then default_value can be “1,2,3”. Default: None.
kwargs (dict) – Other information of the attribute.
- input(index=None, name=None, param_type='required', **kwargs)[source]
Register Custom op input information.