don't attempt to multiply by a sparse matrix (#18737)
authorBrennan Vincent <brennan@umanwizard.com>
Fri, 5 Apr 2019 00:18:11 +0000 (17:18 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 5 Apr 2019 00:24:53 +0000 (17:24 -0700)
commitd35c39e73b04d7ab95812be8cbda21023e1b5cc4
treea4a785caa130ccac53e0fc4da7b123e6f2a3ddb1
parent07efee395c2e3c6ba9bf54581fcce2aac91a54c1
don't attempt to multiply by a sparse matrix (#18737)

Summary:
Tested by running the script in #16562 , and there was no error.

Then:
```
>>> print(mat.grad)
tensor([[1., 2., 3.],
        [1., 2., 3.],
        [1., 2., 3.]])
```

which is correct.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18737

Differential Revision: D14773078

Pulled By: umanwizard

fbshipit-source-id: 8aa36eb6f6aa104263a467d9ac91d61b3bfd05f5
test/test_sparse.py
tools/autograd/templates/Functions.cpp