How to modify and add an operator in pytorch frontend

@masahi Thank you for answering the question https://github.com/apache/incubator-tvm/issues/6761

I also want to ask if it is difficult to modify the underlying implementation of max pool op to support recording maximum index? Does tvm have a specific example code for adding an operator in pytorch frontend?

We have many examples for operator conversion in frontend/pytorch.py.

I don’t recommend modifying the max pool implementation. TVM doesn’t take into account the indices from max pool, so you need to modify code everywhere.