8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8dbd7b2 commit c256871Copy full SHA for c256871
test/test_autograd.py
@@ -12467,15 +12467,16 @@ def test_disallow_nesting(self):
12467
def test_inplace_foreach(self):
12468
with torch.autograd.graph.allow_mutation_on_saved_tensors():
12469
a = [
12470
- torch.tensor(1., requires_grad=True),
12471
- torch.tensor(1., requires_grad=True)
+ torch.tensor(1.0, requires_grad=True),
12472
]
12473
b = torch._foreach_exp(a)
12474
torch._foreach_add_(b, 1)
12475
(b[0] + b[1]).backward()
12476
12477
self.assertEqual([a[0].grad, a[1].grad], torch._foreach_exp(a))
12478
12479
+
12480
class TestAutogradInferenceMode(TestCase):
12481
def _is_inference_tensor(self, tensor):
12482
try:
0 commit comments