code: def from_regular_array(self, A):
          
          dims = A.shape[:-1]
          return A.reshape((np.prod(dims),-1)).view(dtype=self.dtype).squeeze(-1).reshape(dims)
docs: Converts from an array of type `int` where the last index
          is assumed to have length `self.n_elements` to an array
          of type `self.d_type` with one fewer index.
  
          :param np.ndarray A: An `np.array` of type `int`.
  
          :rtype: `np.ndarray`