Hi
Since torch1.13+ torch._C.Graph has been wrapped in GraphContext in the registered symbolic functions.
We can get the opset or envs from the context, that’s cool.
But when we export a custom autograd.Function, the graph in the symbolic is still torch._C.Graph. _run_script_method simply run the symbolic without GraphContext wrapping.
We can not reuse the tools in torch.onnx since some of then might branched by the opset or envs, which is not available in torch._C.Graph.