What is the computational cost of x.to_sparse() and x.to_dense()

I’m working with some very high dimensionality sparse tensors and I’m having RAM trouble with my dataloader. I’ve solved this by storing the tensors in sparse format on the dataloader but throwing a .to_dense() into the collate function. I just wanted to know if the .to_dense() operator has a high cpu cost associated with it or if its essentially “free”.