code: def as_2d_array(theta):
      
      v = theta.view(np.float)
      N = theta.shape[0]
      v.shape = (N, - 1)
      # raise an error if v cannot be reshaped without creating a copy
      return v
docs: returns a view to record array theta which behaves
      like a (N,d) float array