mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Fix broken docs (#124940)
These were causing doctest to be unhappy. In particular the doc from #124496 caused #124771 to fail "trunk / win-vs2019-cpu-py3 / test" to fail when pushing. Not sure why it wasn't a problem on the original PR. Testing: `./test/run_doctests.sh`: before: ``` === 4 warnings in 11.21 seconds === ``` after: ``` === in 11.11 seconds === ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/124940 Approved by: https://github.com/zou3519, https://github.com/atalman, https://github.com/huydhn
This commit is contained in:
committed by
PyTorch MergeBot
parent
9266e472e2
commit
4e2b4c6ed6
@ -849,11 +849,11 @@ def opcheck(
|
||||
>>> def _(x, y):
|
||||
>>> return torch.empty_like(x)
|
||||
>>>
|
||||
>>> def setup_context(ctx, inputs, output)
|
||||
>>> def setup_context(ctx, inputs, output):
|
||||
>>> y, = inputs
|
||||
>>> ctx.y = y
|
||||
>>>
|
||||
>>> def backward(ctx, grad)
|
||||
>>> def backward(ctx, grad):
|
||||
>>> return grad * ctx.y, None
|
||||
>>>
|
||||
>>> numpy_sin.register_autograd(backward, setup_context=setup_context)
|
||||
|
Reference in New Issue
Block a user