Thank u, I have done an experiment again. I set the parameter of the GraphOptimizerEnabledGuard to false instead of true. and it works.

code ：
torch::jit::GraphOptimizerEnabledGuard optimize_guard(false);

I’m looking forward to getting the details of the optimization .