Official Guide: https://tvm.apache.org/docs/dev/relay_add_op.html
While going through this, it is important to have more context.
Attrs and Type Relation
Attrs are used to provide interface for the final interface regarding various attributes of the operator.
Type Relations are dealt with using functions.
Defining Compute / Strategy of the Operation
It seems that the operator can be defined in various ways such as te.compute
or tir
.
I want to see how the weights are defined… I think this can be better observed in operations like Convolution or Matmul
Importantly, to lower Relay operators to the implementations defined in TOPI library, a compute and schedule function need to be registered to each relay operator. However, they are usually specialized for each target. It is important that we provide some schedule for that so that AutoTVM or AutoScheduler can optimize the operations.
https://tvm.apache.org/docs/dev/relay_op_strategy.html
refer to schedule_conv3d_winograd_weight_transform in python/tvm/topi/generic/nn.py#L209-243
Other things are about creating the Python Hooks and stuff, so lets ignore this