The benchmark classes allow us to measure the peak memory usage and required time for both inference and training.