pytorch/test/custom_operator
Pritam Damania cdc56d0b6c Support c10::optional<Tensor> in custom C++ autograd function. (#37700)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/37700

Certain autograd functions can have optional Tensor arguments. For
this purpose it would be nice to support c10::optional<Tensor> as an argument
for C++ autograd functions.

I've added the appropriate overload to ExtractVariables to ensure this works.
For an example, you can look at D21272807 in terms of how this is used.
ghstack-source-id: 103541789

Test Plan: waitforbuildbot

Differential Revision: D21363491

fbshipit-source-id: 0c8665e9bfe279e6b9ab84a889524fea11fa971c
2020-05-06 01:59:51 -07:00
..
CMakeLists.txt Separate torchbind from Python (#30242) 2019-12-21 22:52:40 -08:00
model.py Allow building libraries with setuptools that dont have abi suffix (#14130) 2018-11-27 17:35:53 -08:00
op.cpp Support c10::optional<Tensor> in custom C++ autograd function. (#37700) 2020-05-06 01:59:51 -07:00
op.h Test cases for custom ops with autograd (#31003) 2019-12-15 22:37:24 -08:00
test_custom_classes.py Remove python-2 or python<3.5 checks from unit tests (#37252) 2020-04-24 17:42:04 -07:00
test_custom_ops.cpp Support c10::optional<Tensor> in custom C++ autograd function. (#37700) 2020-05-06 01:59:51 -07:00
test_custom_ops.py Support c10::optional<Tensor> in custom C++ autograd function. (#37700) 2020-05-06 01:59:51 -07:00