Fixed out= variant of linalg.solve (#51968)
Summary:
This PR modifies the behavior of the `linalg_solve_out` variant to match the description here https://github.com/pytorch/pytorch/wiki/Developer-FAQ#how-does-out-work-in-pytorch
With this PR result and input tensors must be on the same device and have the same "type kind".
It's allowed to pass out tensors with complex dtypes for float inputs.
`linalg_solve_out` was broken for batched vector inputs and it's now fixed.
Ref. https://github.com/pytorch/pytorch/issues/42666
Pull Request resolved: https://github.com/pytorch/pytorch/pull/51968
Reviewed By: H-Huang
Differential Revision: D26728825
Pulled By: mruberry
fbshipit-source-id: c06fe937e7f452193b23ba09ca6cfa2703488455