Fix profiling with record_shapes=True and nested tensor (#82854)
We probably want more systematic fix for other tensorImpls that don't support sizes (and also there are other places in profiler that call sizes unchecked, which should be fixed), but this is to unblock Transformer profiling.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82854
Approved by: https://github.com/robieta