semantics of backward passes.
Note:
 When "inputs" are provided and a given input is not a leaf, the
 current implementation will call its grad_fn (though it is not
 strictly needed to get this gradients). It is an implementation
 detail on which the user should not rely. See https://github.com
 /pytorch/pytorch/pull/60521#issuecomment-867061780 for more
 details.

Parameters:
      * gradient (Tensor or None) -- Gradient w.r.t. the
        tensor. If it is a tensor, it will be automatically converted
        to a Tensor that does not require grad unless "create_graph"
        is True. None values can be specified for scalar Tensors or
        ones that don't require grad. If a None value would be
        acceptable then this argument is optional.
  * **retain_graph** (*bool**, **optional*) -- If "False", the
    graph used to compute the grads will be freed. Note that in
    nearly all cases setting this option to True is not needed and
