docstr: Ensures that batch_size is less than the number of rows.
docstr_tok: ["Ensures","that","batch_size","is","less","than","the","number","of","rows","."]
code: def _set_batch_size(self, data_train):
      """
      Ensures that batch_size is less than the number of rows.
      """
      batch_size = min(self.batch_size, data_train.N)
      target_batch_size = min(
          max(self.batch_size, self.target_batch_size), data_train.N
      )
      accum_steps = max(
          int(np.ceil(target_batch_size / self.batch_size)), 1
      )
      max_iter = self.n_epochs * (data_train.N // batch_size)
      return batch_size, target_batch_size, accum_steps, max_iter
  
imports: import time
  import numpy
  import pandas
  from sklearn.base import BaseEstimator
  from sklearn.feature_selection import SelectorMixin
  from sklearn.utils.validation import check_is_fitted
  import torch
  from nni.feature_engineering.feature_selector import FeatureSelector
  from .None import constants
  from .fginitialize import PrepareData
  from .fgtrain import _train
label_desc: Use image node_id 9 for calling the FeatureGradientSelector obj's underlying member method code with example usage: obj._set_batch_size(data_train) and returns: batch_size,  target_batch_size,  accum_steps,  max_iter