If you're using an Intel CPU, you can also use graph optimizations from Intel Extension for PyTorch to boost inference speed even more.