mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
This reverts commit 9a665ca3c472384e9d722bddba79e5a7680f1abd. Reverted https://github.com/pytorch/pytorch/pull/160750 on behalf of https://github.com/jeanschmidt due to Seems that those errors are legitimate, and there is no test plan. I'll be proceeding with a revert ([comment](https://github.com/pytorch/pytorch/pull/160750#issuecomment-3246095383))
17 lines
458 B
Python
17 lines
458 B
Python
import torch
|
|
|
|
|
|
t = torch.tensor([[3.0, 1.5], [2.0, 1.5]])
|
|
|
|
t_sort = t.sort()
|
|
t_sort[0][0, 0] == 1.5 # noqa: B015
|
|
t_sort.indices[0, 0] == 1 # noqa: B015
|
|
t_sort.values[0, 0] == 1.5 # noqa: B015
|
|
reveal_type(t_sort) # E: torch.return_types.sort
|
|
|
|
t_qr = torch.linalg.qr(t)
|
|
t_qr[0].shape == [2, 2] # noqa: B015
|
|
t_qr.Q.shape == [2, 2] # noqa: B015
|
|
# TODO: Fixme, should be Tuple[{Tensor}, {Tensor}, fallback=torch.return_types.qr]
|
|
reveal_type(t_qr) # E: Any
|