small optimizations of a view function (#72626)
Summary:
Gets rid of double dispatch in _unsafe_view, and a few unnecessary checks in `alias_with_sizes_and_strides`
_unsafe_view (for 20 count) goes from ~41K -> 36K, view 58K -> 56K
Pull Request resolved: https://github.com/pytorch/pytorch/pull/72626
Reviewed By: bdhirsh
Differential Revision: D34126611
Pulled By: ngimel
fbshipit-source-id: 686be9d4dee9f8d93e36357e46161c83ef76c1d3
(cherry picked from commit 3c8ba109ec9a230d5d8c14577f3a2e6a94554c74)
Author
Natalia Gimelshein