pytorch/torch/_refs
Laith Sakka 39df901b2a introduce definitely_contiguous and use it for reshape and tensor meta data computation. (#153432)
when a tensor has unbacked symbols it can be general enough to represent both contiguous and non contiguous tensors.
in that case we cant really evaluate is_contiguous. In many places in the code base, we check for is_contiguous to take a fast path. but the general path usually works for both contiguous and not contiguous in that case we probably want
to use definitely _contiguous API.

This is appleid for reshape in this PR and also to  tensor meta data computation, the meta data now will have an attribute that says that its contiguous when its always contiguous. We would store that only if definitely _contiguous is true  now.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/153432
Approved by: https://github.com/bobrenjc93
2025-05-28 03:41:26 +00:00
..
linalg Treat dim=[] same as dim=None (#153570) 2025-05-20 22:44:29 +00:00
nn PEP585: More UP006 fixes (#146392) 2025-02-20 06:18:13 +00:00
special [Inductor][CPP] fix torch logit decomposition (#145576) 2025-01-27 19:37:51 +00:00
__init__.py introduce definitely_contiguous and use it for reshape and tensor meta data computation. (#153432) 2025-05-28 03:41:26 +00:00
_conversions.py
fft.py PEP585 update - torch/_C torch/_decomp torch/_lazy torch/_library torch/_numpy torch/_prims torch/_refs torch/_strobelight (#145102) 2025-01-18 20:47:12 +00:00