Fix symbolic shape function for `flatten` (silvasean's) (#71762)
Summary:
in response to https://github.com/pytorch/pytorch/pull/71727
Pull Request resolved: https://github.com/pytorch/pytorch/pull/71762
Reviewed By: anjali411
Differential Revision: D33771227
Pulled By: makslevental
fbshipit-source-id: 7a46d200665d51c95978153f0638f35cdc7c3742
(cherry picked from commit eb3f404093010a62977c4559d4a931093a991ccc)