mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-15 21:00:47 +00:00
Summary: Related https://github.com/pytorch/pytorch/issues/54261 This PR ports the method_tests() entries of `torch.copysign` to OpInfo. While porting the tests, the `test_out` cases from `test_ops.py` would fail as the out variant of `torch.copysign` does not support scalar inputs. ```python >>> x = torch.randn(2) >>> y = torch.empty_like(x) >>> torch.copysign(x, 1.) tensor([1.4836, 1.2156]) >>> torch.copysign(x, 1., out=y) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: copysign(): argument 'other' (position 2) must be Tensor, not float ``` This PR fixes the tests by adding an overload `native_functions` entry and re-dispatching scalar inputs to the existing `copysign_out` function. Pull Request resolved: https://github.com/pytorch/pytorch/pull/54945 Reviewed By: gchanan Differential Revision: D27505300 Pulled By: mruberry fbshipit-source-id: f68250fa52f8dcfd45426039ec178ca5e883e206 |
||
|---|---|---|
| .. | ||
| _internal | ||
| __init__.py | ||
| asserts.py | ||
| check_kernel_launches.py | ||