How to get memory occupied by tensors when using CPU?

There is a function for cuda device. torch.cuda — PyTorch 1.7.1 documentation

How can I do the same when I train a model on CPU?

Or maybe some workaround exists?