torch.Tensor.backward
Tensor.backward(gradient=None, retain_graph=None, create_graph=False, inputs=None)
Computes the gradient of current tensor w.r.t. graph leaves.
The graph is differentiated using the chain rule. If the tensor is
   non-scalar (i.e. its data has more than one element) and requires
   gradient, the function additionally requires specifying "gradient".
   It should be a tensor of matching type and location, that contains
   the gradient of the differentiated function w.r.t. "self".
This function accumulates gradients in the leaves - you might need
   to zero ".grad" attributes or set them to "None" before calling it.
   See Default gradient layouts for details on the memory layout of
   accumulated gradients.
Note:
 If you run any forward ops, create "gradient", and/or call
 "backward" in a user-specified CUDA stream context, see Stream
 semantics of backward passes.

Note: