code: def predict(self, X):
          
          y_preds = []
          for yp in self.forward_iter(X, training=False):
              yp = yp[0] if isinstance(yp, tuple) else yp
              y_preds.append(to_numpy(yp.max(-1)[-1]))
          y_pred = np.concatenate(y_preds, 0)
          return y_pred
docs: Where applicable, return class labels for samples in X.
  
          If the module's forward method returns multiple outputs as a
          tuple, it is assumed that the first output contains the
          relevant information and the other values are ignored. If all
          values are relevant, consider using
          :func:`~skorch.NeuralNet.forward` instead.
  
          Parameters
          ----------
          X : input data, compatible with skorch.dataset.Dataset
            By default, you should be able to pass:
  
              * numpy arrays
              * torch tensors
              * pandas DataFrame or Series
              * scipy sparse CSR matrices
              * a dictionary of the former three
              * a list/tuple of the former three
              * a Dataset
  
            If this doesn't work with your data, you have to pass a
            ``Dataset`` that can deal with the data.
  
          Returns
          -------
          y_pred : numpy ndarray