Updated on 2022-03-13 GMT+08:00

Operator Registration APIs

Operator type registration starts with the REG_OP API and ends with the OP_END API. The input, output, and attribute information (INPUT, OUTPUT, and ATTR) to be registered is linked by periods (.). After an operator type is registered, a class named after the operator type is automatically generated.

Instance

REG_OP(FullConnection)

.INPUT(x, TensorType::ALL())

.INPUT(w, TensorType::ALL())

.INPUT(b, TensorType::ALL())

.OUTPUT(y, TensorType::ALL())

.ATTR(num_output, AttrValue::INT{0})

.INFER_SHAPE_AND_TYPE(FullConnectionInfer)

.ATTR_ALL_VERIFY(FullConnectionVerify)

.OP_END()

The operator registration APIs are defined in operator_reg.h. For details about registered operators and their header files, see List of Built-in Operators.