If the input is contiguous, short-circuit infer_size_dv in reshape (#95216)
The main improvement is that this avoids guards from infer_size_dv,
although this also counts as a minor perf improvement too.
Signed-off-by: Edward Z. Yang <ezyang@meta.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/95216
Approved by: https://github.com/albanD