gradients w.r.t. each of the outputs. If an output doesn't require_grad,
then the gradient can be ``None``).
- If ``only_inputs`` is ``True``, the function will only return a list of gradients
- w.r.t the specified inputs. If it's ``False``, then gradient w.r.t. all remaining
- leaves will still be computed, and will be accumulated into their ``.grad``
- attribute.
-
.. note::
If you run any forward ops, create ``grad_outputs``, and/or call ``grad``
in a user-specified CUDA stream context, see
:ref:`Stream semantics of backward passes<bwd-cuda-stream-semantics>`.
+ .. note::
+
+ ``only_inputs`` argument is deprecated and is ignored now (defaults to ``True``).
+ To accumulate gradient for other parts of the graph, please use
+ ``torch.autograd.backward``.
+
Args:
outputs (sequence of Tensor): outputs of the differentiated function.
inputs (sequence of Tensor): Inputs w.r.t. which the gradient will be