[fsdp] add ability to iterate through dataclasses in fsdp.utils (#82638)
### Description
previously FSDP was failing on a torchmultimodal model because `_apply_to_tensors` couldn't iterate over dataclasses.
### Issue
None
### Testing
unit test
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82638
Approved by: https://github.com/rohan-varma