Mr.Crab:

i wonder is real the control flow was limited that the trace-torch script can’t get the same accuracy as pytorch did?


That might be the case, as the executed forward pass with be traced and other paths through the model won’t be used.
Therefore you should use a scripted model, which will collect the conditions.