I had the same issue. Then found out that the given example will work in pytorch 1.1, 1.2 but it is throwing erros with the latest version like pytorch 1.5 and 1.7. When I digged into the pytorch onnx documentation I found that we have to pass as an additional argument operator_export_type to torch.onnx.export function(ref: https://pytorch.org/docs/stable/onnx.html#functions 3).
In my understanding of the documentation in order to support the custom lyaers with symbolic links, the additional argument operator_export_type should be assigned a value of OperatorExportTypes.ONNX_ATEN_FALLBACK.
So your line
torch.onnx.export(model, dummy_input, "model.onnx", verbose=True)

Should be replaced with
torch.onnx.export(model, dummy_input, "model.onnx", verbose=True, operator_export_type=torch.onnx.OperatorExportTypes.ONNX_ATEN_FALLBACK)

Then this error should be solved.