PyTorch doesn’t ship with these utilities (the ImageNet example uses some metric objects, but these are probably not what you are looking for).
However, higher-level wrappers such as Ignite or Lightning provide such callbacks.