gradcheck (#14596)
authorWei Yang <weiyang@fb.com>
Fri, 7 Dec 2018 01:58:16 +0000 (17:58 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 7 Dec 2018 02:03:38 +0000 (18:03 -0800)
commit1a247f872f6ce9295e849119b234b2de7c0183b2
tree98df6ccec2f6600408d46f58c22f4c21931bcbd9
parentbfa666eb0deebac21b03486e26642fd70d66e478
gradcheck (#14596)

Summary:
- allow gradcheck to take sparse tensor as input
- sparse output is not allowed yet at gradcheck
- add backward for `to_dense()` to get around sparse output
- calling gradcheck at test_sparse, so that we can use `_gen_sparse()` and also easily cover coalesced / uncoalesced test cases
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14596

Differential Revision: D13271904

Pulled By: weiyangfb

fbshipit-source-id: 5317484104404fd38058884c86e987546011dd86
test/test_autograd.py
test/test_sparse.py
tools/autograd/derivatives.yaml
tools/autograd/templates/Functions.cpp
torch/autograd/gradcheck.py