[profiler] Fix profiling shapes with PT2 + lists of dynamic shapes (#105893)
Fixes #105748
Follow-up to https://github.com/pytorch/pytorch/pull/104320. If we have a list that contains tensors with dynamic shapes, just mark the entire list as undefined.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/105893
Approved by: https://github.com/aaronenyeshi