Memory used by the GPU for the torch.cdist function

Is there a way to determine the internal memory usage of PyTorch functions, such as cdist? Specifically, what is the total memory used during the calculation.