code: def _stack_batches(X):
          
          X = [Classifier._to_numpy(Xb) for Xb in X]
          if len(X[0].shape) == 1:
              return np.hstack(X)
          elif len(X[0].shape) == 2:
              return np.vstack(X)
          else:
              raise ValueError(f"Can't stack {len(X[0].shape)}-dim batches.")
docs: Stack a list of np.ndarrays along the first axis, returning an
          np.ndarray; note this is mainly for smooth hanlding of the multi-task
          setting.