docs: def unfold(self, mode):
          """
          Unfolds a dense tensor in mode n.
  
          Parameters
          ----------
          mode : int
              Mode in which tensor is unfolded
  
          Returns
          -------
          unfolded_dtensor : unfolded_dtensor object
              Tensor unfolded along mode
  
          Examples
          --------
          Create dense tensor from numpy array
  
          >>> T = np.zeros((3, 4, 2))
          >>> T[:, :, 0] = [[ 1,  4,  7, 10], [ 2,  5,  8, 11], [3,  6,  9, 12]]
          >>> T[:, :, 1] = [[13, 16, 19, 22], [14, 17, 20, 23], [15, 18, 21, 24]]
          >>> T = dtensor(T)
  
          Unfolding of dense tensors
  
          >>> T.unfold(0)
          array([[  1.,   4.,   7.,  10.,  13.,  16.,  19.,  22.],
                 [  2.,   5.,   8.,  11.,  14.,  17.,  20.,  23.],
                 [  3.,   6.,   9.,  12.,  15.,  18.,  21.,  24.]])
          >>> T.unfold(1)
          array([[  1.,   2.,   3.,  13.,  14.,  15.],
                 [  4.,   5.,   6.,  16.,  17.,  18.],
                 [  7.,   8.,   9.,  19.,  20.,  21.],
                 [ 10.,  11.,  12.,  22.,  23.,  24.]])
          >>> T.unfold(2)
          array([[  1.,   2.,   3.,   4.,   5.,   6.,   7.,   8.,   9.,  10.,  11.,
                   12.],
                 [ 13.,  14.,  15.,  16.,  17.,  18.,  19.,  20.,  21.,  22.,  23.,
                   24.]])
          """
  
          sz = array(self.shape)
          N = len(sz)
          order = ([mode], from_to_without(N - 1, -1, mode, step=-1, skip=-1))
          newsz = (sz[order[0]][0], prod(sz[order[1]]))
          arr = self.transpose(axes=(order[0] + order[1]))
          arr = arr.reshape(newsz)
          return unfolded_dtensor(arr, mode, self.shape)