pytorch/tools/codegen/dest
Yukio Siraichi 51f1569c77 Add checks for structured in-place operations. (#65686)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/65686

Fixes: #57827

This PR introduces `check_inplace` function. It contains some common checks for all
structured in-place operators (e.g. dtype, device, and sizes). `set_output` method calls
`check_inplace` on in-place specializations of structured kernels.

Besides that, it also:
- adds overlap assertions for both in-place and out-of-place overloads
- remove in-place operator specific `TORCH_CHECK` around the code base

Test Plan: Imported from OSS

Reviewed By: albanD

Differential Revision: D31234063

Pulled By: ezyang

fbshipit-source-id: fa3b45775af7812e07a282e7cae00b68caf0fdb0
2021-09-28 13:21:26 -07:00
..
__init__.py Refactor structured set_output in Register{DispatchKey}.cpp (#62188) 2021-08-27 09:38:27 -07:00
native_functions.py move all external kernels into a class for better compiler error messages (#59839) 2021-07-08 15:31:02 -07:00
register_dispatch_key.py Add checks for structured in-place operations. (#65686) 2021-09-28 13:21:26 -07:00