Skip to content

Conversation

gchanan
Copy link
Contributor

@gchanan gchanan commented May 2, 2018

… tensor_new.

@gchanan
Copy link
Contributor Author

gchanan commented May 2, 2018

This completes #7034; I would argue this should perhaps be a (python) warning rather than an error (see discussion in #7034), but let's make it consistent for now.

@gchanan
Copy link
Contributor Author

gchanan commented May 2, 2018

@pytorchbot retest this please.


namespace torch { namespace autograd { namespace utils {

inline at::Tensor set_requires_grad(at::Tensor self, bool requires_grad) {

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@gchanan
Copy link
Contributor Author

gchanan commented May 3, 2018

#7034 also didn't put this error Variable(..., requires_grad=True)

@ezyang
Copy link
Contributor

ezyang commented May 13, 2018

6:09:33 ======================================================================
16:09:33 ERROR: test_cdf_log_prob (test_distributions.TestDistributions)
16:09:33 ----------------------------------------------------------------------
16:09:33 Traceback (most recent call last):
16:09:33   File "/var/lib/jenkins/workspace/test/test_distributions.py", line 1871, in test_cdf_log_prob
16:09:33     samples = torch.tensor(dist.sample().data, requires_grad=True)
16:09:33 RuntimeError: only Tensors of floating point dtype can require gradients

@gchanan gchanan merged commit 7abdc30 into pytorch:master May 18, 2018
onnxbot added a commit to onnxbot/onnx-fb-universe that referenced this pull request May 18, 2018
weiyangfb pushed a commit to weiyangfb/pytorch that referenced this pull request Jun 11, 2018
pytorch#7185)

* Don't allow requires_grad to be set on integer Tensor constructors in tensor_new.

* Fix autograd test.

* Fix test_distributions.

* Fix test_jit.

* Fix NN tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants