gradients using the "get_gradients()" API.
Parameters:
      * context_id (int) -- The autograd context id for which we
        should retrieve the gradients.
  * **roots** (*list*) -- Tensors which represent the roots of the
    autograd computation. All the tensors should be scalars.

  * **retain_graph** (*bool**, **optional*) -- If False, the graph
    used to compute the grad will be freed. Note that in nearly
    all cases setting this option to True is not needed and often
    can be worked around in a much more efficient way. Usually,
    you need to set this to True to run backward multiple times.

Example::
      >>> import torch.distributed.autograd as dist_autograd
      >>> with dist_autograd.context() as context_id:
      >>>     pred = model.forward()
      >>>     loss = loss_func(pred, loss)
      >>>     dist_autograd.backward(context_id, loss)
class torch.distributed.autograd.context