pytorch/tools/codegen/api
Sebastian Messmer 3ef36dca8e Faithful out arguments (#47712)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/47712

This adds a faithful API for ops with out arguments, as described in https://docs.google.com/document/d/1h7nBibRwkRLQ8rsPhfALlwWR0QbkdQm30u4ZBwmaps8/edit# .

After this, an op will generate the following overloads for the C++ API:

```cpp
// Generated from the aten::abs operator (NOT from aten::abs.out)
Tensor at::abs(Tensor& self)

// Generated from the aten::abs.out operator
Tensor& at::abs(Tensor& self, Tensor& out)
Tensor& at::abs_out(Tensor& out, Tensor& self)

```

This is an important step towards making those ops c10-full (it allows VariableType, XLA and other backends to ignore reordering and just call through with the same argument order), but this does not make any of those ops c10-full yet.
It enables the faithful API independent from c10-fullness. That means the API is more consistent with the same API for all ops and making an op c10-full in the future will not trigger future C++ API changes.
ghstack-source-id: 118068091

Test Plan: waitforsandcastle

Reviewed By: ezyang

Differential Revision: D24835252

fbshipit-source-id: dedfabd07140fc8347bbf16ff219aad3b20f2870
2020-12-08 03:48:42 -08:00
..
__init__.py Rewrite of ATen code generator (#42629) 2020-08-31 09:00:22 -07:00
autograd.py [pytorch][codegen] add autograd data model (#48249) 2020-11-19 21:47:05 -08:00
cpp.py Faithful out arguments (#47712) 2020-12-08 03:48:42 -08:00
dispatcher.py Faithful out arguments (#47712) 2020-12-08 03:48:42 -08:00
meta.py Refactor argument fields in FunctionSchema to Arguments (#48182) 2020-12-02 07:57:06 -08:00
native.py Faithful out arguments (#47712) 2020-12-08 03:48:42 -08:00
python.py Faithful out arguments (#47712) 2020-12-08 03:48:42 -08:00
types.py Faithful out arguments (#47712) 2020-12-08 03:48:42 -08:00