code: def GTax(x, ax):
      
  
      slc0 = (slice(None),) * ax
      xg = np.roll(x, 1, axis=ax) - x
      xg[slc0 + (slice(0, 1),)] = -x[slc0 + (slice(0, 1),)]
      xg[slc0 + (slice(-1, None),)] = x[slc0 + (slice(-2, -1),)]
      return xg
docs: Compute transpose of gradient of `x` along axis `ax`.
  
      Parameters
      ----------
      x : array_like
        Input array
      ax : int
        Axis on which gradient transpose is to be computed
  
      Returns
      -------
      xg : ndarray
        Output array