tensor([[ 0.5000, 0.7500, 1.5000, 2.0000],
                [ 5.0000, 7.5000, 15.0000, 20.0000]]))
      >>> # doubling the spacing between samples halves the estimated partial gradients.
  >>>
  >>> # Estimates only the partial derivative for dimension 1
  >>> torch.gradient(t, dim = 1) # spacing = None (implicitly 1.)
  (tensor([[ 1.0000, 1.5000, 3.0000, 4.0000],
           [10.0000, 15.0000, 30.0000, 40.0000]]),)

  >>> # When spacing is a list of scalars, the relationship between the tensor
  >>> # indices and input coordinates changes based on dimension.
  >>> # For example, below, the indices of the innermost dimension 0, 1, 2, 3 translate
  >>> # to coordinates of [0, 3, 6, 9], and the indices of the outermost dimension
  >>> # 0, 1 translate to coordinates of [0, 2].
  >>> torch.gradient(t, spacing = [3., 2.])
  (tensor([[ 4.5000, 9.0000, 18.0000, 36.0000],
           [ 4.5000, 9.0000, 18.0000, 36.0000]]),
