When caching metrics in eval_multistep, the process crashes for metrics that define a preprocess function as a local lambda (e.g. PowerSpectrum). Python cannot pickle lambda or locally defined functions, leading to a serialization failure during torch.save.
AttributeError: Can't get local object '<Class>.__init__.<locals>.<lambda>'