mirror of
https://github.com/zebrajr/pytorch.git
synced 2026-01-15 12:15:51 +00:00
Record shape and type in autograd to validate gradients (#8168)
The check that the gradient is defined is currently disabled because TestJit.test_ge_optimized will trigger the error.
This commit is contained in:
@@ -71,7 +71,7 @@ TEST_CASE("autograd") {
|
||||
}
|
||||
SECTION("custom gradient inputs") {
|
||||
z.sum().backward(
|
||||
autograd::make_variable(at::ones(at::CPU(at::kFloat), {1}) * 2));
|
||||
autograd::make_variable(at::ones(at::CPU(at::kFloat), {}) * 2));
|
||||
REQUIRE(x.grad().allclose(y * 2));
|
||||
}
|
||||
// Assume everything else is safe from PyTorch tests.
|
||||
|
||||
Reference in New Issue
Block a user