The freeze_module pass was added to 1.5, so there isn’t anything 100% equivalent in 1.4 The _jit_pass_lower_graph does something similar but freezing goes beyond it to try to simplify the graph based on the changes, and to verify that the conversion to constants was a correct transform.
@zdevito : Thanks for the reply. If I had to achieve something similar to freeze_module in PyTorch 1.4.x, is running _jit_pass_lower_graph() and converting the returned parameters into graph constants a good approach? Or is there a better mechanism to achieve this? Porting freeze_module to 1.4.x seems cumbersome as it relies on AliasDB APIs which don’t exist in 1.4.x.