[Checkpoint][2D][4/N] Add nested_dict for distributed checkpoint to core distributed (#89537)
This PR moves nested_dict and its test to torch.distributed.checkpoint. This is a pre-req for enabling 2D checkpoint.
This provides the functionality to flatten a nested dict and unflatten a flattened dict.
Docstring will be added in the following PR.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/89537
Approved by: https://github.com/fduwjj, https://github.com/wanchaol