MCPcopy Create free account
hub / github.com/pytorch/pytorch / f_backward

Method f_backward

test/test_proxy_tensor.py:410–413  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

408 return torch.autograd.grad(val, x)
409
410 def f_backward(x):
411 val = x.cos().cos().sum()
412 val.backward()
413 return x.grad
414
415 for f in [f_grad, f_backward]:
416 self._test(f, [torch.randn(3, requires_grad=True)])

Callers

nothing calls this directly

Calls 3

sumMethod · 0.45
cosMethod · 0.45
backwardMethod · 0.45

Tested by

no test coverage detected