Hey @mrshenli, thanks a lot.  But I find some problems when I use @torch.jit.script decorator. When I use torch.jit.script , the complier cannot infer self.policy correctly, which is a nn.Module and an attribute of Learner. Should change class Learner and Actor to torch.jit.ScriptModule. And if I want to avoid GIL, should both callee function and caller be wrapped by @torch.jit.script?