I have a multitask model which uses ModuleDict. Its forward(self, a, a_len, b, b_len, task_id) has argument task_id.
After converting the pytorch model checkpoint into C++ by tracing, the C++ prediction accuracy is 5% lower than pytorch prediction accuracy.
If I train each task individually, i.e., into a separate model and checkpoint file, then convert each of them into C++, then the accuracy matches.